Quickstart
1. Install
Section titled “1. Install”npm install @ogabrielluiz/patchflowpnpm add @ogabrielluiz/patchflowbun add @ogabrielluiz/patchflowyarn add @ogabrielluiz/patchflowpatchflow ships ESM + CJS builds and its own TypeScript declarations. Its only runtime dependency is dagre.
2. Render a patch
Section titled “2. Render a patch”import { render } from '@ogabrielluiz/patchflow';import { writeFileSync } from 'node:fs';
const svg = render(`- Oscillator (Out) -> Filter (In)- Envelope (Out) >> Filter (Cutoff)- Filter (Out) -> VCA (In)- LFO (Out) >> VCA (CV)`);
writeFileSync('patch.svg', svg);That’s it. You’ll get an SVG you can drop into a README, a blog post, or a PDF.
3. Switch to the dark theme
Section titled “3. Switch to the dark theme”import { render, darkTheme } from '@ogabrielluiz/patchflow';
const svg = render(notation, { theme: darkTheme });Or override just the bits you care about:
const svg = render(notation, { theme: { cable: { colors: { audio: { stroke: '#ff5f7a', plugTip: '#d94963' }, }, }, },});The theme object is deep-merged into the default — you never have to specify a full theme unless you want to. See the Theming guide for the full surface.
4. Try it live
Section titled “4. Try it live”Head to the Playground to edit notation and see the SVG update in real time. Swap presets, toggle themes, copy the SVG to your clipboard, or download it as a file.
Next steps
Section titled “Next steps”- Read the Notation syntax page to learn the full grammar.
- Browse the Signal operators to see the supported cable types and their colors.
- Skim the API reference for the lower-level
parse()/layout()/renderSvg()entry points.