• Scala (v2.11.11)
  • jupyter-scala (v0.4.2)
In [1]:
import $ivy.`org.vegas-viz::vegas:0.3.9`
Out[1]:
import $ivy.$                           
In [2]:
import vegas._
Out[2]:
import vegas._
In [3]:
val user = "vegas-viz"
val repository = "Vegas"

Vegas(s"GitHub Punch Card of ${user}/${repository}")
    .withURL(s"https://api.github.com/repos/${user}/${repository}/stats/punch_card")
    .addTransform("weekday", "datum[0]")
    .addTransform("hour", "datum[1]")
    .addTransform("contributions", "datum[2]")
    .encodeX("hour", Ordinal)
    .encodeY("weekday", Ordinal)
    .encodeSize("contributions", Quantitative)
    .configScale(pointSizeRange = List(0.0, 250.0))
    .configMark(color = "black")
    .show
Out[3]:
user: String = "vegas-viz"
repository: String = "Vegas"
In [ ]: