docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a utility that renders a supplied figure definition into a DOM container and exports a static image snapshot, optionally triggering a client-side download.
data:image/png and reports the requested filename/format in the resolved value. @test/**
* Renders a figure into the given container and exports it as a static image.
* @param {HTMLElement} container - Target element to host the chart during export.
* @param {{ data: any[]; layout?: object; config?: object; }} figure - Trace/layout/config used for rendering.
* @param {{
* format: 'png' | 'jpeg' | 'webp' | 'svg',
* width?: number,
* height?: number,
* scale?: number,
* backgroundColor?: string,
* filename?: string,
* download?: boolean
* }} options - Export options including optional download control.
* @returns {Promise<{ dataUrl: string; format: string; filename: string }>} Resolves with snapshot metadata.
*/
export function exportChart(container, figure, options);Used to render the chart and generate/download the exported image.