Gridlines

extends Path

The Gridlines class represents a set of grid lines for a visual encoding. To create a Gridlines object, use the gridlines method in the Scene class, for example:

let gridlines = scene.gridlines("x", "metric");

Properties

propertyexplanationtypedefault value
attribute the data attribute represented by the grid linesString
channel the visual channel of the grid lines
possible values include “x”, “y”, “width”, “height”, and “radialDistance”
String
elements the elements used to construct the grid linesArray
id the unique id of the gridlinesString
linesthe individual grid line definitions used to render the guideArray[]
scale the scale used to compute the grid line positionsScale
type the type of the gridlinesString“gridlines”
valuesthe data values represented by the grid lines
if not provided, Mascot will auto-generate values
Array

Properties inherited from Path

propertyexplanationtypedefault value
bounds the bounding rectangle of the gridlinesRectangle
fillColorthe fill color of the gridlines pathColor“none”
opacitythe opacity value of the gridlines (between 0 and 1)Number0.5
strokeColorthe stroke color of the gridlinesColor“#ddd”
strokeDashthe dashes and gaps for the gridlines strokeString“none”
strokeWidththe stroke width of the gridlines in pixelsNumber1
x the x coordinate of the center of the gridlines boundsNumber
y the y coordinate of the center of the gridlines boundsNumber

Methods

methodexplanationreturn type
getSVGPathData()returns a string to be used as the d parameter in an SVG path elementString