Skip to content

Commit 58fea76

Browse files
Merge pull request #102 from ClickHouse/horizon-charts
Horizon charts
2 parents b75f641 + 4c8b68f commit 58fea76

File tree

1 file changed

+39
-4
lines changed

1 file changed

+39
-4
lines changed

index.html

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727

2828
--summary-every-other-row-color: #F8F8F8;
2929
--highlight-color: #EEE;
30+
31+
--bar-color1: oklch(calc(0.9 - 0.6) 0.1 calc(90 - 60));
32+
--bar-color2: oklch(calc(0.9 - 0.4) 0.1 calc(90 - 40));
33+
--bar-color3: oklch(calc(0.9 - 0.1) 0.1 calc(90 - 20));
34+
--bar-color4: oklch(0.9 0.1 90);
35+
3036
--bar-color: #FFCB80;
3137
--fake-bar-color: #CCC;
3238

@@ -54,6 +60,12 @@
5460

5561
--summary-every-other-row-color: #042e41;
5662
--highlight-color: #064663;
63+
64+
--bar-color1: oklch(calc(0.4 + 0.6) 0.1 calc(250 - 180));
65+
--bar-color2: oklch(calc(0.4 + 0.4) 0.1 calc(250 - 120));
66+
--bar-color3: oklch(calc(0.4 + 0.2) 0.1 calc(250 - 60));
67+
--bar-color4: oklch(0.4 0.1 250);
68+
5769
--bar-color: #088;
5870
--fake-bar-color: #666;
5971

@@ -155,8 +167,7 @@
155167

156168
.summary-bar {
157169
height: 1rem;
158-
background: var(--bar-color);
159-
border-radius: 0 0.2rem 0.2rem 0;
170+
width: 100%;
160171
}
161172

162173
.summary-bar-fake {
@@ -287,6 +298,12 @@
287298
transform: translate(1px, 1px);
288299
filter: brightness(125%);
289300
}
301+
302+
#scale_hint {
303+
font-weight: normal;
304+
font-size: 80%;
305+
filter: contrast(10%);
306+
}
290307
</style>
291308
<script type="text/javascript">
292309

@@ -430,7 +447,8 @@ <h1>JSONBench — a Benchmark For Data Analytics On JSON</h1>
430447
System
431448
</th>
432449
<th colspan="2">
433-
<span id="metric-title">Relative time (lower is better)</span>
450+
<span id="metric-title">Relative time (lower is better)</span>.<br/>
451+
<span id="scale_hint"></span>
434452
</th>
435453
</tr>
436454
</thead>
@@ -739,7 +757,21 @@ <h2>Detailed Comparison</h2>
739757
let bar = document.createElement('div');
740758

741759
bar.className = elem.fake ? `summary-bar-fake` : `summary-bar`;
742-
bar.style.width = `${percentage}%`;
760+
if (elem.fake) {
761+
bar.style.width = `${percentage}%`;
762+
} else {
763+
bar.style.background = `linear-gradient(to right,
764+
var(--bar-color1) 0%,
765+
var(--bar-color1) ${Math.min(100, percentage)}%,
766+
var(--bar-color2) ${Math.min(100, percentage)}%,
767+
var(--bar-color2) ${Math.min(100, percentage * 10)}%,
768+
var(--bar-color3) ${Math.min(100, percentage * 10)}%,
769+
var(--bar-color3) ${Math.min(100, percentage * 100)}%,
770+
var(--bar-color4) ${Math.min(100, percentage * 100)}%,
771+
var(--bar-color4) ${Math.min(100, percentage * 1000)}%,
772+
transparent ${Math.min(100, percentage * 1000)}%,
773+
transparent 100%)`;
774+
}
743775

744776
td_bar.appendChild(bar);
745777

@@ -950,6 +982,9 @@ <h2>Detailed Comparison</h2>
950982

951983
details_body.appendChild(tr);
952984
}
985+
986+
/// The small hint below column heading "Relative time (lower is better)"
987+
document.getElementById("scale_hint").textContent = 'Different colors on the bar chart represent the same values shown at different scales (1x, 10x, 100x zoom)';
953988
}
954989

955990
function updateHistory() {

0 commit comments

Comments
 (0)