Package smile.plot.vega
Class Layer
java.lang.Object
smile.plot.vega.VegaLite
smile.plot.vega.View
smile.plot.vega.Layer
- All Implemented Interfaces:
ViewComposition
To superimpose one chart on top of another.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionencodeDatum
(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.resolveAxis
(String channel, String resolution) Sets an axis resolution.resolveLegend
(String channel, String resolution) Sets a legend resolution.resolveScale
(String channel, String resolution) Sets a scale resolution.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.Methods inherited from class smile.plot.vega.View
autosize, autosize, background, background, description, encode, mark, name, padding, padding, projection, title, usermeta, usermeta
Methods inherited from class smile.plot.vega.VegaLite
config, data, html, html, iframe, iframe, show, show, spec, toPrettyString, toString, transform, viewConfig
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface smile.plot.vega.ViewComposition
spec
-
Constructor Details
-
Layer
Constructor. Note: Specifications inside layer cannot use row and column channels as layering facet specifications is not allowed. Instead, use the facet operator and place a layer inside a facet.- Parameters:
views
- Layer or single view specifications to be superimposed.
-
-
Method Details
-
width
Description copied from class:View
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. -
height
Description copied from class:View
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. -
width
Description copied from class:View
To enable responsive sizing on width. -
height
Description copied from class:View
To enable responsive sizing on height. -
widthStep
Description copied from class:View
For a discrete x-field, sets the width per discrete step. -
heightStep
Description copied from class:View
For a discrete y-field, sets the height per discrete step.- Overrides:
heightStep
in classView
-
encodeValue
Description copied from class:View
Sets an encoded constant visual value.- Overrides:
encodeValue
in classView
- Parameters:
channel
- the encoding channel.value
- the constant visual value.- Returns:
- this object.
-
encodeValue
Description copied from class:View
Sets an encoded constant visual value.- Overrides:
encodeValue
in classView
- Parameters:
channel
- the encoding channel.value
- the constant visual value.- Returns:
- this object.
-
encodeValue
Description copied from class:View
Sets an encoded constant visual value.- Overrides:
encodeValue
in classView
- Parameters:
channel
- the encoding channel.value
- the constant visual value.- Returns:
- this object.
-
encodeDatum
Description copied from class:View
Sets a constant data value encoded via a scale.- Overrides:
encodeDatum
in classView
- Parameters:
channel
- the encoding channel.datum
- the constant data value.- Returns:
- this object.
-
encodeDatum
Description copied from class:View
Sets a constant data value encoded via a scale.- Overrides:
encodeDatum
in classView
- Parameters:
channel
- the encoding channel.datum
- the constant data value.- Returns:
- this object.
-
encodeDatum
Description copied from class:View
Sets a constant data value encoded via a scale.- Overrides:
encodeDatum
in classView
- Parameters:
channel
- the encoding channel.datum
- the constant data value.- Returns:
- this object.
-
resolveScale
Description copied from interface:ViewComposition
Sets a scale resolution. For scales, resolution can be specified for every channel.- Specified by:
resolveScale
in interfaceViewComposition
- Parameters:
channel
- positional or non-positional channel.resolution
- "shared" or "independent".- Returns:
- this object.
-
resolveAxis
Description copied from interface:ViewComposition
Sets an axis resolution.- Specified by:
resolveAxis
in interfaceViewComposition
- Parameters:
channel
- positional channel: "x" or "y".resolution
- "shared" or "independent".- Returns:
- this object.
-
resolveLegend
Description copied from interface:ViewComposition
Sets a legend resolution.- Specified by:
resolveLegend
in interfaceViewComposition
- Parameters:
channel
- non-positional channel: "color", "opacity", "shape", or "size".resolution
- "shared" or "independent".- Returns:
- this object.
-