订单状态机. Copy the source, paste into the official playground, done. No coordinates — every position is stated relative to something else.
node new "NEW"
node paid "PAID" below new
node shipped "SHIPPED" below paid
node done "DONE" below shipped
node cancel "CANCELLED" right of paid
edge new -> paid
edge paid -> shipped
edge shipped -> done
edge new -> cancel
edge paid -> cancelnpx reladraw state-machine.reladraw -o out.svgAn order state machine: NEW → PAID → SHIPPED → DONE, with CANCELLED reachable from both NEW and PAID. Use it to pin down lifecycle rules before coding them, and to debug the famous question: which states allow cancellation?
node refund "REFUNDED" below cancel and edge cancel -> refund.edge shipped -> done "on delivery confirmation".edge new -> cancel "after 24h silent" — guard conditions belong in labels.States are nodes, transitions are directed edges with their event or guard as the label. Place the initial state at top and the terminal states at the bottom — this order template follows exactly that convention.
Convention: the first-declared node (nothing above it) is the start; label terminal states in caps or add a filled node labeled END. A small legend line in the diagram title removes any ambiguity.
Draw the shared edge from each state — repetition is honest. If three or more states share one exit, consider whether it is really a common error state and draw that state once.