Class Repeat

All Implemented Interfaces:
ViewComposition, ViewLayoutComposition

public class Repeat extends VegaLite implements ViewLayoutComposition
Repeat a View. It provides a shortcut that creates a view for each entry in an array of fields. This operator generates multiple plots like facet. However, unlike facet it allows full replication of a data set in each view.
  • Constructor Details

    • Repeat

      public Repeat(VegaLite view, String... fields)
      Creates a view for each entry in an array of fields. This operator generates multiple plots like facet. However, unlike facet it allows full replication of a data set in each view.
      Parameters:
      view - the view specification.
      fields - The fields that should be used for each entry.
    • Repeat

      public Repeat(VegaLite view, String[] row, String[] column)
      Creates a view for each entry in an array of fields. This operator generates multiple plots like facet. However, unlike facet it allows full replication of a data set in each view.
      Parameters:
      view - the view specification.
      row - An array of fields to be repeated vertically.
      column - An array of fields to be repeated horizontally.
  • Method Details

    • columns

      public Repeat columns(int 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.
    • usermeta

      public Repeat usermeta(com.fasterxml.jackson.databind.JsonNode metadata)
      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.
      Overrides:
      usermeta in class VegaLite
    • usermeta

      public Repeat usermeta(Object metadata)
      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.
      Overrides:
      usermeta in class VegaLite
    • background

      public Repeat background(String color)
      Description copied from class: VegaLite
      Sets the background of the entire view with CSS color property.
      Overrides:
      background in class VegaLite
    • padding

      public Repeat padding(int size)
      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.
      Overrides:
      padding in class VegaLite
    • padding

      public Repeat padding(int left, int top, int right, int bottom)
      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.
      Overrides:
      padding in class VegaLite
    • autosize

      public Repeat 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 class VegaLite
    • autosize

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

      public Repeat name(String name)
      Description copied from class: VegaLite
      Sets the name of the visualization for later reference.
      Overrides:
      name in class VegaLite
    • description

      public Repeat description(String description)
      Description copied from class: VegaLite
      Sets the description of this mark for commenting purpose.
      Overrides:
      description in class VegaLite
    • title

      public Repeat title(String title)
      Description copied from class: VegaLite
      Sets a descriptive title to a chart.
      Overrides:
      title in class VegaLite
      Parameters:
      title - a descriptive title.
      Returns:
      this object.
    • resolveScale

      public Repeat resolveScale(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets a scale resolution. For scales, resolution can be specified for every channel.
      Specified by:
      resolveScale in interface ViewComposition
      Parameters:
      channel - positional or non-positional channel.
      resolution - "shared" or "independent".
      Returns:
      this object.
    • resolveAxis

      public Repeat resolveAxis(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets an axis resolution.
      Specified by:
      resolveAxis in interface ViewComposition
      Parameters:
      channel - positional channel: "x" or "y".
      resolution - "shared" or "independent".
      Returns:
      this object.
    • resolveLegend

      public Repeat resolveLegend(String channel, String resolution)
      Description copied from interface: ViewComposition
      Sets a legend resolution.
      Specified by:
      resolveLegend in interface ViewComposition
      Parameters:
      channel - non-positional channel: "color", "opacity", "shape", or "size".
      resolution - "shared" or "independent".
      Returns:
      this object.
    • align

      public Repeat align(String strategy)
      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 interface ViewLayoutComposition
      Parameters:
      strategy - "all", "each", or "none".
      Returns:
      this object.
    • align

      public Repeat align(String row, String column)
      Description copied from interface: ViewLayoutComposition
      Sets different alignments for rows and columns.
      Specified by:
      align in interface ViewLayoutComposition
      Parameters:
      row - alignment for rows.
      column - alignment for columns.
      Returns:
      this object.
    • bounds

      public Repeat bounds(String 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 interface ViewLayoutComposition
      Parameters:
      bounds - "full" or "flush".
      Returns:
      this object.
    • center

      public Repeat center(boolean flag)
      Description copied from interface: ViewLayoutComposition
      Sets if subviews should be centered relative to their respective rows or columns.
      Specified by:
      center in interface ViewLayoutComposition
      Parameters:
      flag - a flag indicating if subviews should be centered relative to their respective rows or columns.
      Returns:
      this object.
    • center

      public Repeat center(int row, int column)
      Description copied from interface: ViewLayoutComposition
      Sets if subviews should be centered relative to their respective rows or columns.
      Specified by:
      center in interface ViewLayoutComposition
      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

      public Repeat spacing(int size)
      Description copied from interface: ViewLayoutComposition
      Sets the spacing in pixels between sub-views of the composition operator.
      Specified by:
      spacing in interface ViewLayoutComposition
      Parameters:
      size - the spacing between sub-views.
      Returns:
      this object.
    • spacing

      public Repeat spacing(int row, int column)
      Description copied from interface: ViewLayoutComposition
      Sets different spacing values for rows and columns.
      Specified by:
      spacing in interface ViewLayoutComposition
      Parameters:
      row - the spacing between sub-views.
      column - the spacing between sub-views.
      Returns:
      this object.