-
Notifications
You must be signed in to change notification settings - Fork 22
Closed
Description
The mermaid exporter crashes when there's a shape attribute on a node.
This is due to this code: https://github.com/emicklei/dot/blob/master/mermaid.go#L82-L84
Which expect the shape attribute to be of type shape where it can not be. This type is always string.
This can be easily reproduced with:
graph := dot.NewGraph(dot.Directed)
graph.Node("A").Box()
graph.Edge(graph.Node("A"), graph.Node("B"))
fmt.Println(dot.MermaidGraph(graph, dot.MermaidTopDown))
Which causes the following error:
panic: interface conversion: interface {} is string, not dot.shape
goroutine 1 [running]:
github.com/emicklei/dot.diagramGraph(0xc0000a8000, 0xc00007e020)
/home/john/gocode/pkg/mod/github.com/emicklei/[email protected]/mermaid.go:83 +0xb94
github.com/emicklei/dot.diagram(0xc0000a8000, {0x4bd97a, 0x5}, 0x1)
/home/john/gocode/pkg/mod/github.com/emicklei/[email protected]/mermaid.go:67 +0x545
github.com/emicklei/dot.MermaidGraph(...)
/home/john/gocode/pkg/mod/github.com/emicklei/[email protected]/mermaid.go:39
main.main()
/home/john/Documents/dotbug/test.go:14 +0x3b9
exit status 2
Metadata
Metadata
Assignees
Labels
No labels