From 16ed81f0dbb8619646c115cc1e4c9755519c7153 Mon Sep 17 00:00:00 2001 From: Ethanfel Date: Sat, 28 Feb 2026 00:14:25 +0100 Subject: [PATCH] Fix tiny graph: keep SVG natural size, scroll on overflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stop replacing the SVG's width/height attributes — this was shrinking the graph to fit the container. Instead keep graphviz's native pt dimensions and let the scroll container handle overflow. Co-Authored-By: Claude Opus 4.6 --- tab_timeline_ng.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tab_timeline_ng.py b/tab_timeline_ng.py index 6804461..3d677d0 100644 --- a/tab_timeline_ng.py +++ b/tab_timeline_ng.py @@ -1,5 +1,4 @@ import copy -import re import time from nicegui import ui @@ -428,11 +427,7 @@ def _render_graphviz(dot_source: str, selected_node_id: str | None = None): src = graphviz.Source(dot_source) svg = src.pipe(format='svg').decode('utf-8') - # (a) Responsive SVG sizing — fill container width, remove fixed height - # so the SVG scales proportionally via its viewBox attribute - svg = re.sub(r'\bwidth="[^"]*"', 'width="100%"', svg, count=1) - svg = re.sub(r'\s*height="[^"]*"', '', svg, count=1) - + # (a) Keep SVG at natural size, let scroll container handle overflow container_id = f'graph-{id(dot_source)}' html_content = ( f'