big cmap refactoring

This commit is contained in:
2026-09-03 08:40:15 +02:00
parent f0562a06cc
commit 2c141b6d3f
32 changed files with 5616 additions and 4216 deletions
+7 -3
View File
@@ -88,9 +88,10 @@ test("relations render and hit-test behind concept nodes", async () => {
requestAnimationFrame: (callback) => setImmediate(callback)
};
await import("../static/cmap/cmap.js");
const Cmap = global.window.Cmap;
const map = Cmap(root);
const { DiagramEngine } = await import("../static/cmap/cmap.js");
assert.equal(global.window.Cmap, undefined,
"the ES-module engine does not install a legacy global");
const map = new DiagramEngine(root);
const concept = map.node({ x: 40, y: 0, width: 120, height: 50 });
const otherConcept = map.node({ x: 220, y: 0, width: 120, height: 50 });
const relation = map.link({
@@ -98,6 +99,9 @@ test("relations render and hit-test behind concept nodes", async () => {
cx: 150, cy: 25,
targetX: 360, targetY: 25
});
relation.sourceNode(concept).targetNode(otherConcept).straighten();
assert.equal(relation.sourceNode(), concept);
assert.equal(relation.targetNode(), otherConcept);
await settleRendering();
relation.toFront();