Hello spark-notebook-user,
I have a task in hand where I am supposed to visualize certain data in form of 2*2 matrix.
I have to use d3.js, spark, scala and spark-notebook for that, and sadly I am new to all of these including ubuntu :| .Do we have any predefined package or class that can generate matrix?
currently I am going through notebooks/misc/Using Javascript and Scala to add Reactive Chart type LIVE - D3 StreamGraph.snb example as a reference.
I was able to figure out most of the things in this example except :
import notebook.front.widgets._
import notebook.front.widgets.magic._
import notebook.front.widgets.magic.Implicits._
import notebook.front.widgets.magic.SamplerImplicits._
case class StreamgraphChart[C:ToPoints:Sampler](
originalData:C,
override val sizes:(Int, Int)=(600, 400),
maxPoints:Int = 25,
date:String,
value:String,
category:String,
dateFormat:String
) extends Chart[C] {
def mToSeq(t:MagicRenderPoint):Seq[(String, Any)] = t.data.toSeq
override val snippets = List(s"""|{
| "f": $js,
| "o": {
| "category": "$category",
| "value": "$value",
| "date": "$date",
| "date_format": "$dateFormat"
| }
|}
""".stripMargin)
override val scripts = List(notebook.front.Script("consoleDir", play.api.libs.json.Json.obj()))
}
Could you please explain me what exactly is StreamgraphChart[C:ToPoints:Sampler] and def mToSeq(t:MagicRenderPoint):Seq[(String, Any)] = t.data.toSeq for?
Many Thanks