gicentre/elm-vega/3.0.1

NOTE: this package is not compatible with Elm 0.19.1

VegaLite

Create Vega-Lite specifications in Elm. A specification can be sent to a Vega-Lite compiler to generate the graphics. While this a pure Elm library, to generate the graphical output you probably want to send the JSON generated by toVegaLite via a port to some JavaScript that invokes the Vega-Lite runtime.

Creating A Vega-Lite Specification

toVegaLite : List ( VLProperty, Spec ) -> Spec

Convert a list of Vega-Lite specifications into a single JSON object that may be passed to Vega-Lite for graphics generation. Commonly these will include at least data, mark and encoding specifications.

While simple functions like bar may be provided directly, it is usually clearer to label more complex ones such as encodings as separate expressions.

Specifications can be built up by chaining functions such as dataColumn or position. Functional composition using the << operator allows this to be done compactly.

let
    data =
        dataFromColumns []
            << dataColumn "a" (strs [ "C", "C", "D", "E" ])
            << dataColumn "b" (nums [ 2, 7, 1, 2 ])


    enc =
        encoding
            << position X [ pName "a", pMType Nominal ]
            << position Y [ pName "b", pMType Quantitative, pAggregate Mean ]
in
toVegaLite [ data [], bar [], enc [] ]

Top-level Vega-Lite properties. These are the ones that define the core of the visualization grammar. All VLProperties are created by functions in seven broad groups.

Data properties relate to the input data to be visualized. Generated by dataFromColumns, dataFromRows, dataFromUrl, dataFromSource and dataFromJson.

Transform properties indicate that some transformation of input data should be applied before encoding them visually. Generated by transform and projection they can include data transformations such as filter, binAs and calculateAs and geo transformations of longitude, latitude coordinates used by marks such as those generated by geoshape, point and line.

Mark functions specify the symbols used to visualize data items. Generated by functions such as circle, bar and line.

Encoding properties specify which data elements are mapped to which mark characteristics (known as channels). Generated by encoding they include encodings such as position, color, size, shape, text and hyperlink.

Composition properties allow visualization views to be combined to form more complex visualizations. Generated by layer, repeat, facet, hConcat, vConcat, spec and resolve.

Interaction properties allow clicking, dragging and other interactions generated via a GUI or data stream to influence the visualization. Generated by selection.

Supplementary and configuration properties provide a means to add metadata and styling to one or more visualizations. Generated by name, title, description, background, width, height, padding, autosize and configure.

type alias Spec =
Value

Part or all of Vega-Lite specification. Specs are usually nested and can range from a single Boolean value up to the entire Vega-Lite specification.

type alias LabelledSpec =
( String, Spec )

A named Vega-Lite specification, usually generated by an elm-vega function. You shouldn't need to create LabelledSpec tuples directly, but are useful for type annotations.

combineSpecs : List LabelledSpec -> Spec

Combines a list of labelled specifications that may be passed to JavaScript for rendering. Useful when you wish to create a single page with multiple visulizualizations.

combineSpecs
    [ ( "vis1", myFirstVis )
    , ( "vis2", mySecondVis )
    , ( "vis3", myOtherVis )
    ]

Creating the Data Specification

Functions and types for declaring the data to the visualized. See the Vega-Lite documentation.

dataFromUrl : String -> List Format -> Data

Declare a data source from a url. The URL can be a local path on a web server or an external (CORS) URL. A list of field formatting instructions can be provided as the second parameter or an empty list to use the default formatting.

dataFromColumns : List Format -> List DataColumn -> Data

Declare a data source from a list of column values. Each column should contain values of the same type, but columns each with a different type are permitted. If columns do not contain the same number of items the dataset will be truncated to the length of the shortest. A list of field formatting instructions can be provided as the first parameter or an empty list to use the default formatting. The columns are most easily generated with dataColumn:

data =
    dataFromColumns [ parse [ ( "Year", foDate "%Y" ) ] ]
        << dataColumn "Animal" (strs [ "Fish", "Dog", "Cat" ])
        << dataColumn "Age" (nums [ 28, 12, 6 ])
        << dataColumn "Year" (strs [ "2010", "2014", "2015" ])

For more complex inline data tables, such as mixures of arrays and objects, consider using dataFromJson.

dataFromRows : List Format -> List DataRow -> Data

Declare a data source from a list of row values. Each row should contain a list of tuples in the form (column name, value). Each column can have a value of a different type but you must ensure that values are of the same type as others in the same column. A list of field formatting instructions can be provided as the first parameter or an empty list to use the default formatting. Rows are most easily generated with dataRow.

data =
    dataFromRows [ parse [ ( "Year", foDate "%Y" ) ] ]
        << dataRow [ ( "Animal", str "Fish" ), ( "Age", num 28 ), ( "Year", str "2010" ) ]
        << dataRow [ ( "Animal", str "Dog" ), ( "Age", num 12 ), ( "Year", str "2014" ) ]
        << dataRow [ ( "Animal", str "Cat" ), ( "Age", num 6 ), ( "Year", str "2015" ) ]

Generally, adding data by column is more efficient and less error-prone. For more complex inline data tables, such as mixures of arrays and objects, consider using dataFromJson.

dataFromJson : Spec -> List Format -> Data

Declare a data source from a json specification. The most likely use-case is creating geojson objects with geometry, geometryCollection and geoFeatureCollection. For more general cases of json creation such as data tables that mix arrays and objects, consider Json.Encode.

let
    geojson =
        geometry (geoPolygon [ [ ( -3, 59 ), ( 4, 59 ), ( 4, 52 ), ( -3, 59 ) ] ]) []
in
toVegaLite
    [ width 200
    , height 200
    , dataFromJson geojson []
    , projection [ prType Orthographic ]
    , geoshape []
    ]
dataFromSource : String -> List Format -> Data

Declare data from a named source. The source may be from named datasets within a specification or one created via the Vega View API. A list of field formatting instructions can be provided as the second parameter or an empty list to use the default formatting.

data = ...
json = ...
enc = ...
toVegaLite
    [ datasets [ ( "myData", data [] ),  ( "myJson", dataFromJson json [] ) ]
    , dataFromSource "myData" []
    , bar []
    , enc []
    ]
dataName : String -> Data -> Data

Name to give a data source. Useful when a specification needs to reference a data source, such as one generated via an API call.

data =
    dataFromUrl "myData.json" [] |> dataName "myName"
datasets : List ( String, Data ) -> Data

Create a dataset comprising a collection of named Data items. Each data item can be created with normal data generating functions such as dataFromRows or dataFromJson. These can be later referred to using dataFromSource.

import Json.Encode as JE


let
    data =
        dataFromRows []
            << dataRow [ ( "cat", str "a" ), ( "val", num 10 ) ]
            << dataRow [ ( "cat", str "b" ), ( "val", num 18 ) ]
    json =
        JE.list
            [ JE.object [ ( "cat", JE.string "a" ), ( "val", JE.float 120 ) ]
            , JE.object [ ( "cat", JE.string "b" ), ( "val", JE.float 180 ) ]
            ]


    enc = ...


in
toVegaLite
    [ datasets [ ( "myData", data [] ),  ( "myJson", dataFromJson json [] ) ]
    , dataFromSource "myData" []
    , bar []
    , enc []
    ]
dataColumn : String -> DataValues -> List DataColumn -> List DataColumn

Create a column of data. A column has a name and a list of values.

dataRow : List ( String, DataValue ) -> List DataRow -> List DataRow

Create a row of data. A row comprises a list of (columnName, value) pairs.

type alias Data =
( VLProperty, Spec )

Convenience type annotation label for use with data generation functions.

myRegion : List DataColumn -> Data
myRegion =
    dataFromColumns []
        << dataColumn "easting" (nums [ -3, 4, 4, -3, -3 ])
        << dataColumn "northing" (nums [ 52, 52, 45, 45, 52 ])
type alias DataColumn =
List LabelledSpec

A single column of data. Used when generating inline data with dataColumn.

type alias DataRow =
Spec

A single row of data. Used when generating inline data with dataRow.

Geographic Data

geometry : Geometry -> List ( String, DataValue ) -> Spec

Geometric object to be used in a geoshape. The first parameter is the geometric type, the second an optional list of properties to be associated with the object.

  geojson =
      geometry (geoPolygon [ [ ( -3, 59 ), ( 4, 59 ), ( 4, 52 ), ( -3, 59 ) ] ]) []
geoFeatureCollection : List Spec -> Spec

Geo features to be used in a geoshape specification. Each feature object in this collection can be created with geometry.

geojson =
    geoFeatureCollection
        [ geometry (geoPolygon [ [ ( -3, 59 ), ( -3, 52 ), ( 4, 52 ), ( -3, 59 ) ] ])
            [ ( "myRegionName", str "Northern region" ) ]
        , geometry (geoPolygon [ [ ( -3, 52 ), ( 4, 52 ), ( 4, 45 ), ( -3, 52 ) ] ])
            [ ( "myRegionName", str "Southern region" ) ]
        ]
geometryCollection : List Spec -> Spec

Geometry objects to be used in a geoshape specification. Each geometry object can be created with geometry.

geojson =
    geometryCollection
        [ geometry (geoPolygon [ [ ( -3, 59 ), ( 4, 59 ), ( 4, 52 ), ( -3, 59 ) ] ]) []
        , geometry (geoPoint -3.5 55.5) []
        ]
geoPoint : Float -> Float -> Geometry

Point geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry point type.

geoPoints : List ( Float, Float ) -> Geometry

Multi-point geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry multi-point type.

geoLine : List ( Float, Float ) -> Geometry

Line geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry line type.

geoLines : List (List ( Float, Float )) -> Geometry

Multi-line geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry multi-line type.

geoPolygon : List (List ( Float, Float )) -> Geometry

Polygon geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry polygon type.

geoPolygons : List (List (List ( Float, Float ))) -> Geometry

Multi-polygon geometry for programmatically creating GeoShapes. Equivalent to the GeoJson geometry multi-polygon type.

= FoNumber
| FoBoolean

Data type to be parsed when reading input data. To parse dates, see foDate and foUtc.

Formatting Input Data

See the Vega-Lite format and JSON documentation.

type Format
= CSV
| TSV

Data file format (only necessary if the file extension does not indicate the type). To read a file with a delimiter other than comma or tab, use dsv. To customise the parsing of a file use parse, jsonProperty, topojsonFeature or topojsonMesh.

jsonProperty : String -> Format

Property to be extracted from some JSON when it has some surrounding structure. e.g., specifying the property values.features is equivalent to retrieving json.values.features from a JSON object with a custom delimiter.

topojsonFeature : String -> Format

A topoJSON feature format containing an object with the given name.

topojsonMesh : String -> Format

A topoJSON mesh format containing an object with the given name. Unlike topojsonFeature, the corresponding geo data are returned as a single unified mesh, not as individual GeoJSON features.

parse : List ( String, DataType ) -> Format

Parsing rules when processing some data text, specified as a list of tuples in the form (fieldname, datatype). If an empty list is provided, type inference is based on the data.

dsv : Char -> Format

Delimited file format (DSV) with a given separator.

foDate : String -> DataType

Date format for parsing input data using D3's formatting specifiers or left as an empty string for default formatting.

foUtc : String -> DataType

Similar to foDate but for UTC format dates.

Creating the Transform Specification

Transformation rules are applied to data fields or geospatial coordinates before they are encoded visually.

transform : List LabelledSpec -> ( VLProperty, Spec )

Create a single transform from a list of transformation specifications. The order of transformations can be important, e.g. labels created with calculateAs, timeUnitAs and binAs that are used in other transformations. Using the functional composition pipeline idiom (as example below) allows you to provide the transformations in the order intended in a clear manner.

trans =
    transform
        << filter (fiExpr "datum.year == 2010")
        << calculateAs "datum.sex == 2 ? 'Female' : 'Male'" "gender"
projection : List ProjectionProperty -> ( VLProperty, Spec )

Map projection used for geospatial coordinates.

prType : Projection -> ProjectionProperty

Type of global map projection.

prClipAngle : Maybe Float -> ProjectionProperty

Projection’s clipping circle radius to the specified angle in degrees. A value of Nothing will switch to antimeridian cutting rather than small-circle clipping.

prClipExtent : ClipRect -> ProjectionProperty

Projection’s viewport clip extent to the specified bounds in pixels.

prCenter : Float -> Float -> ProjectionProperty

Projection’s center as longitude and latitude in degrees.

prRotate : Float -> Float -> Float -> ProjectionProperty

Projection’s three-axis rotation angle. This should be in order lambda phi gamma specifying the rotation angles in degrees about each spherical axis.

