Fresh history cut from cynarAI/evoo antigravity-handoff/project-timeline (Voice First + project timeline). Brand docs/titles as evOo; keep @rakazo/* packages as tech debt. Excludes node_modules, caches, secrets, voice blobs.
13 lines
504 B
TypeScript
13 lines
504 B
TypeScript
export * from "@rakazo/core/plot";
|
|
|
|
/** Rasterize a rendered plot SVG to an opaque PNG. The SVG's CSS background is
|
|
not honored by all rasterizers, and a transparent chart is unreadable on
|
|
dark chat themes, so the alpha channel is flattened onto white. */
|
|
export async function plotSvgToPng(svg: string): Promise<Buffer> {
|
|
const { default: sharp } = await import("sharp");
|
|
return sharp(Buffer.from(svg), { density: 144 })
|
|
.flatten({ background: "#ffffff" })
|
|
.png()
|
|
.toBuffer();
|
|
}
|