diff --git a/aocsync.py b/aocsync.py index 0f70dee..efe6605 100755 --- a/aocsync.py +++ b/aocsync.py @@ -931,8 +931,9 @@ class HTMLGenerator: if len(data_points) < 2: return "" - # Graph dimensions - width = 600 + # Graph dimensions - make responsive to fit in modal + # Modal has max-width 600px with 20px padding, so max SVG width should be ~560px + width = 560 height = 200 padding = 40 graph_width = width - 2 * padding @@ -961,9 +962,9 @@ class HTMLGenerator: else: return f"{ns}ns" - # Generate SVG + # Generate SVG - make it responsive svg_parts = [] - svg_parts.append(f'') + svg_parts.append(f'') # Draw axes svg_parts.append(f'') # Y-axis @@ -1387,6 +1388,15 @@ class HTMLGenerator: padding: 10px; background: white; border-radius: 4px; + overflow-x: auto; + overflow-y: visible; + }} + + .history-graph svg {{ + display: block; + width: 100%; + max-width: 100%; + height: auto; }} .compact-commits {{