prPrecision : Float -> ProjectionProperty

Threshold for the projection’s adaptive resampling in pixels. Corresponds to the Douglas–Peucker distance. If precision is not specified, the projection’s current resampling precision of 0.707 is used.

prCoefficient : Float -> ProjectionProperty

'Hammer' map projection coefficient.

prDistance : Float -> ProjectionProperty

'Satellite' map projection distance.

prFraction : Float -> ProjectionProperty

Bottomley map projection fraction.

prLobes : Int -> ProjectionProperty

Number of lobes in lobed map projections such as the 'Berghaus star'.

prParallel : Float -> ProjectionProperty

Parallel for map projections such as the 'Armadillo'.

prRadius : Float -> ProjectionProperty

Radius value for map projections such as the 'Gingery'.

prRatio : Float -> ProjectionProperty

Ratio value for map projections such as the 'Hill'.

prSpacing : Float -> ProjectionProperty

Spacing value for map projections such as the 'Lagrange'.

prTilt : Float -> ProjectionProperty

'Satellite' map projection tilt.

= Albers
| AlbersUsa
| AzimuthalEqualArea
| AzimuthalEquidistant
| ConicConformal
| ConicEqualArea
| ConicEquidistant
| Equirectangular
| Gnomonic
| Mercator
| Orthographic
| Stereographic
| TransverseMercator

Types of geographic map projection. These are based on a subset of those provided by the d3-geo library. To generate a custom projection use customProjection.

customProjection : String -> Projection

Custom projection type. Additional custom projections from d3 can be defined via the Vega API and called from with this function where the parameter is the name of the D3 projection to use (e.g. customProjection "winkel3").

= NoClip

No clipping to be applied. To specify a clipping rectangle dimenstions, see clipRect.

clipRect : Float -> Float -> Float -> Float -> ClipRect

Clipping rectangle in pixel units. The four parameters are respectively 'left', 'top', 'right' and 'bottom' of the rectangular clipping bounds.

aggregate : List Spec -> List String -> List LabelledSpec -> List LabelledSpec

Aggregation transformations to be used when encoding channels. Useful when for applying the same transformation to a number of channels without defining it each time. The first parameter is a list of the named aggregation operations to apply. The second is a list of 'group by' fields.

trans =
    transform
        << aggregate
            [ opAs Min "people" "lowerBound", opAs Max "people" "upperBound" ]
            [ "age" ]
= ArgMax
| ArgMin
| Average
| CI0
| CI1
| Count
| Distinct
| Max
| Mean
| Median
| Min
| Missing
| Q1
| Q3
| Stderr
| Stdev
| StdevP
| Sum
| Valid
| Variance
| VarianceP

Type of aggregation operation.

opAs : Operation -> String -> String -> Spec

Aaggregation operation. The first parameter is the operation to use; the second the name of the field in which to apply it and the third the name to be given to this transformation.

trans =
    transform
        << aggregate
            [ opAs Min "people" "lowerBound"
            , opAs Max "people" "upperBound"
            ]
            [ "age" ]

If the operation is Count, it does not apply to any specific field, so the second parameter can be an empty string.

timeUnitAs : TimeUnit -> String -> String -> List LabelledSpec -> List LabelledSpec

Create a new data field based on the given temporal binning. Unlike the direct encoding binning, this transformation is named and so can be referred to in multiple encodings. The first parameter is the width of each temporal bin, the second is the field to bin and the third is name to give the newly binned field.

List BinProperty
-> String
-> String
-> List LabelledSpec
-> List LabelledSpec

Binning transformation that may be referenced in other transformations or encodings. The type of binning can be customised with a list of BinProperty generating functions (biBase, biDivide etc.) or an empty list to use the default binning.

trans =
    transform
        << binAs [ MaxBins 3 ] "IMDB_Rating" "ratingGroup"

Note that usually, direct binning within an encoding is preferred over this form of bin transformation.

biBase : Float -> BinProperty

Number base to use for automatic bin determination (default is base 10).

biDivide : List Float -> BinProperty

Scale factors indicating allowable subdivisions for binning. The default value is [5, 2], which indicates that for base 10 numbers (the default base), binning will consider dividing bin sizes by 5 and/or 2.

biExtent : Float -> Float -> BinProperty

Desired range of bin values when binning a collection of values. The first and second parameters indicate the minimum and maximum range values.

biMaxBins : Int -> BinProperty

Maximum number of bins when binning a collection of values.

biMinStep : Float -> BinProperty

Step size between bins when binning a collection of values.

biNice : Bool -> BinProperty

Whether or not binning boundaries use human-friendly values such as multiples of ten.

biStep : Float -> BinProperty

Step size between bins when binning a collection of values.

biSteps : List Float -> BinProperty

Allowable step sizes between bins when binning a collection of values.

String
-> List String
-> String
-> String
-> List StackProperty
-> List LabelledSpec
-> List LabelledSpec

Apply a stack transform for positioning multiple values. This is an alternative to specifying stacking directly when encoding position. First parameter is the field to be stacked; the second the fields to group by; the third and fourth are the names to give the output field names; the fifth lists the optional offset and sort properties.

stOffset : StackOffset -> StackProperty

Stack offset when applying a stack transformation.

= StZero
| StNormalize
| StCenter
| NoStack

Type of stacking to apply when showing multiple quantities.

stSort : List SortField -> StackProperty

Ordering within a stack when applying a stack transformation.

stAscending : String -> SortField

Indicate that the given field should be sorted in ascending order.

stDescending : String -> SortField

Indicate that the given field should be sorted in descending order.

calculateAs : String -> String -> List LabelledSpec -> List LabelledSpec

Generate a new data field based on calculations from existing fields. The first parameter is an expression representing the calculation and the second is the name to give the newly calculated field.

trans =
    transform << calculateAs "datum.sex == 2 ? 'F' : 'M'" "gender"
filter : Filter -> List LabelledSpec -> List LabelledSpec

Apply a filter to a channel or field.

fiEqual : String -> DataValue -> Filter

Filter a data stream so that only data in a given field equal to the given value are used.

fiLessThan : String -> DataValue -> Filter

Filter a data stream so that only data in a given field less than the given value are used.

fiLessThanEq : String -> DataValue -> Filter

Filter a data stream so that only data in a given field less than or equal to the given value are used.

fiGreaterThan : String -> DataValue -> Filter

Filter a data stream so that only data in a given field greater than the given value are used.

fiGreaterThanEq : String -> DataValue -> Filter

Filter a data stream so that only data in a given field greater than or equal to the given value are used.

fiExpr : String -> Filter

Filter a data stream so that only data that satisfy the given predicate expression are used.

fiCompose : BooleanOp -> Filter

Build up a filtering predicate through logical composition (and, or etc.).

fiSelection : String -> Filter

Filter a data stream so that only data in a given field that are within the given interactive selection are used.

fiOneOf : String -> DataValues -> Filter

Filter a data stream so that only data in a given field contained in the given list of values are used.

fiRange : String -> FilterRange -> Filter

Filter a data stream so that only data in a given field that are within the given range are used.

fiValid : String -> Filter

Filter a data stream so that only valid data (i.e. not null or NaN) in a given field are used.

numRange : Float -> Float -> FilterRange

Minimum-maximum number range to be used in data filtering.

dtRange : List DateTime -> List DateTime -> FilterRange

Min max date-time range to be used in data filtering. If either parameter is an empty list, it is assumed to be unbounded.

Flattening

See the Vega-Lite flatten and fold documentation.

flatten : List String -> List LabelledSpec -> List LabelledSpec

Map array-valued fields to a set of individual data objects, one per array entry.

flattenAs : List String -> List String -> List LabelledSpec -> List LabelledSpec

Similar to flatten but allows the new output fields to be named (second parameter).

fold : List String -> List LabelledSpec -> List LabelledSpec

Collapse one or more data fields into two properties: a key (containing the original data field name) and a value (containing the data value). Useful for mapping matrix or cross-tabulation data into a standardized format.

List String
-> String
-> String
-> List LabelledSpec
-> List LabelledSpec

Similar to fold but allows the new output key and value fields to be given alternative names

Relational Joining (lookup)

See the Vega-Lite lookup documentation.

String
-> ( VLProperty, Spec )
-> String
-> List String
-> List LabelledSpec
-> List LabelledSpec

Perform a lookup of named fields between two data sources. This allows you to find values in one data source based on the values in another. The first parameter is the field in the primary data source to act as key, the second is the secondary data source which can be specified with a call to dataFromUrl or other data generating function. The third is the name of the field in the secondary data source to match values with the primary key. The fourth parameter is the list of fields to be stored when the keys match.

String
-> Data
-> String
-> String
-> List LabelledSpec
-> List LabelledSpec

Similar to lookup but returns the entire set of field values from the secondary data source when keys match. Accessed with via name provided in the fourth parameter.

Data Imputation

Impute missing data. See the Vega-Lite impute documentation.

String
-> String
-> List ImputeProperty
-> List LabelledSpec
-> List LabelledSpec

Impute missing data values. The first parameter is the data field to process; the second the key field to uniquely identify data objects within a group; the third customisable options.

imFrame : Maybe Int -> Maybe Int -> ImputeProperty

1d window over which data imputation values are generated. The two parameters should either be Just a number indicating the offset from the current data object, or Nothing to indicate unbounded rows preceding or following the current data object.

imKeyVals : DataValues -> ImputeProperty

Key values to be considered for imputation.

imKeyValSequence : Float -> Float -> Float -> ImputeProperty

Key values to be considered for imputation as a sequence of numbers between a start (first parameter), to less than an end (second parameter) in steps of the third parameter.

imMethod : ImMethod -> ImputeProperty

Imputation method to use when replacing values.

= ImValue
| ImMean
| ImMedian
| ImMax
| ImMin

The imputation method to use when replacing values.

imGroupBy : List String -> ImputeProperty

Allow imputing of missing values on a per-group basis. For use with the impute transform only and not a channel encoding.

imValue : DataValue -> ImputeProperty

New value to use when imputing with the method ImValue.

Data Sampling

See the Vega-Lite sample documentation

sample : Float -> List LabelledSpec -> List LabelledSpec

Randomly sample rows from a data source up to a given maximum.

Window Transformations

See the Vega-Lite window transform field and window transform documentation.

List ( List Window, String )
-> List WindowProperty
-> List LabelledSpec
-> List LabelledSpec

Wwindow transform for performing calculations over sorted groups of data objects such as ranking, lead/lag analysis, running sums and averages.

The first parameter is a list of tuples each comprising a window transform field definition and an output name. The second is the window transform definition.

   trans =
       transform
           << window [ ( [ wiAggregateOp Sum, wiField "Time" ], "TotalTime" ) ]
               [ wiFrame Nothing Nothing ]
wiAggregateOp : Operation -> Window

An aggregrate operation to be used in a window transformation.

wiOp : WindowOperation -> Window

Window-specific operation to be used in a window transformation.

= RowNumber
| Rank
| DenseRank
| PercentRank
| CumeDist
| Ntile
| Lag
| Lead
| FirstValue
| LastValue
| NthValue

Operations that may be applied during a window transformation.

wiParam : Int -> Window

Numeric parameter for window-only operations that can be parameterised (Ntile, Lag, Lead and NthValue).

wiField : String -> Window

Field for which to compute a window operation. Not needed for operations that do not apply to fields such as Count, Rank and DenseRank.

wiFrame : Maybe Int -> Maybe Int -> WindowProperty

Moving window for use by a window transform. The two parameters should either be Just a number indicating the offset from the current data object, or Nothing to indicate unbounded rows preceding or following the current data object.

wiIgnorePeers : Bool -> WindowProperty

Whether or not the sliding window frame in a window transform should ignore peer values (those considered identical by the sort criteria).

wiGroupBy : List String -> WindowProperty

Fields for partioning data objects in a window transform into separate windows. If unspecified, all points will be in a single group.

wiSort : List SortField -> WindowProperty

Comparator for sorting data objects within a window transform.

wiAscending : String -> SortField

Indicate that the given field should be sorted in ascending order when performing a window transform.

wiDescending : String -> SortField

Indicate that the given field should be sorted in descending order when performing a window transform.

Creating the Mark Specification

Functions for declaring the type of visual marks used in the visualization.

area : List MarkProperty -> ( VLProperty, Spec )

An area mark for representing a series of data elements, such as in a stacked area chart or streamgraph.

bar : List MarkProperty -> ( VLProperty, Spec )

Bar mark for histograms, bar charts etc.

boxplot : List MarkProperty -> ( VLProperty, Spec )

Boxplot composite mark for showing summaries of statistical distibutions.

errorband : List MarkProperty -> ( VLProperty, Spec )

