View

smile.plot.vega.View
See theView companion trait
object View

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
View.type

Members list

Value members

Concrete methods

def field(field: JsValue, `type`: String, bin: JsValue, timeUnit: String, aggregate: String, title: String): JsObject

Returns a field definition. To encode a particular field in the data set with an encoding channel, the channel's field definition must describe the field name and its data type.

Returns a field definition. To encode a particular field in the data set with an encoding channel, the channel's field definition must describe the field name and its data type.

Value parameters

`type`

The encoded field's type of measurement ("quantitative", "temporal", "ordinal", or "nominal"). It can also be a "geojson" type for encoding ‘geoshape'. Data type describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data. Data values for a temporal field can be either a date-time string (e.g., "2015-03-07 12:32:17", "17:01", "2015-03-16", "2015") or a timestamp number (e.g., 1552199579097). Secondary channels (e.g., x2, y2, xError, yError) do not have type as they have exactly the same type as their primary channels (e.g., x, y)

aggregate

Aggregation function for the field (e.g., "mean", "sum", "median", "min", "max", "count").

bin

A flag for binning a quantitative field. - If true, default binning parameters will be applied. - If "binned", this indicates that the data for the x (or y) channel are already binned.

field

A string defining the name of the field from which to pull a data value or an object defining iterated values from the repeat operator. field is not required if aggregate is count.

timeUnit

Time unit (e.g., year, yearmonth, month, hours) for a temporal field, or a temporal field that gets casted as ordinal.

title

A title for the field. If null, the title will be removed. The default value is derived from the field's name and transformation function (aggregate, bin and timeUnit).

Attributes

def markPropField(field: JsValue, `type`: String, bin: JsValue, timeUnit: String, aggregate: String, scale: JsValue, legend: JsValue, condition: JsValue): JsObject

Returns a mark property field Definition. x and y position channels determine the position of the marks, or width/height of horizontal/vertical "area" and "bar". In addition, x2 and y2 can specify the span of ranged area, bar, rect, and rule.

Returns a mark property field Definition. x and y position channels determine the position of the marks, or width/height of horizontal/vertical "area" and "bar". In addition, x2 and y2 can specify the span of ranged area, bar, rect, and rule.

Value parameters

`type`

The encoded field's type of measurement ("quantitative", "temporal", "ordinal", or "nominal"). It can also be a "geojson" type for encoding ‘geoshape'. Data type describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data. Data values for a temporal field can be either a date-time string (e.g., "2015-03-07 12:32:17", "17:01", "2015-03-16", "2015") or a timestamp number (e.g., 1552199579097).

aggregate

Aggregation function for the field (e.g., "mean", "sum", "median", "min", "max", "count").

bin

A flag for binning a quantitative field. - If true, default binning parameters will be applied. - If "binned", this indicates that the data for the x (or y) channel are already binned.

condition

One or more value definition(s) with a selection or a test predicate. Note: A field definition's condition property can only contain conditional value definitions since Vega-Lite only allows at most one encoded field per encoding channel.

field

A string defining the name of the field from which to pull a data value or an object defining iterated values from the repeat operator. field is not required if aggregate is count

legend

An object defining properties of the legend. If null, the legend for the encoding channel will be removed.

scale

An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. If undefined, default scale properties are applied.

timeUnit

Time unit (e.g., year, yearmonth, month, hours) for a temporal field, or a temporal field that gets casted as ordinal.

Attributes

def polarField(field: JsValue, `type`: String, bin: JsValue, timeUnit: String, aggregate: String, title: String, scale: JsValue, sort: String, stack: JsValue): JsObject

Returns a polar field definition. theta and radius position channels determine the position or interval on polar coordindates for arc and text marks.

Returns a polar field definition. theta and radius position channels determine the position or interval on polar coordindates for arc and text marks.

Value parameters

`type`

The encoded field's type of measurement ("quantitative", "temporal", "ordinal", or "nominal"). It can also be a "geojson" type for encoding ‘geoshape'. Data type describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data. Data values for a temporal field can be either a date-time string (e.g., "2015-03-07 12:32:17", "17:01", "2015-03-16", "2015") or a timestamp number (e.g., 1552199579097).

aggregate

Aggregation function for the field (e.g., "mean", "sum", "median", "min", "max", "count").

bin

A flag for binning a quantitative field. - If true, default binning parameters will be applied. - If "binned", this indicates that the data for the x (or y) channel are already binned.

field

A string defining the name of the field from which to pull a data value or an object defining iterated values from the repeat operator. field is not required if aggregate is count

scale

An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. If undefined, default scale properties are applied.

sort

Sort order for the encoded field. For continuous fields (quantitative or temporal), sort can be either "ascending" or "descending". For discrete fields, sort can be one of the following: - "ascending" or "descending" – for sorting by the values' natural order in JavaScript. - A string indicating an encoding channel name to sort by (e.g., "x" or "y") with an optional minus prefix for descending sort (e.g., "-x" to sort by x-field, descending). This channel string is short-form of a sort-by-encoding definition. For example, "sort": "-x" is equivalent to "sort": {"encoding": "x", "order": "descending"}.

