big cmap refactoring
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user