Errorband composite mark for showing summaries of variation along a signal. By default no border is drawn. To add a border with default properties use maBorders with an empty list.

errorbar : List MarkProperty -> ( VLProperty, Spec )

Errorbar composite mark for showing summaries of variation along a signal. By default no ticks are drawn. To add ticks with default properties use maTicks with an empty list.

circle : List MarkProperty -> ( VLProperty, Spec )

Circle mark for symbolising points.

geoshape : List MarkProperty -> ( VLProperty, Spec )

Geoshape determined by georaphically referenced coordinates.

line : List MarkProperty -> ( VLProperty, Spec )

Line mark for symbolising a sequence of values.

point : List MarkProperty -> ( VLProperty, Spec )

Point mark for symbolising a data point with a symbol.

rect : List MarkProperty -> ( VLProperty, Spec )
rule : List MarkProperty -> ( VLProperty, Spec )

Rule line connecting two vertices.

square : List MarkProperty -> ( VLProperty, Spec )

Square mark for symbolising points.

textMark : List MarkProperty -> ( VLProperty, Spec )

Text mark to be displayed at some point location.

tick : List MarkProperty -> ( VLProperty, Spec )

Short line (tick) mark for symbolising point locations.

trail : List MarkProperty -> ( VLProperty, Spec )

Trail mark (line with variable width along its length).

Mark Properties

See the Vega-Lite general mark, area mark, bar mark, hyperlink mark, line mark, point mark, text mark and tick mark property documentation.

maAlign : HAlign -> MarkProperty

Horizontal alignment of a text mark.

maAngle : Float -> MarkProperty

Rotation angle in degrees of a text mark.

maBandSize : Float -> MarkProperty

Band size of a bar mark.

maBaseline : VAlign -> MarkProperty

Vertical alignment of a text mark.

maBinSpacing : Float -> MarkProperty

Offset between bars for a binned field using a bar mark.

maBorders : List MarkProperty -> MarkProperty

Border properties for an errorband mark.

maClip : Bool -> MarkProperty

Whether or not a mark should be clipped to the enclosing group's dimensions.

maColor : String -> MarkProperty

Default color of a mark. Note that maFill and maStroke have higher precedence and will override this if specified.

maCursor : Cursor -> MarkProperty

Cursor to be associated with a hyperlink mark.

maExtent : SummaryExtent -> MarkProperty

Extent of whiskers used in a boxplot, error bars or error bands.

maHRef : String -> MarkProperty

Hyperlink to be associated with a mark making it a clickable hyperlink.

maContinuousBandSize : Float -> MarkProperty

Continuous band size of a bar mark.

maDiscreteBandSize : Float -> MarkProperty

Discrete band size of a bar mark.

maDx : Float -> MarkProperty

Horizontal offset between a text mark and its anchor.

maDy : Float -> MarkProperty

Vertical offset between a text mark and its anchor.

maFill : String -> MarkProperty

Default fill color of a mark.

maFilled : Bool -> MarkProperty

Whether or not a mark's color should be used as the fill color instead of stroke color.

maFillOpacity : Float -> MarkProperty

Fill opacity of a mark.

maFont : String -> MarkProperty

Font of a text mark. Can be any font name made accessible via a css file (or a generic font like serif, monospace etc.).

maFontSize : Float -> MarkProperty

Font size in pixels used by a text mark.

maFontStyle : String -> MarkProperty

Font style (e.g. italic) used by a text mark.

maFontWeight : FontWeight -> MarkProperty

Font wight used by a text mark.

maInterpolate : MarkInterpolation -> MarkProperty

Interpolation method used by line and area marks.

maOpacity : Float -> MarkProperty

Overal opacity of a mark in the range 0 to 1.

maOrient : MarkOrientation -> MarkProperty

Orientation of a non-stacked bar, tick, area or line mark.

maPoint : PointMarker -> MarkProperty

Appearance of a point marker joining the vertices of a line or area mark.

maLine : LineMarker -> MarkProperty

Appearance of a line marker joining the vertices of an area mark.

maRadius : Float -> MarkProperty

Polar coordinate radial offset of a text mark from its origin.

maRule : List MarkProperty -> MarkProperty

Rule (main line) properties for the errorbar mark.

maShape : Symbol -> MarkProperty

Shape of a point mark.

maShortTimeLabels : Bool -> MarkProperty

Whether or not month and weekday names are abbreviated in a text mark.

maSize : Float -> MarkProperty

Ssize of a mark in square units.

maStroke : String -> MarkProperty

Default stroke color of a mark.

maStrokeCap : StrokeCap -> MarkProperty

Cap style of a mark's stroke.

= CButt
| CRound
| CSquare

Type of stroke cap.

maStrokeDash : List Float -> MarkProperty

Stroke dash style used by a mark. Determined by an alternating 'on-off' sequence of line lengths.

maStrokeDashOffset : Float -> MarkProperty

Number of pixels before the first line dash is drawn.

maStrokeJoin : StrokeJoin -> MarkProperty

Line segment join style of a mark's stroke.

= JMiter
| JRound
| JBevel

Type of stroke join.

maStrokeMiterLimit : Float -> MarkProperty

Miter limit at which to bevel a join between line segments of a mark's stroke.

maStrokeOpacity : Float -> MarkProperty

Stroke opacity of a mark in the range 0 to 1.

maStrokeWidth : Float -> MarkProperty

Stroke width of a mark in pixel units.

maStyle : List String -> MarkProperty

Names of custom styles to apply to a mark. Each should refer to a named style defined in a separate style configuration.

maTension : Float -> MarkProperty

Interpolation tension used when interpolating line and area marks.

maText : String -> MarkProperty

Placeholder text for a text mark for when a text channel is not specified.

maTheta : Float -> MarkProperty

Polar coordinate angle (clockwise from north in radians) of a text mark from the origin determined by its x and y properties.

maThickness : Float -> MarkProperty

Thickness of a tick mark.

maTicks : List MarkProperty -> MarkProperty

Tick properties for the errorbar mark.

maTooltip : TooltipContent -> MarkProperty

Source of a mark's tooltip content.

maXOffset : Float -> MarkProperty

X position offset for a mark.

maYOffset : Float -> MarkProperty

Y position offset for a mark.

maX2Offset : Float -> MarkProperty

X2 position offset for a mark.

maY2Offset : Float -> MarkProperty

Y2 position offset for a mark.

Used by Mark Properties

= Horizontal
| Vertical

Desired orientation of a mark (e.g. horizontally or vertically oriented bars.)

= Basis
| BasisClosed
| BasisOpen
| Bundle
| Cardinal
| CardinalClosed
| CardinalOpen
| Linear
| LinearClosed
| Monotone
| StepAfter
| StepBefore
| Stepwise

Mark interpolation style.

type Symbol
= SymCircle
| SymSquare
| Cross
| Diamond
| TriangleUp
| TriangleDown

Type of symbol. To create a user defined path for a symbol use symPath.

symbolPath : String -> Symbol

A custom symbol shape as an SVG path description.

type Cursor
= CAuto
| CDefault
| CNone
| CContextMenu
| CHelp
| CPointer
| CProgress
| CWait
| CCell
| CCrosshair
| CText
| CVerticalText
| CAlias
| CCopy
| CMove
| CNoDrop
| CNotAllowed
| CAllScroll
| CColResize
| CRowResize
| CNResize
| CEResize
| CSResize
| CWResize
| CNEResize
| CNWResize
| CSEResize
| CSWResize
| CEWResize
| CNSResize
| CNESWResize
| CNWSEResize
| CZoomIn
| CZoomOut
| CGrab
| CGrabbing

Type of cursor to display. See the CSS cursor documentation

= PMTransparent
| PMNone

Appearance of a point marker that is overlaid on a line or area mark. Also generated by pmMarker.

pmMarker : List MarkProperty -> PointMarker

Properties of a point marker that is overlaid on a line or area mark.

= LMNone

Appearance of a line marker that is overlaid on to an area mark. Also generated by lmLine.

lmMarker : List MarkProperty -> LineMarker

Properties of a line marker that is overlaid on an area mark.

= ExCI
| ExStderr
| ExStdev
| ExIqr
| ExRange

Type of extent summary of a statistical distribution. Additionally generated by iqrScale.

iqrScale : Float -> SummaryExtent

A scaling of the interquartile range to be used as whiskers in a boxplot. For example a value of 1.5 would extend whiskers to ±1.5x the IQR from the mean.

= TTEncoding
| TTData

Indicate whether tooltips are generated by encoding (default) or data.

Creating the Encoding Specification

Types and functions for declaring which data fields (data) are mapped to which channels (position, color etc.).

encoding : List LabelledSpec -> ( VLProperty, Spec )

Create an encoding specification from a list of channel encodings.

= Nominal
| Ordinal
| Quantitative
| Temporal
| GeoFeature

Type of measurement to be associated with some channel.

Position channel

Relates to where something appears in the visualization. See the Vega-Lite position documentation

Position
-> List PositionChannel
-> List LabelledSpec
-> List LabelledSpec

Encode a position channel. The first parameter identifies the channel, the second a list of encoding options.

= X
| Y
| X2
| Y2
| Longitude
| Latitude
| Longitude2
| Latitude2

Type of position channel.

Position Channel Properties

pName : String -> PositionChannel

Name of the field used for encoding with a position channel.

pRepeat : Arrangement -> PositionChannel

Arrangement of views in a repeated composite view.

pMType : Measurement -> PositionChannel

Level of measurement when encoding with a position channel.

pBin : List BinProperty -> PositionChannel

Discretize numeric values into bins when encoding with a position channel.

pBinned : PositionChannel

Indicate that data encoded with position are already binned.

pTimeUnit : TimeUnit -> PositionChannel

Form of time unit aggregation of field values when encoding with a position channel.

pTitle : String -> PositionChannel

Title of a field when encoding with a position channel.

pAggregate : Operation -> PositionChannel

Compute some aggregate summaray statistics for a field to be encoded with a position channel. The type of aggregation is determined by the given operation parameter.

pScale : List ScaleProperty -> PositionChannel

Scaling applied to a field when encoding with a position channel. The scale will transform a field's value into a position along one axis.

pAxis : List AxisProperty -> PositionChannel

Axis properties used when encoding with a position channel. For no axis, provide an empty list.

pSort : List SortProperty -> PositionChannel

Sort order for field when encoding with a position channel.

pStack : StackOffset -> PositionChannel

Type of stacking offset for field when encoding with a position channel.

pWidth : PositionChannel

Set the position to the width of the enclosing data space. Useful for justifying a mark to the right hand edge of a view. e.g. to position a mark at the right of the data rectangle:

enc =
    encoding
        << position X [ pWidth ]
pHeight : PositionChannel

Set the position to the height of the enclosing data space. Useful for placing a mark relative to the bottom edge of a view.

pImpute : List ImputeProperty -> PositionChannel

Imputation rules for a position channel. See the Vega-Lite impute documentation

Properties Used by Position Channels

Sorting Properties

See the Vega-Lite sort documentation.

= Ascending
| Descending

Allow type of sorting to be customised. To sort a field by the aggregated values of another use soByField or soByRepeat. Custom sorting by explicit values can be provided by soCustom.

soByField : String -> Operation -> SortProperty

Sort by the aggregated summary of a given field using a given aggregation operation. e.g., sort the categorical data field variety by the mean age of the data in each variety category:

position Y [ pName "variety"
           , pMType Ordinal
           , pSort [ soByField "age" Mean, Descending ]
           ]
soByRepeat : Arrangement -> Operation -> SortProperty

Sort by the aggregated summaries of the given fields (referenced by a repeat iteration) using a given aggregation operation.

soCustom : DataValues -> SortProperty

Custom sort order listing data values explicitly.

axDomain : Bool -> AxisProperty

Whether or not an axis baseline (domain) should be included as part of an axis.

axFormat : String -> AxisProperty

Format to apply to labels on an axis.

axGrid : Bool -> AxisProperty

Whether or not grid lines should be included as part of an axis.

axLabelAngle : Float -> AxisProperty

Rotation angle in degrees of axis labels.

axLabelOverlap : OverlapStrategy -> AxisProperty

Overlap strategy for labels when they are too large to fit within the space devoted to an axis.

axLabelPadding : Float -> AxisProperty

Padding in pixels between an axis and its text labels.

axLabels : Bool -> AxisProperty

Whether or not axis labels should be displayed.

axMaxExtent : Float -> AxisProperty

Maximum extent in pixels that axis ticks and labels should use.

axMinExtent : Float -> AxisProperty

Minimum extent in pixels that axis ticks and labels should use.

axOffset : Float -> AxisProperty

Offset to displace the axis from the edge of the enclosing group or data rectangle.

