Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a4f8b7
commit fbe88ef
Showing
6 changed files
with
969 additions
and
557 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<meta http-equiv="X-UA-Compatible" /> | ||
<script src="https://cdn.jsdelivr.net/npm/chart.js@2.8.0/dist/Chart.min.js"></script> | ||
<style> | ||
.wrapper { | ||
display: flex; | ||
flex: wrap; | ||
order: row; | ||
} | ||
</style> | ||
<title>Example</title> | ||
</head> | ||
<body> | ||
<div style="max-width: 800px"> | ||
<canvas id="chart1613239320153" width="16" height="9"></canvas> | ||
</div> | ||
<script> | ||
const format = (num) => { | ||
const chunked = []; | ||
String(num) | ||
.split("") | ||
.reverse() | ||
.forEach((char, index) => { | ||
if (index % 3 === 0) { | ||
chunked.unshift([char]); | ||
} else { | ||
chunked[0].unshift(char); | ||
} | ||
}); | ||
|
||
return chunked.map((chunk) => chunk.join("")).join(" "); | ||
}; | ||
const ctx1613239320153 = document | ||
.getElementById("chart1613239320153") | ||
.getContext("2d"); | ||
const chart1613239320153 = new Chart(ctx1613239320153, { | ||
type: "bar", | ||
data: { | ||
labels: ["Reduce two elements", "Reduce five elements"], | ||
datasets: [ | ||
{ | ||
data: [214117916, 192837271], | ||
backgroundColor: [ | ||
"rgba(63, 142, 252, 0.8)", | ||
"rgba(116, 165, 127, 0.8)", | ||
], | ||
borderColor: ["rgba(63, 142, 252, 1)", "rgba(116, 165, 127, 1)"], | ||
borderWidth: 1, | ||
}, | ||
], | ||
}, | ||
options: { | ||
legend: { | ||
display: false, | ||
}, | ||
title: { | ||
display: true, | ||
text: "Example", | ||
fontSize: 16, | ||
padding: 20, | ||
}, | ||
tooltips: { | ||
callbacks: { | ||
label: (tooltipItem) => { | ||
return format(tooltipItem.yLabel) + " ops/s"; | ||
}, | ||
}, | ||
}, | ||
scales: { | ||
yAxes: [ | ||
{ | ||
gridLines: { | ||
color: "rgba(127, 127, 127, 0.2)", | ||
}, | ||
scaleLabel: { | ||
display: true, | ||
labelString: "Operations per second", | ||
}, | ||
ticks: { | ||
beginAtZero: true, | ||
callback: format, | ||
}, | ||
}, | ||
], | ||
xAxes: [ | ||
{ | ||
gridLines: { | ||
color: "rgba(127, 127, 127, 0.2)", | ||
}, | ||
maxBarThickness: 150, | ||
}, | ||
], | ||
}, | ||
}, | ||
}); | ||
</script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"name": "Example", | ||
"date": "2021-02-13T18:02:00.153Z", | ||
"version": "1.0.0", | ||
"results": [ | ||
{ | ||
"name": "Reduce two elements", | ||
"ops": 214117916, | ||
"margin": 0.29, | ||
"percentSlower": 0 | ||
}, | ||
{ | ||
"name": "Reduce five elements", | ||
"ops": 192837271, | ||
"margin": 0.78, | ||
"percentSlower": 9.94 | ||
} | ||
], | ||
"fastest": { | ||
"name": "Reduce two elements", | ||
"index": 0 | ||
}, | ||
"slowest": { | ||
"name": "Reduce five elements", | ||
"index": 1 | ||
} | ||
} |
Oops, something went wrong.