class RVG · Core

VisQuill

Entry point for creating reactive vector graphics.

VisQuill provides a factory method to instantiate reactive graphics contexts from SVG elements. It serves as the primary API surface for initializing the reactive graphics system, enabling declarative and data-driven visualization through automatic synchronization between data models and visual representations.

Example

const divElement = document.querySelector('div')!;
const graphic = VisQuill.create(divElement, 'my-prefix');

Static properties

clockstaticreadonly

static clock: RvgClock

The animation clock shared by all graphics: real time by default, or manual for capturing animations frame by frame.

graphicsstaticreadonly

static graphics: RvgGraphic[]

Gets all active graphics instances created by VisQuill.

Returns a shallow copy of the internal graphics array to prevent external modification. Graphics are automatically removed from this collection when they are disposed.

Static methods

createstatic

static create(div: HTMLDivElement, options?: string | VisQuillOptions): RvgGraphic

Creates a new reactive vector graphics context within the specified HTML div element.

This method creates a new SVG element, appends it to the provided div, and initializes the reactive graphics system with a processor for managing reactive updates. The SVG element is automatically styled to fill its container (100% width and height). The created graphic is automatically tracked and will be removed from the graphics collection when disposed.

Example

const container = document.getElementById('viz-container') as HTMLDivElement;
const graphic = VisQuill.create(container, { cssPrefix: 'my-viz', licenseKey: 'your-license-key' });
div
The HTMLDivElement container where the SVG element will be created and appended.
options optional
Optional CSS class prefix (string), or a VisQuillOptions object with cssPrefix and/or licenseKey. A valid licence key removes the "Made with VisQuill" attribution label.

Returns A graphic instance representing the newly created reactive graphics context.

disposeAllstatic

static disposeAll(): void

Disposes all active graphics instances created by VisQuill.

Call this before loading a new demo or navigating away to release all resources associated with the current graphics contexts.