axOrient : Side -> AxisProperty

Orientation of an axis relative to the plot it is describing.

axPosition : Float -> AxisProperty

Anchor position of the axis in pixels. For x-axis with top or bottom orientation, this sets the axis group x coordinate. For y-axis with left or right orientation, this sets the axis group y coordinate.

axBandPosition : Float -> AxisProperty

Position of axis tick relative to a band (0 to 1).

axDates : List (List DateTime) -> AxisProperty

Dates/times to appear along an axis.

axDomainColor : String -> AxisProperty

Color of axis domain line.

axDomainOpacity : Float -> AxisProperty

Opacity of axis domain line.

axDomainWidth : Float -> AxisProperty

Width of axis domain line.

axLabelAlign : HAlign -> AxisProperty

Horizontal alignment of axis tick labels.

axLabelBaseline : VAlign -> AxisProperty

Vertical alignment of axis tick labels.

axLabelBound : Maybe Float -> AxisProperty

How or if labels should be hidden if they exceed the axis range. If Nothing, no check for label size is made. A number specifies the permitted overflow in pixels.

axLabelColor : String -> AxisProperty

Color of axis tick label.

axLabelFlush : Maybe Float -> AxisProperty

How or if labels at beginning or end of the axis should be aligned. Specifies the distance threshold from an end-point within which labels are flush-adjusted or if Nothing, no flush-adjustment made.

axLabelFlushOffset : Float -> AxisProperty

Number of pixels by which to offset flush-adjusted labels.

axLabelFont : String -> AxisProperty

Font name of an axis label.

axLabelFontSize : Float -> AxisProperty

Font size of an axis label.

axLabelFontWeight : FontWeight -> AxisProperty

Font weight of an axis label.

axLabelLimit : Float -> AxisProperty

Maximum length in pixels of axis tick labels.

axLabelOpacity : Float -> AxisProperty

Opacity of an axis label.

axTickColor : String -> AxisProperty

Color of axis ticks.

axTickCount : Int -> AxisProperty

Desired number of ticks for axes visualizing quantitative scales. The resulting number may be different so that values are “nice” (multiples of 2, 5, 10).

axTickExtra : Bool -> AxisProperty

Whether or not an extra axis tick should be added for the initial position of an axis.

axTickOffset : Float -> AxisProperty

Offset in pixels of an axis's ticks, labels and gridlines.

axTickOpacity : Float -> AxisProperty

Opacity of axis ticks.

axTickRound : Bool -> AxisProperty

Whether or not axis tick positions should be rounded to nearest integer.

axTicks : Bool -> AxisProperty

Whether or not an axis should include tick marks.

axTickSize : Float -> AxisProperty

Tick mark size in pixels.

axTickStep : Float -> AxisProperty

Desired step size for ticks. Will generate corresponding tick count and values.

axTickWidth : Float -> AxisProperty

Width of axis ticks.

axTitle : String -> AxisProperty

Title to display as part of an axis. An empty string can be used to prevent a title being displayed.

axTitleAlign : HAlign -> AxisProperty

Horizontal alignment of an axis title.

axTitleAngle : Float -> AxisProperty

Angle in degrees of an axis title.

axTitleBaseline : VAlign -> AxisProperty

Vertical alignment of axis title.

axTitleColor : String -> AxisProperty

Color of axis title.

axTitleFont : String -> AxisProperty

Font name for an axis title.

axTitleFontSize : Float -> AxisProperty

Font size for an axis title.

axTitleFontWeight : FontWeight -> AxisProperty

Font weight of an axis title.

axTitleLimit : Float -> AxisProperty

Maximum length in pixels of axis title.

axTitleOpacity : Float -> AxisProperty

Opacity of an axis title.

axTitlePadding : Float -> AxisProperty

Padding in pixels between a title and axis.

axTitleX : Float -> AxisProperty

X position of an axis title relative to the axis group.

axTitleY : Float -> AxisProperty

Y position of an axis title relative to the axis group.

axValues : List Float -> AxisProperty

Numeric values to appear along an axis.

axZIndex : Int -> AxisProperty

Drawing order of the axis relative to the other chart elements. 1 indicates axis is drawn in front of chart marks, 0 indicates it is drawn behind them.

Positioning Constants

= ONone
| OParity
| OGreedy

Type of overlap strategy to be applied when there is not space to show all items on an axis or legend. See the

type Side
= STop
| SBottom
| SLeft
| SRight

One side of a rectangular space.

type HAlign
= AlignCenter
| AlignLeft
| AlignRight

Horizontal alignment of some text such as on an axis or legend.

type VAlign
= AlignTop
| AlignMiddle
| AlignBottom

Vertical alignment of some text that may be attached to a mark.

Mark channels

Relate to the appearance of the visual marks in the visualization such as their color or size.

size : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode a size channel with a list of mark channel properties.

color : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode a color channel. The first parameter is a list of mark channel properties that characterise the way a data field is encoded by color.

fill : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode a fill channel. This acts in a similar way to encoding by color but only affects the interior of closed shapes. If both fill and color encodings are specified, fill takes precedence.

stroke : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode a stroke channel. This acts in a similar way to encoding by color but only affects the exterior boundary of marks.

opacity : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode an opacity channel.

shape : List MarkChannel -> List LabelledSpec -> List LabelledSpec

Encode a shape channel.

Mark Channel Properties

mName : String -> MarkChannel

Field used for encoding with a mark property channel.

mRepeat : Arrangement -> MarkChannel

Reference in a mark channel to a field name generated by repeat. The parameter identifies whether fields are to be laid out in columns or rows.

mMType : Measurement -> MarkChannel

Level of measurement when encoding with a mark property channel.

mScale : List ScaleProperty -> MarkChannel

Scaling applied to a field when encoding with a mark property channel. The scale will transform a field's value into a color, shape, size etc.

mBin : List BinProperty -> MarkChannel

Discretize numeric values into bins when encoding with a mark property channel.

mBinned : MarkChannel

Indicate that data encoding with a mark are already binned.

mImpute : List ImputeProperty -> MarkChannel

Iputation rules for a mark channel. See the Vega-Lite impute documentation

mTimeUnit : TimeUnit -> MarkChannel

Time unit aggregation of field values when encoding with a mark property channel.

mTitle : String -> MarkChannel

Title of a field when encoding with a mark property channel.

mAggregate : Operation -> MarkChannel

Compute some aggregate summaray statistics for a field to be encoded with a mark property channel. The type of aggregation is determined by the given operation parameter.

mLegend : List LegendProperty -> MarkChannel

Properties of a legend that describes a mark's encoding. For no legend, provide an empty list as a parameter.

mPath : String -> MarkChannel

SVG path string used when encoding with a mark property channel. Useful for providing custom shapes.

mNum : Float -> MarkChannel

Literal numeric value when encoding with a mark property channel.

mStr : String -> MarkChannel

Literal string value when encoding with a mark property channel.

mBoo : Bool -> MarkChannel

Boolean value when encoding with a mark property channel.

leClipHeight : Float -> LegendProperty

Limit height of legend entries.

leColumnPadding : Float -> LegendProperty

Horizontal padding between symbol legend entries.

leColumns : Float -> LegendProperty

Number of columns in which to arrange symbol legend entries.

leCornerRadius : Float -> LegendProperty

Legend corner radius.

leDirection : MarkOrientation -> LegendProperty

Direction of a legend.

leFillColor : String -> LegendProperty

Legend background color.

leFormat : String -> LegendProperty

Formatting pattern for legend labels.

leGradientLength : Float -> LegendProperty

Length in pixels of the primary axis of a color ramp legend.

leGradientThickness : Float -> LegendProperty

Thickness in pixels of a color ramp legend.

leGradientStrokeColor : String -> LegendProperty

Color for strokes in a color ramp legend.

leGradientStrokeWidth : Float -> LegendProperty

Width for strokes in a color ramp legend.

leGridAlign : CompositionAlignment -> LegendProperty

Alignment to apply to symbol legends rows and columns.

leLabelAlign : HAlign -> LegendProperty

Horizontal alignment of legend labels.

leLabelBaseline : VAlign -> LegendProperty

Vertical alignment of legend labels.

leLabelColor : String -> LegendProperty

Color for legend labels.

leLabelFont : String -> LegendProperty

Font for legend labels.

leLabelFontSize : Float -> LegendProperty

Font size legend labels.

leLabelLimit : Float -> LegendProperty

Maximum width for legend labels in pixel units.

leLabelOffset : Float -> LegendProperty

Offset for legend labels.

leLabelOverlap : OverlapStrategy -> LegendProperty

Strategy for resolving overlapping legend labels.

leOffset : Float -> LegendProperty

Offset in pixels of a legend from the edge of its enclosing group or data rectangle.

leOrient : LegendOrientation -> LegendProperty

Position of a legend in a scene.

lePadding : Float -> LegendProperty

Padding in pixels between a legend and axis.

leRowPadding : Float -> LegendProperty

Vertical spacing in pixel units between a symbol legend entries.

leStrokeColor : String -> LegendProperty

Legend border color.

leStrokeWidth : Float -> LegendProperty

Legend border stroke width.

leSymbolFillColor : String -> LegendProperty

Legend symbol fill color.

leSymbolSize : Float -> LegendProperty

Legend symbol size.

leSymbolStrokeColor : String -> LegendProperty

Legend symbol outline color.

leSymbolStrokeWidth : Float -> LegendProperty

Legend symbol stroke width.

leSymbolType : Symbol -> LegendProperty

Legend symbol type.

leTickCount : Float -> LegendProperty

Number of tick marks in a quantitative legend.

leTitle : String -> LegendProperty

Title of a legend.

leTitleAlign : HAlign -> LegendProperty

Horizontal alignment for legend titles.

leTitleBaseline : VAlign -> LegendProperty

Vertical alignment for legend titles.

leTitleColor : String -> LegendProperty

Color for legend title.

leTitleFont : String -> LegendProperty

Font for legend titles.

leTitleFontSize : Float -> LegendProperty

Font size for legend titles.

leTitleFontWeight : FontWeight -> LegendProperty

Font weight for legend titles.

leTitleLimit : Float -> LegendProperty

Maximum size in pixel units for legend titles.

leTitlePadding : Float -> LegendProperty

Spacing in pixel units between title and legend.

leType : Legend -> LegendProperty

Type of legend.

leValues : LegendValues -> LegendProperty

An explicit set of legend values.

leZIndex : Int -> LegendProperty

Drawing order of a legend relative to other chart elements. To place a legend in front of others use a positive integer, or 0 to draw behind.

type Legend
= Gradient
| Symbol

Type of legend. Gradient legends are usually used for continuous quantitative data while symbol legends used for categorical data.

= BottomLeft
| BottomRight
| Left
| None
| Right
| TopLeft
| TopRight

Legend position relative to data rectangle.

leNums : List Float -> LegendValues

An explicit set of numeric legend values.

leStrs : List String -> LegendValues

An explicit set of legend strings.

leDts : List (List DateTime) -> LegendValues

An explicit set of legend date-times.

Text Channels

Relate to the appearance of the text and tooltip elements of the visualization. See the Vega-Lite text documentation

text : List TextChannel -> List LabelledSpec -> List LabelledSpec

Encode a text channel.

tooltip : List TextChannel -> List LabelledSpec -> List LabelledSpec

Encode a tooltip channel. To encode multiple tooltip values with a mark, use tooltips.

tooltips : List (List TextChannel) -> List LabelledSpec -> List LabelledSpec

Encode a tooltip channel with multiple tooltips. The first parameter is a list of the multiple tooltips, each of which is a list of text channel properties that define the channel.

tName : String -> TextChannel

Name of the field used for encoding with a text channel.

tRepeat : Arrangement -> TextChannel

Reference in a text channel to a field name generated by repeat. The parameter identifies whether reference is being made to fields that are to be laid out in columns or in rows.

tMType : Measurement -> TextChannel

Level of measurement when encoding with a text channel.

tBin : List BinProperty -> TextChannel

Discretize numeric values into bins when encoding with a text channel.

tBinned : TextChannel

Indicate that data encoded with a text channel are already binned.

tAggregate : Operation -> TextChannel

Compute some aggregate summaray statistics for a field to be encoded with a text channel. The type of aggregation is determined by the given operation parameter.

tTimeUnit : TimeUnit -> TextChannel

Time unit aggregation of field values when encoding with a text channel.

tTitle : String -> TextChannel

Title of a field when encoding with a text or tooltip channel.

tFormat : String -> TextChannel

Formatting pattern for a field when encoding with a text channel.

= Bold
| Bolder
| Lighter
| Normal
| W100
| W200
| W300
| W400
| W500
| W600
| W700
| W800
| W900

