Reference
Component props
Props on the Vega AST node and the shipped Vue Vega component.
Both entry points produce ['Vega', VegaNodeAttrs] nodes. The shipped Vue <Vega> component reads these props.
| Prop | Type | Default | Description |
|---|---|---|---|
spec | Record<string, unknown> | — | Literal Vega / Vega-Lite spec (fenced block, body, or binding-resolved) |
engine | 'vega-lite' | 'vega' | auto | Chart engine; inferred from $schema / structure when omitted |
width | number | string | — | Chart width in pixels |
height | number | string | — | Chart height in pixels |
output | 'svg' | 'img' | 'png' | — | Hint for SSR-capable paths; client Vega uses SVG |
class | string | '' | CSS class on the root element |
:spec / other :prop | string | — | Binding expressions preserved for @comark/binding (resolved before mount) |
Type imports
import type { VegaNodeAttrs } from 'comark-vega'
import { mountVegaView } from 'comark-vega'
Invalid specs
Invalid specs soft-fail: the component shows a <pre class="vega-error"> message and does not throw. See Error handling.
Global defaults for
output, engine, width, height, and config can come from frontmatter or the plugin factory.