stack

Type of stacking offset if the field should be stacked. stack is only applicable for x, y, theta, and radius channels with continuous domains. For example, stack of y can be used to customize stacking for a vertical bar chart. stack can be one of the following values: - "zero" or true: stacking with baseline offset at zero value of the scale (for creating typical stacked bar and area chart). - "normalize": stacking with normalized domain (for creating normalized stacked bar and area charts. - "center": stacking with center baseline (for streamgraph). - null or false: No-stacking. This will produce layered bar and area chart.

timeUnit

Time unit (e.g., year, yearmonth, month, hours) for a temporal field, or a temporal field that gets casted as ordinal.

title

A title for the field. If null, the title will be removed. The default value is derived from the field's name and transformation function (aggregate, bin and timeUnit).

Attributes

def positionField(field: JsValue, `type`: String, bin: JsValue, timeUnit: String, aggregate: String, title: String, scale: JsValue, axis: JsValue, sort: JsValue, band: Double, impute: JsValue, stack: JsValue): JsObject

Returns a position field definition. x and y position channels determine the position of the marks, or width/height of horizontal/vertical "area" and "bar". In addition, x2 and y2 can specify the span of ranged area, bar, rect, and rule.

Returns a position field definition. x and y position channels determine the position of the marks, or width/height of horizontal/vertical "area" and "bar". In addition, x2 and y2 can specify the span of ranged area, bar, rect, and rule.

Value parameters

`type`

The encoded field's type of measurement ("quantitative", "temporal", "ordinal", or "nominal"). It can also be a "geojson" type for encoding ‘geoshape'. Data type describes the semantics of the data rather than the primitive data types (number, string, etc.). The same primitive data type can have different types of measurement. For example, numeric data can represent quantitative, ordinal, or nominal data. Data values for a temporal field can be either a date-time string (e.g., "2015-03-07 12:32:17", "17:01", "2015-03-16", "2015") or a timestamp number (e.g., 1552199579097).

aggregate

Aggregation function for the field (e.g., "mean", "sum", "median", "min", "max", "count").

axis

An object defining properties of axis's gridlines, ticks and labels. If null, the axis for the encoding channel will be removed. If undefined, default axis properties are applied.

band

For rect-based marks (rect, bar, and image), mark size relative to bandwidth of band scales or time units. If set to 1, the mark size is set to the bandwidth or the time unit interval. If set to 0.5, the mark size is half of the bandwidth or the time unit interval. For other marks, relative position on a band of a stacked, binned, time unit or band scale. If set to 0, the marks will be positioned at the beginning of the band. If set to 0.5, the marks will be positioned in the middle of the band.

bin

A flag for binning a quantitative field. - If true, default binning parameters will be applied. - If "binned", this indicates that the data for the x (or y) channel are already binned.

field

A string defining the name of the field from which to pull a data value or an object defining iterated values from the repeat operator. field is not required if aggregate is count

impute

An object defining the properties of the Impute Operation to be applied. The field value of the other positional channel is taken as key of the Impute Operation. The field of the color channel if specified is used as groupby of the Impute Operation.

scale

An object defining properties of the channel's scale, which is the function that transforms values in the data domain (numbers, dates, strings, etc) to visual values (pixels, colors, sizes) of the encoding channels. If null, the scale will be disabled and the data value will be directly encoded. If undefined, default scale properties are applied.

sort

Sort order for the encoded field. For continuous fields (quantitative or temporal), sort can be either "ascending" or "descending". For discrete fields, sort can be one of the following: - "ascending" or "descending" - for sorting by the values' natural order in JavaScript. - A string indicating an encoding channel name to sort by (e.g., "x" or "y") with an optional minus prefix for descending sort (e.g., "-x" to sort by x-field, descending). This channel string is short-form of a sort-by-encoding definition. For example, "sort": "-x" is equivalent to "sort": {"encoding": "x", "order": "descending"}.

stack

Type of stacking offset if the field should be stacked. stack is only applicable for x, y, theta, and radius channels with continuous domains. For example, stack of y can be used to customize stacking for a vertical bar chart. stack can be one of the following values: - "zero" or true: stacking with baseline offset at zero value of the scale (for creating typical stacked bar and area chart). - "normalize": stacking with normalized domain (for creating normalized stacked bar and area charts. - "center": stacking with center baseline (for streamgraph). - null or false: No-stacking. This will produce layered bar and area chart.

timeUnit

Time unit (e.g., year, yearmonth, month, hours) for a temporal field, or a temporal field that gets casted as ordinal.

title

A title for the field. If null, the title will be removed. The default value is derived from the field's name and transformation function (aggregate, bin and timeUnit).

Attributes