Weight options for a font.

Relates to a clickable URL destination of a mark. Unlike most other channels, the hyperlink channel has no direct visual expression other than the option of changing the cursor style when hovering, so an encoding will usually pair hyperlinks with other visual channels such as marks or texts. See the Vega-Lite hyperlink documentation

hName : String -> HyperlinkChannel

Field used for encoding with a hyperlink channel.

hRepeat : Arrangement -> HyperlinkChannel

Reference in a hyperlink channel to a field name generated by repeat. The parameter identifies whether reference is being made to fields being laid out in columns or in rows.

hMType : Measurement -> HyperlinkChannel

Level of measurement when encoding with a hyperlink channel.

hBin : List BinProperty -> HyperlinkChannel

Discretize numeric values into bins when encoding with a hyperlink channel.

hBinned : HyperlinkChannel

Indicate that data encoded with a hyperlink channel are already binned.

hAggregate : Operation -> HyperlinkChannel

Compute some aggregate summaray statistics for a field to be encoded with a hyperlink channel. The type of aggregation is determined by the given operation parameter.

hTimeUnit : TimeUnit -> HyperlinkChannel

Time unit aggregation of field values when encoding with a hyperlink channel.

hStr : String -> HyperlinkChannel

Literal string value when encoding with a hyperlink channel.

Order channels

Channels that relate to the order of data fields such as for sorting stacking order or order of data points in a connected scatterplot. See the Vega-Lite order documentation.

order : List OrderChannel -> List LabelledSpec -> List LabelledSpec

Encode an order channel with a list of order field definitions.

oName : String -> OrderChannel

Name of the field used for encoding with an order channel.

oRepeat : Arrangement -> OrderChannel

Reference in a order channel to a field name generated by repeat. The parameter identifies whether reference is being made to fields that are to be laid out in columns or in rows.

oMType : Measurement -> OrderChannel

Level of measurement when encoding with an order channel.

oBin : List BinProperty -> OrderChannel

Discretize numeric values into bins when encoding with an order channel.

oAggregate : Operation -> OrderChannel

Compute some aggregate summaray statistics for a field to be encoded with an order channel. The type of aggregation is determined by the given operation parameter.

oSort : List SortProperty -> OrderChannel

Sort order to be used by an order channel.

oTimeUnit : TimeUnit -> OrderChannel

Time unit aggregation of field values when encoding with an order channel.

Facet channels

Channels for faceting single plots into small multiples. Can be used to create trellis plots or other arrangements in rows and columns. See the Vega-Lite facet documentation. See also, 'faceted view composition' for a more flexible (but more verbose) way of defining faceted views.

row : List FacetChannel -> List LabelledSpec -> List LabelledSpec

Encode a new facet to be arranged in rows. The first parameter is a list of facet properties that define the faceting channel.

column : List FacetChannel -> List LabelledSpec -> List LabelledSpec

Encodes a new facet to be arranged in columns. The first parameter is a list of properties that define the faceting channel. This should include at least the name of the data field and its measurement type.

Level of detail Channel

Used for grouping data but without changing the visual appearance of a mark. When, for example, a field is encoded by color, all data items with the same value for that field are given the same color. When a detail channel encodes a field, all data items with the same value are placed in the same group. See the Vega-Lite documentation.

detail : List DetailChannel -> List LabelledSpec -> List LabelledSpec

Encode a 'level of detail' channel. This provides a way of grouping by a field but unlike, say color, all groups have the same visual properties. The first parameter is a list of the field characteristics to be grouped.

dName : String -> DetailChannel

Field used for encoding with a level of detail (grouping) channel.

dMType : Measurement -> DetailChannel

Level of measurement when encoding with a level of detail (grouping) channel.

dAggregate : Operation -> DetailChannel

Compute some aggregate summaray statistics for a field to be encoded with a level of detail (grouping) channel. The type of aggregation is determined by the given operation parameter.

dBin : List BinProperty -> DetailChannel

Discretize numeric values into bins when encoding with a level of detail (grouping) channel.

dImpute : List ImputeProperty -> DetailChannel

Set the iputation rules for a detail channel. See the Vega-Lite impute documentation

dTimeUnit : TimeUnit -> DetailChannel

Form of time unit aggregation of field values when encoding with a level of detail (grouping) channel.

Scaling

Used to specify how the encoding of a data field should be applied. See the Vega-Lite scale documentation.

scType : Scale -> ScaleProperty

Type of scaling to apply.

scDomain : ScaleDomain -> ScaleProperty

Custom scaling domain.

scRange : ScaleRange -> ScaleProperty

Range of a scaling. The type of range depends on the encoding channel.

scScheme : String -> List Float -> ScaleProperty

Color scheme used by a color scaling. The first parameter is the name of the scheme (e.g. "viridis") and the second an optional specifiction of the number of colors to use (list of one number), or the extent of the color range to use (list of two numbers between 0 and 1).

scPadding : Float -> ScaleProperty

Padding in pixels to apply to a scaling.

scPaddingInner : Float -> ScaleProperty

Inner padding to apply to a band scaling.

scPaddingOuter : Float -> ScaleProperty

Outer padding to apply to a band scaling.

scRangeStep : Maybe Float -> ScaleProperty

Distance between the starts of adjacent bands in a band scaling. If Nothing is provided the distance is determined automatically.

scRound : Bool -> ScaleProperty

Whether or not numeric values in a scaling are rounded to integers.

scClamp : Bool -> ScaleProperty

Whether or not values outside the data domain are clamped to the minimum or maximum value.

scInterpolate : CInterpolate -> ScaleProperty

Interpolation method for scaling range values.

scNice : ScaleNice -> ScaleProperty

'Nice' minimum and maximum values in a scaling (e.g. multiples of 10).

scZero : Bool -> ScaleProperty

Whether or not a numeric scaling should be forced to include a zero value.

scReverse : Bool -> ScaleProperty

Reverse the order of a scaling.

type Scale
= ScLinear
| ScPow
| ScSqrt
| ScLog
| ScTime
| ScUtc
| ScSequential
| ScOrdinal
| ScBand
| ScPoint
| ScBinLinear
| ScBinOrdinal
| ScQuantile
| ScQuantize
| ScThreshold

Used to indicate the type of scale transformation to apply.

raName : String -> ScaleRange

Name of a pre-defined scale range (e.g. symbol or diverging).

raNums : List Float -> ScaleRange

Numeric scale range. Depending on the scaling this may be a [min, max] pair, or a list of explicit numerical values.

raStrs : List String -> ScaleRange

Text scale range for discrete scales.

categoricalDomainMap : List ( String, String ) -> List ScaleProperty

Create a set of discrete domain to color mappings suitable for customising categorical scales. The first item in each tuple should be a domain value and the second the color value with which it should be associated. It is a convenience function equivalent to specifying separate SDomain and SRange lists and is safer as it guarantees a one-to-one correspondence between domain and range values.

color
    [ mName "weather"
    , mMType Nominal
    , mScale <|
        categoricalDomainMap
            [ ( "sun", "yellow" )
            , ( "rain", "blue" )
            , ( "fog", "grey" )
            ]
    ]
domainRangeMap : ( Float, String ) -> ( Float, String ) -> List ScaleProperty

Create a pair of continuous domain to color mappings suitable for customising ordered scales. The first parameter is a tuple representing the mapping of the lowest numeric value in the domain to its equivalent color; the second tuple the mapping of the highest numeric value to color. If the domain contains any values between these lower and upper bounds they are interpolated according to the scale's interpolation function. Convenience function equivalent to specifying separate SDomain and SRange lists and is safer as it guarantees a one-to-one correspondence between domain and range values.

color
    [ mName "year"
    , mMType Ordinal
    , mScale (domainRangeMap ( 1955, "#e6959c" ) ( 2000, "#911a24" ))
    ]
= Unaggregated

A scale domain (type of data in scale). To specify scale domain values explicitly, use doNums, doStrs, doDts or doSelection.

doNums : List Float -> ScaleDomain

Numeric values that define a scale domain.

doStrs : List String -> ScaleDomain

String values that define a scale domain.

doDts : List (List DateTime) -> ScaleDomain

Date-time values that define a scale domain.

doSelection : String -> ScaleDomain

Scale domain based on a named interactive selection.

= NMillisecond
| NSecond
| NMinute
| NHour
| NDay
| NWeek
| NMonth
| NYear
| NTrue
| NFalse

The style of selecting 'nice' numbers. To specify nice time intervals use scNiceInterval and to set a nice tick count use scNiceTickCount.

scNiceTickCount : Int -> ScaleNice

Desired number of tick marks in a 'nice' scaling.

scNiceInterval : TimeUnit -> Int -> ScaleNice

'Nice' temporal interval values when scaling.

Color Scaling

= Hcl
| HclLong
| Hsl
| HslLong
| Lab

Type of color interpolation to apply when mapping a data field onto a color scale. Note that color interpolation cannot be applied with the default sequential color scale, so additionally, you should set the sType to another continuous scale such as linear, pow etc.

Options that require a gamma value (with 1 being a recommended default to provide) are generated by cubeHelix, cubeHelixLong and rgb.

See the Vega-Lite continouus scale documentation.

cubeHelix : Float -> CInterpolate

Cube helix color interpolation for continuous color scales using the given gamma value (anchored at 1).

cubeHelixLong : Float -> CInterpolate

Long-path cube helix color interpolation for continuous color scales using the given gamma value (anchored at 1).

rgb : Float -> CInterpolate

RGB color interpolation for continuous color scales using the given gamma value (anchored at 1).

Creating view compositions

Views can be combined to create more complex multiview displays. This may involve layering views on top of each other (superposition) or laying them out in adjacent spaces (juxtaposition using repeat, facet, hConcat or vConcat). Where different views have potentially conflicting channels (e.g. two position scales in a layered visualization) the rules for resolving them can be defined with resolve. See the Vega-Lite composition documentation

layer : List Spec -> ( VLProperty, Spec )

Assign a list of specifications to superposed layers in a visualization.

hConcat : List Spec -> ( VLProperty, Spec )

Specifications to be juxtaposed horizontally in a visualization.

vConcat : List Spec -> ( VLProperty, Spec )

Specifications to be juxtaposed vertically in a visualization.

resolve : List LabelledSpec -> ( VLProperty, Spec )

Determine whether scales, axes or legends in composite views should share channel encodings.

resolution : Resolve -> List LabelledSpec -> List LabelledSpec

Define a resolution option to be applied when scales, axes or legends in composite views share channel encodings. This allows different color encodings to be created in a layered view, which would otherwise share color channels between layers. Each resolution rule should be in a tuple pairing the channel to which it applies and the rule type. The first parameter identifies the type of resolution.

resolve
    << resolution (reScale [ ( ChY, Independent ) ])
align : CompositionAlignment -> ( VLProperty, Spec )

Alignment to apply to grid rows and columns generated by a composition operator. This version sets the same alignment for rows and columns.

CompositionAlignment
-> CompositionAlignment
-> ( VLProperty, Spec )

Similar to align but with independent alignments for rows (first parameter) and columns (second parameter).

= CANone
| CAEach
| CAAll

Alignment to apply to grid rows and columns generated by composition (faceting etc.).

bounds : Bounds -> ( VLProperty, Spec )

Bounds calculation method to use for determining the extent of a sub-plot in a composed view. If set to Full the entire calculated bounds including axes, title and legend are used; if Flush only the width and height values for the sub-view will be used.

type Bounds
= Full
| Flush

The bounds calculation method to use for determining the extent of a sub-plot in a composed view.

spacing : Float -> ( VLProperty, Spec )

Spacing between sub-views in a composition operator.

spacingRC : Float -> Float -> ( VLProperty, Spec )

Similar to spacing but with independent spacing for rows (first parameter) and columns (second parameter).

center : Bool -> ( VLProperty, Spec )

Whether or not sub-views specified in a composition operator should be centred relative to their respective rows and columns.

centerRC : Bool -> Bool -> ( VLProperty, Spec )

Similar to center but with independent centring for rows and columns.

reAxis : List ( Channel, Resolution ) -> Resolve

Indicate how a channel's axes should be resolved when defined in more than one view in a composite visualization.

reLegend : List ( Channel, Resolution ) -> Resolve

Indicate how a channel's legends should be resolved when defined in more than one view in a composite visualization.

reScale : List ( Channel, Resolution ) -> Resolve

Indicate how a channel's scales should be resolved when defined in more than one view in a composite visualization.

type Channel
= ChX
| ChY
| ChX2
| ChY2
| ChColor
| ChOpacity
| ChShape
| ChSize

Channel type to be used in a resolution specification.

= Shared
| Independent

