Getting Started

To add this library to an sbt project

libraryDependencies += "io.github.quafadas" %% "dedav4s" % "0.8.0"

To use this library in ammonite / mill

import $ivy.`io.github.quafadas::dedav4s:0.8.0`

Fire up an sbt console (or in a repl... )

import viz.PlotTargets.desktopBrowser
import viz.extensions.*
import viz.vega.plots.BarChart
BarChart(List())
// res1: BarChart = BarChart(mods = List())

A side effect should open a browser window, that should look like the plot below the next code fence.

This code fence uses scala JS. Observe how similar the code is to the code you just ran in the REPL.

import viz.vega.plots.BarChart
import org.scalajs.dom.html.Div
import viz.doc.makePlotTarget

val child : Div = makePlotTarget(node, 50)
BarChart(List())(using child)

In fact, it's cross compiled from the same shared source code! That promise - explore in the REPL, publish in scala JS. I believe to be an attractive proposition.

I like a big chart... let's see if we can fill the div.

BarChart(List(viz.Utils.fillDiv))

If you're curious about how that worked, then you're ready to go! Read on!

See the plot targets to understand what happened, and the examples for suggestions on how to use and extend the concepts.