Class Background

java.lang.Object
smile.plot.vega.Background

public class Background extends Object
The view background of a single-view or layer specification.
  • 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.
    • style

      public Background style(String... style)
      Sets the custom styles.
      Parameters:
      style - A string or array of strings indicating the name of custom styles to apply to the view background. A style is a named collection of mark property defaults defined within the style configuration. If style is an array, later styles will override earlier styles.
      Returns:
      this object.
    • cornerRadius

      public Background 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 Background 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 Background fill(String color)
      Sets the fill color.
      Parameters:
      color - the fill color.
      Returns:
      this object.
    • fillOpacity

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

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

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

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

      public Background 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 Background 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 Background strokeJoin(String join)
      Sets the stroke line join method.
      Parameters:
      join - "miter", "round" or "bevel".
      Returns:
      this object.
    • strokeMiterLimit

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

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

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