mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-13 12:29:42 +02:00
#945 Divider lines for concurrency, full width when in a composit state
This commit is contained in:
@@ -36,8 +36,8 @@ export const drawDivider = g =>
|
|||||||
.attr('x1', 10)
|
.attr('x1', 10)
|
||||||
.attr('class', 'divider')
|
.attr('class', 'divider')
|
||||||
.attr('x2', 20)
|
.attr('x2', 20)
|
||||||
.attr('y1', 20)
|
.attr('y1', 0)
|
||||||
.attr('y2', 20);
|
.attr('y2', 0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a an end state as a black circle
|
* Draws a an end state as a black circle
|
||||||
|
@@ -109,9 +109,9 @@ const renderDoc = (doc, diagram, parentId) => {
|
|||||||
if (parentId)
|
if (parentId)
|
||||||
graph.setGraph({
|
graph.setGraph({
|
||||||
rankdir: 'LR',
|
rankdir: 'LR',
|
||||||
multigraph: false,
|
// multigraph: false,
|
||||||
compound: true,
|
compound: true,
|
||||||
acyclicer: 'greedy',
|
// acyclicer: 'greedy',
|
||||||
rankdir: 'LR',
|
rankdir: 'LR',
|
||||||
ranker: 'tight-tree'
|
ranker: 'tight-tree'
|
||||||
// isMultiGraph: false
|
// isMultiGraph: false
|
||||||
@@ -142,6 +142,7 @@ const renderDoc = (doc, diagram, parentId) => {
|
|||||||
console.warn('rendering doc 2', states, relations);
|
console.warn('rendering doc 2', states, relations);
|
||||||
|
|
||||||
total = keys.length;
|
total = keys.length;
|
||||||
|
let first = true;
|
||||||
for (let i = 0; i < keys.length; i++) {
|
for (let i = 0; i < keys.length; i++) {
|
||||||
const stateDef = states[keys[i]];
|
const stateDef = states[keys[i]];
|
||||||
console.warn('keys[i]', keys[i]);
|
console.warn('keys[i]', keys[i]);
|
||||||
@@ -154,11 +155,22 @@ const renderDoc = (doc, diagram, parentId) => {
|
|||||||
.attr('class', 'classGroup');
|
.attr('class', 'classGroup');
|
||||||
node = renderDoc(stateDef.doc, sub, stateDef.id);
|
node = renderDoc(stateDef.doc, sub, stateDef.id);
|
||||||
|
|
||||||
sub = addIdAndBox(sub, stateDef);
|
if (first) {
|
||||||
let boxBounds = sub.node().getBBox();
|
first = false;
|
||||||
node.width = boxBounds.width;
|
sub = addIdAndBox(sub, stateDef);
|
||||||
node.height = boxBounds.height + 10;
|
let boxBounds = sub.node().getBBox();
|
||||||
transformationLog[stateDef.id] = { y: 35 };
|
node.width = boxBounds.width;
|
||||||
|
node.height = boxBounds.height + 10;
|
||||||
|
transformationLog[stateDef.id] = { y: 35 };
|
||||||
|
console.warn('Here2');
|
||||||
|
} else {
|
||||||
|
console.warn('Here');
|
||||||
|
// sub = addIdAndBox(sub, stateDef);
|
||||||
|
let boxBounds = sub.node().getBBox();
|
||||||
|
node.width = boxBounds.width;
|
||||||
|
node.height = boxBounds.height;
|
||||||
|
// transformationLog[stateDef.id] = { y: 35 };
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
node = drawState(diagram, stateDef, graph);
|
node = drawState(diagram, stateDef, graph);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user