Skip to content

Commit

Permalink
feat: Improve graph visualization responsiveness and browser window fit
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Nov 30, 2024
1 parent 46565b7 commit c2bd0b8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions hugo-site/static/html/eventual_convergence_viz.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -60,8 +71,8 @@ <h1 class="title">Freenet Eventual Convergence Simulation</h1>

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()
Expand Down

0 comments on commit c2bd0b8

Please sign in to comment.