Skip to content

Commit

Permalink
Merge pull request #88 from ethpandaops/skylenet/fix-performance-many…
Browse files Browse the repository at this point in the history
…-clients

clients pages: disable animations when many nodes
  • Loading branch information
skylenet authored Aug 7, 2024
2 parents beddef0 + ee24f3a commit 818643d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions templates/clients/clients_cl.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,12 @@ <h2 class="accordion-header">
data.nodes[i].title = data.nodes[i].id;
}
var options = $_network.defaultOptions;

// Performance improvements. Less animations
if (data.nodes.length >= 20) {
options.physics.stabilization = true
}

var network = new vis.Network(container, data, options);

sleep(1000).then(() => {
Expand Down
6 changes: 6 additions & 0 deletions templates/clients/clients_el.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,12 @@ <h2 class="accordion-header">
data.nodes[i].title = data.nodes[i].id;
}
var options = $_network.defaultOptions;

// Performance improvements. Less animations
if (data.nodes.length >= 20) {
options.physics.stabilization = true
}

var network = new vis.Network(container, data, options);

sleep(1000).then(() => {
Expand Down

0 comments on commit 818643d

Please sign in to comment.