PitchKit
API Reference@pitchkit/coreFunctions

renderSceneToSVGElement()

function renderSceneToSVGElement(scene, doc?): SVGSVGElement;

Defined in: packages/core/src/render/svg/render-scene.ts:54

Internal

Walks a Scene and builds an SVGSVGElement via DOM APIs (not string templating) — runs under happy-dom in tests and a real DOM in the browser with the same code path, and extends cleanly to interactive marks (event listeners need real nodes) in Milestone 1.

Resolves issue #6: @pitchkit/react re-emits its own JSX rather than calling this (JSX is what makes output SSR-able), so this function's only first-party consumer is the packages/core/examples/index.html dev harness. It is kept — and exported from @pitchkit/core so that harness keeps working — as an internal building block, not a supported public API for framework-agnostic/vanilla-JS consumption. React is the only officially supported rendering surface for marks; do not add painters for new Milestone 2 mark types (hexbin, KDE, flow, polygon, hull, Voronoi, goal angle) — ship those React-only. canvasRenderer (heatmaps) is unaffected and remains fully supported.

Parameters

ParameterTypeDefault value
sceneSceneundefined
docDocumentdocument

Returns

SVGSVGElement

On this page