Package smile.plot.vega
Class Config
java.lang.Object
smile.plot.vega.Config
Vega-Lite's config object lists configuration properties of
a visualization for creating a consistent theme.
-
Method Summary
Modifier and TypeMethodDescriptionautosize()
Sets the overall size of the visualization.Sets the overall size of the visualization.axis()
Returns the axis definition object.background
(String color) Sets the background with CSS color property.countTitle
(String title) Sets the default axis and legend title for count fields.fieldTitle
(String title) Defines how Vega-Lite generates title for fields.Sets the default font for all text marks, titles, and labels.legend()
Returns the legend definition object.Sets a delimiter, such as a newline character, upon which to break text strings into multiple lines.padding
(int size) Specifies padding for all sides.padding
(int left, int top, int right, int bottom) Specifies padding for each side.Define custom format configuration for tooltips.Returns the specification in pretty print.toString()
-
Method Details
-
toString
-
toPrettyString
Returns the specification in pretty print.- Returns:
- the specification in pretty print.
-
autosize
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
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.- 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.
-
background
Sets the background with CSS color property. -
padding
Specifies padding for all sides. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle. -
padding
Specifies padding for each side. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle. -
countTitle
Sets the default axis and legend title for count fields. -
fieldTitle
Defines how Vega-Lite generates title for fields. There are three possible styles:"verbal" (Default) - displays function in a verbal style (e.g., “Sum of field”, “Year-month of date”, “field (binned)”).
"function" - displays function using parentheses and capitalized texts (e.g., “SUM(field)”, “YEARMONTH(date)”, “BIN(field)”).
"plain" - displays only the field name without functions (e.g., “field”, “date”, “field”).
-
font
Sets the default font for all text marks, titles, and labels. -
lineBreak
Sets a delimiter, such as a newline character, upon which to break text strings into multiple lines. This property provides a global default for text marks, which is overridden by mark or style config settings, and by the lineBreak mark encoding channel. If signal-valued, either string or regular expression (regexp) values are valid. -
tooltipFormat
Define custom format configuration for tooltips.- Returns:
- a FormatConfig object to set custom format configuration.
-
axis
Returns the axis definition object.- Returns:
- the axis definition object.
-
legend
Returns the legend definition object.- Returns:
- the legend definition object.
-