Documentation / @ripl/svg / createContext
Function: createContext()
createContext(
target,options?):SVGContext
Defined in: svg/src/index.ts:1002
Creates an SVG rendering context (a concrete Context) attached to the given DOM target.
Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | HTMLElement | A DOM element or CSS selector identifying the element to mount the SVG into. |
options? | ContextOptions<Record<string, unknown>> | Optional context configuration such as interactivity and metadata. |
Returns
The constructed SVGContext.
Example
ts
const context = createContext(target);