Class Facet
- All Implemented Interfaces:
ViewComposition
,ViewLayoutComposition
The facet channels (facet, row, and column) are encoding channels that serves as macros for a facet specification. Vega-Lite automatically translates this shortcut to use the facet operator.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSets the alignment to apply to grid rows and columns.Sets different alignments for rows and columns.autosize()
Sets the overall size of the visualization.Sets the overall size of the visualization.background
(String color) Sets the background of the entire view with CSS color property.Sets the bounds calculation method to use for determining the extent of a sub-plot.center
(boolean flag) Sets if subviews should be centered relative to their respective rows or columns.center
(int row, int column) Sets if subviews should be centered relative to their respective rows or columns.Returns the field definition for the vertical facet of trellis plots.columns
(int columns) Sets the number of columns to include in the view composition layout.description
(String description) Sets the description of this mark for commenting purpose.Returns the field definition for faceting the plot by one field.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.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.Returns the field definition for the horizontal facet of trellis plots.spacing
(int size) Sets the spacing in pixels between sub-views of the composition operator.spacing
(int row, int column) Sets different spacing values for rows and columns.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.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
-
Facet
Constructor.
-
-
Method Details
-
columns
Sets the number of columns to include in the view composition layout.- Parameters:
columns
- The number of columns to include in the view composition layout.- Returns:
- this object.
-
facet
Returns the field definition for faceting the plot by one field.- Parameters:
field
- 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 facet field object.
-
row
Returns the field definition for the horizontal facet of trellis plots.- Parameters:
field
- 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 facet field object.
-
column
Returns the field definition for the vertical facet of trellis plots.- Parameters:
field
- 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 facet field object.
-
usermeta
Description copied from class:VegaLite
Optional 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:VegaLite
Optional 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:VegaLite
Sets the background of the entire view with CSS color property.- Overrides:
background
in classVegaLite
-
padding
Description copied from class:VegaLite
Specifies 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:VegaLite
Specifies 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:VegaLite
Sets 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:VegaLite
Sets 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:
autosize
in 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.
-
name
Description copied from class:VegaLite
Sets the name of the visualization for later reference. -
description
Description copied from class:VegaLite
Sets the description of this mark for commenting purpose.- Overrides:
description
in classVegaLite
-
title
Description copied from class:VegaLite
Sets a descriptive title to a chart. -
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.
-
align
Description copied from interface:ViewLayoutComposition
Sets the alignment to apply to grid rows and columns. The supported string values are "all" (the default), "each", and "none".For "none", a flow layout will be used, in which adjacent subviews are simply placed one after the other.
For "each", subviews will be aligned into a clean grid structure, but each row or column may be of variable size.
For "all", subviews will be aligned and each row or column will be sized identically based on the maximum observed size. String values for this property will be applied to both grid rows and columns.
- Specified by:
align
in interfaceViewLayoutComposition
- Parameters:
strategy
- "all", "each", or "none".- Returns:
- this object.
-
align
Description copied from interface:ViewLayoutComposition
Sets different alignments for rows and columns.- Specified by:
align
in interfaceViewLayoutComposition
- Parameters:
row
- alignment for rows.column
- alignment for columns.- Returns:
- this object.
-
bounds
Description copied from interface:ViewLayoutComposition
Sets the bounds calculation method to use for determining the extent of a sub-plot. One of "full" (the default) or "flush".If set to "full", the entire calculated bounds (including axes, title, and legend) will be used.
If set to "flush", only the specified width and height values for the sub-view will be used. The flush setting can be useful when attempting to place sub-plots without axes or legends into a uniform grid structure.
- Specified by:
bounds
in interfaceViewLayoutComposition
- Parameters:
bounds
- "full" or "flush".- Returns:
- this object.
-
center
Description copied from interface:ViewLayoutComposition
Sets if subviews should be centered relative to their respective rows or columns.- Specified by:
center
in interfaceViewLayoutComposition
- Parameters:
flag
- a flag indicating if subviews should be centered relative to their respective rows or columns.- Returns:
- this object.
-
center
Description copied from interface:ViewLayoutComposition
Sets if subviews should be centered relative to their respective rows or columns.- Specified by:
center
in interfaceViewLayoutComposition
- Parameters:
row
- a flag indicating if subviews should be centered relative to their respective rows.column
- a flag indicating if subviews should be centered relative to their respective columns.- Returns:
- this object.
-
spacing
Description copied from interface:ViewLayoutComposition
Sets the spacing in pixels between sub-views of the composition operator.- Specified by:
spacing
in interfaceViewLayoutComposition
- Parameters:
size
- the spacing between sub-views.- Returns:
- this object.
-
spacing
Description copied from interface:ViewLayoutComposition
Sets different spacing values for rows and columns.- Specified by:
spacing
in interfaceViewLayoutComposition
- Parameters:
row
- the spacing between sub-views.column
- the spacing between sub-views.- Returns:
- this object.
-