diff --git a/components/Visualization/svgs/LaTeXGraphSvgReact.js b/components/Visualization/svgs/LaTeXGraphSvgReact.js index b7d7d19..f191bac 100644 --- a/components/Visualization/svgs/LaTeXGraphSvgReact.js +++ b/components/Visualization/svgs/LaTeXGraphSvgReact.js @@ -149,6 +149,11 @@ function LaTeXGraphSvgReact({ problemData }) { const style = link.dashed === true ? "dashed" : ""; const weight = + link.weighted === true + ? ` node[midway, fill=white, inner sep=2pt] {${escapeLatexText(link.weight)}}` + : ""; + + const loopWeight = link.weighted === true ? ` node {${escapeLatexText(link.weight)}}` : ""; @@ -179,7 +184,7 @@ function LaTeXGraphSvgReact({ problemData }) { edgeDefs += ` \\path[draw=${color},very thick,>={Stealth[black]}] ` + - `(${src}) edge[${arrow},loop ${side}${style ? "," + style : ""}]${weight} (${src});\n`; + `(${src}) edge[${arrow},loop ${side}${style ? "," + style : ""}]${loopWeight} (${src});\n`; return; } @@ -225,9 +230,9 @@ function LaTeXGraphSvgReact({ problemData }) {
{!loading && (