type RVG · Core

VisQuillOptions

type VisQuillOptions = { … }

Configuration options for creating a VisQuill graphics context.

Passed as the second argument to VisQuill.create. All fields are optional; omitting the object entirely is equivalent to passing default values. As a convenience, VisQuill.create also accepts a bare string in place of this object, which is treated as VisQuillOptions.cssPrefix.

Example

const graphic = VisQuill.create(container, {
  cssPrefix: 'my-viz',
  licenseKey: 'VQ-...'
});

Properties

cssPrefixoptional

cssPrefix?: string

Optional CSS class prefix applied to the generated graphics elements, allowing styles to be scoped and avoiding collisions with other content on the page. Defaults to an empty string (no prefix).

licenseKeyoptional

licenseKey?: string

Optional commercial license key. When a valid key is supplied, the "Made with VisQuill" attribution label is removed from the rendered output. Without a key — or with an invalid or out-of-coverage key — the attribution label is shown, as required by the non-commercial license.

A commercial license is required for revenue-generating use. See the license terms, or contact contact@visquill.com for commercial licensing.

measureTextoptional

measureText?: MeasureTextFunction

Optional function that measures texts, in place of the browser's canvas measureText: it gets the text and the CSS font of its style and returns the advance width and the font box above (ascent) and below (descent) the baseline. Used for text extents (label.extent), e.g. in tests or with fonts of your own.