Plotting engine based on Vega-Lite (https://vega.github.io/vega-lite/). Required DataFrame columns are automatically encoded and embedded.
The syntax keeps 1:1 to the Vega-Lite JSON grammar https://vega.github.io/vega-lite/docs/ with a few adaptions:
- Top level specifications are added via methods (e.g.
.title(...)). - The mark definition is on top level (e.g.
.bar(...)) rather than part of amarkdefinition. - The encoding channel definitions are on top level (e.g.
.color(...)) rather than part ofencoding.
Top level definitions usually contain named parameters with following data types:
- Number (
Int,Float,Double), String,Struct, a complex struct-like object with one or more properties (of any type listed here),Seq[T], a sequence (list) where the inner typeTis one of the types above,null.
Due to the reserved keyword type in Scala the following parameter name replacements were made:
- Please use
aswhere the JSON element is namedtype(e.g. in encodings and projection). - Please use
setwhere the JSON element is namedas(e.g. in transform).
- See also
- https://pan-data.org/scala/basics/plotting-a-dataframe.html for a basic introduction
- https://pan-data.org/scala/plotting/index.html for more details
- Since
0.1.0
- Companion
- object
Value members
Concrete methods
How the visualization size should be determined. If a string, should be one of "pad", "fit" or "none".
How the visualization size should be determined. If a string, should be one of "pad", "fit" or "none".
- Value Params
- struct
String or Struct. https://vega.github.io/vega-lite/docs/size.html#autosize
- Since
0.1.0
Color property to use as the background of the entire view.
Color property to use as the background of the entire view.
- Value Params
- struct
Color definition.
- Since
0.1.0
Renders the plot as HTML.
Renders the plot as HTML.
- Returns
HTML as a string with the embedded plot.
- Since
0.1.0
Plot specification in Vega-Lite's JSON grammar.
Plot specification in Vega-Lite's JSON grammar.
- Returns
JSON as string.
- Since
0.1.0
The default visualization padding (in pixels).
The default visualization padding (in pixels).
- Value Params
- struct
Number or Struct.
- Since
0.1.0
- Example
.padding(Struct(left= 5, top=5, right= 5, bottom=5))
Inherited methods
The alignment to apply to grid rows and columns.
The alignment to apply to grid rows and columns.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Rotation angle of "point" and "text" marks.
Rotation angle of "point" and "text" marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The bounds calculation method to use for determining the extent of a sub-plot.
The bounds calculation method to use for determining the extent of a sub-plot.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Indicating if subviews should be centered relative to their respective rows or columns.
Indicating if subviews should be centered relative to their respective rows or columns.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Color of the marks – either fill or stroke color based on the filled property of mark definition.
Color of the marks – either fill or stroke color based on the filled property of mark definition.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Facets plots into columns.
Facets plots into columns.
- Value Params
- align
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- as
- bin
- center
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- field
Column or field name.
- header
- spacing
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- timeUnit
- title
Title.
- See also
- Since
0.1.0
- Inherited from
- Grammar
Concatenation of plots.
Concatenation of plots.
- Value Params
- layers
Layers.
- See also
- Since
0.1.0
- Inherited from
- Grammar
Custom element.
Custom element.
- Value Params
- name
Element name.
- struct
Definition.
- Since
0.1.0
- Inherited from
- Grammar
Custom encoding channel element.
Custom encoding channel element.
- Value Params
- field
Column or field name.
- name
Encoding name.
- struct
Definition.
- Since
0.1.0
- Inherited from
- Grammar
DataFrame referenced by column names for Plot or Layer.
DataFrame referenced by column names for Plot or Layer.
- Value Params
- df
DataFrame.
- Since
0.1.0
- Inherited from
- Grammar
Embeds additional DataFrame columns in the data.
Embeds additional DataFrame columns in the data.
- Value Params
- field
Column name.
- Since
0.1.0
- Inherited from
- Grammar
The description encoding adds a text description to the mark for ARIA accessibility (SVG output only).
The description encoding adds a text description to the mark for ARIA accessibility (SVG output only).
- Value Params
- aggregate
- as
- bandPosition
- bin
- condition
- datum
- field
Column or field name.
- format
- formatType
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Description of this mark for commenting purpose.
Description of this mark for commenting purpose.
- Value Params
- string
Description.
- Since
0.1.0
- Inherited from
- Grammar
Defines an additional grouping field for grouping data without mapping the field to any visual properties.
Defines an additional grouping field for grouping data without mapping the field to any visual properties.
- Value Params
- as
- field
Column or field name.
- Since
0.1.0
- Inherited from
- Grammar
Defines additional grouping fields for grouping data without mapping the fields to any visual properties.
Defines additional grouping fields for grouping data without mapping the fields to any visual properties.
- Value Params
- fields
Tuples of
fieldandas(https://vega.github.io/vega-lite/docs/type.html). Example:.details( "group3" -> Nominal, "group4" -> Nominal)
- Since
0.1.0
- Inherited from
- Grammar
Facets single plots into trellis plots, i.e. columns and rows.
Facets single plots into trellis plots, i.e. columns and rows.
- Value Params
- align
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- as
- bin
- center
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- columns
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- field
Column or field name.
- header
- spacing
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- timeUnit
- title
Title.
- See also
- Since
0.1.0
- Inherited from
- Grammar
Fill color of the marks.
Fill color of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Fill opacity of the marks.
Fill opacity of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Horizontal concatenation of plots.
Horizontal concatenation of plots.
- Value Params
- layers
Layers.
- Since
0.1.0
- Inherited from
- Grammar
The href encoding makes a mark a hyperlink.
The href encoding makes a mark a hyperlink.
- Value Params
- aggregate
- as
- bandPosition
- bin
- condition
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The key channel can enable object constancy for transitions over dynamic data.
The key channel can enable object constancy for transitions over dynamic data.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- format
- formatType
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Latitude position of geographically projected marks.
Latitude position of geographically projected marks.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Latitude2 position for geographically projected ranged "area", "bar", "rect", and "rule"
Latitude2 position for geographically projected ranged "area", "bar", "rect", and "rule"
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Adds multiple (overlaying) layers .
Adds multiple (overlaying) layers .
- Value Params
- layers
Layers.
- Since
0.1.0
- Note
The layering mode is applied to all defined layers.
- Inherited from
- Grammar
Longitude position of geographically projected marks.
Longitude position of geographically projected marks.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Longitude2 position for geographically projected ranged "area", "bar", "rect", and "rule".
Longitude2 position for geographically projected ranged "area", "bar", "rect", and "rule".
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Name of the visualization for reference.
Name of the visualization for reference.
- Value Params
- name
Name.
- Since
0.1.0
- Inherited from
- Grammar
Opacity of the marks.
Opacity of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Multi-field order definition.
Multi-field order definition.
- Value Params
- fields
Tuples of field names and Struct.
- Since
0.1.0
- Inherited from
- Grammar
The order defines a data field that is used to sorts stacking order for stacked charts and the order of data points in line marks for connected scatterplots.
The order defines a data field that is used to sorts stacking order for stacked charts and the order of data points in line marks for connected scatterplots.
- Value Params
- aggregate
- as
- bandPosition
- bin
- condition
- datum
- field
Column or field name.
- sort
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Parameters can either be simple variables or more complex selections that map user input to data queries.
Parameters can either be simple variables or more complex selections that map user input to data queries.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Radius determines the position or interval on polar coordinates for arc and text marks.
Radius determines the position or interval on polar coordinates for arc and text marks.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- scale
- sort
- stack
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Radius2 determines the position or interval on polar coordinates for arc and text marks.
Radius2 determines the position or interval on polar coordinates for arc and text marks.
https://vega.github.io/vega-lite/docs/encoding.html#polar
- @param field Column or field name.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Scale, axis, and legend resolutions for view composition specifications.
Scale, axis, and legend resolutions for view composition specifications.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Facets plots into rows.
Facets plots into rows.
- Value Params
- align
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- as
- bin
- center
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- field
Column or field name.
- header
- spacing
https://vega.github.io/vega-lite/docs/facet.html#facet-field-definition
- timeUnit
- title
Title.
- See also
- Since
0.1.0
- Inherited from
- Grammar
Shape of the mark.
Shape of the mark.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Size of the mark.
Size of the mark.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The spacing (in pixels) between sub-views of the composition operator.
The spacing (in pixels) between sub-views of the composition operator.
- Value Params
- Since
0.1.0
- Inherited from
- Grammar
Stroke color of the marks.
Stroke color of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Stroke dash of the marks.
Stroke dash of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Stroke opacity of the marks.
Stroke opacity of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Stroke width of the marks.
Stroke width of the marks.
https://vega.github.io/vega-lite/docs/encoding.html#mark-prop
- Value Params
- aggregate
- as
- bin
- condition
- datum
- field
Column or field name.
- legend
- scale
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Text of the text mark.
Text of the text mark.
- Value Params
- aggregate
- as
- bandPosition
- bin
- condition
- datum
- field
Column or field name.
- format
- formatType
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Theta determines the position or interval on polar coordinates for arc and text marks.
Theta determines the position or interval on polar coordinates for arc and text marks.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- scale
- sort
- stack
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Theta2 determines the interval on polar coordinates for arc and text marks.
Theta2 determines the interval on polar coordinates for arc and text marks.
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The tooltip text to show upon mouse hover.
The tooltip text to show upon mouse hover.
- Value Params
- aggregate
- as
- bandPosition
- bin
- condition
- datum
- field
Column or field name.
- format
- formatType
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Multi-field tooltip text to show upon mouse hover.
Multi-field tooltip text to show upon mouse hover.
- Value Params
- fields
Tuples of field names and Struct(field, as, aggregate, bandPosition, bin, condition, datum, format, formatType, timeUnit, title, value) (see tooltip for details).
- Since
0.1.0
- Example
.tooltips( "x" -> Struct(field = "x", as = Temporal, title = "X Value"), "y" -> Struct(field = "y", as = Nominal, title = "Y Value") )- Inherited from
- Grammar
Data transformations such as filter and new field calculation.
Data transformations such as filter and new field calculation.
- Value Params
- Since
0.1.0
- Note
Use "set" to set a new field/variable.
- Example
.transform( Struct(calculate="datum.x*datum.x", set="x2"), Struct(filter="datum.x2 < 100") )- Inherited from
- Grammar
Vertical concatenation of plots.
Vertical concatenation of plots.
- Value Params
- layers
Layers.
- Since
0.1.0
- Inherited from
- Grammar
Defines the view background’s fill and stroke.
Defines the view background’s fill and stroke.
https://vega.github.io/vega-lite/docs/spec.html#view-background
- Since
0.1.0
- Inherited from
- Grammar
X coordinates or width of horizontal "bar" and "area".
X coordinates or width of horizontal "bar" and "area".
https://vega.github.io/vega-lite/docs/encoding.html#position
- Value Params
- aggregate
- as
- axis
- bandPosition
- bin
- datum
- field
Column or field name.
- impute
- scale
- sort
- stack
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
X2 coordinates for ranged "area", "bar", "rect", and "rule".
X2 coordinates for ranged "area", "bar", "rect", and "rule".
https://vega.github.io/vega-lite/docs/encoding.html#position
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- impute
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The xOffset determines an additional offset to the x position.
The xOffset determines an additional offset to the x position.
https://vega.github.io/vega-lite/docs/encoding.html#positon-offset
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- scale
- sort
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Y coordinates or height of vertical "bar" and "area".
Y coordinates or height of vertical "bar" and "area".
https://vega.github.io/vega-lite/docs/encoding.html#position
- Value Params
- aggregate
- as
- axis
- bandPosition
- bin
- datum
- field
Column or field name.
- impute
- scale
- sort
- stack
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
Y2 coordinates for ranged "area", "bar", "rect", and "rule".
Y2 coordinates for ranged "area", "bar", "rect", and "rule".
https://vega.github.io/vega-lite/docs/encoding.html#position
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- impute
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar
The yOffset determines an additional offset to the y position.
The yOffset determines an additional offset to the y position.
https://vega.github.io/vega-lite/docs/encoding.html#positon-offset
- Value Params
- aggregate
- as
- bandPosition
- bin
- datum
- field
Column or field name.
- scale
- sort
- timeUnit
- title
Title.
- value
- Since
0.1.0
- Inherited from
- Grammar