Whether or not a scale domain should be independent of others in a composite visualization. See the Vega-Lite resolve documentation.

Faceted views

Small multiples each of which show subsets of the same dataset. The specification determines which field should be used to determine subsets along with their spatial arrangement. See the Vega-Lite facet documentation

repeat : List RepeatFields -> ( VLProperty, Spec )

Define the fields that will be used to compose rows and columns of a set of small multiples. Used when the encoding largely identical, but the data field used in each might vary. When a list of fields is identified with repeat you also need to define a full specification to apply to each of those fields using asSpec.

spec = ...
toVegaLite
    [ repeat [ columnFields [ "Cat", "Dog", "Fish" ] ]
    , specification (asSpec spec)
    ]
rowFields : List String -> RepeatFields

Create a list of fields to use in set of repeated small multiples arranged in rows. The list of fields named here can be referenced in an encoding with pRepeat Row, mRepeat Row etc.

columnFields : List String -> RepeatFields

Create a list of fields to use in set of repeated small multiples arranged in columns. The list of fields named here can be referenced in an encoding with pRepeat Column, mRepeat Column etc.

facet : List FacetMapping -> ( VLProperty, Spec )

Fields to be used to facet a view in rows or columns creating a set of small multiples. Used when the encoding of the visualization in small multiples is identical, but data for each is grouped by the given fields. When creating a faceted view in this way you also need to define a full specification to apply to each of those facets using asSpec.

spec = ...
toVegaLite
    [ facet [ rowBy [ fName "Origin", fMType Nominal ] ]
    , specifcation spec
    ]
columnBy : List FacetChannel -> FacetMapping

The mapping between a column and its field definitions in a set of faceted small multiples.

rowBy : List FacetChannel -> FacetMapping

Tthe mapping between a row and its field definitions in a set of faceted small multiples.

fName : String -> FacetChannel

Field used for encoding with a facet channel.

fMType : Measurement -> FacetChannel

Level of measurement when encoding with a facet channel.

fAggregate : Operation -> FacetChannel

Compute some aggregate summaray statistics for a field to be encoded with a facet channel. The type of aggregation is determined by the given operation parameter.

fBin : List BinProperty -> FacetChannel

Discretize numeric values into bins when encoding with a facet channel.

fHeader : List HeaderProperty -> FacetChannel

Guide that spans a collection of faceted plots, each of which may have their own axes.

fTimeUnit : TimeUnit -> FacetChannel

Form of time unit aggregation of field values when encoding with a facet channel.

asSpec : List ( VLProperty, Spec ) -> Spec

Create a specification sufficient to define an element in a composed visualization such as a superposed layer or juxtaposed facet. Typically a layer will contain a full set of specifications that define a visualization with the exception of the data specification which is usually defined outside of any one layer. For repeated and faceted specs, the entire specification is provided.

specification : Spec -> ( VLProperty, Spec )

Define a specification object for use with faceted and repeated small multiples.

spec = ...
toVegaLite
    [ facet [ rowBy [ fName "Origin", fMType Nominal ] ]
    , specifcation spec
    ]
= Column
| Row

Row or column arrangment in a repeated/faceted view.

hdLabelAngle : Float -> HeaderProperty

Header label rotation angle (in degrees) for a faceted view. A 'label' is the title for each sub-plot in a faceted view.

hdLabelColor : String -> HeaderProperty

Header label text color for a faceted view.

hdLabelFont : String -> HeaderProperty

Header label font for a faceted view.

hdLabelFontSize : Float -> HeaderProperty

Header label font size for a faceted view.

hdLabelLimit : Float -> HeaderProperty

Maximum length of a header label in a faceted view.

hdLabelPadding : Float -> HeaderProperty

Spacing in pixels between facet labels and the main plot area.

hdTitle : String -> HeaderProperty

Header title in a faceted view. A 'title' is the overall title describing the collection of faceted plots.

hdTitleAnchor : APosition -> HeaderProperty

Anchor position of a header title in a faceted view.

hdTitleAngle : Float -> HeaderProperty

Text angle of a header title in a faceted view.

hdTitleBaseline : VAlign -> HeaderProperty

Vertical alignment of a header title in a faceted view.

hdTitleColor : String -> HeaderProperty

Text color of a header title in a faceted view.

hdTitleFont : String -> HeaderProperty

Title font in a faceted view.

hdTitleFontWeight : String -> HeaderProperty

Title font weight in a faceted view.

hdTitleFontSize : Float -> HeaderProperty

Title font size in a faceted view.

hdTitleLimit : Float -> HeaderProperty

Maximum length of a header title in a faceted view.

hdTitlePadding : Float -> HeaderProperty

Spacing in pixels between the main facet title and labels.

hdFormat : String -> HeaderProperty

Header format for a faceted view.

Creating Selections for Interaction

Selections allow a visualization to respond to interactions (such as clicking or dragging). They transform interactions into data queries. See the Vega-Lite selection and bind documentation.

selection : List LabelledSpec -> ( VLProperty, Spec )

Create a full selection specification from a list of selections.

sel =
    selection
        << select "view" Interval [ BindScales ] []
        << select "myBrush" Interval []
        << select "myPaintbrush" Multi [ On "mouseover", Nearest True ]
String
-> Selection
-> List SelectionProperty
-> List LabelledSpec
-> List LabelledSpec

Create a single named selection that may be applied to a data query or transformation. The first two parameters specify the name to be given to the selection for later reference and the type of selection made. The third allows additional selection options to be specified.

= Single
| Multi
| Interval

Type of selection to be generated by the user. Single allows one mark at a time to be selected. 'Multi' allows multiple items to be selected (e.g. with shift-click). 'Interval' allows a bounding rectangle to be dragged by user to select all items intersecting with it.

= Empty
| BindScales

Properties for customising the nature of an interactive selection. Parameterised properties generated by seBind, seEncodings, seFields, seNearest, seOn, seResolve, seSelectionMark, seToggle, seTranslate and seZoom.

seBind : List Binding -> SelectionProperty

Binding to some input elements as part of a named selection.

seEncodings : List Channel -> SelectionProperty

Encoding channels that form a named selection.

seFields : List String -> SelectionProperty

Field names for projecting a selection.

seNearest : Bool -> SelectionProperty

Whether or not a selection should capture nearest marks to a pointer rather than an exact position match.

seOn : String -> SelectionProperty

Vega event stream that triggers a selection.

seResolve : SelectionResolution -> SelectionProperty

Strategy that determines how selections’ data queries are resolved when applied in a filter transform, conditional encoding rule, or scale domain.

seSelectionMark : List SelectionMarkProperty -> SelectionProperty

Appearance of an interval selection mark (dragged rectangle).

seToggle : String -> SelectionProperty

Predicate expression that determines a toggled selection. See the Vega-Lite toggle documentation

seTranslate : String -> SelectionProperty

Translation selection transformation used for panning a view. See the Vega-Lite translate documentation

seZoom : String -> SelectionProperty

Zooming selection transformation used for zooming a view. See the Vega-Lite zoom documentation

iRange : String -> List InputProperty -> Binding

Range slider input element that can bound to a named field value.

iCheckbox : String -> List InputProperty -> Binding

Checkbox input element that can bound to a named field value.

iRadio : String -> List InputProperty -> Binding

Radio box input element that can bound to a named field value.

iSelect : String -> List InputProperty -> Binding

Select input element that can bound to a named field value.

iText : String -> List InputProperty -> Binding

Text input element that can bound to a named field value.

iNumber : String -> List InputProperty -> Binding

Number input element that can bound to a named field value.

iDate : String -> List InputProperty -> Binding

Date input element that can bound to a named field value.

iTime : String -> List InputProperty -> Binding

Time input element that can bound to a named field value.

iMonth : String -> List InputProperty -> Binding

Month input element that can bound to a named field value.

iWeek : String -> List InputProperty -> Binding

Week input element that can bound to a named field value.

iDateTimeLocal : String -> List InputProperty -> Binding

Local time input element that can bound to a named field value.

iTel : String -> List InputProperty -> Binding

Telephone number input element that can bound to a named field value.

iColor : String -> List InputProperty -> Binding

Color input element that can bound to a named field value.

inDebounce : Float -> InputProperty

Delay to introduce when processing input events in order to avoid unnecessary event broadcasting.

inElement : String -> InputProperty

CSS selector indicating the parent element to which an input element should be added. Allows the option of the input element to be outside the visualization container.

inOptions : List String -> InputProperty

Options for a radio or select input element.

inMin : Float -> InputProperty

Minimum slider value for a range input element.

inMax : Float -> InputProperty

Maximum slider value for a range input element.

inName : String -> InputProperty

Custom label for a radio or select input element.

inStep : Float -> InputProperty

Minimum input element range slider increment.

inPlaceholder : String -> InputProperty

Initial placeholding text for input elements such as text fields.

= Global
| Union
| Intersection

How selections in faceted or repeated views are resolved. See the Vege-Lite resolve documentation.

smFill : String -> SelectionMarkProperty

Fill color of an interval selection mark (dragged rectangular area).

smFillOpacity : Float -> SelectionMarkProperty

Fill opacity of an interval selection mark in the range 0 to 1.

smStroke : String -> SelectionMarkProperty

Sroke color of the interval selection mark.

smStrokeDash : List Float -> SelectionMarkProperty

Stroke dash style of the interval selection mark.

smStrokeDashOffset : Float -> SelectionMarkProperty

Stroke dash offset of the interval selection mark.

smStrokeOpacity : Float -> SelectionMarkProperty

Stroke opacity of the interval selection mark in the range 0 to 1.

smStrokeWidth : Float -> SelectionMarkProperty

Stroke width of the interval selection mark.

Making conditional channel encodings

To make channel encoding conditional on the result of some interaction, use mSelectionCondition (and its 't' and 'h' variants). Similarly mDataCondition (and its 't' and 'h' variants) will encode a mark conditionally depending on some data properties such as whether a datum is null or an outlier.

For interaction, once a selection has been defined and named, supplying a set of encodings allow mark encodings to become dependent on that selection. mSelectionCondition is followed firstly a (Boolean) selection and then an encoding if that selection is true and another encoding to be applied if it is false. The color specification below states "whenever data marks are selected with an interval mouse drag, encode the cylinder field with an ordinal color scheme, otherwise make them grey":

sel =
    selection << select "myBrush" Interval []


enc =
    encoding
        << position X [ pName "Horsepower", pMType Quantitative ]
        << position Y [ pName "Miles_per_Gallon", pMType Quantitative ]
        << color
            [ mSelectionCondition (selectionName "myBrush")
                [ mName "Cylinders", mMType Ordinal ]
                [ mStr "grey" ]
            ]

In a similar way, mDataCondition will encocode a mark depending on whether any predicate tests are satisfied. Unlike slections, multiple conditions and associated encodings can be specified. Each test condition is evaluated in order and only on failure of the test does encoding procede to the next test. If no tests are true, the encoding in the final parameter is applied in a similar way to 'case of' expressions:

enc =
    encoding
        << position X [ pName "value", pMType Ordinal ]
        << color
            [ mDataCondition
                [ ( expr "datum.value < 40", [ mStr "blue" ] )
                , ( expr "datum.value < 50", [ mStr "red" ] )
                , ( expr "datum.value < 60", [ mStr "yellow" ] )
                ]
                [ mStr "black" ]
            ]

See the Vega-Lite documentation.

mSelectionCondition : BooleanOp -> List MarkChannel -> List MarkChannel -> MarkChannel

Make a mark channel conditional on interactive selection. The first parameter is a selection condition to evaluate; the second the encoding to apply if that selection is true; the third parameter is the encoding if the selection is false.

color
    [ mSelectionCondition ( selectionName "myBrush")
        [ mName "myField", mMType Ordinal ]
        [ mStr "grey" ]
    ]
List ( BooleanOp, List MarkChannel )
-> List MarkChannel
-> MarkChannel

Make a mark channel conditional on one or more predicate expressions. The first parameter is a list of tuples each pairing a test condition with the encoding if that condition evaluates to true. The second is the encoding if none of the tests are true.

color
    [ mDataCondition [ ( expr "datum.myField === null", [ mStr "grey" ] ) ]
        [ mStr "black" ]
    ]
tSelectionCondition : BooleanOp -> List TextChannel -> List TextChannel -> TextChannel

Make a text channel conditional on interactive selection. The first parameter is a selection condition to evaluate; the second the encoding to apply if that selection is true; the third parameter is the encoding if the selection is false.

List ( BooleanOp, List TextChannel )
-> List TextChannel
-> TextChannel

Make a text channel conditional on one or more predicate expressions. The first parameter is a list of tuples each pairing an expression to evaluate with the encoding if that expression is true. The second is the encoding if none of the expressions are evaluated as true.

