#945 Divider lines for concurrency

This commit is contained in:
Knut Sveidqvist
2019-10-06 15:44:31 +02:00
parent dce09586cd
commit ce0b0fa0c8
5 changed files with 67 additions and 1 deletions

View File

@@ -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);