mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-20 07:49:43 +02:00
#945 Divider lines for concurrency
This commit is contained in:
@@ -25,6 +25,20 @@ export const drawStartState = g =>
|
||||
.attr('cx', conf.padding + 5)
|
||||
.attr('cy', conf.padding + 5);
|
||||
|
||||
/**
|
||||
* Draws a start state as a black circle
|
||||
*/
|
||||
export const drawDivider = g =>
|
||||
g
|
||||
.append('line')
|
||||
.style('stroke', 'grey')
|
||||
.style('stroke-dasharray', '3')
|
||||
.attr('x1', 10)
|
||||
.attr('class', 'divider')
|
||||
.attr('x2', 20)
|
||||
.attr('y1', 20)
|
||||
.attr('y2', 20);
|
||||
|
||||
/**
|
||||
* Draws a an end state as a black circle
|
||||
*/
|
||||
@@ -276,6 +290,7 @@ export const drawState = function(elem, stateDef, graph, doc) {
|
||||
if (stateDef.type === 'end') drawEndState(g);
|
||||
if (stateDef.type === 'fork' || stateDef.type === 'join') drawForkJoinState(g);
|
||||
if (stateDef.type === 'note') drawNote(stateDef.note.text, g);
|
||||
if (stateDef.type === 'divider') drawDivider(g);
|
||||
if (stateDef.type === 'default' && stateDef.descriptions.length === 0)
|
||||
drawSimpleState(g, stateDef);
|
||||
if (stateDef.type === 'default' && stateDef.descriptions.length > 0) drawDescrState(g, stateDef);
|
||||
|
Reference in New Issue
Block a user