Grammar

abstract class Grammar[T](val cfg: Config) extends Dynamic

Base class for plotting specifications.

Type Params
T

Type that implementes the base class.

Value Params
cfg

Plotting configuration.

Since

0.1.0

Companion
object
trait Dynamic
class Object
trait Matchable
class Any
class Layer
class Plot

Value members

Concrete methods

def align(struct: Struct*): T

The alignment to apply to grid rows and columns.

The alignment to apply to grid rows and columns.

Value Params
struct

https://vega.github.io/vega-lite/docs/spec.html#common

Since

0.1.0

def applyDynamicNamed(method: String)(kwargs: (String, Struct)*): T
def bounds(struct: Struct*): T

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
struct

https://vega.github.io/vega-lite/docs/spec.html#common

Since

0.1.0

def center(struct: Struct*): T

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
struct

https://vega.github.io/vega-lite/docs/spec.html#common

Since

0.1.0

def color(field: String, as: String, aggregate: Struct, bin: Struct, condition: Struct, datum: Struct, legend: Struct, scale: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def concat(columns: Int, layers: Layer*): T

Concatenation of plots.

Value Params
layers

Layers.

See also
Since

0.1.0

def custom(name: String, struct: Struct): T

Custom element.

Custom element.

Value Params
name

Element name.

struct

Definition.

Since

0.1.0

def customEncoding(name: String, field: String, struct: Struct): T

Custom encoding channel element.

Custom encoding channel element.

Value Params
field

Column or field name.

name

Encoding name.

struct

Definition.

Since

0.1.0

def data: T

Custom data definition.

Since

0.1.0

def dataFrame(df: DataFrame): T

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

def dataInclude(field: String*): T

Embeds additional DataFrame columns in the data.

Embeds additional DataFrame columns in the data.

Value Params
field

Column name.

Since

0.1.0

def description(string: String): T

Description of this mark for commenting purpose.

Description of this mark for commenting purpose.

https://vega.github.io/vega-lite/docs/spec.html#common

Value Params
string

Description.

Since

0.1.0

def description(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, condition: Struct, datum: Struct, format: Struct, formatType: String, timeUnit: Struct, title: Struct, value: Struct): T
def detail(field: String, as: String): T

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.

https://vega.github.io/vega-lite/docs/encoding.html#detail

Value Params
as

https://vega.github.io/vega-lite/docs/type.html

field

Column or field name.

Since

0.1.0

def details(fields: (String, String)*): T

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.

https://vega.github.io/vega-lite/docs/encoding.html#detail

Value Params
fields

Tuples of field and as (https://vega.github.io/vega-lite/docs/type.html). Example:

.details( "group3" -> Nominal, "group4" -> Nominal)
Since

0.1.0

def hconcat(layers: Layer*): T

Horizontal concatenation of plots.

Horizontal concatenation of plots.

https://vega.github.io/vega-lite/docs/concat.html

Value Params
layers

Layers.

Since

0.1.0

def height(px: Int): T

Height of plot.

Value Params
px

Height of plot.

Since

0.1.0

def href(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, condition: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def key(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, format: Struct, formatType: String, timeUnit: Struct, title: Struct, value: Struct): T
def latitude(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def latitude2(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T

Latitude2 position for geographically projected ranged "area", "bar", "rect", and "rule"

def layer(layers: Layer*): T

Adds multiple (overlaying) layers .

Adds multiple (overlaying) layers .

https://vega.github.io/vega-lite/docs/layer.html

Value Params
layers

Layers.

Since

0.1.0

Note

The layering mode is applied to all defined layers.

def longitude(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def longitude2(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T

Longitude2 position for geographically projected ranged "area", "bar", "rect", and "rule".

def name(name: String): T

Name of the visualization for reference.

Name of the visualization for reference.

https://vega.github.io/vega-lite/docs/spec.html#common

Value Params
name

Name.

Since

0.1.0

def order(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, condition: Struct, datum: Struct, sort: Struct, timeUnit: Struct, title: Struct, value: Struct): T

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.

def order(fields: (String, Struct)*): T

Multi-field order definition.

Value Params
fields

Tuples of field names and Struct.

Since

0.1.0

def param(struct: Struct*): T

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
struct

https://vega.github.io/vega-lite/docs/parameter.html

Since

0.1.0

def projection: T

Sets cartographic projection.

Since

0.1.0

def radius(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, scale: Struct, sort: Struct, stack: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def radius2(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T

Radius2 determines the position or interval on polar coordinates for arc and text marks.

def resolve(scale: Struct, axis: Struct, legend: Struct): T

Scale, axis, and legend resolutions for view composition specifications.

def spacing(struct: Struct*): T

The spacing (in pixels) between sub-views of the composition operator.

The spacing (in pixels) between sub-views of the composition operator.

Value Params
struct

https://vega.github.io/vega-lite/docs/spec.html#common

Since

0.1.0

def theta(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, scale: Struct, sort: Struct, stack: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def theta2(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, timeUnit: Struct, title: Struct, value: Struct): T

Theta2 determines the interval on polar coordinates for arc and text marks.

def tooltips(fields: (String, Struct)*): T

Multi-field tooltip text to show upon mouse hover.

Multi-field tooltip text to show upon mouse hover.

https://vega.github.io/vega-lite/docs/tooltip.html

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")
)
def transform(struct: Struct*): T

Data transformations such as filter and new field calculation.

Data transformations such as filter and new field calculation.

Value Params
struct

https://vega.github.io/vega-lite/docs/transform.html

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")
 )
def vconcat(layers: Layer*): T

Vertical concatenation of plots.

Vertical concatenation of plots.

https://vega.github.io/vega-lite/docs/concat.html

Value Params
layers

Layers.

Since

0.1.0

def view: T

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

def width(px: Int): T

Width of plot.

Value Params
px

Width of plot.

Since

0.1.0

def x2(field: String, as: String, aggregate: Struct, bin: Struct, bandPosition: Struct, datum: Struct, impute: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def xOffset(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, scale: Struct, sort: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def y2(field: String, as: String, aggregate: Struct, bin: Struct, bandPosition: Struct, datum: Struct, impute: Struct, timeUnit: Struct, title: Struct, value: Struct): T
def yOffset(field: String, as: String, aggregate: Struct, bandPosition: Struct, bin: Struct, datum: Struct, scale: Struct, sort: Struct, timeUnit: Struct, title: Struct, value: Struct): T