Is there any way to render Vegas (scala DSL for Vega-lite) directly to png?

456 Views Asked by At

I am looking for a way to render a plot to a .png file on the local file system using Vegas. Something like

val plot = Vegas("Country Pop")
  .withData(
    Seq(
      Map("country" -> "USA", "population" -> 314),
      Map("country" -> "UK", "population" -> 64),
      Map("country" -> "DK", "population" -> 80)
    )
  )
  .encodeX("country", Nom)
  .encodeY("population", Quant)
  .mark(Bar)

plot.missingMethodForSavingAFigure("path/to/dest.png")

Unfortunately it seems something like a .saveFigure method does not exist that I am aware of. Does anyone have any suggested alternatives?

0

There are 0 best solutions below