@aigentive/wire-renderers
v1.0.2
Published
Wire — server/static renderers and framework-neutral adapter output.
Readme
@aigentive/wire-renderers
Render Wire diagrams. Two surfaces:
renderToSvg(diagram)— pure server-side SVG renderer. No React, no DOM. Used by the MCP server forrender_svgand by the CLI forwire export.toReactFlow(diagram)— compatibility adapter that returns React Flow-shapednodes+edgesfor apps that still maintain their own third-party graph canvas.
Install
npm install @aigentive/wire-renderersUse
import { renderToSvg } from "@aigentive/wire-renderers";
import { writeFileSync } from "node:fs";
const svg = renderToSvg(diagram, { padding: 24, background: "#fafafa" });
writeFileSync("./diagram.svg", svg);For React apps, prefer the native <WireCanvas> from @aigentive/wire-react. Use toReactFlow only as an interop adapter for an app that already owns a React Flow-compatible canvas.
License
Apache-2.0
