@shumoku/core
v0.2.23
Published
Core library for shumoku network topology visualization
Maintainers
Readme
@shumoku/core
Core library for Shumoku network topology visualization.
Installation
npm install @shumoku/coreFeatures
- 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
Usage
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)Related Packages
@shumoku/parser-yaml- YAML parser for network definitions@shumoku/icons- Vendor-specific icons (Yamaha, Aruba, AWS, Juniper)
Documentation
- Playground - Interactive demo
- GitHub
License
MIT
