signals
Used to create dynamic variables
data
scales
Scale related configuration
scales-band
band
scale is mainly used to map discrete data to continuous intervals.
marks
Graphic element configuration, supporting multiple types
marks-rect
Rectangle Element
marks-arc
arc element
marks-symbol
Symbol Element
marks-circle
circle graphic element
marks-polygon
polygon mark
marks-shape
shape Primitive
marks-path
Path element
marks-area
area mark
marks-line
Line graphic element Test it out
marks-rule
Rule geom
marks-image
Image mark
marks-richtext
Richtext Graphic Element
marks-text
text primitive
marks-interval
Interval Graphic element
marks-cell
Cell Graphic Element
marks-group
group Mark
marks-glyph
glyph Chart Element
marks-component
component Graphics
marks-arc3d
arc3d Graphic Element
marks-pyramid3d
pyramid3d primitive
marks-rect3d
rect3d Primitive
coordinates
Coordinate system configuration, VGrammar currently has two built-in types of coordinate systems
coordinates-rect
Rectangular coordinate system, which can set transformations on it to achieve chart transformations, such as row and column transposition.
coordinates-polar
Polar coordinate system, which can convert Cartesian coordinate system coordinates into polar coordinate system coordinates and can be used to transform Cartesian coordinate system charts into polar coordinate system charts.
events
Event configuration
width
The total width of the canvas
height
The total height of the canvas
padding
The inner padding of canvas, in px unit, with the default padding of 0 for all directions. Accepts numerical values, numerical arrays, and objects for settings.
Example of usage:
// Numerical type, set the padding to 5
padding: 5;
// Numerical array, set the top and bottom padding to 5, and the left and right padding to 10, similar to the CSS box model
padding: [5, 10];
// Numerical array, set the padding for all four directions separately
padding: [
5, // Top
10, // Right
5, // Bottom
10 // Left
];
// Object type
padding: {
top: 5,
right: 10,
bottom: 5,
left: 10
}
background
Set the background of the canvas