@tanstack/charts
Version:
A chart grammar for TypeScript and JavaScript. Marks consume your data directly, channels describe visual encodings, and the engine compiles them into a renderer-neutral keyed scene. TanStack's compact scales cover common numeric and categorical mappings.
19 lines (18 loc) • 503 B
JavaScript
const childrenByOptions = /* @__PURE__ */ new WeakMap();
function svgRenderChildren(options) {
return childrenByOptions.get(options);
}
function withSvgRenderChildren(options, children, render) {
const previous = childrenByOptions.get(options);
childrenByOptions.set(options, children);
try {
return render();
} finally {
if (previous) childrenByOptions.set(options, previous);
else childrenByOptions.delete(options);
}
}
export {
svgRenderChildren,
withSvgRenderChildren
};