BooleanOp
-> List HyperlinkChannel
-> List HyperlinkChannel
-> HyperlinkChannel

Make a hyperlink channel conditional on some predicate expression. The first parameter provides the expression to evaluate, the second the encoding to apply if the expression is true, the third the encoding if the expression is false.

BooleanOp
-> List HyperlinkChannel
-> List HyperlinkChannel
-> HyperlinkChannel

Make a hyperlink channel conditional on interactive selection. The first parameter provides the selection to evaluate, the second the encoding to apply if the hyperlink has been selected, the third the encoding if it is not selected.

and : BooleanOp -> BooleanOp -> BooleanOp

Apply an 'and' Boolean operation as part of a logical composition.

and (expr "datum.IMDB_Rating === null") (expr "datum.Rotten_Tomatoes_Rating === null")
or : BooleanOp -> BooleanOp -> BooleanOp

Apply an 'or' Boolean operation as part of a logical composition.

not : BooleanOp -> BooleanOp

Apply a negation Boolean operation as part of a logical composition. Boolean operations can be nested to any level.

not (and (expr "datum.IMDB_Rating === null") (expr "datum.Rotten_Tomatoes_Rating === null") )
expr : String -> BooleanOp

Expression that should evaluate to either true or false. Can use any valid Vega expression.

selected : String -> BooleanOp

Interactive selection that will be true or false as part of a logical composition. e.g., to filter a dataset so that only items selected interactively and that have a weight of more than 30:

transform
    << filter (fCompose (and (selected "brush") (expr "datum.weight > 30")))
selectionName : String -> BooleanOp

Name a selection that is used as part of a conditional encoding.

color
    [ mSelectionCondition ( selectionName "myBrush" )
        [ mName "myField", mMType Nominal ]
        [ mStr "grey" ]
    ]

Global Configuration

Configuration options that affect the entire visualization. These are in addition to the data and transform options described above. See the Vega-Lite top level spec documentation

name : String -> ( VLProperty, Spec )

Name to be associated with a visualization.

title : String -> ( VLProperty, Spec )

Title to be displayed in the visualization.

description : String -> ( VLProperty, Spec )

Description to be associated with a visualization.

height : Float -> ( VLProperty, Spec )

Override the default height of the visualization. If not specified the height will be calculated based on the content of the visualization.

width : Float -> ( VLProperty, Spec )

Override the default width of the visualization. If not specified the width will be calculated based on the content of the visualization.

padding : Padding -> ( VLProperty, Spec )

Padding around the visualization in pixel units. The way padding is interpreted will depend on the autosize properties.

paSize : Float -> Padding

Indicate uniform padding around a visualization in pixel units.

paEdges : Float -> Float -> Float -> Float -> Padding

Padding around a visualization in pixel units. The four parameters refer to left, top, right, and bottom edges respectively.

autosize : List Autosize -> ( VLProperty, Spec )

Declare the way the view is sized. See the Vega-Lite autosize documentation.

enc = ...
toVegaLite
    [ width 250
    , height 300
    , autosize [ AFit, APadding, AResize ]
    , dataFromUrl "data/population.json" []
    , bar []
    , enc []
    ]
= AContent
| AFit
| ANone
| APad
| APadding
| AResize

The auto-sizing characteristics of a visualization such as amount of padding, whether it should fill the parent container etc.

background : String -> ( VLProperty, Spec )

Background color of the visualization. Should be specified with a CSS string such as #ffe or rgb(200,20,150). If not specified the background will be transparent.

Style Setting

Allows default properties for most marks and guides to be set. See the Vega-Lite configuration documentation.

configure : List LabelledSpec -> ( VLProperty, Spec )

Create a single global configuration from a list of configuration specifications. See the Vega-Lite documentation.

config =
    configure
        << configuration (coAxis [ axcoDomainWidth 1 ])
        << configuration (coView [ vicoStroke Nothing ])
        << configuration (coSelection [ ( Single, [ seOn "dblclick" ] ) ])
configuration : ConfigurationProperty -> List LabelledSpec -> List LabelledSpec

A configuration option to be applied globally across the visualization.

coArea : List MarkProperty -> ConfigurationProperty

Configure the default appearance of area marks.

coAutosize : List Autosize -> ConfigurationProperty

Configure the default sizing of visualizations.

coAxis : List AxisConfig -> ConfigurationProperty

Configure the default appearance of axes.

coAxisX : List AxisConfig -> ConfigurationProperty

Configure the default appearance of x-axes.

coAxisY : List AxisConfig -> ConfigurationProperty

Configure the default appearance of y-axes.

coAxisLeft : List AxisConfig -> ConfigurationProperty

Configure the default appearance of left-side axes.

coAxisRight : List AxisConfig -> ConfigurationProperty

Configure the default appearance of right-side axes.

coAxisTop : List AxisConfig -> ConfigurationProperty

Configure the default appearance of top-side axes.

coAxisBottom : List AxisConfig -> ConfigurationProperty

Configure the default appearance of bottom-side axes.

coAxisBand : List AxisConfig -> ConfigurationProperty

Configure the default appearance of axes with band scaling.

coBackground : String -> ConfigurationProperty

Configure the default background color of visualizations.

coBar : List MarkProperty -> ConfigurationProperty

Configure the default appearance of bar marks.

coCircle : List MarkProperty -> ConfigurationProperty

Configure the default appearance of circle marks.

coCountTitle : String -> ConfigurationProperty

Configure the default title style for count fields.

coFieldTitle : FieldTitleProperty -> ConfigurationProperty

Configure the default title generation style for fields.

coGeoshape : List MarkProperty -> ConfigurationProperty

Configure the default appearance of geoshape marks.

coLegend : List LegendConfig -> ConfigurationProperty

Configure the default appearance of legends.

coLine : List MarkProperty -> ConfigurationProperty

Configure the default appearance of line marks.

coHeader : List HeaderProperty -> ConfigurationProperty

Configure the default appearance of facet headers.

coMark : List MarkProperty -> ConfigurationProperty

Configure the default mark appearance.

coNamedStyle : String -> List MarkProperty -> ConfigurationProperty

Configure the default appearance of a named style.

coNumberFormat : String -> ConfigurationProperty

Configure the default number formatting for axis and text labels.

coPadding : Padding -> ConfigurationProperty

Configure the default padding in pixels from the edge of the of visualization to the data rectangle.

coPoint : List MarkProperty -> ConfigurationProperty

Configure the default appearance of point marks.

coProjection : List ProjectionProperty -> ConfigurationProperty

Configure the default style of map projections.

coRange : List RangeConfig -> ConfigurationProperty

Configure the default range properties used when scaling.

coRect : List MarkProperty -> ConfigurationProperty

Configure the default appearance of rectangle marks.

coRemoveInvalid : Bool -> ConfigurationProperty

Configure the default handling of invalid (null and NaN) values. If true, invalid values are skipped or filtered out when represented as marks.

coRule : List MarkProperty -> ConfigurationProperty

Configure the default appearance of rule marks.

coScale : List ScaleConfig -> ConfigurationProperty

Configure the default scale properties used when scaling.

List ( Selection, List SelectionProperty )
-> ConfigurationProperty

Configure the default appearance of selection marks.

coSquare : List MarkProperty -> ConfigurationProperty

Configure the default appearance of square marks.)

coStack : StackOffset -> ConfigurationProperty

Configure the default stack offset style for stackable marks.

coText : List MarkProperty -> ConfigurationProperty

Configure the default appearance of text marks.

coTick : List MarkProperty -> ConfigurationProperty

Configure the default appearance of tick marks.

coTitle : List TitleConfig -> ConfigurationProperty

Configure the default style of visualization titles.

coTimeFormat : String -> ConfigurationProperty

Configure the default time format for axis and legend labels.

coTrail : List MarkProperty -> List LabelledSpec -> List LabelledSpec

Configure the default style of trail marks.

coView : List ViewConfig -> ConfigurationProperty

Configure the default single view style.

Axis Configuration Options

See the Vega-Lite axis config documentation.

axcoBandPosition : Float -> AxisConfig

Default axis band position.

axcoDomain : Bool -> AxisConfig

Whether or not an axis domain should be displayed by default.

axcoDomainColor : String -> AxisConfig

Default axis domain color.

axcoDomainOpacity : Float -> AxisConfig

Default axis domain opacity.

axcoDomainWidth : Float -> AxisConfig

Default axis domain width style.

axcoMaxExtent : Float -> AxisConfig

Default maximum extent style.

axcoMinExtent : Float -> AxisConfig

Default minimum extent style.

axcoGrid : Bool -> AxisConfig

Whether or not an axis grid is displayed by default.

axcoGridColor : String -> AxisConfig

Default axis grid color style.

axcoGridDash : List Float -> AxisConfig

Default axis line dash style.

axcoGridOpacity : Float -> AxisConfig

Default axis grid line opacity.

axcoGridWidth : Float -> AxisConfig

Default axis grid line width.

axcoLabels : Bool -> AxisConfig

Whether or not an axis has labels by default.

axcoLabelAlign : HAlign -> AxisConfig

Default axis label horizontal alignment.

axcoLabelAngle : Float -> AxisConfig

Default axis label angle.

axcoLabelBaseline : VAlign -> AxisConfig

Default axis label vertical alignment.

axcoLabelBound : Maybe Float -> AxisConfig

Default axis label bounding when label exceeds available space. If Nothing, no check for label size is made. A number specifies the permitted overflow in pixels.

axcoLabelColor : String -> AxisConfig

Default axis label color.

axcoLabelFlush : Maybe Float -> AxisConfig

Default label alignment at beginning or end of the axis. Specifies the distance threshold from an end-point within which labels are flush-adjusted or if Nothing, no flush-adjustment made.

axcoLabelFlushOffset : Float -> AxisConfig

Defailt number of pixels by which to offset flush-adjusted labels.

axcoLabelFontWeight : FontWeight -> AxisConfig

Default axis label font weight.

axcoLabelFont : String -> AxisConfig

Default axis label font.

axcoLabelFontSize : Float -> AxisConfig

Default axis label font size.

axcoLabelLimit : Float -> AxisConfig

Default axis label limit (how much a label can extend beyond the left/bottom or right/top of the axis line).

axcoLabelOpacity : Float -> AxisConfig

Default axis label opacity.

axcoLabelOverlap : OverlapStrategy -> AxisConfig

Default axis label overlap strategy for cases where labels cannot fit within the allotted space.

axcoLabelPadding : Float -> AxisConfig

Default axis label padding (space between labels in pixels).

axcoShortTimeLabels : Bool -> AxisConfig

Whether or not an axis should use short time labels by default.

axcoTicks : Bool -> AxisConfig

Whether or not an axis should show ticks by default.

axcoTickColor : String -> AxisConfig

Default axis tick mark color.

axcoTickExtra : Bool -> AxisConfig

Whether or not by default an extra axis tick should be added for the initial position of axes.

axcoTickOffset : Float -> AxisConfig

Default offset in pixels of axis ticks, labels and gridlines.

axcoTickOpacity : Float -> AxisConfig

Default opacity of axis ticks.

axcoTickRound : Bool -> AxisConfig

Whether or not axis tick labels use rounded values by default.

axcoTickSize : Float -> AxisConfig

Default axis tick mark size.

axcoTickStep : Float -> AxisConfig

Default step size for axis ticks.

axcoTickWidth : Float -> AxisConfig

Default axis tick mark width.

axcoTitleAlign : HAlign -> AxisConfig

Default axis tick label horizontal alignment.

axcoTitleAngle : Float -> AxisConfig

Default axis title angle.

axcoTitleBaseline : VAlign -> AxisConfig

Default axis title vertical alignment.

axcoTitleColor : String -> AxisConfig

Default axis title color.

axcoTitleFont : String -> AxisConfig

Default axis title font.

axcoTitleFontWeight : FontWeight -> AxisConfig

Default axis title font weight.

axcoTitleFontSize : Float -> AxisConfig

Default axis title font size.

axcoTitleLimit : Float -> AxisConfig

Default axis title maximum size.

axcoTitleOpacity : Float -> AxisConfig

Default opacity of axis titles.

axcoTitlePadding : Float -> AxisConfig

Default axis title padding between axis line and text.

axcoTitleX : Float -> AxisConfig

Default axis x-position relative to the axis group.

axcoTitleY : Float -> AxisConfig

Default axis y-position relative to the axis group.

Legend Configuration Options

See the Vega-Lite legend configuration documentation.

lecoClipHeight : Float -> LegendConfig

Default maximum height of legend entries.

lecoColumnPadding : Float -> LegendConfig

