diff --git a/src/diagrams/state/shapes.js b/src/diagrams/state/shapes.js index dc3754de8..718deb2fa 100644 --- a/src/diagrams/state/shapes.js +++ b/src/diagrams/state/shapes.js @@ -36,8 +36,8 @@ export const drawDivider = g => .attr('x1', 10) .attr('class', 'divider') .attr('x2', 20) - .attr('y1', 20) - .attr('y2', 20); + .attr('y1', 0) + .attr('y2', 0); /** * Draws a an end state as a black circle diff --git a/src/diagrams/state/stateRenderer.js b/src/diagrams/state/stateRenderer.js index 23fa0c778..8276c36ca 100644 --- a/src/diagrams/state/stateRenderer.js +++ b/src/diagrams/state/stateRenderer.js @@ -109,9 +109,9 @@ const renderDoc = (doc, diagram, parentId) => { if (parentId) graph.setGraph({ rankdir: 'LR', - multigraph: false, + // multigraph: false, compound: true, - acyclicer: 'greedy', + // acyclicer: 'greedy', rankdir: 'LR', ranker: 'tight-tree' // isMultiGraph: false @@ -142,6 +142,7 @@ const renderDoc = (doc, diagram, parentId) => { console.warn('rendering doc 2', states, relations); total = keys.length; + let first = true; for (let i = 0; i < keys.length; i++) { const stateDef = states[keys[i]]; console.warn('keys[i]', keys[i]); @@ -154,11 +155,22 @@ const renderDoc = (doc, diagram, parentId) => { .attr('class', 'classGroup'); node = renderDoc(stateDef.doc, sub, stateDef.id); - sub = addIdAndBox(sub, stateDef); - let boxBounds = sub.node().getBBox(); - node.width = boxBounds.width; - node.height = boxBounds.height + 10; - transformationLog[stateDef.id] = { y: 35 }; + if (first) { + first = false; + sub = addIdAndBox(sub, stateDef); + let boxBounds = sub.node().getBBox(); + 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 { node = drawState(diagram, stateDef, graph); }