From cca792b2d33479a8550506c639306508abd2ae08 Mon Sep 17 00:00:00 2001 From: Andrija-Sevaljevic Date: Sun, 25 Jan 2026 21:19:04 -0700 Subject: [PATCH 1/2] latex visualization fix --- .../Visualization/svgs/LaTeXGraphSvgReact.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/components/Visualization/svgs/LaTeXGraphSvgReact.js b/components/Visualization/svgs/LaTeXGraphSvgReact.js index b7d7d19..1168267 100644 --- a/components/Visualization/svgs/LaTeXGraphSvgReact.js +++ b/components/Visualization/svgs/LaTeXGraphSvgReact.js @@ -150,7 +150,12 @@ function LaTeXGraphSvgReact({ problemData }) { const weight = link.weighted === true - ? ` node {${escapeLatexText(link.weight)}}` + ? ` node[midway, fill=white, inner sep=2pt] {${escapeLatexText(link.weight)}}` + : ""; + + const loopWeight = + link.weighted === true + ? ` node[fill=white, inner sep=0pt] {${escapeLatexText(link.weight)}}` : ""; if (src === tgt) { @@ -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 && ( From f6eabe4c81bc43d97cf92ebf3a9c5f08aa9e36b6 Mon Sep 17 00:00:00 2001 From: Andrija-Sevaljevic Date: Sun, 25 Jan 2026 21:23:55 -0700 Subject: [PATCH 2/2] fix self loop --- components/Visualization/svgs/LaTeXGraphSvgReact.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/Visualization/svgs/LaTeXGraphSvgReact.js b/components/Visualization/svgs/LaTeXGraphSvgReact.js index 1168267..f191bac 100644 --- a/components/Visualization/svgs/LaTeXGraphSvgReact.js +++ b/components/Visualization/svgs/LaTeXGraphSvgReact.js @@ -155,7 +155,7 @@ function LaTeXGraphSvgReact({ problemData }) { const loopWeight = link.weighted === true - ? ` node[fill=white, inner sep=0pt] {${escapeLatexText(link.weight)}}` + ? ` node {${escapeLatexText(link.weight)}}` : ""; if (src === tgt) {