@ankhorage/zora 26.0.0 → 26.0.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.
@@ -1,18 +1,24 @@
1
1
  import type { Core } from 'cytoscape';
2
2
 
3
3
  /***
4
- * Identifies layout-relevant leaf dimensions without including positions or presentation colors.
5
- * Adding viewport, color or arbitrary data to this key turns interaction updates into relayouts.
6
- * Measure after style reconciliation; actual size changes still require layout. Compound bounds
7
- * follow child positions, so keying their measured bounds would feed layout output back into input.
8
- * Styled geometry tests and runtime interaction tests protect these distinctions.
4
+ * Identifies layout-relevant leaf dimensions without including positions or paint-only outlines.
5
+ * Cytoscape's layoutDimensions() includes selected-outline rendering even though layouts use only
6
+ * the node body, padding, border, and label bounds. Key those direct inputs instead. Compound
7
+ * bounds follow child positions, so keying their measured bounds would feed layout output back
8
+ * into input. Styled geometry tests and runtime interaction tests protect these distinctions.
9
9
  */
10
10
  export function getGraphGeometryKey(cy: Core): string {
11
11
  return JSON.stringify(
12
12
  cy.nodes().map((node) => {
13
13
  if (node.isParent()) return [node.id()];
14
- const dimensions = node.layoutDimensions({ nodeDimensionsIncludeLabels: true });
15
- return [node.id(), dimensions.w, dimensions.h];
14
+ const labelBounds = node.boundingBox({
15
+ includeEdges: false,
16
+ includeLabels: true,
17
+ includeNodes: false,
18
+ includeOverlays: false,
19
+ includeUnderlays: false,
20
+ });
21
+ return [node.id(), node.outerWidth(), node.outerHeight(), labelBounds.w, labelBounds.h];
16
22
  }),
17
23
  );
18
24
  }