VegaSpec

viz.vega.VegaSpec
class VegaSpec[M](val rawSpec: Json, val mod: M, val sourceInfo: Option[SourceInfo])

Vega spec wrapper to generate typed accessors inferred from the JSON structure.

When created from a file via VegaPlot.pwd or resource via VegaPlot.fromResource, this class tracks the source and automatically uses fresh content if it has changed since compilation. This ensures the output is always correct, even if the typed accessors are stale.

Value parameters

mod

The typed accessor object for modifications

rawSpec

The JSON spec as parsed at compile time

sourceInfo

Optional source tracking for staleness detection

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def build(mods: M => SpecMod*): Json

Apply modifications using lambda syntax: spec.build(_.title := "New")

Apply modifications using lambda syntax: spec.build(_.title := "New")

If the source has changed, modifications are applied to the fresh content.

Attributes

def buildWith(mods: SpecMod*): Json

Apply modifications directly: spec.buildWith(titleMod, widthMod)

Apply modifications directly: spec.buildWith(titleMod, widthMod)

If the source has changed, modifications are applied to the fresh content.

Attributes

Concrete fields

val mod: M
val rawSpec: Json
val sourceInfo: Option[SourceInfo]