@yuneta/gobj-ui 7.23.83 → 7.23.84

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.
@@ -181,6 +181,21 @@ describe("the radial tree", () => {
181
181
  expect(d).toBeGreaterThan(190);
182
182
  });
183
183
 
184
+ test("a ring clears the ring inside it: a card does not sit on its parent", () => {
185
+ /* One child, straight below its root: `ranksep` alone is a
186
+ * step between CENTRES, so two cards 96 tall 100 apart had
187
+ * 48 + 48 of card and 4 of air. The ring adds the halves. */
188
+ let pos = layout_radial(
189
+ [N("root", 172, 96), N("kid", 172, 96)],
190
+ [{source: "root", target: "kid", rank: 0}],
191
+ {nodesep: 18, ranksep: 100}
192
+ );
193
+ let d = Math.hypot(
194
+ pos.get("kid").x - pos.get("root").x, pos.get("kid").y - pos.get("root").y
195
+ );
196
+ expect(d).toBeGreaterThanOrEqual(48 + 48 + 18);
197
+ });
198
+
184
199
  test("several roots share the circle around an empty centre", () => {
185
200
  let pos = layout_radial(
186
201
  [N("a", 100, 50), N("b", 100, 50), N("c", 100, 50)], [], {ranksep: 100}