Core library for shumoku network topology visualization
npm install @shumoku/coreCore library for Shumoku network topology visualization.
``bash`
npm install @shumoku/core
- Data models - Type-safe network topology models (Device, Port, Link, Module)
- Layout engines - Automatic positioning with ELK.js (hierarchical layout)
- SVG renderer - High-quality vector output
- Themes - Built-in modern and dark themes
`typescript
import { NetworkGraph, HierarchicalLayoutEngine, SvgRenderer } from '@shumoku/core'
// Create a network graph
const graph: NetworkGraph = {
version: '1.0.0',
devices: [
{ id: 'router1', name: 'Router', type: 'router' },
{ id: 'switch1', name: 'Switch', type: 'l2-switch' }
],
links: [
{ id: 'link1', source: 'router1', target: 'switch1' }
]
}
// Layout the graph
const engine = new HierarchicalLayoutEngine()
const layout = await engine.layout(graph)
// Render to SVG
const renderer = new SvgRenderer()
const svg = renderer.render(layout)
`
- @shumoku/parser-yaml - YAML parser for network definitions
- @shumoku/icons` - Vendor-specific icons (Yamaha, Aruba, AWS, Juniper)
- Playground - Interactive demo
- GitHub
MIT