mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
Merge remote-tracking branch 'os_repo/5237-unified-layout-common-renderer' into alanaV11
This commit is contained in:
@@ -96,7 +96,7 @@ end
|
|||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
flowchart LR
|
flowchart RL
|
||||||
subgraph Apa["Apa"]
|
subgraph Apa["Apa"]
|
||||||
subgraph Gorilla
|
subgraph Gorilla
|
||||||
A["Start"]
|
A["Start"]
|
||||||
@@ -211,12 +211,12 @@ flowchart
|
|||||||
if_state --> True : if n >= 0
|
if_state --> True : if n >= 0
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"layout": "dagre", "mergeEdges": true} }%%
|
%%{init: {"layout": "dagre", "mergeEdges": true} }%%
|
||||||
stateDiagram
|
stateDiagram
|
||||||
direction TB
|
direction TB
|
||||||
State T1 {
|
State T1 {
|
||||||
T11 --> T12
|
T12--> T11
|
||||||
}
|
}
|
||||||
T1 --> T2
|
T1 --> T2
|
||||||
T11 --> T2
|
T11 --> T2
|
||||||
@@ -232,16 +232,17 @@ State T1 {
|
|||||||
}
|
}
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"layout": "elk", "mergeEdges": true} }%%
|
%%{init: {"layouts": "elk2", "mergeEdges": true} }%%
|
||||||
stateDiagram
|
stateDiagram
|
||||||
direction TB
|
State S1 {
|
||||||
State T1 {
|
direction TB
|
||||||
T11
|
S11
|
||||||
}
|
}
|
||||||
|
S1 --> S2
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"layout": "elk", "mergeEdges": true} }%%
|
%%{init: {"layout": "elk", "mergeEdges": true} }%%
|
||||||
stateDiagram
|
stateDiagram
|
||||||
State T1 {
|
State T1 {
|
||||||
@@ -251,7 +252,7 @@ State T1 {
|
|||||||
}
|
}
|
||||||
</pre
|
</pre
|
||||||
>
|
>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid">
|
||||||
%%{init: {"layout": "elk", "mergeEdges": true} }%%
|
%%{init: {"layout": "elk", "mergeEdges": true} }%%
|
||||||
stateDiagram
|
stateDiagram
|
||||||
[*] --> T1
|
[*] --> T1
|
||||||
@@ -305,7 +306,7 @@ stateDiagram-v2
|
|||||||
// handdrawnSeed: 12,
|
// handdrawnSeed: 12,
|
||||||
// look: 'handdrawn',
|
// look: 'handdrawn',
|
||||||
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
|
// 'elk.nodePlacement.strategy': 'NETWORK_SIMPLEX',
|
||||||
// layout: 'dagre',
|
layout: 'dagre',
|
||||||
// layout: 'elk',
|
// layout: 'elk',
|
||||||
// layout: 'fixed',
|
// layout: 'fixed',
|
||||||
// htmlLabels: false,
|
// htmlLabels: false,
|
||||||
|
@@ -162,7 +162,7 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit
|
|||||||
node.x -= 8;
|
node.x -= 8;
|
||||||
|
|
||||||
log.info(
|
log.info(
|
||||||
'A tainted cluster node XBX',
|
'A pure cluster node XBX',
|
||||||
v,
|
v,
|
||||||
node.id,
|
node.id,
|
||||||
node.width,
|
node.width,
|
||||||
@@ -188,7 +188,7 @@ const recursiveRender = async (_elem, graph, diagramType, id, parentCluster, sit
|
|||||||
|
|
||||||
// A cluster in the non-recursive way
|
// A cluster in the non-recursive way
|
||||||
log.info(
|
log.info(
|
||||||
'A pure cluster node with children XBX',
|
'A tainted cluster node with children XBX',
|
||||||
v,
|
v,
|
||||||
node.id,
|
node.id,
|
||||||
node.width,
|
node.width,
|
||||||
|
@@ -273,7 +273,6 @@ export const intersection = (node, outsidePoint, insidePoint) => {
|
|||||||
// log.warn();
|
// log.warn();
|
||||||
if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
|
if (Math.abs(y - outsidePoint.y) * w > Math.abs(x - outsidePoint.x) * h) {
|
||||||
// Intersection is top or bottom of rect.
|
// Intersection is top or bottom of rect.
|
||||||
// let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
|
||||||
let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
let q = insidePoint.y < outsidePoint.y ? outsidePoint.y - h - y : y - h - outsidePoint.y;
|
||||||
r = (R * q) / Q;
|
r = (R * q) / Q;
|
||||||
const res = {
|
const res = {
|
||||||
@@ -281,10 +280,10 @@ export const intersection = (node, outsidePoint, insidePoint) => {
|
|||||||
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q,
|
y: insidePoint.y < outsidePoint.y ? insidePoint.y + Q - q : insidePoint.y - Q + q,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (r === 0) {
|
// if (r === 0) {
|
||||||
res.x = outsidePoint.x;
|
// res.x = outsidePoint.x;
|
||||||
res.y = outsidePoint.y;
|
// res.y = outsidePoint.y;
|
||||||
}
|
// }
|
||||||
if (R === 0) {
|
if (R === 0) {
|
||||||
res.x = outsidePoint.x;
|
res.x = outsidePoint.x;
|
||||||
}
|
}
|
||||||
@@ -292,7 +291,7 @@ export const intersection = (node, outsidePoint, insidePoint) => {
|
|||||||
res.y = outsidePoint.y;
|
res.y = outsidePoint.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
log.warn(`abc89 top/bot calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res);
|
log.warn(`abc89 top/bot calc, Q ${Q}, q ${q}, R ${R}, r ${r}`, res, 'apa');
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
} else {
|
} else {
|
||||||
@@ -347,7 +346,7 @@ const cutPathAtIntersect = (_points, boundaryNode) => {
|
|||||||
// Calc the intersection coord between the point anf the last point outside the rect
|
// Calc the intersection coord between the point anf the last point outside the rect
|
||||||
const inter = intersection(boundaryNode, lastPointOutside, point);
|
const inter = intersection(boundaryNode, lastPointOutside, point);
|
||||||
log.warn('abc88 inside', point, lastPointOutside, inter);
|
log.warn('abc88 inside', point, lastPointOutside, inter);
|
||||||
log.warn('abc88 intersection', inter);
|
log.warn('abc88 intersection', inter, boundaryNode);
|
||||||
|
|
||||||
// // Check case where the intersection is the same as the last point
|
// // Check case where the intersection is the same as the last point
|
||||||
let pointPresent = false;
|
let pointPresent = false;
|
||||||
|
Reference in New Issue
Block a user