N°5621 Move C3 0.4.11 to NPM

This commit is contained in:
Pierre Goiffon
2024-02-16 16:42:42 +01:00
parent ff079f7d01
commit f3fbce7459
609 changed files with 84517 additions and 6 deletions

19
node_modules/c3/htdocs/js/samples/angularjs.js generated vendored Normal file
View File

@@ -0,0 +1,19 @@
var myApp = angular.module('myApp', [])
.controller('myCtrl', function ($scope) {
$scope.text = 'world';
$scope.loading = true;
var chart = c3.generate({
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
setTimeout(function () {
$scope.loading = false;
}, 1000);
});

13
node_modules/c3/htdocs/js/samples/plugin.js generated vendored Normal file
View File

@@ -0,0 +1,13 @@
c3.chart.internal.fn.isTimeSeries = function () {
console.log('custom isTimeSeries');
return false;
};
c3.chart.internal.fn.additionalConfig.test1 = undefined;
c3.chart.internal.fn.additionalConfig.test2 = undefined;
c3.chart.fn.hoge = function () {
console.log("hoge()", this.internal.isTimeSeries());
};
c3.chart.fn.test = function () {
console.log('test()', this.internal.config.test1);
};

18
node_modules/c3/htdocs/js/samples/requirejs.js generated vendored Normal file
View File

@@ -0,0 +1,18 @@
require.config({
baseUrl: '/js',
paths: {
d3: "http://d3js.org/d3.v3.min"
}
});
require(["d3", "c3"], function(d3, c3) {
window.chart = c3.generate({
data: {
columns: [
['sample', 30, 200, 100, 400, 150, 250]
]
}
});
});

81
node_modules/c3/htdocs/js/samples/zoom_reduction.js generated vendored Normal file
View File

@@ -0,0 +1,81 @@
var chart;
function refresh() {
if (suspendRefresh)
return;
chart.load({
columns: [
["Value"].concat(zoom(column, currentZoom, "t=>Math.round(t.avg())".toLambda())),
["xColumn"].concat(zoom(xColumn, currentZoom, "t=>t[0]".toLambda())),
]
});
}
function getChart() {
return chart;
}
function main() {
var last = 0;
var max = 10000;
var column = Array.generate(max, function (i) {
return last += Math.randomInt(-10, 10);
});
var xColumn = Array.generateNumbers(0, max);
var options = {
bindto: "#divChart",
data: {
columns: [
["Value"].concat(column),
["x"].concat(xColumn),
],
type: "line",
x: "x"
},
zoom2: {
enabled: true,
}
};
chart = c3ext.generate(options);
window.setInterval(refreshStatus, 1000);
function refreshStatus() {
var zoomInfo = chart.zoom2.getZoom();
var info = {
reduced: chart.zoom2.maxItems(),
actual: (zoomInfo.currentZoom[1] - zoomInfo.currentZoom[0]),
range: zoomInfo.currentZoom[0] + "-" + zoomInfo.currentZoom[1],
total: zoomInfo.totalItems
};
$("#status").text(JSON.stringify(info, null, " "));
}
};
if (typeof (Array.generate) == "undefined") {
Array.generate = function (length, generator) {
var list = new Array(length);
for (var i = 0; i < length; i++) {
list[i] = generator(i);
}
return list;
}
}
if (typeof (Math.randomInt) == "undefined") {
Math.randomInt = function (min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
}
if (typeof (Array.generateNumbers) == "undefined") {
Array.generateNumbers = function (from, until) {
if (arguments.length == 1) {
until = from;
from = 0;
}
var length = until - from;
var list = new Array(length);
for (var i = 0; i < length; i++) {
list[i] = i + from;
}
return list;
}
}