Class Config

java.lang.Object
smile.plot.vega.Config

public class Config extends Object
Vega-Lite's config object lists configuration properties of a visualization for creating a consistent theme.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toPrettyString

      public String toPrettyString()
      Returns the specification in pretty print.
      Returns:
      the specification in pretty print.
    • autosize

      public Config 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

      public Config autosize(String type, boolean resize, String contains)
      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

      public Config background(String color)
      Sets the background with CSS color property.
    • padding

      public Config padding(int size)
      Specifies padding for all sides. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle.
    • padding

      public Config padding(int left, int top, int right, int bottom)
      Specifies padding for each side. The visualization padding, in pixels, is from the edge of the visualization canvas to the data rectangle.
    • countTitle

      public Config countTitle(String title)
      Sets the default axis and legend title for count fields.
    • fieldTitle

      public Config fieldTitle(String title)
      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

      public Config font(String font)
      Sets the default font for all text marks, titles, and labels.
    • lineBreak

      public Config lineBreak(String 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

      public FormatConfig tooltipFormat()
      Define custom format configuration for tooltips.
      Returns:
      a FormatConfig object to set custom format configuration.
    • axis

      public Axis axis()
      Returns the axis definition object.
      Returns:
      the axis definition object.
    • legend

      public Legend legend()
      Returns the legend definition object.
      Returns:
      the legend definition object.