A marks section defines the visual shapes that represent data in a Vega visualization. Each mark specifies a type, data source, encoding, and initial visual properties. section 3.1.1
A line mark
A line mark can read from myData, map x and y fields through xScale and yScale, and set its stroke color to red. section 3.1.1
Listing 3.5 An example marks section
"marks": [
{
"type": "line",
"from": {"data": "myData"},
"encode": {
"enter": {
"x": {"scale": "xScale", "field": "x"},
"y": {"scale": "yScale", "field": "y"},
"stroke": {"value": "red"}
}
}
}
],
Inspect the complete marks definition for the line chart, including type, data source, encoding channels, scales, and stroke styling. section 3.1.1
Configure each mark by specifying:
- A mark type, such as line, symbol, or rect. section 3.1.1
- A data source through the from property. section 3.1.1
- Encoding channels such as x, y, and color. section 3.1.1
- Initial properties in the enter block, including size, color, opacity, or shape. section 3.1.1
