Package smile.plot.vega
Class Background
java.lang.Object
smile.plot.vega.Background
The view background of a single-view or layer specification.
-
Method Summary
Modifier and TypeMethodDescriptioncornerRadius
(int cornerRadius) Sets the radius of corners.Sets the mouse cursor used over the view.Sets the fill color.fillOpacity
(double opacity) Sets the fill opacity.opacity
(double opacity) Sets the overall opacity.Sets the stroke color.Sets the stroke cap for line ending style.strokeDash
(double stroke, double space) Sets the alternating [stroke, space] lengths for stroke dash.strokeDashOffset
(int offset) Sets the offset (in pixels) into which to begin drawing with the stroke dash array.strokeJoin
(String join) Sets the stroke line join method.strokeMiterLimit
(int limit) Sets the miter limit at which to bevel a line join.strokeOpacity
(double opacity) Sets the stroke opacitystrokeWidth
(int width) Sets the stroke width.Sets the custom styles.Returns the specification in pretty print.toString()
-
Method Details
-
toString
-
toPrettyString
Returns the specification in pretty print.- Returns:
- the specification in pretty print.
-
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
Sets the radius of corners.- Parameters:
cornerRadius
- The radius in pixels of rounded rectangles or arcs' corners.- Returns:
- this object.
-
cursor
Sets the mouse cursor used over the view.- Parameters:
cursor
- Any valid CSS cursor type can be used.- Returns:
- this object.
-
fill
Sets the fill color.- Parameters:
color
- the fill color.- Returns:
- this object.
-
fillOpacity
Sets the fill opacity.- Parameters:
opacity
- a value between [0, 1].- Returns:
- this object.
-
opacity
Sets the overall opacity.- Parameters:
opacity
- a value between [0, 1].- Returns:
- this object.
-
stroke
Sets the stroke color.- Parameters:
color
- the stroke color.- Returns:
- this object.
-
strokeCap
Sets the stroke cap for line ending style.- Parameters:
cap
- "butt", "round", or "square".- Returns:
- this object.
-
strokeDash
Sets the alternating [stroke, space] lengths for stroke dash.- Parameters:
stroke
- the stroke length.space
- the space length.- Returns:
- this object.
-
strokeDashOffset
Sets the offset (in pixels) into which to begin drawing with the stroke dash array.- Parameters:
offset
- the stroke offset.- Returns:
- this object.
-
strokeJoin
Sets the stroke line join method.- Parameters:
join
- "miter", "round" or "bevel".- Returns:
- this object.
-
strokeMiterLimit
Sets the miter limit at which to bevel a line join.- Parameters:
limit
- the miter limit.- Returns:
- this object.
-
strokeOpacity
Sets the stroke opacity- Parameters:
opacity
- a value between [0, 1].- Returns:
- this object.
-
strokeWidth
Sets the stroke width.- Parameters:
width
- the width in pixels.- Returns:
- this object.
-