Skip to content

draw.io export and comparison with Trailwright ​

Export > Cabling Topology (draw.io) writes an uncompressed .drawio file (mxfile XML) that opens in draw.io, diagrams.net and the VS Code draw.io extension. It is built by buildDrawio in src/features/export/exportDrawio.ts, a pure function of the diagram document.

Content ​

draw.io cellSource in the diagramid
Title textdiagram nametitle
Rounded box, light blueToR / other switch: title, subtitle, model, zone, trunk VLANssw-N
Rounded box, light grey, left alignedHost node: title, model, zone, one line per Network ATC intent with traffic and portsnode-N
Rounded box, greyOOB switch or console serveroob-N
Dashed green rectangle (40 % opacity)Logical network area: name, VLAN, CIDR, MTUnet-N
EdgeOne per cable, source and target set to the shapes, label portA - portB VLAN n MEDIAe-N
Dashed orange edgeNode-to-node switchless storage cablesl-A-B-L

Edge colours follow what the cable carries: management and compute #1a73e8, storage #e8710a, OOB and console grey #5f6368 (dashed). Cables whose end no longer exists in the diagram are skipped. All text is attribute-escaped, so a device name cannot inject markup.

Comparison with Trailwright ​

Trailwright (the AzureLocal deployment planner) produces its own draw.io export (apps/trailwright/src/exports/topologyDrawio.ts) from a deployment project (cluster facts, intents, networking), not from a drawn diagram. The two files are meant to be read side by side and to look alike. No code is shared between the repositories.

AspectTrailwrightDraftsman
InputProject model (nodes, intents, storage pattern, SAN)Drawn diagram (positions chosen by the author)
File skeletonmxfile host="trailwright" > diagram name="topology" > mxGraphModel > root with cells 0 and 1Same, with host="draftsman"
Text escaping&, ", <, >, newline as &#xa;Identical
Shape idssw-N, node-N, san, fc-Nsw-N, node-N, oob-N, net-N
Edge idse-<node>-<port>, sl-A-B-L (direct storage), san-sw-Ne-N, sl-A-B-L (direct storage)
Fills and coloursswitch #e8f0fe, node #f8f9fa, management #1a73e8, storage #e8710aIdentical
LayoutComputed (switch row, node row, edge routing points)Author's layout, translated so the top-left is at (40, 40)
Edge attachmentFree sourcePoint/targetPointsource/target shape ids, so edges follow when shapes move
ExtrasSAN, Fibre Channel, cluster and iSCSI networksOOB devices, logical network areas, zones, intents, trunk VLANs
Port labelsOS adapter namesHardware profile port ids (OCP-P1, Eth12)

Where the two overlap (switch and node shapes, direct storage links, colours, ids), a diagram exported from either tool can be merged or restyled in draw.io without renaming cells. Differences in edge ids are deliberate: Draftsman edges are numbered by cable order because a cable has no node/port coordinates until the author draws it.

Compatibility notes for maintainers: keep the file uncompressed (Trailwright's tests and draw.io diffs rely on readable XML), keep host as the tool name, and if Trailwright changes its style strings update STYLE and DRAWIO_COLORS in exportDrawio.ts and the table above.

Released under the MIT License. Forked from AzLoFlows by Cristian Edwards Sabathe.