From c2bd0b8024679a223c47c0c2d52d33f949e9566f Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Sat, 30 Nov 2024 09:43:42 -0500 Subject: [PATCH] feat: Improve graph visualization responsiveness and browser window fit --- .../static/html/eventual_convergence_viz.html | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hugo-site/static/html/eventual_convergence_viz.html b/hugo-site/static/html/eventual_convergence_viz.html index 379f5f83..7492e0b6 100644 --- a/hugo-site/static/html/eventual_convergence_viz.html +++ b/hugo-site/static/html/eventual_convergence_viz.html @@ -23,6 +23,17 @@ .message { r: 5; } + svg { + display: block; + margin: 0 auto; + max-width: 100%; + height: auto; + } + .container { + padding: 1rem; + max-width: 100%; + overflow-x: hidden; + } @@ -60,8 +71,8 @@

Freenet Eventual Convergence Simulation

let randomTreeData = generateRandomTree(80); - const width = 1200; - const height = 1000; + const width = Math.min(window.innerWidth - 40, 1200); + const height = Math.min(window.innerHeight - 200, 800); const root = d3 .stratify()