Guide
Frontmatter
Global vega defaults in document frontmatter and plugin factory options.
Set global defaults in the document frontmatter under the vega key. Per-directive attrs always take precedence.
---
vega:
output: svg
engine: vega-lite
width: 600
height: 300
scaleFactor: 2
config:
background: transparent
axis:
grid: false
---
::vl
```
{ ... }
```
::
Plugin factory defaults
Pass defaults via the plugin factory — frontmatter values override these:
import vega from 'comark-vega'
const plugins = [
vega({
vega: {
output: 'svg',
engine: 'vega-lite',
width: 500,
height: 300,
config: {
background: null,
},
},
}),
]
Precedence
- Per-directive attrs (highest)
- Document frontmatter
vega:block - Plugin factory
vega()options (lowest)
See Output modes for output values and Component props for all supported keys.