@weasel-js/diagram 1.5.0 → 1.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +32 -0
- package/dist/chunk-AD7TY6TK.js +862 -0
- package/dist/chunk-AD7TY6TK.js.map +1 -0
- package/dist/index.d.ts +12 -749
- package/dist/index.js +17 -883
- package/dist/index.js.map +1 -1
- package/dist/layout.d.ts +3 -0
- package/dist/layout.entry-C0twMfuH.d.ts +752 -0
- package/dist/layout.js +3 -0
- package/dist/layout.js.map +1 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -92,6 +92,38 @@ nodes already sit, and a node carrying `pinned: true` that nothing moves.
|
|
|
92
92
|
`force` is the exception to the second half of that: it is an iterative
|
|
93
93
|
relaxation seeded from the current positions, so re-running it keeps relaxing.
|
|
94
94
|
|
|
95
|
+
## Design notes
|
|
96
|
+
|
|
97
|
+
Five decisions the code cannot explain on its own.
|
|
98
|
+
|
|
99
|
+
**`dependsOn: 'children'` is deliberately absent from the reverse dependents
|
|
100
|
+
index.** Deleting a node deletes everything that names it in `dependsOn`, and a
|
|
101
|
+
container must *not* be deleted when a child goes — an emptied group is still a
|
|
102
|
+
group. That asymmetry is why a `'children'` container is invalidated by an
|
|
103
|
+
ancestor walk instead. Registering it would "fix" the inconsistency and delete
|
|
104
|
+
your groups.
|
|
105
|
+
|
|
106
|
+
**Ports live on the bounds and are cast onto the outline when read.** The
|
|
107
|
+
anchor stays normalized against the bounds because that is what survives a
|
|
108
|
+
resize; `rayHit` moves it onto the shape. Don't store outline-relative anchors.
|
|
109
|
+
|
|
110
|
+
**Connect declines in two different places on purpose.** Which presses start a
|
|
111
|
+
connect is routing, and lives in the binding's `target`. Which ports a live
|
|
112
|
+
connect may land on cannot be routing — the dispatcher never re-reads the
|
|
113
|
+
affordance under a moving pointer — so `canConnect` filters the candidate set
|
|
114
|
+
instead. Neither is an action body inspecting a hit and bailing.
|
|
115
|
+
|
|
116
|
+
**A live run does not re-anchor; the one-shot layouts do.** The anchor
|
|
117
|
+
translation keeps a single 300-tick jump from moving the diagram off where the
|
|
118
|
+
author left it. A live run cannot jump, and re-anchoring per frame would fight
|
|
119
|
+
a drag — the anchor is measured from where the nodes were, and a pinned node is
|
|
120
|
+
deliberately somewhere else.
|
|
121
|
+
|
|
122
|
+
**A pose run's frame is the whole picture, not a delta.** An id a producer
|
|
123
|
+
omits stops being published, which is what releases a node the moment a gesture
|
|
124
|
+
takes it. It is why the layout producers drop a pinned participant's whole
|
|
125
|
+
subtree from the frame rather than only the participant.
|
|
126
|
+
|
|
95
127
|
## License
|
|
96
128
|
|
|
97
129
|
MIT
|