Default horizontal padding between symbol legend entries.

lecoColumns : Float -> LegendConfig

Default number of columns in which to arrange symbol legend entries.

lecoCornerRadius : Float -> LegendConfig

Default legend corner radius.

lecoFillColor : String -> LegendConfig

Default background legend color.

lecoOrient : LegendOrientation -> LegendConfig

Default legend position relative to the main plot content.

lecoOffset : Float -> LegendConfig

Default offset in pixel units between the legend and the enclosing group or data rectangle.

lecoStrokeColor : String -> LegendConfig

Default legend border color.

lecoStrokeDash : List Float -> LegendConfig

Default legend border stroke dash style.

lecoStrokeWidth : Float -> LegendConfig

Default legend border stroke width.

lecoPadding : Float -> LegendConfig

Default spacing in pixel units between a legend and axis.

lecoRowPadding : Float -> LegendConfig

Default vertical spacing in pixel units between legend symbol entries.

lecoGradientDirection : MarkOrientation -> LegendConfig

Default direction of a color ramp legend.

lecoGradientLabelBaseline : VAlign -> LegendConfig

Default vertical alignment for labels in a color ramp legend.

lecoGradientLabelLimit : Float -> LegendConfig

Default maximum allowable length for labels in a color ramp legend.

lecoGradientLabelOffset : Float -> LegendConfig

Default vertical offset in pixel units for labels in a color ramp legend.

lecoGradientStrokeColor : String -> LegendConfig

Default color for strokes in a color ramp legend.

lecoGradientStrokeWidth : Float -> LegendConfig

Default width for strokes in a color ramp legend.

lecoGradientHeight : Float -> LegendConfig

Default height of a color ramp legend.

lecoGradientWidth : Float -> LegendConfig

Default width of a color ramp legend.

lecoGridAlign : CompositionAlignment -> LegendConfig

Defailt alignment to apply to symbol legends rows and columns.

lecoLabelAlign : HAlign -> LegendConfig

Default horizontal alignment of legend labels.

lecoLabelBaseline : VAlign -> LegendConfig

Default vertical alignment of legend labels.

lecoLabelColor : String -> LegendConfig

Default color for legend labels.

lecoLabelFont : String -> LegendConfig

Default font for legend labels.

lecoLabelFontSize : Float -> LegendConfig

Default font size legend labels.

lecoLabelLimit : Float -> LegendConfig

Default maximum width for legend labels in pixel units.

lecoLabelOffset : Float -> LegendConfig

Default offset for legend labels.

lecoLabelOverlap : OverlapStrategy -> LegendConfig

Strategy for resolving overlapping legend labels.

lecoShortTimeLabels : Bool -> LegendConfig

Whether or not time labels are abbreviated by default in a legend.

lecoEntryPadding : Float -> LegendConfig

Default spacing between legend items.

lecoSymbolBaseFillColor : String -> LegendConfig

Default legend symbol fill color for when no fill scale color in legend encoding.

lecoSymbolBaseStrokeColor : String -> LegendConfig

Default legend symbol stroke color for when no stroke scale color in legend encoding.

lecoSymbolDirection : MarkOrientation -> LegendConfig

Default direction of a symbol legend.

lecoSymbolFillColor : String -> LegendConfig

Default legend symbol fill color.

lecoSymbolOffset : Float -> LegendConfig

Default horizontal pixel offset for legend symbols.

lecoSymbolSize : Float -> LegendConfig

Default legend symbol size.

lecoSymbolStrokeColor : String -> LegendConfig

Default legend symbol outline color.

lecoSymbolStrokeWidth : Float -> LegendConfig

Default legend symbol stroke width.

lecoSymbolType : Symbol -> LegendConfig

Default legend symbol type.

lecoTitleAlign : HAlign -> LegendConfig

Default horizontal alignment for legend titles.

lecoTitleBaseline : VAlign -> LegendConfig

Default vertical alignment for legend titles.

lecoTitleColor : String -> LegendConfig

Default color legend titles.

lecoTitleFont : String -> LegendConfig

Default font for legend titles.

lecoTitleFontSize : Float -> LegendConfig

Default font size for legend titles.

lecoTitleFontWeight : FontWeight -> LegendConfig

Default font weight for legend titles.

lecoTitleLimit : Float -> LegendConfig

Default maximum size in pixel units for legend titles.

lecoTitlePadding : Float -> LegendConfig

Default spacing in pixel units between title and legend.

Scale Configuration Options

See the Vega-Lite scale configuration documentation

sacoBandPaddingInner : Float -> ScaleConfig

Default inner padding for x and y band-ordinal scales.

sacoBandPaddingOuter : Float -> ScaleConfig

Default outer padding for x and y band-ordinal scales.

sacoClamp : Bool -> ScaleConfig

Whether or not by default values that exceed the data domain are clamped to the min/max range value.

sacoMaxBandSize : Float -> ScaleConfig

Default maximum value for mapping quantitative fields to a bar's size/bandSize.

sacoMinBandSize : Float -> ScaleConfig

Default minimum value for mapping quantitative fields to a bar's size/bandSize.

sacoMaxFontSize : Float -> ScaleConfig

Default maximum value for mapping a quantitative field to a text mark's size.

sacoMinFontSize : Float -> ScaleConfig

Default minimum value for mapping a quantitative field to a text mark's size.

sacoMaxOpacity : Float -> ScaleConfig

Default maximum opacity (in the range [0, 1]) for mapping a field to opacity.

sacoMinOpacity : Float -> ScaleConfig

Default minimum opacity (0 to 1) for mapping a field to opacity.

sacoMaxSize : Float -> ScaleConfig

Default maximum size for point-based scales.

sacoMinSize : Float -> ScaleConfig

Default minimum size for point-based scales (when not forced to start at zero).

sacoMaxStrokeWidth : Float -> ScaleConfig

Default maximum stroke width for rule, line and trail marks.

sacoMinStrokeWidth : Float -> ScaleConfig

Default minimum stroke width for rule, line and trail marks.

sacoPointPadding : Float -> ScaleConfig

Default padding for point-ordinal scales.

sacoRangeStep : Maybe Float -> ScaleConfig

Default range step for band and point scales when the mark is not text.

sacoRound : Bool -> ScaleConfig

Whether or not numeric values are rounded to integers when scaling. Useful for snapping to the pixel grid.

sacoTextXRangeStep : Float -> ScaleConfig

Default range step for x band and point scales of text marks.

sacoUseUnaggregatedDomain : Bool -> ScaleConfig

Whether or not to use the source data range before aggregation.

Scale Range Configuration Options

See the Vega-Lite scheme configuration documentation.

racoCategory : String -> RangeConfig

Default color scheme for categorical ranges.

racoDiverging : String -> RangeConfig

Default diverging color scheme.

racoHeatmap : String -> RangeConfig

Default 'heatmap' color scheme.

racoOrdinal : String -> RangeConfig

Default ordinal color scheme.

racoRamp : String -> RangeConfig

Default ramp (contnuous) color scheme.

racoSymbol : String -> RangeConfig

Default color scheme symbols.

Title Configuration Options

See the Vega-Lite title configuration documentation

ticoAnchor : APosition -> TitleConfig

Default anchor position when placing titles.

ticoAngle : Float -> TitleConfig

Default angle when orientating titles.

ticoBaseline : VAlign -> TitleConfig

Default vertical alignment when placing titles.

ticoColor : String -> TitleConfig

Default color when showing titles.

ticoFont : String -> TitleConfig

Default font when showing titles.

ticoFontSize : Float -> TitleConfig

Default font size when showing titles.

ticoFontWeight : FontWeight -> TitleConfig

Default font weight when showing titles.

ticoLimit : Float -> TitleConfig

Default maximim length in pixel units when showing titles.

ticoOffset : Float -> TitleConfig

Default offset in pixel units of titles relative to the chart body.

ticoOrient : Side -> TitleConfig

Default placement of titles relative to the chart body.

View Configuration Options

See the Vega-Lite view configuration documentation

vicoWidth : Float -> ViewConfig

Default width of single views (e.g. each view in a trellis plot).

vicoHeight : Float -> ViewConfig

Default height of single views (e.g. each view in a trellis plot).

vicoClip : Bool -> ViewConfig

Whether or not by default single views should be clipped.

vicoFill : Maybe String -> ViewConfig

Default fill color for single views.

vicoFillOpacity : Float -> ViewConfig

Default fill opacity for single views.

vicoStroke : Maybe String -> ViewConfig

Default stroke color for single views. If Nothing is provided, no strokes are drawn around the view.

vicoStrokeOpacity : Float -> ViewConfig

Default stroke opacity for single views.

vicoStrokeWidth : Float -> ViewConfig

Default stroke width of single views.

vicoStrokeDash : List Float -> ViewConfig

Default stroke dash style for single views.

vicoStrokeDashOffset : Float -> ViewConfig

Default stroke dash offset for single views.

= AStart
| AMiddle
| AEnd

Anchor position for some text.

= Verbal
| Function
| Plain

Style in which field names are displayed. The Verbal style is 'Sum of field', 'Year of date' etc. The Function style is 'SUM(field)', 'YEAR(date)' etc. The Plain style is just the field name without any additional text.

General Data functions

In addition to more general data types like integers and string, the following types can carry data used in specifications.

boo : Bool -> DataValue

A boolean data value.

true : DataValue

A true value used for functions that can accept a Boolean literal or a reference to something that generates a Boolean value. Convenience function equivalent to boo True

false : DataValue

A false value used for functions that can accept a Boolean literal or a reference to something that generates a Boolean value. Convenience function equivalent to boo False

dt : List DateTime -> DataValue

Date-time data value.

num : Float -> DataValue

A numeric data value.

str : String -> DataValue

A string data value.

boos : List Bool -> DataValues

A list of boolean data values.

dts : List (List DateTime) -> DataValues

List of date-time data values.

nums : List Float -> DataValues

List of numeric data values.

strs : List String -> DataValues

A list of string data values.

dtYear : Int -> DateTime

A year.

dtQuarter : Int -> DateTime

Year quarter (1 to 4).

dtMonth : MonthName -> DateTime

Month of a year (1 to 12).

dtDate : Int -> DateTime

Day of the month (1 to 31).

dtDay : DayName -> DateTime

Day of the week.

dtHour : Int -> DateTime

Hour of the day (0=midnight, 1=1am, 23=11pm etc.).

dtMinute : Int -> DateTime

Minute of an hour (0-59).

dtSecond : Int -> DateTime

Second of a minute (0-59).

dtMillisecond : Int -> DateTime

Millisecond of a second (0-999).

= Jan
| Feb
| Mar
| Apr
| May
| Jun
| Jul
| Aug
| Sep
| Oct
| Nov
| Dec

Idntifies a month of the year.

type DayName
= Mon
| Tue
| Wed
| Thu
| Fri
| Sat
| Sun

Day of the week.

= Year
| YearQuarter
| YearQuarterMonth
| YearMonth
| YearMonthDate
| YearMonthDateHours
| YearMonthDateHoursMinutes
| YearMonthDateHoursMinutesSeconds
| Quarter
| QuarterMonth
| Month
| MonthDate
| Date
| Day
| Hours
| HoursMinutes
| HoursMinutesSeconds
| Minutes
| MinutesSeconds
| Seconds
| SecondsMilliseconds
| Milliseconds

A unit of time. See the Vega-Lite documentation.

To encode a time as UTC (coordinated universal time, independent of local time zones or daylight saving), provide a time unit to the utc function. For example,

encoding
    << position X [ pName "date", pMType Temporal, pTimeUnit (utc YearMonthDateHours) ]
utc : TimeUnit -> TimeUnit

UTC version of a given a time (coordinated universal time, independent of local time zones or daylight saving).


Type Reference

Types that are not specified directly, provided here for reference with links to the functions that generate them.

Generated by expr, selected, selectionName, and, or and not.

Generated by functions prefixed with ax, for example axBandPosition.

Generated by functions prefixed with axco.

Generated by functions prefixed with leco.

Generated by functions prefied with le. For example leCornerRadius.

Generated by leNums, leStrs and leDts.

Generated by functions prefixed by saco

Generated by stOffset and stSort.

Generated by functions prefixed with raco.

Generated by functions prefixed by tico.

Generated by functions prefixed with vico.

Generated by boo, true, false, dt, num and str.

Generated by boos, dts, nums and strs.

Generated by columnBy and rowBy.

Generated by rowFields and columnFields.

Generated by numRange and dtRange.

type Resolve

Generated by reAxis, reLegend and reScale.

type Padding

Generated by paSize and paEdges.

Generated by raNums, raStrs and raName.

type Window

Generated by wiAggregateOp, wiOp, wiParam and wiField.