Area
extends Path
The Area class represents an enclosed area mark that is used in visualizations such as the area chart and the violin plot. You cannot create an Area object directly, instead, you need to use the densify operation to transform a Rect to an Area. Here is an explanation of the densify operation. The figure below shows how Area objects are created from a Rect object through the densify operation.

Properties
| property | explanation | type | default value |
|---|---|---|---|
| baseline | the anchor used to evenly distribute the width or height of the area | String | |
firstVertexPair ![]() | the first pair of the vertices (highlighted in red in the figure above) | Array of Vertex | |
height ![]() | the height of the area | Number | |
left ![]() | the x coordinate of the first vertex | Number | |
| orientation | the orientation of the area | String | |
top ![]() | the y coordinate of the first vertex | Number | |
width ![]() | the width of the area | Number |
Properties inherited from Path
| property | explanation | type | default value |
|---|---|---|---|
| curveMode | how the segments are drawn | String | |
firstSegment ![]() | returns the first segment of the path | Segment | |
firstVertex ![]() | returns the first vertex of the path | Vertex | |
segments ![]() | the segments on the path | Array | |
vertices ![]() | the vertices along the path | Array | |
| vxFillColor | the fill color of the vertices on this path | Color | “#555555” |
| vxHeight | the height of the vertices on this path | Number | 0 |
| vxOpacity | the opacity of the vertices on this path | Number | 1 |
| vxRadius | the radius of the vertices on this path if the shape is “circle” | Number | 0 |
| vxShape | the shape of the vertices on this path possible values: “rect”, “circle” | String | undefined |
| vxStrokeColor | the stroke color of the vertices on this path | Color | “#aaaaaa” |
| vxStrokeWidth | the stroke width of the vertices on this path in pixels | Number | 0 |
| vxWidth | the width of the vertices on this path | Number | 0 |
x ![]() | the x coordinate of the center of the path bounds | Number | |
y ![]() | the y coordinate of the center of the path bounds | Number |
Properties inherited from Mark
| property | explanation | type | default value |
|---|---|---|---|
bounds ![]() | the bounding rectangle of the mark | Rectangle | |
| dataScope | the data scope of the mark | DataScope | undefined |
| fillColor | the fill color of the mark | Color | “none” |
id ![]() | the unique id of the mark | String | |
| opacity | the opacity value of the mark (between 0 and 1) | Number | 1 |
| strokeColor | the stroke color of the mark | Color | “#ccc” |
| strokeDash | the dashes and gaps for the mark stroke | String | “none” |
| strokeWidth | the stroke width of the mark in pixels | Number | 1 |
type ![]() | the type of the mark | String | “area” |
| visibility | whether the mark is visible (“visible” or “hidden”) | String | “visible” |
Methods inherited from Path
| method | explanation | return type |
|---|---|---|
| getSVGPathData() | returns a string to be used as the d parameter in an SVG path element | String |
| resize(wd, ht, xRef, yRef) | change the width and height of the area wd (Number): width ht (Number): height xRef (String, optional): horizontal reference point yRef (String, optional): vertical reference point | void |
