Repository navigation
Browser editor
The same editor runs in the browser: the core compiled to WebAssembly, with the canvas and panel in plain JavaScript. It is also the editor inside NetBox.
Open https://stratagram.app/editor/, or an example:
https://stratagram.app/editor/#file=../examples/berlin-hq.stratagram. #file= opens a diagram from
the same site only.
Everything runs in the browser; diagrams are not uploaded anywhere. Save writes back to the chosen file where the browser allows it (Chrome, Edge) and downloads the file elsewhere. Exports are downloads.
Some desktop shortcuts belong to the browser there (Ctrl+N, Ctrl+Shift+N, Ctrl+Shift+T, Ctrl+Shift+P); use the toolbar buttons instead.
Install app at the bottom right of the editor installs it as an app (a PWA). It shows when Chrome or Edge offer to install it and opens their install dialog; in Safari it tells how (Add to Dock, Add to Home Screen). It is hidden in the installed app and where installing is not possible (Firefox, which has no install for web apps on the desktop).
Installed, it runs in its own window and works offline: the service worker keeps the editor's
files, and online it always takes the newest from the site first. In Chrome and Edge it also opens
.stratagram files from the system and saves back to them.
Build it and serve web/www with any static web server; see Building from source. The
homepage's workflow does the same for stratagram.app.
To embed it in another page, mount(element, { host }) from web/www/app.js takes a host that
says where diagrams come from and go to:
host. |
|
|---|---|
open() |
Promise<{json, name} | null> (optional: no Open button) |
save(json, name, as) |
Promise<string | null>: the name saved under, null if not |
initial |
{json, name}, the diagram to start with (optional) |
canNew |
show the New button (default true) |
buttons |
[{label, title, run(app)}], extra toolbar buttons |
title(text) |
show the window title (default: document.title) |
dirty(bool) |
unsaved changes appeared or went away (optional) |
theme |
"light", "deep" or "neon" until the user picks one (optional) |
fileHost() in app.js is the default host, plain files on the user's computer.
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