COMARK0422 · warning
comark/charts/spec-with-props
Leave type, x, and y off a chart drawn from a Vega-Lite spec
A chart drawn from a Vega-Lite spec takes its mark and its columns from the spec, so type, x, and y on the block are ignored. Only title still applies. Name the columns in the spec's encoding.
Incorrect
::chart{type="bar" title="Ducks per pond"}
| pond | ducks |
| --- | --: |
| north | 12 |
| south | 7 |
| east | 9 |
```vega-lite
{
"mark": "bar",
"encoding": {
"x": { "field": "pond", "type": "nominal" },
"y": { "field": "ducks", "type": "quantitative" }
}
}
```
:: lint-comark example.mdexample.md:1:1 comark/charts/spec-with-propsName the columns in the spec's
encoding instead.✖ 1 problemCorrect
::chart{title="Ducks per pond"}
| pond | ducks |
| --- | --: |
| north | 12 |
| south | 7 |
| east | 9 |
```vega-lite
{
"mark": "bar",
"encoding": {
"x": { "field": "pond", "type": "nominal" },
"y": { "field": "ducks", "type": "quantitative" }
}
}
```
:: lint-comark example.md✔ No problems