billboard.js 3.5.0 → 3.6.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -2
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +159 -98
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2416 -2173
- package/dist/billboard.pkgd.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -71
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -71
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -71
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -71
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2259 -2077
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2260 -2147
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2261 -2148
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2262 -2149
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2263 -2150
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +149 -94
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +30 -28
- package/src/Chart/api/data.ts +2 -2
- package/src/Chart/api/group.ts +1 -1
- package/src/Chart/api/selection.ts +1 -1
- package/src/ChartInternal/Axis/AxisRenderer.ts +3 -3
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
- package/src/ChartInternal/ChartInternal.ts +3 -3
- package/src/ChartInternal/data/convert.ts +4 -3
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/interactions/drag.ts +1 -1
- package/src/ChartInternal/internals/color.ts +5 -2
- package/src/ChartInternal/internals/domain.ts +1 -1
- package/src/ChartInternal/internals/format.ts +1 -1
- package/src/ChartInternal/internals/grid.ts +0 -1
- package/src/ChartInternal/internals/legend.ts +3 -2
- package/src/ChartInternal/internals/region.ts +1 -1
- package/src/ChartInternal/internals/scale.ts +1 -1
- package/src/ChartInternal/internals/size.axis.ts +1 -1
- package/src/ChartInternal/internals/style.ts +2 -2
- package/src/ChartInternal/internals/text.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +1 -1
- package/src/ChartInternal/shape/arc.ts +3 -3
- package/src/ChartInternal/shape/area.ts +3 -2
- package/src/ChartInternal/shape/bar.ts +2 -2
- package/src/ChartInternal/shape/line.ts +5 -1
- package/src/ChartInternal/shape/point.ts +1 -1
- package/src/ChartInternal/shape/polar.ts +1 -1
- package/src/ChartInternal/shape/shape.ts +16 -8
- package/src/Plugin/sparkline/index.ts +1 -1
- package/src/Plugin/textoverlap/index.ts +1 -1
- package/src/config/Options/common/grid.ts +2 -2
- package/src/config/Options/common/legend.ts +3 -2
- package/src/config/Options/data/data.ts +19 -1
- package/src/config/Store/Element.ts +1 -1
- package/src/module/Cache.ts +1 -1
- package/src/module/generator.ts +1 -1
- package/src/module/util.ts +1 -74
- package/src/module/worker.ts +101 -0
- package/types/axis.d.ts +18 -3
- package/types/index.d.ts +1 -0
- package/types/options.d.ts +9 -0
package/README.md
CHANGED
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<img src="https://naver.github.io/billboard.js/img/logo/billboard.js.svg" width="350" alt="billboard.js"><br>
|
|
4
4
|
</picture>
|
|
5
5
|
|
|
6
|
-
[![Latest Version][badge-latest]][link-version] [![Next version][badge-next]][link-version] [![
|
|
6
|
+
[![Latest Version][badge-latest]][link-version] [![Next version][badge-next]][link-version] [![bb][badge-@billboard.js/react]][link-@billboard.js/react]<br>
|
|
7
|
+
[![semantic-release][badge-semantic-release]][link-semantic-release] ![React][badge-react]
|
|
7
8
|
|
|
8
9
|
![CI Status][badge-ci-status] [![Coverage Status][badge-coverage]][link-coverage] [![Known Vulnerabilities][badge-snyk]][link-snyk]
|
|
9
10
|
[![download][badge-download]][link-download] [![jsDelivr][badge-jsDelivr]][link-jsDelivr] [![gzip size][badge-gzip-size]][link-gzip-size]
|
|
@@ -115,7 +116,7 @@ There're two ways to install from `nightly` branch directly.
|
|
|
115
116
|
// Specify on 'package.json' file
|
|
116
117
|
"dependencies": {
|
|
117
118
|
...
|
|
118
|
-
"billboard.js": "
|
|
119
|
+
"billboard.js": "naver/billboard.js#nightly"
|
|
119
120
|
},
|
|
120
121
|
```
|
|
121
122
|
|
|
@@ -139,6 +140,12 @@ $ npm install billboard.js@next --save
|
|
|
139
140
|
$ npm install billboard.js
|
|
140
141
|
```
|
|
141
142
|
|
|
143
|
+
### Packages
|
|
144
|
+
|
|
145
|
+
Name | For | Description
|
|
146
|
+
:---: | :---:| :---:
|
|
147
|
+
[![bb][badge-@billboard.js/react]][link-@billboard.js/react] | ![React][badge-react] | React component for billboard.js
|
|
148
|
+
|
|
142
149
|
### Using CDN
|
|
143
150
|
|
|
144
151
|
If you want to use 'billboard.js' without installation, load files directly from one of the CDN providers.
|
|
@@ -344,6 +351,8 @@ THE SOFTWARE.
|
|
|
344
351
|
[badge-latest]: https://img.shields.io/npm/v/billboard.js/latest.svg
|
|
345
352
|
[badge-next]: https://img.shields.io/npm/v/billboard.js/next.svg
|
|
346
353
|
[badge-semantic-release]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
|
|
354
|
+
[badge-react]: https://img.shields.io/badge/React-20232A?style=flat&logo=react&logoColor=fff&labelColor=grey&color=62d9fb
|
|
355
|
+
[badge-@billboard.js/react]: https://img.shields.io/npm/v/@billboard.js/react?style=flat&labelColor=grey&label=%40billboard.js%2Freact
|
|
347
356
|
|
|
348
357
|
<!-- links -->
|
|
349
358
|
[link-download]: https://npm-stat.com/charts.html?package=billboard.js&from=2017-06-08
|
|
@@ -353,5 +362,6 @@ THE SOFTWARE.
|
|
|
353
362
|
[link-snyk]: https://snyk.io/test/github/naver/billboard.js?targetFile=package.json
|
|
354
363
|
[link-gzip-size]: https://unpkg.com/billboard.js/dist/billboard.min.js
|
|
355
364
|
[link-semantic-release]: https://github.com/semantic-release/semantic-release
|
|
365
|
+
[link-@billboard.js/react]: https://www.npmjs.com/package/@billboard.js/react
|
|
356
366
|
|
|
357
367
|
[](https://app.fossa.io/projects/git%2Bgithub.com%2Fnaver%2Fbillboard.js?ref=badge_large)
|
package/dist/billboard.css
CHANGED
package/dist/billboard.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.6.0-next.1
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1310,75 +1310,6 @@ function convertInputType(mouse, touch) {
|
|
|
1310
1310
|
|
|
1311
1311
|
return hasMouse && "mouse" || hasTouch && "touch" || "mouse";
|
|
1312
1312
|
}
|
|
1313
|
-
/**
|
|
1314
|
-
* Create and run on Web Worker
|
|
1315
|
-
* @param {boolean} useWorker Use Web Worker
|
|
1316
|
-
* @param {Function} fn Function to be executed in worker
|
|
1317
|
-
* @param {Function} callback Callback function to receive result from worker
|
|
1318
|
-
* @param {Array} depsFn Dependency functions to run given function(fn).
|
|
1319
|
-
* @returns {object}
|
|
1320
|
-
* @example
|
|
1321
|
-
* const worker = runWorker(function(arg) {
|
|
1322
|
-
* // do some tasks...
|
|
1323
|
-
* console.log("param:", A(arg));
|
|
1324
|
-
*
|
|
1325
|
-
* return 1234;
|
|
1326
|
-
* }, function(data) {
|
|
1327
|
-
* // callback after worker is done
|
|
1328
|
-
* console.log("result:", data);
|
|
1329
|
-
* },
|
|
1330
|
-
* [function A(){}]
|
|
1331
|
-
* );
|
|
1332
|
-
*
|
|
1333
|
-
* worker(11111);
|
|
1334
|
-
* @private
|
|
1335
|
-
*/
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
function runWorker(useWorker, fn, callback, depsFn) {
|
|
1339
|
-
if (useWorker === void 0) {
|
|
1340
|
-
useWorker = !0;
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
var runFn;
|
|
1344
|
-
|
|
1345
|
-
if (win.Worker && useWorker) {
|
|
1346
|
-
var _depsFn$map$join,
|
|
1347
|
-
blob = new Blob([((_depsFn$map$join = depsFn == null ? void 0 : depsFn.map(String).join(";")) != null ? _depsFn$map$join : "") + "\n\n\t\t\tself.onmessage=function({data}) {\n\t\t\t\tconst result = (" + fn.toString() + ").apply(null, data);\n\t\t\t\tself.postMessage(result);\n\t\t\t};"], {
|
|
1348
|
-
type: "text/javascript"
|
|
1349
|
-
}),
|
|
1350
|
-
worker = new Worker(URL.createObjectURL(blob));
|
|
1351
|
-
|
|
1352
|
-
runFn = function () {
|
|
1353
|
-
for (var _len5 = arguments.length, args = Array(_len5), _key5 = 0; _key5 < _len5; _key5++) {
|
|
1354
|
-
args[_key5] = arguments[_key5];
|
|
1355
|
-
}
|
|
1356
|
-
|
|
1357
|
-
// trigger worker
|
|
1358
|
-
worker.postMessage(args); // listen worker
|
|
1359
|
-
|
|
1360
|
-
worker.onmessage = function (e) {
|
|
1361
|
-
return callback(e.data);
|
|
1362
|
-
}; // handle error
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
worker.onerror = function (e) {
|
|
1366
|
-
console.error(e);
|
|
1367
|
-
}; // return new Promise((resolve, reject) => {
|
|
1368
|
-
// worker.onmessage = ({data}) => resolve(data);
|
|
1369
|
-
// worker.onerror = reject;
|
|
1370
|
-
// });
|
|
1371
|
-
|
|
1372
|
-
};
|
|
1373
|
-
} else {
|
|
1374
|
-
runFn = function () {
|
|
1375
|
-
var res = fn.apply(void 0, arguments);
|
|
1376
|
-
callback(res);
|
|
1377
|
-
};
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
return runFn;
|
|
1381
|
-
}
|
|
1382
1313
|
/**
|
|
1383
1314
|
* Run function until given condition function return true
|
|
1384
1315
|
* @param {Function} fn Function to be executed when condition is true
|
|
@@ -2598,6 +2529,24 @@ var data_this = undefined;
|
|
|
2598
2529
|
*/
|
|
2599
2530
|
data_groups: [],
|
|
2600
2531
|
|
|
2532
|
+
/**
|
|
2533
|
+
* Set how zero value will be treated on groups.<br>
|
|
2534
|
+
* Possible values:
|
|
2535
|
+
* - `zero`: 0 will be positioned at absolute axis zero point.
|
|
2536
|
+
* - `positive`: 0 will be positioned at the top of a stack.
|
|
2537
|
+
* - `negative`: 0 will be positioned at the bottom of a stack.
|
|
2538
|
+
* @name data․groupsZeroAs
|
|
2539
|
+
* @memberof Options
|
|
2540
|
+
* @type {string}
|
|
2541
|
+
* @default "positive"
|
|
2542
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Data.Groups)
|
|
2543
|
+
* @example
|
|
2544
|
+
* data: {
|
|
2545
|
+
* groupsZeroAs: "zero" // "positive" or "negative"
|
|
2546
|
+
* }
|
|
2547
|
+
*/
|
|
2548
|
+
data_groupsZeroAs: "positive",
|
|
2549
|
+
|
|
2601
2550
|
/**
|
|
2602
2551
|
* Set color converter function.<br><br>
|
|
2603
2552
|
* This option should a function and the specified function receives color (e.g. '#ff0000') and d that has data parameters like id, value, index, etc. And it must return a string that represents color (e.g. '#00ff00').
|
|
@@ -3341,7 +3290,8 @@ var data_this = undefined;
|
|
|
3341
3290
|
* @property {boolean} [legend.hide=false] Hide legend
|
|
3342
3291
|
* If true given, all legend will be hidden. If string or array given, only the legend that has the id will be hidden.
|
|
3343
3292
|
* @property {string|HTMLElement} [legend.contents.bindto=undefined] Set CSS selector or element reference to bind legend items.
|
|
3344
|
-
*
|
|
3293
|
+
* - **NOTE:** Should be used along with `legend.contents.template`.
|
|
3294
|
+
* @property {string|Function} [legend.contents.template="<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>"] Set item's template.<br>
|
|
3345
3295
|
* - If set `string` value, within template the 'color' and 'title' can be replaced using template-like syntax string:
|
|
3346
3296
|
* - {=COLOR}: data color value
|
|
3347
3297
|
* - {=TITLE}: data title value
|
|
@@ -3419,7 +3369,7 @@ var data_this = undefined;
|
|
|
3419
3369
|
legend_show: !0,
|
|
3420
3370
|
legend_hide: !1,
|
|
3421
3371
|
legend_contents_bindto: undefined,
|
|
3422
|
-
legend_contents_template:
|
|
3372
|
+
legend_contents_template: "<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",
|
|
3423
3373
|
legend_position: "bottom",
|
|
3424
3374
|
legend_inset_anchor: "top-left",
|
|
3425
3375
|
legend_inset_x: 10,
|
|
@@ -4044,6 +3994,105 @@ function generateWait() {
|
|
|
4044
3994
|
|
|
4045
3995
|
return f;
|
|
4046
3996
|
}
|
|
3997
|
+
;// CONCATENATED MODULE: ./src/module/worker.ts
|
|
3998
|
+
/**
|
|
3999
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
4000
|
+
* billboard.js project is licensed under the MIT license
|
|
4001
|
+
*/
|
|
4002
|
+
// Store blob in memory
|
|
4003
|
+
|
|
4004
|
+
var blob = {};
|
|
4005
|
+
/**
|
|
4006
|
+
* Get Object URL
|
|
4007
|
+
* @param {Function} fn Function to be executed in worker
|
|
4008
|
+
* @param {Array} depsFn Dependency functions to run given function(fn).
|
|
4009
|
+
* @returns {string}
|
|
4010
|
+
* @private
|
|
4011
|
+
*/
|
|
4012
|
+
|
|
4013
|
+
function getObjectURL(fn, depsFn) {
|
|
4014
|
+
var fnString = fn.toString(),
|
|
4015
|
+
key = fnString.replace(/(function|[\s\W\n])/g, "").substring(0, 15);
|
|
4016
|
+
|
|
4017
|
+
if (!(key in blob)) {
|
|
4018
|
+
var _depsFn$map$join;
|
|
4019
|
+
|
|
4020
|
+
// Web Worker body
|
|
4021
|
+
blob[key] = new win.Blob([((_depsFn$map$join = depsFn == null ? void 0 : depsFn.map(String).join(";")) != null ? _depsFn$map$join : "") + "\n\n\t\t\tself.onmessage=function({data}) {\n\t\t\t\tconst result = (" + fnString + ").apply(null, data);\n\t\t\t\tself.postMessage(result);\n\t\t\t};"], {
|
|
4022
|
+
type: "text/javascript"
|
|
4023
|
+
});
|
|
4024
|
+
}
|
|
4025
|
+
|
|
4026
|
+
return win.URL.createObjectURL(blob[key]);
|
|
4027
|
+
}
|
|
4028
|
+
/**
|
|
4029
|
+
* Create and run on Web Worker
|
|
4030
|
+
* @param {boolean} useWorker Use Web Worker
|
|
4031
|
+
* @param {Function} fn Function to be executed in worker
|
|
4032
|
+
* @param {Function} callback Callback function to receive result from worker
|
|
4033
|
+
* @param {Array} depsFn Dependency functions to run given function(fn).
|
|
4034
|
+
* @returns {object}
|
|
4035
|
+
* @example
|
|
4036
|
+
* const worker = runWorker(function(arg) {
|
|
4037
|
+
* // do some tasks...
|
|
4038
|
+
* console.log("param:", A(arg));
|
|
4039
|
+
*
|
|
4040
|
+
* return 1234;
|
|
4041
|
+
* }, function(data) {
|
|
4042
|
+
* // callback after worker is done
|
|
4043
|
+
* console.log("result:", data);
|
|
4044
|
+
* },
|
|
4045
|
+
* [function A(){}]
|
|
4046
|
+
* );
|
|
4047
|
+
*
|
|
4048
|
+
* worker(11111);
|
|
4049
|
+
* @private
|
|
4050
|
+
*/
|
|
4051
|
+
|
|
4052
|
+
|
|
4053
|
+
function runWorker(useWorker, fn, callback, depsFn) {
|
|
4054
|
+
if (useWorker === void 0) {
|
|
4055
|
+
useWorker = !0;
|
|
4056
|
+
}
|
|
4057
|
+
|
|
4058
|
+
var runFn;
|
|
4059
|
+
|
|
4060
|
+
if (win.Worker && useWorker) {
|
|
4061
|
+
var src = getObjectURL(fn, depsFn),
|
|
4062
|
+
worker = new win.Worker(src);
|
|
4063
|
+
|
|
4064
|
+
runFn = function () {
|
|
4065
|
+
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
|
|
4066
|
+
args[_key] = arguments[_key];
|
|
4067
|
+
}
|
|
4068
|
+
|
|
4069
|
+
// trigger worker
|
|
4070
|
+
worker.postMessage(args); // listen worker
|
|
4071
|
+
|
|
4072
|
+
worker.onmessage = function (e) {
|
|
4073
|
+
// release object URL from memory
|
|
4074
|
+
win.URL.revokeObjectURL(src);
|
|
4075
|
+
return callback(e.data);
|
|
4076
|
+
}; // handle error
|
|
4077
|
+
|
|
4078
|
+
|
|
4079
|
+
worker.onerror = function (e) {
|
|
4080
|
+
console.error(e);
|
|
4081
|
+
}; // return new Promise((resolve, reject) => {
|
|
4082
|
+
// worker.onmessage = ({data}) => resolve(data);
|
|
4083
|
+
// worker.onerror = reject;
|
|
4084
|
+
// });
|
|
4085
|
+
|
|
4086
|
+
};
|
|
4087
|
+
} else {
|
|
4088
|
+
runFn = function () {
|
|
4089
|
+
var res = fn.apply(void 0, arguments);
|
|
4090
|
+
callback(res);
|
|
4091
|
+
};
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
return runFn;
|
|
4095
|
+
}
|
|
4047
4096
|
// EXTERNAL MODULE: external {"commonjs":"d3-dsv","commonjs2":"d3-dsv","amd":"d3-dsv","root":"d3"}
|
|
4048
4097
|
var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_require__(5);
|
|
4049
4098
|
;// CONCATENATED MODULE: ./src/ChartInternal/data/convert.helper.ts
|
|
@@ -4272,6 +4321,7 @@ function tsv(tsv) {
|
|
|
4272
4321
|
|
|
4273
4322
|
|
|
4274
4323
|
|
|
4324
|
+
|
|
4275
4325
|
/**
|
|
4276
4326
|
* Get data key for JSON
|
|
4277
4327
|
* @param {string|object} keysParam Key params
|
|
@@ -4465,7 +4515,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4465
4515
|
}.bind(this)); // finish targets
|
|
4466
4516
|
|
|
4467
4517
|
targets.forEach(function (t) {
|
|
4468
|
-
var _this5 = this
|
|
4518
|
+
var _this5 = this,
|
|
4519
|
+
_$$$data$xs$t$id;
|
|
4469
4520
|
|
|
4470
4521
|
_newArrowCheck(this, _this2);
|
|
4471
4522
|
|
|
@@ -4487,7 +4538,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
4487
4538
|
return v.index = i;
|
|
4488
4539
|
}.bind(this)); // this needs to be sorted because its index and value.index is identical
|
|
4489
4540
|
|
|
4490
|
-
$$.data.xs[t.id].sort(function (v1, v2) {
|
|
4541
|
+
(_$$$data$xs$t$id = $$.data.xs[t.id]) == null ? void 0 : _$$$data$xs$t$id.sort(function (v1, v2) {
|
|
4491
4542
|
_newArrowCheck(this, _this5);
|
|
4492
4543
|
|
|
4493
4544
|
return v1 - v2;
|
|
@@ -7661,8 +7712,9 @@ function getFormat($$, typeValue, v) {
|
|
|
7661
7712
|
var getColor = function (id) {
|
|
7662
7713
|
_newArrowCheck(this, _this4);
|
|
7663
7714
|
|
|
7664
|
-
var data = $$.getDataById(id)
|
|
7665
|
-
|
|
7715
|
+
var data = $$.getDataById(id),
|
|
7716
|
+
color = $$.levelColor ? $$.levelColor(data.values[0].value) : $$.color(data);
|
|
7717
|
+
return color;
|
|
7666
7718
|
}.bind(this),
|
|
7667
7719
|
usePoint = config.legend_usePoint;
|
|
7668
7720
|
|
|
@@ -8635,7 +8687,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8635
8687
|
$$ = this,
|
|
8636
8688
|
_$$$getShapeOffsetDat = $$.getShapeOffsetData(typeFilter),
|
|
8637
8689
|
shapeOffsetTargets = _$$$getShapeOffsetDat.shapeOffsetTargets,
|
|
8638
|
-
indexMapByTargetId = _$$$getShapeOffsetDat.indexMapByTargetId
|
|
8690
|
+
indexMapByTargetId = _$$$getShapeOffsetDat.indexMapByTargetId,
|
|
8691
|
+
groupsZeroAs = $$.config.data_groupsZeroAs;
|
|
8639
8692
|
|
|
8640
8693
|
return function (d, idx) {
|
|
8641
8694
|
var _this10 = this;
|
|
@@ -8653,13 +8706,13 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8653
8706
|
return scale(value[0]);
|
|
8654
8707
|
}
|
|
8655
8708
|
|
|
8656
|
-
var
|
|
8657
|
-
|
|
8709
|
+
var dataXAsNumber = +x,
|
|
8710
|
+
y0 = scale(groupsZeroAs === "zero" ? 0 : $$.getShapeYMin(id)),
|
|
8658
8711
|
offset = y0;
|
|
8659
8712
|
shapeOffsetTargets.filter(function (t) {
|
|
8660
8713
|
_newArrowCheck(this, _this10);
|
|
8661
8714
|
|
|
8662
|
-
return t.id !== id;
|
|
8715
|
+
return t.id !== id && ind[t.id] === ind[id];
|
|
8663
8716
|
}.bind(this)).forEach(function (t) {
|
|
8664
8717
|
_newArrowCheck(this, _this10);
|
|
8665
8718
|
|
|
@@ -8668,8 +8721,9 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8668
8721
|
rowValues = t.rowValues,
|
|
8669
8722
|
tvalues = t.values; // for same stacked group (ind[tid] === ind[id])
|
|
8670
8723
|
|
|
8671
|
-
if (
|
|
8724
|
+
if (indexMapByTargetId[tid] < indexMapByTargetId[id]) {
|
|
8672
8725
|
var _row,
|
|
8726
|
+
rValue = tvalues[dataXAsNumber],
|
|
8673
8727
|
row = rowValues[idx];
|
|
8674
8728
|
|
|
8675
8729
|
// check if the x values line up
|
|
@@ -8677,8 +8731,12 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8677
8731
|
row = rowValueMapByXValue[dataXAsNumber];
|
|
8678
8732
|
}
|
|
8679
8733
|
|
|
8680
|
-
if (((_row = row) == null ? void 0 : _row.value) * value >= 0 && isNumber(
|
|
8681
|
-
|
|
8734
|
+
if (((_row = row) == null ? void 0 : _row.value) * value >= 0 && isNumber(rValue)) {
|
|
8735
|
+
var addOffset = value === 0 ? groupsZeroAs === "positive" && rValue > 0 || groupsZeroAs === "negative" && rValue < 0 : !0;
|
|
8736
|
+
|
|
8737
|
+
if (addOffset) {
|
|
8738
|
+
offset += scale(rValue) - y0;
|
|
8739
|
+
}
|
|
8682
8740
|
}
|
|
8683
8741
|
}
|
|
8684
8742
|
}.bind(this));
|
|
@@ -11447,15 +11505,15 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
11447
11505
|
|
|
11448
11506
|
$$.updateTargetsForSubchart && $$.updateTargetsForSubchart(targets); // Arc, Polar, Radar
|
|
11449
11507
|
} else if ($$.hasArcType(targets)) {
|
|
11450
|
-
var
|
|
11508
|
+
var type = "Arc";
|
|
11451
11509
|
|
|
11452
11510
|
if (hasRadar) {
|
|
11453
|
-
|
|
11511
|
+
type = "Radar";
|
|
11454
11512
|
} else if ($$.hasType("polar")) {
|
|
11455
|
-
|
|
11513
|
+
type = "Polar";
|
|
11456
11514
|
}
|
|
11457
11515
|
|
|
11458
|
-
helper(
|
|
11516
|
+
helper(type);
|
|
11459
11517
|
} // Point types
|
|
11460
11518
|
|
|
11461
11519
|
|
|
@@ -14488,12 +14546,13 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
14488
14546
|
;
|
|
14489
14547
|
|
|
14490
14548
|
_proto.getGeneratedTicks = function getGeneratedTicks(count) {
|
|
14491
|
-
var
|
|
14492
|
-
len = this.generatedTicks.length - 1,
|
|
14493
|
-
res = this.generatedTicks
|
|
14549
|
+
var _this$generatedTicks,
|
|
14550
|
+
len = ((_this$generatedTicks = this.generatedTicks) == null ? void 0 : _this$generatedTicks.length) - 1,
|
|
14551
|
+
res = this.generatedTicks,
|
|
14552
|
+
_this3 = this;
|
|
14494
14553
|
|
|
14495
14554
|
if (len > count) {
|
|
14496
|
-
var interval = Math.round(len / count
|
|
14555
|
+
var interval = Math.round(len / count + .1);
|
|
14497
14556
|
res = this.generatedTicks.map(function (v, i) {
|
|
14498
14557
|
_newArrowCheck(this, _this3);
|
|
14499
14558
|
|
|
@@ -19360,7 +19419,7 @@ function axis_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
|
|
|
19360
19419
|
* @property {boolean} [y.show=false] Show grids along x axis.
|
|
19361
19420
|
* @property {Array} [y.lines=[]] Show additional grid lines along y axis.<br>
|
|
19362
19421
|
* This option accepts array including object that has value, text, position and class.
|
|
19363
|
-
* @property {number} [y.ticks=
|
|
19422
|
+
* @property {number} [y.ticks=undefined] Number of y grids to be shown.
|
|
19364
19423
|
* @property {object} focus Grid focus object
|
|
19365
19424
|
* @property {boolean} [focus.edge=false] Show edged focus grid line.<br>**NOTE:** Available when [`tooltip.grouped=false`](#.tooltip) option is set.
|
|
19366
19425
|
* @property {boolean} [focus.show=true] Show grid line when focus.
|
|
@@ -19408,7 +19467,7 @@ function axis_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
|
|
|
19408
19467
|
grid_x_lines: [],
|
|
19409
19468
|
grid_y_show: !1,
|
|
19410
19469
|
grid_y_lines: [],
|
|
19411
|
-
grid_y_ticks:
|
|
19470
|
+
grid_y_ticks: undefined,
|
|
19412
19471
|
grid_focus_edge: !1,
|
|
19413
19472
|
grid_focus_show: !0,
|
|
19414
19473
|
grid_focus_y: !1,
|
|
@@ -19494,7 +19553,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
19494
19553
|
w = config.gauge_width || config.donut_width,
|
|
19495
19554
|
gaugeArcWidth = $$.filterTargetsToShow($$.data.targets).length * config.gauge_arcs_minWidth;
|
|
19496
19555
|
// determine radius
|
|
19497
|
-
state.radiusExpanded = Math.min(state.arcWidth, state.arcHeight) / 2 * ($$.hasMultiArcGauge() ? .85 : 1);
|
|
19556
|
+
state.radiusExpanded = Math.min(state.arcWidth, state.arcHeight) / 2 * ($$.hasMultiArcGauge() && config.gauge_label_show ? .85 : 1);
|
|
19498
19557
|
state.radius = state.radiusExpanded * .95;
|
|
19499
19558
|
state.innerRadiusRatio = w ? (state.radius - w) / state.radius : .6;
|
|
19500
19559
|
state.gaugeArcWidth = w || (gaugeArcWidth <= state.radius - state.innerRadius ? state.radius - state.innerRadius : gaugeArcWidth <= state.radius ? gaugeArcWidth : state.radius);
|
|
@@ -20449,10 +20508,11 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
20449
20508
|
var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id)),
|
|
20450
20509
|
offset = areaOffset(d, i) || y0,
|
|
20451
20510
|
posX = x(d),
|
|
20511
|
+
value = d.value,
|
|
20452
20512
|
posY = y(d);
|
|
20453
20513
|
|
|
20454
20514
|
// fix posY not to overflow opposite quadrant
|
|
20455
|
-
if (config.axis_rotated && (
|
|
20515
|
+
if (config.axis_rotated && (value > 0 && posY < y0 || value < 0 && y0 < posY)) {
|
|
20456
20516
|
posY = y0;
|
|
20457
20517
|
} // 1 point that marks the area position
|
|
20458
20518
|
|
|
@@ -21235,7 +21295,8 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
21235
21295
|
mainLineEnter.append("g").attr("class", classLines); // Areas
|
|
21236
21296
|
|
|
21237
21297
|
if ($$.hasTypeOf("Area")) {
|
|
21238
|
-
|
|
21298
|
+
var mainLine = (!area && mainLineEnter.empty() ? mainLineUpdate : mainLineEnter).filter($$.isAreaType.bind($$));
|
|
21299
|
+
$$.initArea(mainLine);
|
|
21239
21300
|
}
|
|
21240
21301
|
|
|
21241
21302
|
$$.updateTargetForCircle(targets, mainLineEnter);
|
|
@@ -25904,7 +25965,7 @@ var _defaults = {},
|
|
|
25904
25965
|
* bb.version; // "1.0.0"
|
|
25905
25966
|
* @memberof bb
|
|
25906
25967
|
*/
|
|
25907
|
-
version: "3.
|
|
25968
|
+
version: "3.6.0-next.1",
|
|
25908
25969
|
|
|
25909
25970
|
/**
|
|
25910
25971
|
* Generate chart
|
|
@@ -26039,7 +26100,7 @@ var _defaults = {},
|
|
|
26039
26100
|
};
|
|
26040
26101
|
/**
|
|
26041
26102
|
* @namespace bb
|
|
26042
|
-
* @version 3.
|
|
26103
|
+
* @version 3.6.0-next.1
|
|
26043
26104
|
*/
|
|
26044
26105
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
26045
26106
|
|
package/dist/billboard.min.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.6.0-next.1
|
|
9
9
|
*/.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-brush .extent,.bb-region,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}
|