Use MSAGL-JS (Microsoft Automatic Graph Layout) to lay out and visualize networks in JavaScript or TypeScript. Use for graph and network layout, DOT/JSON/JGF parsing, live embedded SVG or WebGL graphs, Sugiyama/MDS/IPSepCola layouts, edge routing, and exporting SVG, PDF, PNG, EPS, or PostScript figures for LaTeX and other documents.
npx skills add https://github.com/microsoft/msagljs --skill msagljs
Use this skill to add automatic graph layout or network visualization with the
@msagl/* packages.
| Goal | Workflow |
| --- | --- |
| Compute node positions and routed edge curves without a viewer | Core layout |
| Embed an interactive graph that appears when a page loads | Live web embedding |
| Add or configure the SVG or WebGL renderer | Browser renderers |
| Select a layout algorithm or edge-routing mode | Layout and routing |
| Generate SVG, PDF, PNG, EPS, or PostScript for a document | Document export |
| Choose packages or parse graph inputs | Packages and inputs |
| Diagnose an integration problem | Troubleshooting |
build or test commands.
live WebGL viewer, or a static document figure.
local graph file, or an API response.
@msagl/* package imported directly by the code. Do not relyon transitive dependencies.
desired visual style.
browser smoke test. Confirm the output is visibly non-empty.
new Edge(source, target) registers the edge with both endpoint nodes. Do notinvent a separate addEdge call.
Graph.GeomGraph, a GeomNode with a boundary curvefor each node, and a GeomEdge for each edge before layoutGeomGraph.
RendererSvg.setGraph() is synchronous. WebGL Renderer.setGraph() isasynchronous and must be awaited.
window, document, canvas text measurement, anda mounted container with nonzero dimensions. Do not run them during SSR.
document.bodydefault in an embedded application.
setGraph() or setOptions(). Do not reconstruct it on every framework
render.
layoutType to use the renderer default. The string 'default' is not avalid LayoutOptions.layoutType.
The binary figure should not be the only editable artifact.
For a repository without an existing browser application, install the helper's
locked dependencies from this skill directory:
npm ci --prefix scripts
Then render a graph:
node scripts/render-network.mjs examples/network.dot figures/network.pdf \
--layout sugiyama-lr \
--routing spline
The output extension selects svg, pdf, png, eps, or ps. PDF is the
default choice for pdfLaTeX, LuaLaTeX, and XeLaTeX. EPS is intended for legacy
LaTeX-to-DVI-to-PostScript workflows.
Do not pre-approve shell execution for this skill. Let the agent host apply its
normal permission policy before installing dependencies or running commands.
mounted.
opened or otherwise checked for non-empty output.
Take microsoft/msagljs from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.