billboard.js 3.7.5 → 3.8.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/dist/billboard.css +1 -1
- package/dist/billboard.js +368 -221
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +371 -224
- 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 +20 -18
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +20 -18
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +20 -18
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +20 -18
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +4 -4
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +22 -20
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +22 -20
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +22 -20
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +49 -30
- 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 +339 -204
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -9
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +6 -11
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +7 -12
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -7
- package/package.json +25 -25
- package/src/Chart/api/focus.ts +4 -4
- package/src/Chart/api/grid.ts +206 -0
- package/src/Chart/api/load.ts +31 -21
- package/src/Chart/api/regions.ts +28 -24
- package/src/Chart/api/zoom.ts +18 -3
- package/src/ChartInternal/Axis/Axis.ts +1 -0
- package/src/ChartInternal/Axis/AxisRenderer.ts +7 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/convert.ts +6 -3
- package/src/ChartInternal/data/data.ts +19 -15
- package/src/ChartInternal/data/load.ts +19 -4
- package/src/ChartInternal/interactions/eventrect.ts +3 -2
- package/src/ChartInternal/interactions/subchart.ts +3 -2
- package/src/ChartInternal/interactions/zoom.ts +10 -3
- package/src/ChartInternal/internals/clip.ts +3 -2
- package/src/ChartInternal/internals/domain.ts +17 -8
- package/src/ChartInternal/internals/legend.ts +4 -1
- package/src/ChartInternal/internals/redraw.ts +0 -16
- package/src/ChartInternal/internals/scale.ts +7 -4
- package/src/ChartInternal/internals/size.axis.ts +14 -4
- package/src/ChartInternal/internals/size.ts +41 -18
- package/src/ChartInternal/internals/transform.ts +1 -1
- package/src/ChartInternal/internals/type.ts +10 -0
- package/src/config/Options/axis/x.ts +17 -0
- package/src/config/Options/axis/y.ts +2 -1
- package/src/config/Options/axis/y2.ts +2 -1
- package/src/config/Options/common/main.ts +19 -1
- package/src/config/resolver/axis.ts +2 -4
- package/src/module/browser.ts +13 -5
- package/src/module/generator.ts +3 -3
- package/src/module/util.ts +2 -2
- package/types/axis.d.ts +8 -7
- package/types/chart.d.ts +6 -1
- package/types/options.d.ts +6 -0
- package/src/Chart/api/grid.x.ts +0 -90
- package/src/Chart/api/grid.y.ts +0 -92
package/dist/billboard.pkgd.js
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.8.0-next.1
|
|
9
9
|
*
|
|
10
10
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
|
-
* - @types/d3-selection ^3.0.
|
|
11
|
+
* - @types/d3-selection ^3.0.5
|
|
12
12
|
* - @types/d3-transition ^3.0.3
|
|
13
13
|
* - d3-axis ^3.0.0
|
|
14
14
|
* - d3-brush ^3.0.0
|
|
@@ -1170,10 +1170,10 @@ var store = __webpack_require__(37);
|
|
|
1170
1170
|
(module.exports = function (key, value) {
|
|
1171
1171
|
return store[key] || (store[key] = value !== undefined ? value : {});
|
|
1172
1172
|
})('versions', []).push({
|
|
1173
|
-
version: '3.29.
|
|
1173
|
+
version: '3.29.1',
|
|
1174
1174
|
mode: IS_PURE ? 'pure' : 'global',
|
|
1175
1175
|
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
|
|
1176
|
-
license: 'https://github.com/zloirock/core-js/blob/v3.29.
|
|
1176
|
+
license: 'https://github.com/zloirock/core-js/blob/v3.29.1/LICENSE',
|
|
1177
1177
|
source: 'https://github.com/zloirock/core-js'
|
|
1178
1178
|
});
|
|
1179
1179
|
|
|
@@ -19757,23 +19757,25 @@ var browser_this = undefined;
|
|
|
19757
19757
|
/* eslint-disable no-new-func, no-undef */
|
|
19758
19758
|
|
|
19759
19759
|
var win = function () {
|
|
19760
|
-
|
|
19761
|
-
|
|
19762
|
-
|
|
19763
|
-
}.bind(undefined)()
|
|
19760
|
+
_newArrowCheck(this, browser_this);
|
|
19761
|
+
var root = typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis || typeof global === "object" && global !== null && global.Object === Object && global || typeof self === "object" && self !== null && self.Object === Object && self;
|
|
19762
|
+
return root || Function("return this")();
|
|
19763
|
+
}.bind(undefined)(),
|
|
19764
|
+
hasRAF = typeof win.requestAnimationFrame === "function",
|
|
19765
|
+
hasRIC = typeof win.requestIdleCallback === "function",
|
|
19766
|
+
requestAnimationFrame = hasRAF ? win.requestAnimationFrame : function (cb) {
|
|
19767
|
+
_newArrowCheck(this, browser_this);
|
|
19768
|
+
return setTimeout(cb, 1);
|
|
19769
|
+
}.bind(undefined),
|
|
19770
|
+
cancelAnimationFrame = hasRAF ? win.cancelAnimationFrame : function (id) {
|
|
19771
|
+
_newArrowCheck(this, browser_this);
|
|
19772
|
+
return clearTimeout(id);
|
|
19773
|
+
}.bind(undefined),
|
|
19774
|
+
requestIdleCallback = hasRIC ? win.requestIdleCallback : requestAnimationFrame,
|
|
19775
|
+
cancelIdleCallback = hasRIC ? win.cancelIdleCallback : cancelAnimationFrame,
|
|
19776
|
+
browser_doc = win == null ? void 0 : win.document;
|
|
19764
19777
|
/* eslint-enable no-new-func, no-undef */
|
|
19765
|
-
|
|
19766
19778
|
// fallback for non-supported environments
|
|
19767
|
-
win.requestIdleCallback = win.requestIdleCallback || function (cb) {
|
|
19768
|
-
_newArrowCheck(this, browser_this);
|
|
19769
|
-
return setTimeout(cb, 1);
|
|
19770
|
-
}.bind(undefined);
|
|
19771
|
-
// win.cancelIdleCallback = win.cancelIdleCallback || (id => clearTimeout(id));
|
|
19772
|
-
win.requestAnimationFrame = win.requestAnimationFrame || function (cb) {
|
|
19773
|
-
_newArrowCheck(this, browser_this);
|
|
19774
|
-
return setTimeout(cb, 1);
|
|
19775
|
-
}.bind(undefined);
|
|
19776
|
-
var browser_doc = win == null ? void 0 : win.document;
|
|
19777
19779
|
;// CONCATENATED MODULE: ./src/config/const.ts
|
|
19778
19780
|
/**
|
|
19779
19781
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -23213,7 +23215,7 @@ function convertInputType(mouse, touch) {
|
|
|
23213
23215
|
function runUntil(fn, conditionFn) {
|
|
23214
23216
|
var _this18 = this;
|
|
23215
23217
|
if (conditionFn() === !1) {
|
|
23216
|
-
|
|
23218
|
+
requestAnimationFrame(function () {
|
|
23217
23219
|
_newArrowCheck(this, _this18);
|
|
23218
23220
|
return runUntil(fn, conditionFn);
|
|
23219
23221
|
}.bind(this));
|
|
@@ -23825,15 +23827,30 @@ var Store = /*#__PURE__*/function () {
|
|
|
23825
23827
|
* - `false`: Remove padding completely and make shape to fully occupy the container element.
|
|
23826
23828
|
* - In this case, axes and subchart will be hidden.
|
|
23827
23829
|
* - To adjust some padding from this state, use `axis.[x|y].padding` option.
|
|
23830
|
+
* @property {string} [padding.mode] padding mode
|
|
23831
|
+
* - `"fit"`: Reduce padding as much as possible to make chart fit to the container element for chart types w/axis.<br>When specified, all padding values will be relative from fitted value.
|
|
23828
23832
|
* @property {number} [padding.top] padding on the top of chart
|
|
23829
23833
|
* @property {number} [padding.right] padding on the right of chart
|
|
23830
23834
|
* @property {number} [padding.bottom] padding on the bottom of chart
|
|
23831
23835
|
* @property {number} [padding.left] padding on the left of chart
|
|
23832
23836
|
* @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Padding)
|
|
23837
|
+
* @see [Demo: Fit padding](https://naver.github.io/billboard.js/demo/#ChartOptions.FitPadding)
|
|
23833
23838
|
* @example
|
|
23834
23839
|
* // remove padding completely.
|
|
23835
23840
|
* padding: false,
|
|
23836
23841
|
*
|
|
23842
|
+
* padding: {
|
|
23843
|
+
* // specifying mode value, will reduce padding and make fit to the container element.
|
|
23844
|
+
* mode: "fit"
|
|
23845
|
+
*
|
|
23846
|
+
* // when mode is "fit", all padding values will be relative from fitted value.
|
|
23847
|
+
* // so, 0 will be initial fitted value.
|
|
23848
|
+
* top: 20,
|
|
23849
|
+
* right: 20,
|
|
23850
|
+
* bottom: 20,
|
|
23851
|
+
* left: 20
|
|
23852
|
+
* }
|
|
23853
|
+
*
|
|
23837
23854
|
* // or specify padding value for each side
|
|
23838
23855
|
* padding: {
|
|
23839
23856
|
* top: 20,
|
|
@@ -23843,6 +23860,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
23843
23860
|
* }
|
|
23844
23861
|
*/
|
|
23845
23862
|
padding: !0,
|
|
23863
|
+
padding_mode: undefined,
|
|
23846
23864
|
padding_left: undefined,
|
|
23847
23865
|
padding_right: undefined,
|
|
23848
23866
|
padding_top: undefined,
|
|
@@ -23856,7 +23874,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
23856
23874
|
* @property {boolean} [resize.auto=true] Set chart resize automatically on viewport changes.
|
|
23857
23875
|
* @property {boolean|number} [resize.timer=true] Set resize timer option.
|
|
23858
23876
|
* - **NOTE:**
|
|
23859
|
-
* - The resize function will be called using:
|
|
23877
|
+
* - The resize function will be called using:
|
|
23878
|
+
* - true: `setTimeout()`
|
|
23879
|
+
* - false: `requestIdleCallback()`
|
|
23860
23880
|
* - Given number(delay in ms) value, resize function will be triggered using `setTimer()` with given delay.
|
|
23861
23881
|
* @example
|
|
23862
23882
|
* resize: {
|
|
@@ -25697,7 +25717,7 @@ function generateResize(option) {
|
|
|
25697
25717
|
var _this = this;
|
|
25698
25718
|
// Delay all resize functions call, to prevent unintended excessive call from resize event
|
|
25699
25719
|
callResizeFn.clear();
|
|
25700
|
-
if (option === !1
|
|
25720
|
+
if (option === !1) {
|
|
25701
25721
|
requestIdleCallback(function () {
|
|
25702
25722
|
var _this2 = this;
|
|
25703
25723
|
_newArrowCheck(this, _this);
|
|
@@ -26310,6 +26330,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
26310
26330
|
axis = $$.axis,
|
|
26311
26331
|
config = $$.config,
|
|
26312
26332
|
state = $$.state,
|
|
26333
|
+
chartType = config.data_type,
|
|
26313
26334
|
isCategorized = !1,
|
|
26314
26335
|
isTimeSeries = !1,
|
|
26315
26336
|
isCustomX = !1;
|
|
@@ -26453,11 +26474,12 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
26453
26474
|
state.hasPositiveValue = $$.hasPositiveValueInTargets(targets);
|
|
26454
26475
|
|
|
26455
26476
|
// set target types
|
|
26456
|
-
if (
|
|
26457
|
-
$$.
|
|
26477
|
+
if (chartType && $$.isValidChartType(chartType)) {
|
|
26478
|
+
var targetIds = $$.mapToIds(targets).filter(function (id) {
|
|
26458
26479
|
_newArrowCheck(this, _this2);
|
|
26459
|
-
return !(id in config.data_types);
|
|
26460
|
-
}.bind(this))
|
|
26480
|
+
return !(id in config.data_types) || !$$.isValidChartType(config.data_types[id]);
|
|
26481
|
+
}.bind(this));
|
|
26482
|
+
$$.setTargetType(targetIds, chartType);
|
|
26461
26483
|
}
|
|
26462
26484
|
|
|
26463
26485
|
// cache as original id keyed
|
|
@@ -26838,7 +26860,8 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
26838
26860
|
getMaxDataCountTarget: function getMaxDataCountTarget() {
|
|
26839
26861
|
var _this18 = this,
|
|
26840
26862
|
target = this.filterTargetsToShow() || [],
|
|
26841
|
-
length = target.length
|
|
26863
|
+
length = target.length,
|
|
26864
|
+
isInverted = this.config.axis_x_inverted;
|
|
26842
26865
|
if (length > 1) {
|
|
26843
26866
|
target = target.map(function (t) {
|
|
26844
26867
|
_newArrowCheck(this, _this18);
|
|
@@ -26850,11 +26873,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
26850
26873
|
_newArrowCheck(this, _this18);
|
|
26851
26874
|
return v.x;
|
|
26852
26875
|
}.bind(this));
|
|
26853
|
-
target = sortValue(getUnique(target)).map(function (x, index) {
|
|
26876
|
+
target = sortValue(getUnique(target)).map(function (x, index, array) {
|
|
26854
26877
|
_newArrowCheck(this, _this18);
|
|
26855
26878
|
return {
|
|
26856
26879
|
x: x,
|
|
26857
|
-
index: index
|
|
26880
|
+
index: isInverted ? array.length - index - 1 : index
|
|
26858
26881
|
};
|
|
26859
26882
|
}.bind(this));
|
|
26860
26883
|
} else if (length) {
|
|
@@ -27248,36 +27271,40 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27248
27271
|
return values;
|
|
27249
27272
|
}
|
|
27250
27273
|
|
|
27251
|
-
//
|
|
27252
|
-
|
|
27253
|
-
|
|
27254
|
-
|
|
27255
|
-
|
|
27256
|
-
|
|
27257
|
-
|
|
27258
|
-
|
|
27259
|
-
|
|
27260
|
-
|
|
27261
|
-
|
|
27262
|
-
|
|
27263
|
-
|
|
27264
|
-
|
|
27265
|
-
|
|
27266
|
-
|
|
27267
|
-
|
|
27274
|
+
// when all datas are null, return empty array
|
|
27275
|
+
// https://github.com/naver/billboard.js/issues/3124
|
|
27276
|
+
if (converted.length) {
|
|
27277
|
+
// insert & append cloning first/last value to be fully rendered covering on each gap sides
|
|
27278
|
+
var head = converted[0],
|
|
27279
|
+
tail = converted[converted.length - 1],
|
|
27280
|
+
id = head.id;
|
|
27281
|
+
var x = head.x;
|
|
27282
|
+
|
|
27283
|
+
// insert head
|
|
27284
|
+
converted.unshift({
|
|
27285
|
+
x: --x,
|
|
27286
|
+
value: head.value,
|
|
27287
|
+
id: id
|
|
27288
|
+
});
|
|
27289
|
+
isCategorized && stepType === "step-after" && converted.unshift({
|
|
27290
|
+
x: --x,
|
|
27291
|
+
value: head.value,
|
|
27292
|
+
id: id
|
|
27293
|
+
});
|
|
27268
27294
|
|
|
27269
|
-
|
|
27270
|
-
|
|
27271
|
-
|
|
27272
|
-
|
|
27273
|
-
|
|
27274
|
-
|
|
27275
|
-
|
|
27276
|
-
|
|
27277
|
-
|
|
27278
|
-
|
|
27279
|
-
|
|
27280
|
-
|
|
27295
|
+
// append tail
|
|
27296
|
+
x = tail.x;
|
|
27297
|
+
converted.push({
|
|
27298
|
+
x: ++x,
|
|
27299
|
+
value: tail.value,
|
|
27300
|
+
id: id
|
|
27301
|
+
});
|
|
27302
|
+
isCategorized && stepType === "step-before" && converted.push({
|
|
27303
|
+
x: ++x,
|
|
27304
|
+
value: tail.value,
|
|
27305
|
+
id: id
|
|
27306
|
+
});
|
|
27307
|
+
}
|
|
27281
27308
|
return converted;
|
|
27282
27309
|
},
|
|
27283
27310
|
convertValuesToRange: function convertValuesToRange(values) {
|
|
@@ -27503,11 +27530,27 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27503
27530
|
*/
|
|
27504
27531
|
|
|
27505
27532
|
|
|
27533
|
+
|
|
27534
|
+
/**
|
|
27535
|
+
* Call done callback with resize after transition
|
|
27536
|
+
* @param {Function} fn Callback function
|
|
27537
|
+
* @param {boolean} resizeAfter Weather to resize chart after the load
|
|
27538
|
+
* @private
|
|
27539
|
+
*/
|
|
27540
|
+
function callDone(fn, resizeAfter) {
|
|
27541
|
+
if (resizeAfter === void 0) {
|
|
27542
|
+
resizeAfter = !1;
|
|
27543
|
+
}
|
|
27544
|
+
var $$ = this,
|
|
27545
|
+
api = $$.api;
|
|
27546
|
+
resizeAfter && $$.api.flush(!0);
|
|
27547
|
+
fn == null ? void 0 : fn.call(api);
|
|
27548
|
+
}
|
|
27506
27549
|
/* harmony default export */ var load = ({
|
|
27507
27550
|
load: function load(rawTargets, args) {
|
|
27508
27551
|
var _this = this,
|
|
27509
|
-
_args$done,
|
|
27510
27552
|
$$ = this,
|
|
27553
|
+
data = $$.data,
|
|
27511
27554
|
append = args.append,
|
|
27512
27555
|
targets = rawTargets;
|
|
27513
27556
|
if (targets) {
|
|
@@ -27527,7 +27570,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27527
27570
|
}
|
|
27528
27571
|
|
|
27529
27572
|
// Update/Add data
|
|
27530
|
-
|
|
27573
|
+
data.targets.forEach(function (d) {
|
|
27531
27574
|
_newArrowCheck(this, _this);
|
|
27532
27575
|
for (var i = 0; i < targets.length; i++) {
|
|
27533
27576
|
if (d.id === targets[i].id) {
|
|
@@ -27537,11 +27580,11 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27537
27580
|
}
|
|
27538
27581
|
}
|
|
27539
27582
|
}.bind(this));
|
|
27540
|
-
|
|
27583
|
+
data.targets = data.targets.concat(targets); // add remained
|
|
27541
27584
|
}
|
|
27542
27585
|
|
|
27543
27586
|
// Set targets
|
|
27544
|
-
$$.updateTargets(
|
|
27587
|
+
$$.updateTargets(data.targets);
|
|
27545
27588
|
|
|
27546
27589
|
// Redraw with new targets
|
|
27547
27590
|
$$.redraw({
|
|
@@ -27552,7 +27595,7 @@ function getDataKeyForJson(keysParam, config) {
|
|
|
27552
27595
|
|
|
27553
27596
|
// Update current state chart type and elements list after redraw
|
|
27554
27597
|
$$.updateTypesElements();
|
|
27555
|
-
(
|
|
27598
|
+
callDone.call($$, args.done, args.resizeAfter);
|
|
27556
27599
|
},
|
|
27557
27600
|
loadFromArgs: function loadFromArgs(args) {
|
|
27558
27601
|
var _this2 = this,
|
|
@@ -29090,7 +29133,9 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
29090
29133
|
getXDomain: function getXDomain(targets) {
|
|
29091
29134
|
var $$ = this,
|
|
29092
29135
|
axis = $$.axis,
|
|
29136
|
+
config = $$.config,
|
|
29093
29137
|
x = $$.scale.x,
|
|
29138
|
+
isInverted = config.axis_x_inverted,
|
|
29094
29139
|
domain = [$$.getXDomainMinMax(targets, "min"), $$.getXDomainMinMax(targets, "max")];
|
|
29095
29140
|
var _domain$ = domain[0],
|
|
29096
29141
|
min = _domain$ === void 0 ? 0 : _domain$,
|
|
@@ -29120,7 +29165,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
29120
29165
|
max = isTimeSeries ? new Date(lastX.getTime() + padding.right) : lastX + padding.right;
|
|
29121
29166
|
}
|
|
29122
29167
|
}
|
|
29123
|
-
return [min, max];
|
|
29168
|
+
return isInverted ? [max, min] : [min, max];
|
|
29124
29169
|
},
|
|
29125
29170
|
updateXDomain: function updateXDomain(targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
|
|
29126
29171
|
var $$ = this,
|
|
@@ -29132,7 +29177,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
29132
29177
|
zoomEnabled = config.zoom_enabled;
|
|
29133
29178
|
if (withUpdateOrgXDomain) {
|
|
29134
29179
|
var _$$$brush;
|
|
29135
|
-
x.domain(domain || sortValue($$.getXDomain(targets)));
|
|
29180
|
+
x.domain(domain || sortValue($$.getXDomain(targets), !config.axis_x_inverted));
|
|
29136
29181
|
org.xDomain = x.domain();
|
|
29137
29182
|
zoomEnabled && $$.zoom.updateScaleExtent();
|
|
29138
29183
|
subX.domain(x.domain());
|
|
@@ -29148,15 +29193,24 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
29148
29193
|
withTrim && x.domain($$.trimXDomain(x.orgDomain()));
|
|
29149
29194
|
return x.domain();
|
|
29150
29195
|
},
|
|
29196
|
+
/**
|
|
29197
|
+
* Trim x domain when given domain surpasses the range
|
|
29198
|
+
* @param {Array} domain Domain value
|
|
29199
|
+
* @returns {Array} Trimed domain if given domain is out of range
|
|
29200
|
+
* @private
|
|
29201
|
+
*/
|
|
29151
29202
|
trimXDomain: function trimXDomain(domain) {
|
|
29152
|
-
var
|
|
29153
|
-
|
|
29154
|
-
|
|
29155
|
-
|
|
29156
|
-
|
|
29203
|
+
var $$ = this,
|
|
29204
|
+
isInverted = $$.config.axis_x_inverted,
|
|
29205
|
+
zoomDomain = $$.getZoomDomain(),
|
|
29206
|
+
_zoomDomain = zoomDomain,
|
|
29207
|
+
min = _zoomDomain[0],
|
|
29208
|
+
max = _zoomDomain[1];
|
|
29209
|
+
if (isInverted ? domain[0] >= min : domain[0] <= min) {
|
|
29157
29210
|
domain[0] = min;
|
|
29211
|
+
domain[1] = +domain[1] + (min - domain[0]);
|
|
29158
29212
|
}
|
|
29159
|
-
if (
|
|
29213
|
+
if (isInverted ? domain[1] <= max : domain[1] >= max) {
|
|
29160
29214
|
domain[0] = +domain[0] - (domain[1] - max);
|
|
29161
29215
|
domain[1] = max;
|
|
29162
29216
|
}
|
|
@@ -29501,13 +29555,15 @@ function getLegendColor(id) {
|
|
|
29501
29555
|
* @private
|
|
29502
29556
|
*/
|
|
29503
29557
|
getLegendHeight: function getLegendHeight() {
|
|
29504
|
-
var
|
|
29558
|
+
var _$$$config$padding,
|
|
29559
|
+
$$ = this,
|
|
29505
29560
|
_$$$state3 = $$.state,
|
|
29506
29561
|
current = _$$$state3.current,
|
|
29507
29562
|
isLegendRight = _$$$state3.isLegendRight,
|
|
29508
29563
|
legendItemHeight = _$$$state3.legendItemHeight,
|
|
29509
|
-
legendStep = _$$$state3.legendStep
|
|
29510
|
-
|
|
29564
|
+
legendStep = _$$$state3.legendStep,
|
|
29565
|
+
isFitPadding = ((_$$$config$padding = $$.config.padding) == null ? void 0 : _$$$config$padding.mode) === "fit";
|
|
29566
|
+
return $$.config.legend_show ? isLegendRight ? current.height : (isFitPadding ? 10 : Math.max(20, legendItemHeight)) * (legendStep + 1) : 0;
|
|
29511
29567
|
},
|
|
29512
29568
|
/**
|
|
29513
29569
|
* Get the opacity of the legend that is unfocused
|
|
@@ -30276,20 +30332,6 @@ function getLegendColor(id) {
|
|
|
30276
30332
|
|
|
30277
30333
|
// Draw with new sizes & scales
|
|
30278
30334
|
$$.redraw(options, transitions);
|
|
30279
|
-
},
|
|
30280
|
-
/**
|
|
30281
|
-
* Redraw without rescale
|
|
30282
|
-
* @private
|
|
30283
|
-
*/
|
|
30284
|
-
redrawWithoutRescale: function redrawWithoutRescale() {
|
|
30285
|
-
this.redraw({
|
|
30286
|
-
withY: !1,
|
|
30287
|
-
withDimension: !1,
|
|
30288
|
-
withLegend: !1,
|
|
30289
|
-
withSubchart: !1,
|
|
30290
|
-
withEventRect: !1,
|
|
30291
|
-
withTransitionForAxis: !1
|
|
30292
|
-
});
|
|
30293
30335
|
}
|
|
30294
30336
|
});
|
|
30295
30337
|
;// CONCATENATED MODULE: ./node_modules/d3-array/src/ticks.js
|
|
@@ -31581,7 +31623,7 @@ function getScale(type, min, max) {
|
|
|
31581
31623
|
getXScale: function getXScale(min, max, domain, offset) {
|
|
31582
31624
|
var $$ = this,
|
|
31583
31625
|
scale = $$.scale.zoom || getScale($$.axis.getAxisType("x"), min, max);
|
|
31584
|
-
return $$.
|
|
31626
|
+
return $$.getCustomizedXScale(domain ? scale.domain(domain) : scale, offset);
|
|
31585
31627
|
},
|
|
31586
31628
|
/**
|
|
31587
31629
|
* Get y Axis scale function
|
|
@@ -31615,19 +31657,20 @@ function getScale(type, min, max) {
|
|
|
31615
31657
|
return this.scale[key];
|
|
31616
31658
|
},
|
|
31617
31659
|
/**
|
|
31618
|
-
* Get customized scale
|
|
31660
|
+
* Get customized x axis scale
|
|
31619
31661
|
* @param {d3.scaleLinear|d3.scaleTime} scaleValue Scale function
|
|
31620
31662
|
* @param {Function} offsetValue Offset getter to be sum
|
|
31621
31663
|
* @returns {Function} Scale function
|
|
31622
31664
|
* @private
|
|
31623
31665
|
*/
|
|
31624
|
-
|
|
31666
|
+
getCustomizedXScale: function getCustomizedXScale(scaleValue, offsetValue) {
|
|
31625
31667
|
var _this = this,
|
|
31626
31668
|
$$ = this,
|
|
31627
31669
|
offset = offsetValue || function () {
|
|
31628
31670
|
_newArrowCheck(this, _this);
|
|
31629
31671
|
return $$.axis.x.tickOffset();
|
|
31630
31672
|
}.bind(this),
|
|
31673
|
+
isInverted = $$.config.axis_x_inverted,
|
|
31631
31674
|
scale = function (d, raw) {
|
|
31632
31675
|
var v = scaleValue(d) + offset();
|
|
31633
31676
|
return raw ? v : Math.ceil(v);
|
|
@@ -31651,7 +31694,7 @@ function getScale(type, min, max) {
|
|
|
31651
31694
|
var domain = domainValue;
|
|
31652
31695
|
if (!arguments.length) {
|
|
31653
31696
|
domain = this.orgDomain();
|
|
31654
|
-
return [domain[0], domain[1] + 1];
|
|
31697
|
+
return isInverted ? [domain[0] + 1, domain[1]] : [domain[0], domain[1] + 1];
|
|
31655
31698
|
}
|
|
31656
31699
|
scaleValue.domain(domain);
|
|
31657
31700
|
return scale;
|
|
@@ -33227,47 +33270,60 @@ function stepAfter(context) {
|
|
|
33227
33270
|
return padding + (axesLen ? $$.getHorizontalAxisHeight(axisId) * axesLen : 0);
|
|
33228
33271
|
},
|
|
33229
33272
|
getCurrentPaddingLeft: function getCurrentPaddingLeft(withoutRecompute) {
|
|
33230
|
-
var
|
|
33273
|
+
var _config$padding,
|
|
33274
|
+
$$ = this,
|
|
33231
33275
|
config = $$.config,
|
|
33232
33276
|
hasAxis = $$.state.hasAxis,
|
|
33233
33277
|
isRotated = config.axis_rotated,
|
|
33278
|
+
isFitPadding = ((_config$padding = config.padding) == null ? void 0 : _config$padding.mode) === "fit",
|
|
33234
33279
|
axisId = isRotated ? "x" : "y",
|
|
33235
33280
|
axesLen = hasAxis ? config["axis_" + axisId + "_axes"].length : 0,
|
|
33236
33281
|
axisWidth = hasAxis ? $$.getAxisWidthByAxisId(axisId, withoutRecompute) : 0;
|
|
33237
|
-
|
|
33282
|
+
if (!isFitPadding) {
|
|
33283
|
+
axisWidth = ceil10(axisWidth);
|
|
33284
|
+
}
|
|
33285
|
+
var padding = config["axis_" + axisId + "_inner"] || !config["axis_" + axisId + "_show"] ? 0 : axisWidth;
|
|
33238
33286
|
if (isValue(config.padding_left)) {
|
|
33239
|
-
padding = config.padding_left;
|
|
33287
|
+
padding = config.padding_left + (isFitPadding && isRotated ? axisWidth : 0);
|
|
33240
33288
|
} else if (hasAxis && isRotated) {
|
|
33241
|
-
padding = !config.axis_x_show ? 1 : Math.max(
|
|
33242
|
-
}
|
|
33243
|
-
|
|
33244
|
-
padding
|
|
33245
|
-
} else {
|
|
33246
|
-
padding = ceil10(axisWidth);
|
|
33289
|
+
padding = !config.axis_x_show ? 1 : isFitPadding ? axisWidth : Math.max(axisWidth, 40);
|
|
33290
|
+
}
|
|
33291
|
+
if (hasAxis && (isFitPadding || config["axis_" + axisId + "_inner"]) && config["axis_" + axisId + "_label"].text) {
|
|
33292
|
+
padding += $$.axis.getAxisLabelPosition("y").isOuter ? 20 : 0;
|
|
33247
33293
|
}
|
|
33248
33294
|
return padding + axisWidth * axesLen;
|
|
33249
33295
|
},
|
|
33250
33296
|
getCurrentPaddingRight: function getCurrentPaddingRight(withXAxisTickTextOverflow) {
|
|
33297
|
+
var _config$padding2, _$$$axis;
|
|
33251
33298
|
if (withXAxisTickTextOverflow === void 0) {
|
|
33252
33299
|
withXAxisTickTextOverflow = !1;
|
|
33253
33300
|
}
|
|
33254
33301
|
var $$ = this,
|
|
33255
33302
|
config = $$.config,
|
|
33256
33303
|
hasAxis = $$.state.hasAxis,
|
|
33304
|
+
isRotated = config.axis_rotated,
|
|
33305
|
+
isFitPadding = ((_config$padding2 = config.padding) == null ? void 0 : _config$padding2.mode) === "fit",
|
|
33306
|
+
defaultPadding = isFitPadding ? 2 : 10,
|
|
33257
33307
|
legendWidthOnRight = $$.state.isLegendRight ? $$.getLegendWidth() + 20 : 0,
|
|
33258
33308
|
axesLen = hasAxis ? config.axis_y2_axes.length : 0,
|
|
33259
|
-
|
|
33260
|
-
xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(
|
|
33261
|
-
var
|
|
33309
|
+
axisLabelWidth = (_$$$axis = $$.axis) != null && _$$$axis.getAxisLabelPosition("y2").isOuter ? 20 : 0,
|
|
33310
|
+
xAxisTickTextOverflow = withXAxisTickTextOverflow ? $$.axis.getXAxisTickTextY2Overflow(defaultPadding) : 0;
|
|
33311
|
+
var axisWidth = hasAxis && !config.axis_y2_inner ? $$.getAxisWidthByAxisId("y2") : 1;
|
|
33312
|
+
if (!isFitPadding) {
|
|
33313
|
+
axisWidth = ceil10(axisWidth);
|
|
33314
|
+
}
|
|
33315
|
+
var padding = isRotated ? 0 : Math.max(axisWidth + legendWidthOnRight, xAxisTickTextOverflow);
|
|
33262
33316
|
if (isValue(config.padding_right)) {
|
|
33263
|
-
padding = config.padding_right + (hasAxis ? 1 : 0); // 1 is needed not to hide tick line
|
|
33264
|
-
|
|
33265
|
-
padding =
|
|
33317
|
+
// padding = config.padding_right + (hasAxis ? 1 : 0); // 1 is needed not to hide tick line
|
|
33318
|
+
|
|
33319
|
+
padding = config.padding_right + (isFitPadding && (isRotated || !config.axis_y2_show ? defaultPadding : padding)) + (hasAxis && !isFitPadding ? 1 : 0); // 1 is needed not to hide tick line
|
|
33320
|
+
} else if ($$.axis && isRotated) {
|
|
33321
|
+
padding = defaultPadding + legendWidthOnRight;
|
|
33266
33322
|
} else if ($$.axis && (!config.axis_y2_show || config.axis_y2_inner)) {
|
|
33267
|
-
|
|
33268
|
-
|
|
33269
|
-
|
|
33270
|
-
padding
|
|
33323
|
+
padding = Math.max((isFitPadding && !config.axis_y2_show ? 2 : 1) + legendWidthOnRight + axisLabelWidth, xAxisTickTextOverflow);
|
|
33324
|
+
}
|
|
33325
|
+
if (hasAxis && !isRotated && isFitPadding && config.axis_y2_show && !config.axis_y2_inner && config.axis_y2_label.text) {
|
|
33326
|
+
padding += axisLabelWidth;
|
|
33271
33327
|
}
|
|
33272
33328
|
return padding + axisWidth * axesLen;
|
|
33273
33329
|
},
|
|
@@ -33406,12 +33462,14 @@ function stepAfter(context) {
|
|
|
33406
33462
|
* @private
|
|
33407
33463
|
*/
|
|
33408
33464
|
updateSizes: function updateSizes(isInit) {
|
|
33409
|
-
var
|
|
33465
|
+
var _config$padding3,
|
|
33466
|
+
$$ = this,
|
|
33410
33467
|
config = $$.config,
|
|
33411
33468
|
state = $$.state,
|
|
33412
33469
|
legend = $$.$el.legend,
|
|
33413
33470
|
isRotated = config.axis_rotated,
|
|
33414
|
-
isNonAxis = $$.hasArcType() || state.hasTreemap
|
|
33471
|
+
isNonAxis = $$.hasArcType() || state.hasTreemap,
|
|
33472
|
+
isFitPadding = ((_config$padding3 = config.padding) == null ? void 0 : _config$padding3.mode) === "fit";
|
|
33415
33473
|
isInit || $$.setContainerSize();
|
|
33416
33474
|
var currLegend = {
|
|
33417
33475
|
width: legend ? $$.getLegendWidth() : 0,
|
|
@@ -33432,7 +33490,7 @@ function stepAfter(context) {
|
|
|
33432
33490
|
bottom: $$.getHorizontalAxisHeight("y") + legendHeightForBottom + padding.bottom,
|
|
33433
33491
|
left: subchartHeight + (isNonAxis ? 0 : padding.left)
|
|
33434
33492
|
} : {
|
|
33435
|
-
top: 4 + padding.top,
|
|
33493
|
+
top: (isFitPadding ? 0 : 4) + padding.top,
|
|
33436
33494
|
// for top tick text
|
|
33437
33495
|
right: isNonAxis ? 0 : $$.getCurrentPaddingRight(!0),
|
|
33438
33496
|
bottom: xAxisHeight + subchartHeight + legendHeightForBottom + padding.bottom,
|
|
@@ -34707,7 +34765,7 @@ function getTextPos(pos, width) {
|
|
|
34707
34765
|
y = isRotated ? state.height + padding : 0;
|
|
34708
34766
|
} else if (target === "y2") {
|
|
34709
34767
|
x = isRotated ? 0 : state.width + padding;
|
|
34710
|
-
y = isRotated ? 1 - padding : 0;
|
|
34768
|
+
y = isRotated && padding ? 1 - padding : 0;
|
|
34711
34769
|
} else if (target === "subX") {
|
|
34712
34770
|
x = 0;
|
|
34713
34771
|
y = isRotated ? 0 : state.height2;
|
|
@@ -34759,6 +34817,15 @@ function getTextPos(pos, width) {
|
|
|
34759
34817
|
|
|
34760
34818
|
|
|
34761
34819
|
/* harmony default export */ var internals_type = ({
|
|
34820
|
+
/**
|
|
34821
|
+
* Check if the given chart type is valid
|
|
34822
|
+
* @param {string} type Chart type string
|
|
34823
|
+
* @returns {boolean}
|
|
34824
|
+
* @private
|
|
34825
|
+
*/
|
|
34826
|
+
isValidChartType: function isValidChartType(type) {
|
|
34827
|
+
return !!(type && Object.values(TYPE).indexOf(type) > -1);
|
|
34828
|
+
},
|
|
34762
34829
|
setTargetType: function setTargetType(targetIds, type) {
|
|
34763
34830
|
var _this = this,
|
|
34764
34831
|
$$ = this,
|
|
@@ -35326,7 +35393,7 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
35326
35393
|
|
|
35327
35394
|
// Set domains for each scale
|
|
35328
35395
|
if (x) {
|
|
35329
|
-
x.domain(sortValue($$.getXDomain($$.data.targets)));
|
|
35396
|
+
x.domain(sortValue($$.getXDomain($$.data.targets), !config.axis_x_inverted));
|
|
35330
35397
|
subX.domain(x.domain());
|
|
35331
35398
|
|
|
35332
35399
|
// Save original x domain for zoom update
|
|
@@ -36586,17 +36653,17 @@ function renderText(ctx, glyph) {
|
|
|
36586
36653
|
state.defocusedTargetIds = targetIds;
|
|
36587
36654
|
},
|
|
36588
36655
|
/**
|
|
36589
|
-
*
|
|
36590
|
-
* You can specify multiple targets by giving an array that includes id as
|
|
36656
|
+
* Revert focused or defocused state to initial state.<br><br>
|
|
36657
|
+
* You can specify multiple targets by giving an array that includes id as string. If no argument is given, all of targets will be reverted.
|
|
36591
36658
|
* @function revert
|
|
36592
36659
|
* @instance
|
|
36593
36660
|
* @memberof Chart
|
|
36594
36661
|
* @param {string|Array} targetIdsValue Target ids to be reverted
|
|
36595
36662
|
* @example
|
|
36596
|
-
* // data1 will be reverted.
|
|
36663
|
+
* // 'data1' will be reverted.
|
|
36597
36664
|
* chart.revert("data1");
|
|
36598
36665
|
*
|
|
36599
|
-
* // data1 and data2 will be reverted.
|
|
36666
|
+
* // 'data1' and 'data2' will be reverted.
|
|
36600
36667
|
* chart.revert(["data1", "data2"]);
|
|
36601
36668
|
*
|
|
36602
36669
|
* // all targets will be reverted.
|
|
@@ -36698,6 +36765,7 @@ var legend_legend = {
|
|
|
36698
36765
|
*/
|
|
36699
36766
|
|
|
36700
36767
|
|
|
36768
|
+
|
|
36701
36769
|
/* harmony default export */ var api_load = ({
|
|
36702
36770
|
/**
|
|
36703
36771
|
* Load data to the chart.<br><br>
|
|
@@ -36712,23 +36780,29 @@ var legend_legend = {
|
|
|
36712
36780
|
* @memberof Chart
|
|
36713
36781
|
* @param {object} args The object can consist with following members:<br>
|
|
36714
36782
|
*
|
|
36715
|
-
* | Key | Description |
|
|
36716
|
-
* | --- | --- |
|
|
36717
|
-
* |
|
|
36718
|
-
* |
|
|
36719
|
-
* |
|
|
36720
|
-
* |
|
|
36721
|
-
* |
|
|
36722
|
-
* |
|
|
36723
|
-
* |
|
|
36724
|
-
* |
|
|
36725
|
-
* |
|
|
36726
|
-
* |
|
|
36727
|
-
* |
|
|
36728
|
-
* |
|
|
36729
|
-
* |
|
|
36730
|
-
* |
|
|
36731
|
-
* |
|
|
36783
|
+
* | Key | Type | Description |
|
|
36784
|
+
* | --- | --- | --- |
|
|
36785
|
+
* | columns | Array | The `columns` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |
|
|
36786
|
+
* | json | Array | The `json` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |
|
|
36787
|
+
* | rows | Array | The `rows` data will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |
|
|
36788
|
+
* | url | string | The data from `url` will be loaded. If data that has the same target id is given, the chart will be updated. Otherwise, new target will be added |
|
|
36789
|
+
* | | | |
|
|
36790
|
+
* | append | boolean | Load data appending it to the current dataseries.<br>If the existing chart has`x` value, should provide with corresponding `x` value for newly loaded data. |
|
|
36791
|
+
* | axes | Object | The axes specified by data.axes will be updated. axes must be Object that has target id as keys. |
|
|
36792
|
+
* | categories | Array | The categories specified by axis.x.categories or data.x will be updated. categories must be Array. |
|
|
36793
|
+
* | classes | Object | The classes specified by data.classes will be updated. classes must be Object that has target id as keys. |
|
|
36794
|
+
* | colors | Object | The colors specified by data.colors will be updated. colors must be Object that has target id as keys. |
|
|
36795
|
+
* | data | Obejct | Data objects to be loaded. Checkout the example. |
|
|
36796
|
+
* | done | Function | The specified function will be called after data loaded.|
|
|
36797
|
+
* | headers | string | Set request header if loading via `data.url`.<br>@see [data․headers](Options.html#.data%25E2%2580%25A4headers) |
|
|
36798
|
+
* | keys | Object | Choose which JSON objects keys correspond to desired data.<br>**NOTE:** Only for JSON object given as array.<br>@see [data․keys](Options.html#.data%25E2%2580%25A4keys) |
|
|
36799
|
+
* | mimeType | string | Set 'json' if loading JSON via url.<br>@see [data․mimeType](Options.html#.data%25E2%2580%25A4mimeType) |
|
|
36800
|
+
* | names | Object | Same as data.names() |
|
|
36801
|
+
* | resizeAfter | boolean | Resize after the load. Default value is `false`.<br>- This option won't call `onresize` neither `onresized`.<br>- When set to 'true', will call `.flush(true)` at the end of load. |
|
|
36802
|
+
* | type | string | The type of targets will be updated. |
|
|
36803
|
+
* | types | Object | The types of targets will be updated. |
|
|
36804
|
+
* | unload | Array | Specify the data will be unloaded before loading new data. If true given, all of data will be unloaded. If target ids given as String or Array, specified targets will be unloaded. If absent or false given, unload will not occur. |
|
|
36805
|
+
* | xs | string | Same as data.xs option |
|
|
36732
36806
|
* @see [Demo](https://naver.github.io/billboard.js/demo/#Data.DataFromURL)
|
|
36733
36807
|
* @example
|
|
36734
36808
|
* // Load data1 and unload data2 and data3
|
|
@@ -36740,6 +36814,7 @@ var legend_legend = {
|
|
|
36740
36814
|
* unload: ["data2", "data3"],
|
|
36741
36815
|
* url: "...",
|
|
36742
36816
|
* done: function() { ... }
|
|
36817
|
+
* resizeAfter: true // will resize after load
|
|
36743
36818
|
* });
|
|
36744
36819
|
* @example
|
|
36745
36820
|
* const chart = bb.generate({
|
|
@@ -36869,7 +36944,7 @@ var legend_legend = {
|
|
|
36869
36944
|
_newArrowCheck(this, _this);
|
|
36870
36945
|
// to mitigate improper rendering for multiple consecutive calls
|
|
36871
36946
|
// https://github.com/naver/billboard.js/issues/2121
|
|
36872
|
-
|
|
36947
|
+
requestIdleCallback(function () {
|
|
36873
36948
|
_newArrowCheck(this, _this2);
|
|
36874
36949
|
return $$.loadFromArgs(args);
|
|
36875
36950
|
}.bind(this));
|
|
@@ -36893,13 +36968,15 @@ var legend_legend = {
|
|
|
36893
36968
|
* | --- | --- | --- |
|
|
36894
36969
|
* | ids | String | Array | Target id data to be unloaded. If not given, all data will be unloaded. |
|
|
36895
36970
|
* | done | Fuction | Callback after data is unloaded. |
|
|
36971
|
+
* | resizeAfter | boolean | Resize after the unload. Default value is `false`.<br>- This option won't call `onresize` neither `onresized`.<br>- When set to 'true', will call `.flush(true)` at the end of unload. |
|
|
36896
36972
|
* @example
|
|
36897
36973
|
* // Unload data2 and data3
|
|
36898
36974
|
* chart.unload({
|
|
36899
36975
|
* ids: ["data2", "data3"],
|
|
36900
36976
|
* done: function() {
|
|
36901
36977
|
* // called after the unloaded
|
|
36902
|
-
* }
|
|
36978
|
+
* },
|
|
36979
|
+
* resizeAfter: true // will resize after unload
|
|
36903
36980
|
* });
|
|
36904
36981
|
*/
|
|
36905
36982
|
unload: function unload(argsValue) {
|
|
@@ -36924,7 +37001,7 @@ var legend_legend = {
|
|
|
36924
37001
|
withLegend: !0
|
|
36925
37002
|
});
|
|
36926
37003
|
$$.cache.remove(ids);
|
|
36927
|
-
args.done
|
|
37004
|
+
callDone.call($$, args.done, args.resizeAfter);
|
|
36928
37005
|
}.bind(this));
|
|
36929
37006
|
}
|
|
36930
37007
|
});
|
|
@@ -37611,19 +37688,61 @@ var axis = {
|
|
|
37611
37688
|
return config.axis_x_categories;
|
|
37612
37689
|
}
|
|
37613
37690
|
});
|
|
37614
|
-
;// CONCATENATED MODULE: ./src/Chart/api/grid.
|
|
37691
|
+
;// CONCATENATED MODULE: ./src/Chart/api/grid.ts
|
|
37615
37692
|
/**
|
|
37616
37693
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
37617
37694
|
* billboard.js project is licensed under the MIT license
|
|
37618
37695
|
*/
|
|
37619
37696
|
|
|
37697
|
+
/**
|
|
37698
|
+
* Update grid lines.
|
|
37699
|
+
* @param {Array} grids grid lines to update
|
|
37700
|
+
* @param {string} axisId axis' id: "x" or "y"
|
|
37701
|
+
* @returns {Array}
|
|
37702
|
+
* @private
|
|
37703
|
+
*/
|
|
37704
|
+
function grid(grids, axisId) {
|
|
37705
|
+
var $$ = this.internal,
|
|
37706
|
+
config = $$.config,
|
|
37707
|
+
withTransition = config.transition_duration && isTabVisible(),
|
|
37708
|
+
gridPropLines = "grid_" + axisId + "_lines";
|
|
37709
|
+
if (!grids) {
|
|
37710
|
+
return config[gridPropLines];
|
|
37711
|
+
}
|
|
37712
|
+
config[gridPropLines] = grids;
|
|
37713
|
+
$$.updateGrid();
|
|
37714
|
+
$$.redrawGrid(withTransition);
|
|
37715
|
+
return config[gridPropLines];
|
|
37716
|
+
}
|
|
37717
|
+
|
|
37718
|
+
/**
|
|
37719
|
+
* Add grid lines.
|
|
37720
|
+
* @param {Array|object} grids grid lines to add
|
|
37721
|
+
* @param {string} axisId axis' id: "x" or "y"
|
|
37722
|
+
* @returns {Array}
|
|
37723
|
+
* @private
|
|
37724
|
+
*/
|
|
37725
|
+
function _add(grids, axisId) {
|
|
37726
|
+
return grid.bind(this)(this.internal.config["grid_" + axisId + "_lines"].concat(grids || []), axisId);
|
|
37727
|
+
}
|
|
37728
|
+
|
|
37729
|
+
/**
|
|
37730
|
+
* Remove grid lines.
|
|
37731
|
+
* @param {object} grids grid lines to remove
|
|
37732
|
+
* @param {boolean} isXAxis weather is x axis or not
|
|
37733
|
+
* @private
|
|
37734
|
+
*/
|
|
37735
|
+
function _remove(grids, isXAxis) {
|
|
37736
|
+
this.internal.removeGridLines(grids, isXAxis);
|
|
37737
|
+
}
|
|
37738
|
+
|
|
37620
37739
|
/**
|
|
37621
37740
|
* Update x grid lines.
|
|
37622
37741
|
* @function xgrids
|
|
37623
37742
|
* @instance
|
|
37624
37743
|
* @memberof Chart
|
|
37625
37744
|
* @param {Array} grids X grid lines will be replaced with this argument. The format of this argument is the same as grid.x.lines.
|
|
37626
|
-
* @returns {
|
|
37745
|
+
* @returns {Array}
|
|
37627
37746
|
* @example
|
|
37628
37747
|
* // Show 2 x grid lines
|
|
37629
37748
|
* chart.xgrids([
|
|
@@ -37633,14 +37752,7 @@ var axis = {
|
|
|
37633
37752
|
* // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
|
|
37634
37753
|
*/
|
|
37635
37754
|
var xgrids = function (grids) {
|
|
37636
|
-
|
|
37637
|
-
config = $$.config;
|
|
37638
|
-
if (!grids) {
|
|
37639
|
-
return config.grid_x_lines;
|
|
37640
|
-
}
|
|
37641
|
-
config.grid_x_lines = grids;
|
|
37642
|
-
$$.redrawWithoutRescale();
|
|
37643
|
-
return config.grid_x_lines;
|
|
37755
|
+
return grid.bind(this)(grids, "x");
|
|
37644
37756
|
};
|
|
37645
37757
|
util_extend(xgrids, {
|
|
37646
37758
|
/**
|
|
@@ -37650,7 +37762,7 @@ util_extend(xgrids, {
|
|
|
37650
37762
|
* @instance
|
|
37651
37763
|
* @memberof Chart
|
|
37652
37764
|
* @param {Array|object} grids New x grid lines will be added. The format of this argument is the same as grid.x.lines and it's possible to give an Object if only one line will be added.
|
|
37653
|
-
* @returns {
|
|
37765
|
+
* @returns {Array}
|
|
37654
37766
|
* @example
|
|
37655
37767
|
* // Add a new x grid line
|
|
37656
37768
|
* chart.xgrids.add(
|
|
@@ -37664,7 +37776,7 @@ util_extend(xgrids, {
|
|
|
37664
37776
|
* ]);
|
|
37665
37777
|
*/
|
|
37666
37778
|
add: function add(grids) {
|
|
37667
|
-
return
|
|
37779
|
+
return _add.bind(this)(grids, "x");
|
|
37668
37780
|
},
|
|
37669
37781
|
/**
|
|
37670
37782
|
* Remove x grid lines.<br>
|
|
@@ -37672,7 +37784,10 @@ util_extend(xgrids, {
|
|
|
37672
37784
|
* @function xgrids․remove
|
|
37673
37785
|
* @instance
|
|
37674
37786
|
* @memberof Chart
|
|
37675
|
-
* @param {object}
|
|
37787
|
+
* @param {object} grids This argument should include value or class. If value is given, the x grid lines that have specified x value will be removed. If class is given, the x grid lines that have specified class will be removed. If args is not given, all of x grid lines will be removed.
|
|
37788
|
+
* @param {number} [grids.value] target value
|
|
37789
|
+
* @param {string} [grids.class] target class
|
|
37790
|
+
* @returns {void}
|
|
37676
37791
|
* @example
|
|
37677
37792
|
* // x grid line on x = 2 will be removed
|
|
37678
37793
|
* chart.xgrids.remove({value: 2});
|
|
@@ -37685,20 +37800,11 @@ util_extend(xgrids, {
|
|
|
37685
37800
|
* // all of x grid lines will be removed
|
|
37686
37801
|
* chart.xgrids.remove();
|
|
37687
37802
|
*/
|
|
37688
|
-
remove: function remove(
|
|
37803
|
+
remove: function remove(grids) {
|
|
37689
37804
|
// TODO: multiple
|
|
37690
|
-
|
|
37805
|
+
return _remove.bind(this)(grids, !0);
|
|
37691
37806
|
}
|
|
37692
37807
|
});
|
|
37693
|
-
/* harmony default export */ var grid_x = ({
|
|
37694
|
-
xgrids: xgrids
|
|
37695
|
-
});
|
|
37696
|
-
;// CONCATENATED MODULE: ./src/Chart/api/grid.y.ts
|
|
37697
|
-
/**
|
|
37698
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
37699
|
-
* billboard.js project is licensed under the MIT license
|
|
37700
|
-
*/
|
|
37701
|
-
|
|
37702
37808
|
|
|
37703
37809
|
/**
|
|
37704
37810
|
* Update y grid lines.
|
|
@@ -37716,14 +37822,7 @@ util_extend(xgrids, {
|
|
|
37716
37822
|
* // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
|
|
37717
37823
|
*/
|
|
37718
37824
|
var ygrids = function (grids) {
|
|
37719
|
-
|
|
37720
|
-
config = $$.config;
|
|
37721
|
-
if (!grids) {
|
|
37722
|
-
return config.grid_y_lines;
|
|
37723
|
-
}
|
|
37724
|
-
config.grid_y_lines = grids;
|
|
37725
|
-
$$.redrawWithoutRescale();
|
|
37726
|
-
return config.grid_y_lines;
|
|
37825
|
+
return grid.bind(this)(grids, "y");
|
|
37727
37826
|
};
|
|
37728
37827
|
util_extend(ygrids, {
|
|
37729
37828
|
/**
|
|
@@ -37747,7 +37846,7 @@ util_extend(ygrids, {
|
|
|
37747
37846
|
* ]);
|
|
37748
37847
|
*/
|
|
37749
37848
|
add: function add(grids) {
|
|
37750
|
-
return
|
|
37849
|
+
return _add.bind(this)(grids, "y");
|
|
37751
37850
|
},
|
|
37752
37851
|
/**
|
|
37753
37852
|
* Remove y grid lines.<br>
|
|
@@ -37755,9 +37854,10 @@ util_extend(ygrids, {
|
|
|
37755
37854
|
* @function ygrids․remove
|
|
37756
37855
|
* @instance
|
|
37757
37856
|
* @memberof Chart
|
|
37758
|
-
* @param {object}
|
|
37759
|
-
* @param {number} [
|
|
37760
|
-
* @param {string} [
|
|
37857
|
+
* @param {object} grids This argument should include value or class. If value is given, the y grid lines that have specified y value will be removed. If class is given, the y grid lines that have specified class will be removed. If args is not given, all of y grid lines will be removed.
|
|
37858
|
+
* @param {number} [grids.value] target value
|
|
37859
|
+
* @param {string} [grids.class] target class
|
|
37860
|
+
* @returns {void}
|
|
37761
37861
|
* @example
|
|
37762
37862
|
* // y grid line on y = 200 will be removed
|
|
37763
37863
|
* chart.ygrids.remove({value: 200});
|
|
@@ -37770,12 +37870,13 @@ util_extend(ygrids, {
|
|
|
37770
37870
|
* // all of y grid lines will be removed
|
|
37771
37871
|
* chart.ygrids.remove();
|
|
37772
37872
|
*/
|
|
37773
|
-
remove: function remove(
|
|
37873
|
+
remove: function remove(grids) {
|
|
37774
37874
|
// TODO: multiple
|
|
37775
|
-
|
|
37875
|
+
return _remove.bind(this)(grids, !1);
|
|
37776
37876
|
}
|
|
37777
37877
|
});
|
|
37778
|
-
/* harmony default export */ var
|
|
37878
|
+
/* harmony default export */ var api_grid = ({
|
|
37879
|
+
xgrids: xgrids,
|
|
37779
37880
|
ygrids: ygrids
|
|
37780
37881
|
});
|
|
37781
37882
|
;// CONCATENATED MODULE: ./src/Chart/api/group.ts
|
|
@@ -37817,6 +37918,29 @@ util_extend(ygrids, {
|
|
|
37817
37918
|
*/
|
|
37818
37919
|
|
|
37819
37920
|
|
|
37921
|
+
/**
|
|
37922
|
+
* Region add/update function
|
|
37923
|
+
* @param {Array} regions Regions will be replaced with this argument. The format of this argument is the same as regions.
|
|
37924
|
+
* @param {boolean} isAdd If true, add new regions, otherwise update regions
|
|
37925
|
+
* @returns {Array} regions
|
|
37926
|
+
* @private
|
|
37927
|
+
*/
|
|
37928
|
+
function regionsFn(regions, isAdd) {
|
|
37929
|
+
if (isAdd === void 0) {
|
|
37930
|
+
isAdd = !1;
|
|
37931
|
+
}
|
|
37932
|
+
var $$ = this.internal,
|
|
37933
|
+
config = $$.config,
|
|
37934
|
+
withTransition = config.transition_duration && isTabVisible();
|
|
37935
|
+
if (!regions) {
|
|
37936
|
+
return config.regions;
|
|
37937
|
+
}
|
|
37938
|
+
config.regions = isAdd ? config.regions.concat(regions) : regions;
|
|
37939
|
+
$$.updateRegion();
|
|
37940
|
+
$$.redrawRegion(withTransition);
|
|
37941
|
+
return isAdd ? config.regions : regions;
|
|
37942
|
+
}
|
|
37943
|
+
|
|
37820
37944
|
/**
|
|
37821
37945
|
* Update regions.
|
|
37822
37946
|
* @function regions
|
|
@@ -37832,14 +37956,7 @@ util_extend(ygrids, {
|
|
|
37832
37956
|
* ]);
|
|
37833
37957
|
*/
|
|
37834
37958
|
var regions = function (_regions) {
|
|
37835
|
-
|
|
37836
|
-
config = $$.config;
|
|
37837
|
-
if (!_regions) {
|
|
37838
|
-
return config.regions;
|
|
37839
|
-
}
|
|
37840
|
-
config.regions = _regions;
|
|
37841
|
-
$$.redrawWithoutRescale();
|
|
37842
|
-
return _regions;
|
|
37959
|
+
return regionsFn.bind(this)(_regions);
|
|
37843
37960
|
};
|
|
37844
37961
|
util_extend(regions, {
|
|
37845
37962
|
/**
|
|
@@ -37863,14 +37980,7 @@ util_extend(regions, {
|
|
|
37863
37980
|
*]);
|
|
37864
37981
|
*/
|
|
37865
37982
|
add: function add(regions) {
|
|
37866
|
-
|
|
37867
|
-
config = $$.config;
|
|
37868
|
-
if (!regions) {
|
|
37869
|
-
return config.regions;
|
|
37870
|
-
}
|
|
37871
|
-
config.regions = config.regions.concat(regions);
|
|
37872
|
-
$$.redrawWithoutRescale();
|
|
37873
|
-
return config.regions;
|
|
37983
|
+
return regionsFn.bind(this)(regions, !0);
|
|
37874
37984
|
},
|
|
37875
37985
|
/**
|
|
37876
37986
|
* Remove regions.<br><br>
|
|
@@ -38826,7 +38936,7 @@ var AxisRenderer = /*#__PURE__*/function () {
|
|
|
38826
38936
|
}
|
|
38827
38937
|
var tickWidth = params.tickWidth;
|
|
38828
38938
|
if (!tickWidth || tickWidth <= 0) {
|
|
38829
|
-
tickWidth = isLeftRight ? 95 : params.isCategory ? Math.ceil(scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
|
|
38939
|
+
tickWidth = isLeftRight ? 95 : params.isCategory ? Math.ceil(params.isInverted ? scale(ticks[0]) - scale(ticks[1]) : scale(ticks[1]) - scale(ticks[0])) - 12 : 110;
|
|
38830
38940
|
}
|
|
38831
38941
|
|
|
38832
38942
|
// split given text by tick width size
|
|
@@ -39234,6 +39344,7 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
39234
39344
|
owner: $$
|
|
39235
39345
|
}, isX && {
|
|
39236
39346
|
isCategory: isCategory,
|
|
39347
|
+
isInverted: config.axis_x_inverted,
|
|
39237
39348
|
tickMultiline: config.axis_x_tick_multiline,
|
|
39238
39349
|
tickWidth: config.axis_x_tick_width,
|
|
39239
39350
|
tickTitle: isCategory && config.axis_x_tick_tooltip && $$.api.categories(),
|
|
@@ -39858,7 +39969,8 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
39858
39969
|
config = $$.config,
|
|
39859
39970
|
state = $$.state,
|
|
39860
39971
|
$el = $$.$el,
|
|
39861
|
-
isMultipleX = $$.isMultipleX()
|
|
39972
|
+
isMultipleX = $$.isMultipleX(),
|
|
39973
|
+
isInverted = config.axis_x_inverted;
|
|
39862
39974
|
if ($el.eventRect) {
|
|
39863
39975
|
$$.updateEventRect($el.eventRect, !0);
|
|
39864
39976
|
} else {
|
|
@@ -39879,10 +39991,10 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
39879
39991
|
if (!isMultipleX) {
|
|
39880
39992
|
// Set data and update eventReceiver.data
|
|
39881
39993
|
var xAxisTickValues = $$.getMaxDataCountTarget();
|
|
39882
|
-
if (!config.data_xSort) {
|
|
39994
|
+
if (!config.data_xSort || isInverted) {
|
|
39883
39995
|
xAxisTickValues.sort(function (a, b) {
|
|
39884
39996
|
_newArrowCheck(this, _this);
|
|
39885
|
-
return a.x - b.x;
|
|
39997
|
+
return isInverted ? b.x - a.x : a.x - b.x;
|
|
39886
39998
|
}.bind(this));
|
|
39887
39999
|
}
|
|
39888
40000
|
|
|
@@ -40624,7 +40736,8 @@ var src_linear_linear = function (t) {
|
|
|
40624
40736
|
* @private
|
|
40625
40737
|
*/
|
|
40626
40738
|
setYAxisClipPath: function setYAxisClipPath(node) {
|
|
40627
|
-
var
|
|
40739
|
+
var _config$padding,
|
|
40740
|
+
$$ = this,
|
|
40628
40741
|
config = $$.config,
|
|
40629
40742
|
_$$$state3 = $$.state,
|
|
40630
40743
|
margin = _$$$state3.margin,
|
|
@@ -40633,10 +40746,10 @@ var src_linear_linear = function (t) {
|
|
|
40633
40746
|
isRotated = config.axis_rotated,
|
|
40634
40747
|
left = Math.max(30, margin.left) - (isRotated ? 20 : 0),
|
|
40635
40748
|
isInner = config.axis_y_inner,
|
|
40636
|
-
x = isInner ? -1 : isRotated ? -(1 + left) : -(left - 1),
|
|
40749
|
+
x = isInner && !isRotated ? config.axis_y_label.text ? -20 : -1 : isRotated ? -(1 + left) : -(left - 1),
|
|
40637
40750
|
y = -(isRotated ? 20 : margin.top),
|
|
40638
40751
|
w = (isRotated ? width + 15 + left : margin.left + 20) + (isInner ? 20 : 0),
|
|
40639
|
-
h = (isRotated ? margin.bottom : margin.top + height) + 10;
|
|
40752
|
+
h = (isRotated ? margin.bottom + (((_config$padding = config.padding) == null ? void 0 : _config$padding.mode) === "fit" ? 10 : 0) : margin.top + height) + 10;
|
|
40640
40753
|
node.attr("x", x).attr("y", y).attr("width", w).attr("height", h);
|
|
40641
40754
|
},
|
|
40642
40755
|
updateXAxisTickClip: function updateXAxisTickClip() {
|
|
@@ -40742,7 +40855,7 @@ function smoothLines(el, type) {
|
|
|
40742
40855
|
});
|
|
40743
40856
|
}
|
|
40744
40857
|
}
|
|
40745
|
-
/* harmony default export */ var
|
|
40858
|
+
/* harmony default export */ var internals_grid = ({
|
|
40746
40859
|
hasGrid: function hasGrid() {
|
|
40747
40860
|
var _this4 = this,
|
|
40748
40861
|
config = this.config;
|
|
@@ -41254,14 +41367,16 @@ function smoothLines(el, type) {
|
|
|
41254
41367
|
var _$$$axis,
|
|
41255
41368
|
position = (_$$$axis = $$.axis) == null ? void 0 : _$$$axis.getLabelPositionById(id),
|
|
41256
41369
|
width = $$.axis.getMaxTickWidth(id, withoutRecompute),
|
|
41257
|
-
gap = width === 0 ? .5 : 0
|
|
41258
|
-
|
|
41370
|
+
gap = width === 0 ? .5 : 0,
|
|
41371
|
+
_$$$config$padding;
|
|
41372
|
+
return width + (((_$$$config$padding = $$.config.padding) == null ? void 0 : _$$$config$padding.mode) === "fit" ? position.isInner ? 10 + gap : 10 : position.isInner ? 20 + gap : 40);
|
|
41259
41373
|
} else {
|
|
41260
41374
|
return 40;
|
|
41261
41375
|
}
|
|
41262
41376
|
},
|
|
41263
41377
|
getHorizontalAxisHeight: function getHorizontalAxisHeight(id) {
|
|
41264
|
-
var
|
|
41378
|
+
var _config$padding,
|
|
41379
|
+
$$ = this,
|
|
41265
41380
|
config = $$.config,
|
|
41266
41381
|
state = $$.state,
|
|
41267
41382
|
_state = state,
|
|
@@ -41269,8 +41384,12 @@ function smoothLines(el, type) {
|
|
|
41269
41384
|
rotatedPadding = _state.rotatedPadding,
|
|
41270
41385
|
isLegendRight = _state.isLegendRight,
|
|
41271
41386
|
isLegendInset = _state.isLegendInset,
|
|
41272
|
-
isRotated = config.axis_rotated
|
|
41273
|
-
|
|
41387
|
+
isRotated = config.axis_rotated,
|
|
41388
|
+
isFitPadding = ((_config$padding = config.padding) == null ? void 0 : _config$padding.mode) === "fit",
|
|
41389
|
+
isInner = config["axis_" + id + "_inner"],
|
|
41390
|
+
hasLabelText = config["axis_" + id + "_label"].text,
|
|
41391
|
+
_config$padding2,
|
|
41392
|
+
h = ((_config$padding2 = config.padding) == null ? void 0 : _config$padding2.mode) === "fit" ? isInner && !hasLabelText ? id === "y" ? 1 : 0 : 20 : 30;
|
|
41274
41393
|
if (id === "x" && !config.axis_x_show) {
|
|
41275
41394
|
return 8;
|
|
41276
41395
|
}
|
|
@@ -41281,7 +41400,7 @@ function smoothLines(el, type) {
|
|
|
41281
41400
|
return config.legend_show && !isLegendRight && !isLegendInset ? 10 : 1;
|
|
41282
41401
|
}
|
|
41283
41402
|
if (id === "y2" && !config.axis_y2_show) {
|
|
41284
|
-
return rotatedPadding.top;
|
|
41403
|
+
return isFitPadding ? 0 : rotatedPadding.top;
|
|
41285
41404
|
}
|
|
41286
41405
|
var rotate = $$.getAxisTickRotate(id);
|
|
41287
41406
|
|
|
@@ -41297,7 +41416,12 @@ function smoothLines(el, type) {
|
|
|
41297
41416
|
return h + ($$.axis.getLabelPositionById(id).isInner ? 0 : 10) + (id === "y2" && !isRotated ? -10 : 0);
|
|
41298
41417
|
},
|
|
41299
41418
|
getEventRectWidth: function getEventRectWidth() {
|
|
41300
|
-
|
|
41419
|
+
var $$ = this,
|
|
41420
|
+
config = $$.config,
|
|
41421
|
+
axis = $$.axis,
|
|
41422
|
+
isInverted = config.axis_x_inverted,
|
|
41423
|
+
tickInterval = axis.x.tickInterval();
|
|
41424
|
+
return Math.max(0, isInverted ? Math.abs(tickInterval) : tickInterval);
|
|
41301
41425
|
},
|
|
41302
41426
|
/**
|
|
41303
41427
|
* Get axis tick test rotate value
|
|
@@ -41990,6 +42114,22 @@ function smoothLines(el, type) {
|
|
|
41990
42114
|
* }
|
|
41991
42115
|
*/
|
|
41992
42116
|
axis_x_min: undefined,
|
|
42117
|
+
/**
|
|
42118
|
+
* Change the direction of x axis.<br><br>
|
|
42119
|
+
* If true set, the direction will be `right -> left`.
|
|
42120
|
+
* @name axis․x․inverted
|
|
42121
|
+
* @memberof Options
|
|
42122
|
+
* @type {boolean}
|
|
42123
|
+
* @default false
|
|
42124
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)
|
|
42125
|
+
* @example
|
|
42126
|
+
* axis: {
|
|
42127
|
+
* x: {
|
|
42128
|
+
* inverted: true
|
|
42129
|
+
* }
|
|
42130
|
+
* }
|
|
42131
|
+
*/
|
|
42132
|
+
axis_x_inverted: !1,
|
|
41993
42133
|
/**
|
|
41994
42134
|
* Set padding for x axis.<br><br>
|
|
41995
42135
|
* If this option is set, the range of x axis will increase/decrease according to the values.
|
|
@@ -42252,11 +42392,12 @@ function smoothLines(el, type) {
|
|
|
42252
42392
|
axis_y_min: undefined,
|
|
42253
42393
|
/**
|
|
42254
42394
|
* Change the direction of y axis.<br><br>
|
|
42255
|
-
* If true set, the direction will be
|
|
42395
|
+
* If true set, the direction will be `top -> bottom`.
|
|
42256
42396
|
* @name axis․y․inverted
|
|
42257
42397
|
* @memberof Options
|
|
42258
42398
|
* @type {boolean}
|
|
42259
42399
|
* @default false
|
|
42400
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)
|
|
42260
42401
|
* @example
|
|
42261
42402
|
* axis: {
|
|
42262
42403
|
* y: {
|
|
@@ -42730,11 +42871,12 @@ function smoothLines(el, type) {
|
|
|
42730
42871
|
axis_y2_min: undefined,
|
|
42731
42872
|
/**
|
|
42732
42873
|
* Change the direction of y2 axis.<br><br>
|
|
42733
|
-
* If true set, the direction will be
|
|
42874
|
+
* If true set, the direction will be `top -> bottom`.
|
|
42734
42875
|
* @name axis․y2․inverted
|
|
42735
42876
|
* @memberof Options
|
|
42736
42877
|
* @type {boolean}
|
|
42737
42878
|
* @default false
|
|
42879
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#Axis.InvertedAxis)
|
|
42738
42880
|
* @example
|
|
42739
42881
|
* axis: {
|
|
42740
42882
|
* y2: {
|
|
@@ -43226,7 +43368,6 @@ function axis_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
|
|
|
43226
43368
|
|
|
43227
43369
|
|
|
43228
43370
|
|
|
43229
|
-
|
|
43230
43371
|
// ChartInternal
|
|
43231
43372
|
|
|
43232
43373
|
|
|
@@ -43240,8 +43381,8 @@ function axis_objectSpread(target) { for (var i = 1, source; i < arguments.lengt
|
|
|
43240
43381
|
|
|
43241
43382
|
|
|
43242
43383
|
|
|
43243
|
-
var api = [api_axis, api_category,
|
|
43244
|
-
var internal = [Axis, clip, eventrect, interactions_flow,
|
|
43384
|
+
var api = [api_axis, api_category, flow, api_grid, group, api_regions, x];
|
|
43385
|
+
var internal = [Axis, clip, eventrect, interactions_flow, internals_grid, region, size_axis];
|
|
43245
43386
|
var options = [data_axis, Options_axis_axis, common_grid];
|
|
43246
43387
|
;// CONCATENATED MODULE: ./node_modules/d3-shape/src/array.js
|
|
43247
43388
|
var slice = Array.prototype.slice;
|
|
@@ -49766,17 +49907,21 @@ function defaultConstrain(transform, extent, translateExtent) {
|
|
|
49766
49907
|
* @param {Array} domain Target domain value
|
|
49767
49908
|
* @param {Array} current Current zoom domain value
|
|
49768
49909
|
* @param {Array} range Zoom range value
|
|
49910
|
+
* @param {boolean} isInverted Whether the axis is inverted or not
|
|
49769
49911
|
* @returns {boolean}
|
|
49770
49912
|
* @private
|
|
49771
49913
|
*/
|
|
49772
|
-
function withinRange(domain, current, range) {
|
|
49773
|
-
var _this = this
|
|
49774
|
-
|
|
49914
|
+
function withinRange(domain, current, range, isInverted) {
|
|
49915
|
+
var _this = this;
|
|
49916
|
+
if (isInverted === void 0) {
|
|
49917
|
+
isInverted = !1;
|
|
49918
|
+
}
|
|
49919
|
+
var min = range[0],
|
|
49775
49920
|
max = range[1];
|
|
49776
49921
|
return domain.every(function (v, i) {
|
|
49777
49922
|
var _this2 = this;
|
|
49778
49923
|
_newArrowCheck(this, _this);
|
|
49779
|
-
return (i === 0 ? v >= min : v <= max) && !domain.every(function (v, i) {
|
|
49924
|
+
return (i === 0 ? isInverted ? +v <= min : +v >= min : isInverted ? +v >= max : +v <= max) && !domain.every(function (v, i) {
|
|
49780
49925
|
_newArrowCheck(this, _this2);
|
|
49781
49926
|
return v === current[i];
|
|
49782
49927
|
}.bind(this));
|
|
@@ -49812,6 +49957,7 @@ var zoom = function (domainValue) {
|
|
|
49812
49957
|
org = $$.org,
|
|
49813
49958
|
scale = $$.scale,
|
|
49814
49959
|
isRotated = config.axis_rotated,
|
|
49960
|
+
isInverted = config.axis_x_inverted,
|
|
49815
49961
|
isCategorized = axis.isCategorized(),
|
|
49816
49962
|
domain = domainValue;
|
|
49817
49963
|
if (config.zoom_enabled && domain) {
|
|
@@ -49821,7 +49967,8 @@ var zoom = function (domainValue) {
|
|
|
49821
49967
|
return parseDate.bind($$)(x);
|
|
49822
49968
|
}.bind(this));
|
|
49823
49969
|
}
|
|
49824
|
-
|
|
49970
|
+
var isWithinRange = withinRange(domain, $$.getZoomDomain(!0), $$.getZoomDomain(), isInverted);
|
|
49971
|
+
if (isWithinRange) {
|
|
49825
49972
|
if (isCategorized) {
|
|
49826
49973
|
domain = domain.map(function (v, i) {
|
|
49827
49974
|
_newArrowCheck(this, _this3);
|
|
@@ -50712,7 +50859,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
50712
50859
|
if (!$$.state.xTickOffset) {
|
|
50713
50860
|
$$.state.xTickOffset = $$.axis.x.tickOffset();
|
|
50714
50861
|
}
|
|
50715
|
-
scale.zoom = $$.
|
|
50862
|
+
scale.zoom = $$.getCustomizedXScale(newScale);
|
|
50716
50863
|
$$.axis.x.scale(scale.zoom);
|
|
50717
50864
|
if (rescale) {
|
|
50718
50865
|
// copy current initial x scale in case of rescale option is used
|
|
@@ -50844,7 +50991,7 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
50844
50991
|
var zoomDomain = zoom.domain(),
|
|
50845
50992
|
xDomain = subX.domain(),
|
|
50846
50993
|
delta = .015,
|
|
50847
|
-
isfullyShown = (zoomDomain[0] <= xDomain[0] || zoomDomain[0] - delta <= xDomain[0]) && (xDomain[1] <= zoomDomain[1] || xDomain[1] <= zoomDomain[1] - delta);
|
|
50994
|
+
isfullyShown = $$.config.axis_x_inverted ? (zoomDomain[0] >= xDomain[0] || zoomDomain[0] + delta >= xDomain[0]) && (xDomain[1] >= zoomDomain[1] || xDomain[1] >= zoomDomain[1] + delta) : (zoomDomain[0] <= xDomain[0] || zoomDomain[0] - delta <= xDomain[0]) && (xDomain[1] <= zoomDomain[1] || xDomain[1] <= zoomDomain[1] - delta);
|
|
50848
50995
|
// check if the zoomed chart is fully shown, then reset scale when zoom is out as initial
|
|
50849
50996
|
if (force || isfullyShown) {
|
|
50850
50997
|
$$.axis.x.scale(subX);
|
|
@@ -51321,7 +51468,7 @@ var _defaults = {};
|
|
|
51321
51468
|
|
|
51322
51469
|
/**
|
|
51323
51470
|
* @namespace bb
|
|
51324
|
-
* @version 3.
|
|
51471
|
+
* @version 3.8.0-next.1
|
|
51325
51472
|
*/
|
|
51326
51473
|
var bb = {
|
|
51327
51474
|
/**
|
|
@@ -51331,7 +51478,7 @@ var bb = {
|
|
|
51331
51478
|
* bb.version; // "1.0.0"
|
|
51332
51479
|
* @memberof bb
|
|
51333
51480
|
*/
|
|
51334
|
-
version: "3.
|
|
51481
|
+
version: "3.8.0-next.1",
|
|
51335
51482
|
/**
|
|
51336
51483
|
* Generate chart
|
|
51337
51484
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|