Fix timeline graph height: remove invalid SVG height="auto"
Drop the fixed height attribute entirely instead of setting it to "auto", which SVGs don't support. The viewBox attribute handles proportional scaling when only width="100%" is set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -428,9 +428,10 @@ 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 — replace fixed width/height with 100%
|
||||
# (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'\bheight="[^"]*"', 'height="auto"', svg, count=1)
|
||||
svg = re.sub(r'\s*height="[^"]*"', '', svg, count=1)
|
||||
|
||||
container_id = f'graph-{id(dot_source)}'
|
||||
html_content = (
|
||||
|
||||
Reference in New Issue
Block a user