Class ViewConfig

java.lang.Object
smile.plot.vega.ViewConfig

public class ViewConfig extends Object
The style of a single view visualization.
  • 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.
    • continuousWidth

      public ViewConfig continuousWidth(int width)
      Sets the default width when the plot has a continuous field for x or longitude, or has arc marks.
    • continuousHeight

      public ViewConfig continuousHeight(int height)
      Sets the default height when the plot has a continuous field for y or latitude, or has arc marks.
    • discreteWidth

      public ViewConfig discreteWidth(int width)
      Sets the default width when the plot has non-arc marks and either a discrete x-field or no x-field.
    • discreteHeight

      public ViewConfig discreteHeight(int height)
      Sets the default height when the plot has non arc marks and either a discrete y-field or no y-field.
    • step

      public ViewConfig step(int step)
      Sets the default step size for x-/y- discrete fields.
    • cornerRadius

      public ViewConfig cornerRadius(int cornerRadius)
      Sets the radius of corners.
      Parameters:
      cornerRadius - The radius in pixels of rounded rectangles or arcs' corners.
      Returns:
      this object.
    • cursor

      public ViewConfig cursor(String cursor)
      Sets the mouse cursor used over the view.
      Parameters:
      cursor - Any valid CSS cursor type can be used.
      Returns:
      this object.
    • fill

      public ViewConfig fill(String color)
      Sets the fill color.
      Parameters:
      color - the fill color.
      Returns:
      this object.
    • fillOpacity

      public ViewConfig fillOpacity(double opacity)
      Sets the fill opacity.
      Parameters:
      opacity - a value between [0, 1].
      Returns:
      this object.
    • opacity

      public ViewConfig opacity(double opacity)
      Sets the overall opacity.
      Parameters:
      opacity - a value between [0, 1].
      Returns:
      this object.
    • stroke

      public ViewConfig stroke(String color)
      Sets the stroke color.
      Parameters:
      color - the stroke color.
      Returns:
      this object.
    • strokeCap

      public ViewConfig strokeCap(String cap)
      Sets the stroke cap for line ending style. One of "butt", "round", or "square".
      Parameters:
      cap - "butt", "round", or "square".
      Returns:
      this object.
    • strokeDash

      public ViewConfig strokeDash(double stroke, double space)
      Sets the alternating [stroke, space] lengths for stroke dash.
      Parameters:
      stroke - the stroke length.
      space - the space length.
      Returns:
      this object.
    • strokeDashOffset

      public ViewConfig strokeDashOffset(int offset)
      Sets the offset (in pixels) into which to begin drawing with the stroke dash array.
      Parameters:
      offset - the stroke offset.
      Returns:
      this object.
    • strokeJoin

      public ViewConfig strokeJoin(String join)
      Sets the stroke line join method.
      Parameters:
      join - "miter", "round" or "bevel".
      Returns:
      this object.
    • strokeMiterLimit

      public ViewConfig strokeMiterLimit(int limit)
      Sets the miter limit at which to bevel a line join.
      Parameters:
      limit - the miter limit.
      Returns:
      this object.
    • strokeOpacity

      public ViewConfig strokeOpacity(double opacity)
      Sets the stroke opacity
      Parameters:
      opacity - a value between [0, 1].
      Returns:
      this object.
    • strokeWidth

      public ViewConfig strokeWidth(int width)
      Sets the stroke width.
      Parameters:
      width - the width in pixels.
      Returns:
      this object.
    • axis

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