Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visualiser: Create custom branching name to avoid collision #40

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions testdata/graph-visualisation.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
```mermaid
---
title: Diagram of example Workflow
title: Workflow diagram of example
---
stateDiagram-v2
direction LR
Expand All @@ -9,10 +9,10 @@ stateDiagram-v2
10: Middle
11: End

state if_state <<choice>>
9 --> if_state
if_state --> 10
if_state --> 11
state 9_branching <<choice>>
9 --> 9_branching
9_branching --> 10
9_branching --> 11

10-->11
```
6 changes: 3 additions & 3 deletions visualiser.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ stateDiagram-v2
{{- end }}
{{ range $key, $value := .Transitions }}
{{- if gt (len $value.To) 1 }}
state if_state <<choice>>
{{$value.From}} --> if_state
state {{$value.From}}_branching <<choice>>
{{$value.From}} --> {{$value.From}}_branching
{{- range $index, $to := $value.To }}
if_state --> {{$to}}
{{$value.From}}_branching --> {{$to}}
{{- end}}
{{ else }}
{{$value.From}}-->{{index $value.To 0}}
Expand Down
Loading