Skip to content

Commit

Permalink
visualiser: Create custom branching name to avoid collision (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewwormald authored Oct 7, 2024
1 parent 45bbba8 commit ec94dac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
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

0 comments on commit ec94dac

Please sign in to comment.