Class View
java.lang.Object
smile.plot.vega.VegaLite
smile.plot.vega.View
- Direct Known Subclasses:
Layer
Single view specification, which describes a view that uses a single
mark type to visualize the data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautosize()Sets the overall size of the visualization.Sets the overall size of the visualization.Returns the view background's fill and stroke object.background(String color) Sets the background of the entire view with CSS color property.description(String description) Sets the description of this mark for commenting purpose.Returns the field object for encoding a channel.encodeDatum(String channel, double datum) Sets a constant data value encoded via a scale.encodeDatum(String channel, int datum) Sets a constant data value encoded via a scale.encodeDatum(String channel, String datum) Sets a constant data value encoded via a scale.encodeValue(String channel, double value) Sets an encoded constant visual value.encodeValue(String channel, int value) Sets an encoded constant visual value.encodeValue(String channel, String value) Sets an encoded constant visual value.height(int height) Sets the height of a plot with a continuous y-field, or the fixed height of a plot a discrete y-field or no y-field.To enable responsive sizing on height.heightStep(int step) For a discrete y-field, sets the height per discrete step.Returns the mark definition object.Sets the name of the visualization for later reference.padding(int size) Specifies padding for all sides.padding(int left, int top, int right, int bottom) Specifies padding for each side.projection(String type) Returns the defining properties of geographic projection, which will be applied to shape path for "geoshape" marks and to latitude and "longitude" channels for other marks.Sets a descriptive title to a chart.usermeta(com.fasterxml.jackson.databind.JsonNode metadata) Optional metadata that will be passed to Vega.Optional metadata that will be passed to Vega.width(int width) Sets the width of a plot with a continuous x-field, or the fixed width of a plot a discrete x-field or no x-field.To enable responsive sizing on width.widthStep(int step) For a discrete x-field, sets the width per discrete step.
-
Constructor Details
-
View
public View()Constructor. -
View
-
-
Method Details
-
width
Sets the width of a plot with a continuous x-field, or the fixed width of a plot a discrete x-field or no x-field.- Parameters:
width- the width of plot.- Returns:
- this object.
-
height
Sets the height of a plot with a continuous y-field, or the fixed height of a plot a discrete y-field or no y-field.- Parameters:
height- the height of plot.- Returns:
- this object.
-
width
-
height
-
widthStep
For a discrete x-field, sets the width per discrete step.- Parameters:
step- the width per discrete step.- Returns:
- this object.
-
heightStep
For a discrete y-field, sets the height per discrete step.- Parameters:
step- the height per discrete step.- Returns:
- this object.
-
mark
Returns the mark definition object.- Parameters:
type- The mark type. This could a primitive mark type (one of "bar", "circle", "square", "tick", "line", "area", "point", "geoshape", "rule", and "text") or a composite mark type ("boxplot", "errorband", "errorbar").- Returns:
- the mark definition object.
-
background
Returns the view background's fill and stroke object.- Returns:
- the view background.
-
projection
Returns the defining properties of geographic projection, which will be applied to shape path for "geoshape" marks and to latitude and "longitude" channels for other marks.- Parameters:
type- The cartographic projection to use.- Returns:
- the geographic projection.
- See Also:
-
encode
Returns the field object for encoding a channel.- Parameters:
channel- Vega-Lite supports the following groups of encoding channels: - Position Channels: x, y, x2, y2, xError, yError, xError2, yError2 - Position Offset Channels: xOffset, yOffset - Polar Position Channels: theta, theta2, radius, radius2 - Geographic Position Channels: longitude, latitude, longitude2, latitude2 - Mark Property Channels: angle, color (and fill / stroke), opacity, fillOpacity, strokeOpacity, shape, size, strokeDash, strokeWidth - Text and Tooltip Channels: text, tooltip - Hyperlink Channel: href - Description Channel: description - Level of Detail Channel: detail - Key Channel: key - Order Channel: order - Facet Channels: facet, row, columnfield- A string defining the name of the field from which to pull a data value. Dots (.) and brackets ([ and ]) can be used to access nested objects (e.g., "field": "foo.bar" and "field": "foo['bar']"). If field names contain dots or brackets but are not nested, you can use \\ to escape dots and brackets (e.g., "a\\.b" and "a\\[0\\]").- Returns:
- the field object for encoding the channel.
-
encodeValue
-
encodeValue
-
encodeValue
-
encodeDatum
-
encodeDatum
-
encodeDatum
-
usermeta
Description copied from class:VegaLiteOptional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. -
usermeta
Description copied from class:VegaLiteOptional metadata that will be passed to Vega. This object is completely ignored by Vega and Vega-Lite and can be used for custom metadata. -
background
Description copied from class:VegaLiteSets the background of the entire view with CSS color property.- Overrides:
backgroundin classVegaLite- Parameters:
color- the background color.- Returns:
- this object.
-
padding
Description copied from class:VegaLiteSpecifies padding for all sides. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle. -
padding
Description copied from class:VegaLiteSpecifies padding for each side. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle. -
autosize
Description copied from class:VegaLiteSets the overall size of the visualization. The total size of a Vega-Lite visualization may be determined by multiple factors: specified width, height, and padding values, as well as content such as axes, legends, and titles. -
autosize
Description copied from class:VegaLiteSets the overall size of the visualization. The total size of a Vega-Lite visualization may be determined by multiple factors: specified width, height, and padding values, as well as content such as axes, legends, and titles.- Overrides:
autosizein classVegaLite- Parameters:
type- The sizing format type. One of "pad", "fit", "fit-x", "fit-y", or "none". See Vega-Lite documentation for descriptions of each.resize- A boolean flag indicating if autosize layout should be re-calculated on every view update.contains- Determines how size calculation should be performed, one of "content" or "padding". The default setting ("content") interprets the width and height settings as the data rectangle (plotting) dimensions, to which padding is then added. In contrast, the "padding" setting includes the padding within the view size calculations, such that the width and height settings indicate the total intended size of the view.- Returns:
- this object.
- See Also:
-
name
-
description
Description copied from class:VegaLiteSets the description of this mark for commenting purpose.- Overrides:
descriptionin classVegaLite- Parameters:
description- description of this mark.- Returns:
- this object.
-
title
-