Fixes Graphviz Visualizer

This commit is contained in:
Henning Dieterichs
2020-02-13 16:54:23 +01:00
parent c127306f47
commit 5acf4e11b6

View File

@@ -44,14 +44,16 @@ export class GraphvizGraphViewer extends React.Component<{
const dotContent = `
digraph MyGraph {
${nodes
.map(n => `${n.id} [ label = ${JSON.stringify(n.label)} ];`)
.map(
n => `"${n.id}" [ label = ${JSON.stringify(n.label)} ];`
)
.join("\n ")}
${edges
.map(
e =>
`${e.from} -> ${e.to} [ label = ${JSON.stringify(
e.label
)} ];`
`"${e.from}" -> "${
e.to
}" [ label = ${JSON.stringify(e.label)} ];`
)
.join("\n")}
}