Alana version 11.0.2-b.5, Updated calcIntersections allowing mouse coordinates

This commit is contained in:
Knut Sveidqvist
2024-08-28 11:45:20 +02:00
parent 9c2d7b1dad
commit 62f887b3c3
3 changed files with 28 additions and 14 deletions

View File

@@ -188,12 +188,15 @@
// };
const { svg } = await mermaid.render('the-id-of-the-svg', code, undefined, positions);
// if (window?.calcIntersections) {
// console.log('Intersections', window.calcIntersections(positions, 'T', 'U'));
// } else {
// console.error('calcIntersections not found');
// }
console.log(JSON.stringify(positions));
if (window?.calcIntersections) {
console.log(
'Intersections',
calcIntersections('T', undefined, positions.nodes['T'], { x: 200, y: 200 })
);
} else {
console.error('calcIntersections not found');
}
// console.log(JSON.stringify(positions));
const elem = document.querySelector('#diagram');
elem.innerHTML = svg;
</script>