Repository navigation
File format
Diagrams are saved as .stratagram files: plain JSON, easy to generate from scripts (for example
from NetBox data). Save as suggests the .stratagram name.
{
"format": "stratagram",
"version": 1,
"devices": [
{ "id": 1, "name": "fw-01", "kind": "firewall", "x": 300, "y": 90, "w": 120, "h": 60,
"color": "#fecaca", "layer": 20, "z": 1,
"ports": [ { "id": 6, "name": "port3", "side": "bottom", "t": 0.5 } ] }
],
"links": [
{ "id": 8, "from": { "device": 1, "port": 6 }, "to": { "device": 2, "port": 7 },
"color": "#334155", "width": 2.0, "style": "solid",
"head_start": "none", "head_end": "arrow", "routing": "straight", "kind": "trunk", "label": "10G", "label_margin": 32,
"layer": 20, "z": 0 },
{ "id": 10, "from": { "device": 1, "port": 6 }, "to": { "point": 11 }, "head_end": "arrow" }
],
"points": [ { "id": 11, "x": 360, "y": 300 } ],
"notes": [
{ "id": 9, "text": "DMZ\nVLAN 20", "x": 280, "y": 20, "size": 14, "color": "#334155", "bold": false,
"layer": 21, "z": 2 }
],
"layers": [
{ "id": 20, "name": "Physical", "visible": true },
{ "id": 21, "name": "Annotations", "visible": false, "locked": true, "show_name": true }
],
"active_layer": 20
}See examples/demo.stratagram in the repository and its exports examples/demo.svg and
examples/demo.drawio. Generated files may leave out positions and sizes; see Command line.
Devices and ports
-
tis the position along the side (0 = left/top, 1 = right/bottom). - A port's
layerputs it on a layer of its own (left out for its device's).
Links
- A link end is either a port (
device+port) or a free connection point (point, with an optionallabel);pointsmay be left out. -
kind(plain, trunk, ipsec, vxlan, capwap, sdwan, mpls, l2, l3, l3sub), with an optionalover(the kinds carrying it, innermost first, e.g.["ipsec"]), may be left out for a plain line. -
label_at(0 to 1 along the line) holds a label placed by hand, and"label_hidden": truehides the label.
Notes
- A note's
x/yis the top left corner of its text; optionalwandhgive it a fixed box (at its own scale).notesmay be left out.
Layers
- A layer may carry a
background:margin,fill,opacityin percent,border(none, solid, dashed or dotted),border_color,border_width,rounded,radius. - A layer may carry a
frame:-
template: lines, titleblock, banner, minimal, corporate, report, card, iso, revision, blueprint, change, classification, site, controlled, signoff, solution, proposal, presentation, executive, asbuilt, incident, location or noc; -
title,subtitle,author,note,show_date,margin,color; - as needed
company,doc_id,revision,approver,status,level,address,page,show_file,version,owner,review_date,reviewer,customer,summary,installer,commissioned,severity,start,end,services,location,watermark,revisions(rev,date,change,author); -
logoandlogo2as data URIs of a PNG or JPEG, withlogo_w/logo_handlogo2_w/logo2_h. Logos that are not embedded this way (a web address, say) are dropped when the file is opened.
-
-
changedholds the local date and time of the last change.
Stacking and ids
-
zis the global stacking order (higher is in front, across all layers). -
layers,layerandzare optional: without them everything goes into one layer, with links under devices and notes on top. - Ids only need to be unique within the file; links pointing at missing ports are dropped on load.
A document with several sheets keeps its first sheet at the top level and the others in sheets, a
list of the same fields (devices, links, notes, points, layers, active_layer, changed)
without format and version. Each sheet's name is optional ("name": "Core"). A one-sheet file
has neither, so older versions open the first sheet of any file.
Files from before the rename (.netdiag, format "netdiag") and older .json files still open,
and keep their name when saved with Ctrl+S. On first start, the settings of netdiag
(netdiag.conf and its saved logos) move over to stratagram.conf.
Stratagram · Source · Issues · Apache License 2.0
Getting it
Drawing
- Editing basics
- Device types and front panels
- Lines
- Auto layout
- Layers and sheets
- Deep zoom
- Frames
- Themes
Out and in
More