The all-in-one package for Shumoku — network topology visualization for Markdown and the web. Re-exports @shumoku/core (models, parser, layout, themes) plus the HTML renderer, so most apps only need this one dependency.
Install
npm install shumoku
Quick start
import { readNetworkModel, renderGraphToHtml, toNetworkGraph } from 'shumoku'
const graph = toNetworkGraph(
readNetworkModel(`
name: Edge
nodes:
- { id: rt-01, type: router, product: Yamaha }
- { id: sw-01, type: l3-switch }
links:
- endpoints: [{ node: rt-01, port: lan1 }, { node: sw-01, port: ge-0/0/0 }]
speed: 10G
`),
)
// Interactive HTML (pan / zoom / tooltips)
const html = await renderGraphToHtml(graph, { title: 'Edge', toolbar: true })
What you get
- Everything in
@shumoku/core—readNetworkModel,toNetworkGraph,computeNetworkLayout, models,lightTheme/darkTheme, the plugin kit, and plugin types. - HTML rendering —
renderGraphToHtml,renderHtml, hierarchical variants,initInteractive, and theINTERACTIVE_IIFEbundle for embedding. - Legacy SVG access — the synchronous
svg.render(graph, layout)namespace retained forLayoutResultcompatibility. Prefer the dedicated canonical SVG API below for new code.
Need standalone SVG or PNG output? Depend on the dedicated renderers directly:
import { renderGraphToSvg } from '@shumoku/renderer-svg'
import { renderGraphToPng } from '@shumoku/renderer-png' // Node.js only
const svg = await renderGraphToSvg(graph)
const png = await renderGraphToPng(graph, { scale: 2 })
License
AGPL-3.0-only. For commercial licensing, contact [email protected].