forked from naver/billboard.js
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
85 changed files
with
16,985 additions
and
36,528 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "weekly" | ||
ignore: | ||
- dependency-name: "d3-axis" | ||
- dependency-name: "d3-brush" | ||
- dependency-name: "d3-color" | ||
- dependency-name: "d3-drag" | ||
- dependency-name: "d3-dsv" | ||
- dependency-name: "d3-ease" | ||
- dependency-name: "d3-interpolate" | ||
- dependency-name: "d3-scale" | ||
- dependency-name: "d3-selection" | ||
- dependency-name: "d3-shape" | ||
- dependency-name: "d3-time-format" | ||
- dependency-name: "d3-transition" | ||
- dependency-name: "d3-zoom" | ||
- dependency-name: "d3-format" | ||
- dependency-name: "d3-polygon" |
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,2 @@ | ||
# https://docs.npmjs.com/using-npm/config | ||
package-lock=false |
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
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
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,5 @@ | ||
h1 {margin: 10px 0} | ||
p {margin:5px 0} | ||
input, button, select {font-size:16px;} | ||
button{border:solid 1px #ccc;} | ||
button:nth-child(3) {background-color: red;color:#fff} |
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,89 @@ | ||
window.bench = { | ||
chart: null, | ||
timer: null, | ||
billboard: null, | ||
$el: { | ||
type: document.getElementById("type"), | ||
matrix1: document.getElementById("matrix1"), | ||
matrix2: document.getElementById("matrix2"), | ||
transition: document.getElementById("transition") | ||
}, | ||
getRandom(min = 100, max = 1000) { | ||
return Math.random() * (max - min) + min; | ||
}, | ||
getData() { | ||
const data = []; | ||
const matrix = [this.$el.matrix1.value, this.$el.matrix2.value]; | ||
|
||
for (let i = 0; i < matrix[1]; i++) { | ||
const d = []; | ||
|
||
for (let j = 0; j < matrix[0]; j++) { | ||
if (j === 0) { | ||
d.push(`data${i}`); | ||
} else { | ||
d.push(this.getRandom()); | ||
} | ||
} | ||
|
||
data.push(d); | ||
} | ||
|
||
return data; | ||
}, | ||
loadBillboard: function() { | ||
const version = document.getElementById("version").value; | ||
|
||
this.billboard && document.head.removeChild(this.billboard); | ||
this.billboard = document.createElement("script"); | ||
|
||
this.billboard.src = version === "local-latest" ? | ||
"../../dist/billboard.js": | ||
`https://cdn.jsdelivr.net/npm/billboard.js@${version}/dist/billboard.js`; | ||
|
||
document.head.appendChild(this.billboard); | ||
}, | ||
generate: function(type) { | ||
this.chart = bb.generate({ | ||
data: { | ||
columns: this.getData(), | ||
type: this.$el.type.value | ||
}, | ||
transition: { | ||
duration: +this.$el.transition.value | ||
}, | ||
legend: { | ||
show: false | ||
} | ||
}); | ||
|
||
this[type](); | ||
}, | ||
load: function() { | ||
const ctx = this; | ||
|
||
this.stop(); | ||
|
||
this.chart.load({ | ||
columns: this.getData(), | ||
done: function() { | ||
ctx.timer = setTimeout(bench.load.bind(bench), 500); | ||
} | ||
}); | ||
}, | ||
resize: function() { | ||
const ctx = this; | ||
|
||
this.stop(); | ||
this.timer = setInterval(function() { | ||
bench.chart.resize({ | ||
width: ctx.getRandom(200, 600), | ||
height: ctx.getRandom(200, 480) | ||
}); | ||
}, 500); | ||
}, | ||
stop: function() { | ||
this.play = false; | ||
clearInterval(this.timer); | ||
} | ||
}; |
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,56 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width"> | ||
<title>Benchmark</title> | ||
<link rel="stylesheet" href="./benchmark.css"> | ||
<link rel="stylesheet" href="../../dist/billboard.min.css"> | ||
<script src="https://d3js.org/d3.v5.min.js"></script> | ||
</head> | ||
<body> | ||
<h1>Benchmark</h1> | ||
1) billboard.js | ||
<select id="version" onchange="bench.loadBillboard()"> | ||
<option>select version</option> | ||
<option value="1.12.11">v1.12.11</option> | ||
<option value="2.0.0">v2.0.0</option> | ||
<option value="local-latest">local-latest</option> | ||
</select> | ||
<p> | ||
2) Data matrix: <input id="matrix1" type="text" value="50" style="width:50px"> x | ||
<input id="matrix2" type="text" value="50" style="width:50px"> / | ||
Transition: <select id="transition"> | ||
<option value="0">0</option> | ||
<option value="350">350</option> | ||
</select> | ||
|
||
</p> | ||
<p> | ||
3) Type: <select id="type"> | ||
<option value="area">area</option> | ||
<option value="area-spline">area-spline</option> | ||
<option value="area-step">area-step</option> | ||
<option value="bar">bar</option> | ||
<option value="bubble">bubble</option> | ||
<option value="donut">donut</option> | ||
<option value="gauge">gauge</option> | ||
<option value="line">line</option> | ||
<option value="pie">pie</option> | ||
<option value="radar">radar</option> | ||
<option value="scatter">scatter</option> | ||
<option value="spline">spline</option> | ||
<option value="step">step</option> | ||
</select> | ||
</p> | ||
<p> | ||
4) Run! - | ||
<button onclick="bench.generate('load')">Load Start</button> | ||
<button onclick="bench.generate('resize')">Resize Start</button> | ||
<button onclick="bench.stop()">STOP</button> | ||
</p> | ||
|
||
<div id="chart"></div> | ||
<script src="./benchmark.js"></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
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,42 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> | ||
<title>billboard.js - Themes</title> | ||
<style> | ||
span { | ||
display: inline-block; | ||
padding: 5px; | ||
color: #fff; | ||
font-size: 15px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Themes Colors</h1> | ||
<div id="colors"></div> | ||
<script> | ||
// | ||
const colors = { | ||
default: "#1f77b4;#ff7f0e;#2ca02c;#d62728;#9467bd;#8c564b;#e377c2;#7f7f7f;#bcbd22;#17becf;", | ||
insight: "#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;", | ||
graph: "#65CFC2;#D0A45F;#64A4F5;#EF65A2;#A377FE;#8AAEC7;#FF7E5A;#898EFE;#FFAC35;#70B0FF;", | ||
datalab: "#2ac4b3;#feaf29;#ff617b;#73a2ef;#b180d0;#3064cf;#d0a45f;#8aaec7;#ef65a2;#8aaec7;" | ||
} | ||
|
||
let html = ""; | ||
|
||
Object.keys(colors).forEach(v => { | ||
html += `<h2>${v}</h2>`; | ||
|
||
colors[v].split(";").forEach(v2 => { | ||
html += `<span style=background-color:${v2}>${v2}</span>`; | ||
}); | ||
}); | ||
|
||
document.getElementById("colors").innerHTML = html; | ||
</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,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"> | ||
<title>billboard.js - benchmark</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/billboard.js/dist/theme/insight.min.css"> | ||
<script src="https://cdn.jsdelivr.net/npm/billboard.js/dist/billboard.pkgd.min.js"></script> | ||
<link rel="stylesheet" href="./types.css"> | ||
</head> | ||
<body> | ||
<h1>Supported Chart Types</h1> | ||
<div id="wrapper"></div> | ||
<script src="./types.js"></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,33 @@ | ||
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@300&display=swap'); | ||
|
||
:root { | ||
--border-color: #969696; | ||
} | ||
|
||
body { | ||
padding: 10px; | ||
} | ||
|
||
h1 {margin: 10px 0} | ||
|
||
.bb { | ||
height: 160px; | ||
border-right: dotted 1px var(--border-color); | ||
border-bottom: dotted 1px var(--border-color); | ||
} | ||
|
||
.title { | ||
font-family: 'Raleway', sans-serif; | ||
font-size: 15px; | ||
margin: 10px 0 0 10px; | ||
text-transform: capitalize; | ||
position: absolute; | ||
color: var(--border-color); | ||
} | ||
|
||
#wrapper { | ||
border-top: dotted 1px var(--border-color); | ||
border-left: dotted 1px var(--border-color); | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | ||
} |
Oops, something went wrong.