UNPKG

@ndbx/runtime

Version:

The `@ndbx/runtime` package provides a runtime environment to embed NodeBox visualizations directly into React applications. NodeBox is a powerful tool for creating interactive and generative visualizations, and this runtime allows you to integrate those

14 lines (13 loc) 756 B
import { ReactElement } from "react"; import { Item } from "./types"; export interface RenderOptions { drawPoints?: boolean; includeBackground?: boolean; } export interface PngOptions extends RenderOptions { scale?: number; } export declare function renderItemToSvgElement(item: Item, resultValue: unknown, options?: RenderOptions): ReactElement | undefined; export declare function renderItemToSvgString(item: Item, resultValue: unknown, options?: RenderOptions): string | undefined; export declare function svgStringToPngBlob(svgString: string, width: number, height: number, options?: PngOptions): Promise<Blob>; export declare function renderItemToPngBlob(item: Item, resultValue: unknown, options?: PngOptions): Promise<Blob | undefined>;