Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 2e085cd

Browse files
committed
small bugfixes
1 parent 439892b commit 2e085cd

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

samples/datalimits.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Box Plot Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

samples/horizontal.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Horizontal Bar Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

samples/logarithm.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Box Plot Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

samples/minmax.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Box Plot Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

samples/vertical.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Box Plot Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

samples/violin.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<title>Violin Chart</title>
66
<script src="../node_modules/chart.js/dist/Chart.bundle.js"></script>
77
<script src="../build/Chart.BoxPlot.js" type="text/javascript"></script>
8-
<script src="https://unpkg.com/d3-random"></script>
8+
<script src="https://unpkg.com/d3-random@latest/dist/d3-random.js"></script>
99
<script src="./utils.js"></script>
1010
<style>
1111
canvas {

src/data.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import quantiles from '@sgratzl/science/src/stats/quantiles';
44
import kde from '@sgratzl/science/src/stats/kde';
55

66
function extent(arr) {
7-
return arr.reduce((acc, v) => [Math.min(acc[0], v), Math.max(acc[1], v)], [Number.POSITIVE_INFINITY, Number.POSITIVE_INFINITY]);
7+
return arr.reduce((acc, v) => [Math.min(acc[0], v), Math.max(acc[1], v)], [Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY]);
88
}
99

1010
export function whiskers(boxplot, arr) {
@@ -54,7 +54,7 @@ export function boxplotStats(arr) {
5454
arr = arr.filter((v) => typeof v === 'number' && !isNaN(v));
5555
arr.sort((a, b) => a - b);
5656

57-
const {median, q1, q3} = quantiles(arr, [0.5, 0.25, 0.75]);
57+
const [median, q1, q3] = quantiles(arr, [0.5, 0.25, 0.75]);
5858

5959
const minmax = extent(arr);
6060
const base = {

0 commit comments

Comments
 (0)