mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-26 10:49:38 +02:00
MC-1733 Reset layout
This commit is contained in:
@@ -119,30 +119,24 @@
|
||||
A
|
||||
|
||||
S --> T: angrepp
|
||||
T --> U: Apa
|
||||
T --> V: Varg
|
||||
T --> U
|
||||
T --> V
|
||||
C
|
||||
D
|
||||
E
|
||||
|
||||
`;
|
||||
// code = `
|
||||
// stateDiagram
|
||||
// A0
|
||||
// state subbe {
|
||||
// subState
|
||||
// B
|
||||
// }
|
||||
// C
|
||||
// D
|
||||
// E
|
||||
// `;
|
||||
code = `
|
||||
stateDiagram
|
||||
T --> U
|
||||
T --> V
|
||||
`;
|
||||
|
||||
let positions = {
|
||||
nodes: {
|
||||
S: { x: 0, y: 0 },
|
||||
T: { x: 100, y: 100, width: 100, height: 100 },
|
||||
U: { x: 250, y: 160 },
|
||||
U: { x: 250, y: 260 },
|
||||
V: { x: 300, y: 120 },
|
||||
Z: { x: 300, y: 10, width: 160, height: 100 },
|
||||
X: { x: 300, y: 20, width: 80, height: 60 },
|
||||
@@ -167,7 +161,7 @@
|
||||
{ x: 150, y: 120 },
|
||||
{ x: 190.19453144073486, y: 120 },
|
||||
{ x: 190.19453144073486, y: 152.1556251525879 },
|
||||
{ x: 230.38906288146973, y: 152.1556251525879 },
|
||||
{ x: 250, y: 152.1556251525879 },
|
||||
{ x: 250, y: 160 },
|
||||
],
|
||||
},
|
||||
@@ -182,11 +176,55 @@
|
||||
},
|
||||
};
|
||||
|
||||
// positions = {
|
||||
// nodes: {},
|
||||
// edges: {},
|
||||
// };
|
||||
positions = {
|
||||
nodes: {
|
||||
T: {
|
||||
x: 37.964874267578125,
|
||||
y: 24.99908971786499,
|
||||
width: 38.10995101928711,
|
||||
height: 25.998868942260742,
|
||||
},
|
||||
U: {
|
||||
x: 31.61321258544922,
|
||||
y: 85.99644947052002,
|
||||
width: 39.22151184082031,
|
||||
height: 25.998876571655273,
|
||||
},
|
||||
V: {
|
||||
x: 105.83320808410645,
|
||||
y: 85.99644947052002,
|
||||
width: 39.22149658203125,
|
||||
height: 25.998876571655273,
|
||||
},
|
||||
},
|
||||
edges: {
|
||||
edge0: {
|
||||
points: [
|
||||
// { x: 37.61160659790039, y: 24 },
|
||||
{ x: 31.61160659790039, y: 38 },
|
||||
{ x: 31.61160659790039, y: 55.5 },
|
||||
{ x: 31.61160659790039, y: 73 },
|
||||
],
|
||||
},
|
||||
edge1: {
|
||||
points: [
|
||||
// { x: 37.61160659790039, y: 24 },
|
||||
|
||||
{ x: 44.31547546386719, y: 38 },
|
||||
{ x: 44.31547546386719, y: 51.5 },
|
||||
{ x: 45.487048339120996, y: 54.32842712474619 },
|
||||
{ x: 48.31547546386719, y: 55.5 },
|
||||
{ x: 101.83481979370117, y: 55.5 },
|
||||
{ x: 104.66324691844736, y: 56.67157287525381 },
|
||||
{ x: 105.83481979370117, y: 59.5 },
|
||||
{ x: 105.83481979370117, y: 66.25 },
|
||||
{ x: 105.83481979370117, y: 73 },
|
||||
],
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
// console.log('positions:', positions);
|
||||
const { svg } = await mermaid.render('the-id-of-the-svg', code, undefined, positions);
|
||||
if (window?.calcIntersections) {
|
||||
console.log(
|
||||
|
Reference in New Issue
Block a user