A browser tool for sketching qualitative phase portraits of planar flows, the kind drawn in a dynamical systems course. You draw trajectories, equilibria, periodic orbits and inflow/outflow boundaries by hand, as Bézier curves. The tool keeps the picture topologically consistent: trajectories must not cross, attachments must respect the direction of the flow, and so on.
index.html in Chrome, Edge, Firefox or Safari. It works offline from disk.*.phase.json, a plain JSON description of the drawing..tex), and PDF via the browser's print dialog.| Tool | Key | What it does |
|---|---|---|
| Select / edit | V | Click or drag a rectangle to select; Shift adds to the selection. Drag to move. Corner handles scale uniformly (Shift: free, Alt: about the centre), edge handles stretch one direction, the round handle on top rotates (Shift: 15° steps). |
| Pan | H | Drag to pan. Space+drag or the middle mouse button also pans. |
| Trajectory (freehand) | T | Draw in the direction of the flow. The stroke is smoothed and converted to cubic Béziers. Ends snap to targets (see Magnet). If an end only fits the other way round, the trajectory is reversed automatically. |
| Bézier pen | P | Click for corner points; click-drag to pull out smooth handles. Enter or double-click finishes, Esc cancels. |
| Sink | 1 | Filled disc. Can be shown as a focus (cw/ccw spiral). |
| Source | 2 | Open disc. Can be shown as a focus. |
| Saddle | 3 | Has 4 terminals: two unstable separatrices (pointing out) and two stable ones (pointing in). Drag the diamond handles to rotate it or to change the angle between its eigendirections. |
| Saddle-node | 4 | Codimension 1, only when Structurally stable is off. Transversally stable or unstable. Half-filled disc on the node side, with three separatrix terminals plus the node sector. |
| Periodic orbit | C | Click for an ellipse, or draw a closed loop. Stable = solid, unstable = dashed. Semi-stable (codim 1) = solid with a dashed shadow on the repelling side. Arrows show the orientation. |
| Boundary | B | A transversal the flow crosses in one direction only, shown by small crossing arrows. A closed loop is created as an inflow boundary (trapping region); flip it in the panel. |
| Label | L | Click to place text. Inside $…$: _ gives a subscript, ^ a superscript, and \alpha, \Gamma, … give Greek letters. TikZ receives the text verbatim. |
Alt-drag a handle to break smoothness.Del to remove it.S or panel button): smooths the selected curve(s) and refits them with about 30% fewer nodes. Press repeatedly to straighten wobbly hand-drawn curves. The smoothing applied to freehand strokes (low/medium/high) is set in the right panel when nothing is selected.Del deletes.Ctrl+D duplicates. A duplicate is never refused, so you can drag the copy into place.R reverses a trajectory or orbit, or flips a boundary.Ctrl+A selects all; arrow keys nudge.Ctrl+Z / Ctrl+Shift+Z undo and redo.Esc goes back to Select.+/− zoom and 0 fits the drawing.A trajectory end within about 14 screen pixels of one of these targets snaps to it:
The ring is green for a valid target and red for an invalid one; the status bar says why.
The Consistency panel lists:
Refuse crossings (off by default): when on, an edit that introduces a new problem is undone, the offending spot flashes red and the status bar gives the reason. When off, problems are only flagged.
Structurally stable (on by default):
Ctrl+S) keeps writing to the same file. Safari and Firefox do not give web pages this ability, so there files go to the Downloads folder..phase.json file can be dropped onto the drawing area to open it..tex)\usepackage{tikz} and \usetikzlibrary{arrows.meta,decorations.markings}. 50 px of drawing = 1 cm; change the x/y options of the tikzpicture to rescale.index.html – the application (HTML + CSS + JavaScript, no dependencies).README.md – this help.PLAN.md – specification, design decisions and implementation notes, sufficient to regenerate or extend the tool.