diff --git a/pages/index.html b/pages/index.html index df69995c16..02ef0b5fb4 100644 --- a/pages/index.html +++ b/pages/index.html @@ -1,79 +1,52 @@ + Ethrex Flamegraph Comparison - + - - - - - + + + + + + -
-

Ethrex Flamegraph Comparison

-

Last update: {{LAST_UPDATE}}

-
-
-
-
-

Ethrex

- Download -
-

Time elapsed: {{ETHREX_TIME}}

-
- +
+

Ethrex Flamegraph Comparison

+

Last update: {{LAST_UPDATE}}

+ LEVM Flamegraph Comparison +
+
+
+
+

Ethrex

+ Download +
+

Time elapsed: {{ETHREX_TIME}}

+
+ +
-
-
-
-

Reth

- - Download +
+
+

Reth

+ + Download +
+

Time elapsed: {{RETH_TIME}}

+
+ +
-

Time elapsed: {{RETH_TIME}}

-
- -
-
-
- - + + + diff --git a/pages/levm.html b/pages/levm.html new file mode 100644 index 0000000000..b649b7d263 --- /dev/null +++ b/pages/levm.html @@ -0,0 +1,52 @@ + + + + + + + LEVM Flamegraph Comparison + + + + + + + + + + + + + +
+

LEVM Flamegraph Comparison

+

Last update: {{LAST_UPDATE}}

+ Ethrex Flamegraph Comparison +
+
+
+
+

Ethrex

+ Download +
+

Time elapsed: {{LEVM_TIME}}

+
+ +
+
+
+
+

Reth

+ + Download +
+

Time elapsed: {{REVM_TIME}}

+
+ +
+
+
+ + + + diff --git a/pages/script.js b/pages/script.js new file mode 100644 index 0000000000..f62d2c19c6 --- /dev/null +++ b/pages/script.js @@ -0,0 +1,26 @@ +function adjustViewBox(objectId) { + const object = document.getElementById(objectId); + object.addEventListener('load', () => { + const svgDocument = object.contentDocument; + const svgElement = svgDocument?.querySelector('svg'); + if (svgElement) { + // Remove explicit width and height attributes to allow scaling + svgElement.removeAttribute('width'); + svgElement.removeAttribute('height'); + // Ensure the aspect ratio is preserved during scaling + svgElement.setAttribute('preserveAspectRatio', 'xMidYMid meet'); + + // Get the current viewBox or calculate a new one based on the bounding box + const bbox = svgElement.getBBox(); + svgElement.setAttribute( + 'viewBox', + `${bbox.x} ${bbox.y} ${bbox.width} ${bbox.height}` + ); + } else { + console.warn(`SVG element not found in object with ID: ${objectId}`); + } + }); +} + +adjustViewBox('svg1'); +adjustViewBox('svg2');