billboard.js 3.2.0-next.6 → 3.3.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 +8 -8
- package/dist/billboard.js +294 -126
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +5500 -3359
- 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 +17 -12
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +17 -12
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +19 -14
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +17 -12
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +5043 -3261
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +5067 -3280
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +5069 -3282
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +5062 -3275
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +5061 -3274
- package/dist/theme/datalab.css +6 -4
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +6 -4
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +6 -4
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +602 -464
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +15 -15
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +6 -6
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -4
- package/package.json +55 -56
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +11 -2
- package/src/ChartInternal/data/convert.ts +1 -1
- package/src/ChartInternal/data/data.ts +28 -11
- package/src/ChartInternal/interactions/zoom.ts +1 -1
- package/src/ChartInternal/internals/domain.ts +31 -31
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/scale.ts +3 -2
- package/src/ChartInternal/internals/size.ts +32 -1
- package/src/ChartInternal/internals/text.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +4 -0
- package/src/ChartInternal/shape/arc.ts +2 -6
- package/src/ChartInternal/shape/bar.ts +87 -34
- package/src/ChartInternal/shape/shape.ts +33 -2
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/config/Options/axis/x.ts +2 -2
- package/src/config/Options/common/main.ts +11 -1
- package/src/config/Options/data/data.ts +25 -3
- package/src/config/Options/shape/bar.ts +1 -2
- package/src/module/util.ts +19 -20
- package/src/scss/billboard.scss +3 -13
- package/src/scss/theme/datalab.scss +3 -7
- package/src/scss/theme/graph.scss +3 -2
- package/src/scss/theme/insight.scss +3 -2
- package/types/options.d.ts +11 -4
- package/types/types.d.ts +9 -6
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.3.0-next.1
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -432,9 +432,9 @@ var external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_ = __webp
|
|
|
432
432
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
433
433
|
|
|
434
434
|
|
|
435
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
435
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
436
436
|
|
|
437
|
-
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
437
|
+
function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
438
438
|
|
|
439
439
|
/**
|
|
440
440
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -524,18 +524,19 @@ function hasValue(dict, value) {
|
|
|
524
524
|
/**
|
|
525
525
|
* Call function with arguments
|
|
526
526
|
* @param {Function} fn Function to be called
|
|
527
|
-
* @param {*}
|
|
527
|
+
* @param {*} thisArg "this" value for fn
|
|
528
|
+
* @param {*} args Arguments for fn
|
|
528
529
|
* @returns {boolean} true: fn is function, false: fn is not function
|
|
529
530
|
* @private
|
|
530
531
|
*/
|
|
531
532
|
|
|
532
533
|
|
|
533
|
-
function callFn(fn) {
|
|
534
|
-
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len >
|
|
535
|
-
args[_key -
|
|
534
|
+
function callFn(fn, thisArg) {
|
|
535
|
+
for (var isFn = isFunction(fn), _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
536
|
+
args[_key - 2] = arguments[_key];
|
|
536
537
|
}
|
|
537
538
|
|
|
538
|
-
isFn && fn.call.apply(fn, args);
|
|
539
|
+
isFn && fn.call.apply(fn, [thisArg].concat(args));
|
|
539
540
|
return isFn;
|
|
540
541
|
}
|
|
541
542
|
/**
|
|
@@ -691,9 +692,13 @@ function getPathBox(path) {
|
|
|
691
692
|
|
|
692
693
|
|
|
693
694
|
function getPointer(event, element) {
|
|
694
|
-
var
|
|
695
|
-
|
|
696
|
-
|
|
695
|
+
var _ref,
|
|
696
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
697
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
698
|
+
|
|
699
|
+
return pointer.map(function (v) {
|
|
700
|
+
return isNaN(v) ? 0 : v;
|
|
701
|
+
});
|
|
697
702
|
}
|
|
698
703
|
/**
|
|
699
704
|
* Return brush selection array
|
|
@@ -1681,12 +1686,21 @@ var Store = /*#__PURE__*/function () {
|
|
|
1681
1686
|
* @name padding
|
|
1682
1687
|
* @memberof Options
|
|
1683
1688
|
* @type {object}
|
|
1684
|
-
* @property {object} [padding] padding object
|
|
1689
|
+
* @property {object|boolean} [padding=true] Set padding of chart, and accepts object or boolean type.
|
|
1690
|
+
* - `Object`: Specify each side's padding.
|
|
1691
|
+
* - `false`: Remove padding completely and make shape to fully occupy the container element.
|
|
1692
|
+
* - In this case, axes and subchart will be hidden.
|
|
1693
|
+
* - To adjust some padding from this state, use `axis.[x|y].padding` option.
|
|
1685
1694
|
* @property {number} [padding.top] padding on the top of chart
|
|
1686
1695
|
* @property {number} [padding.right] padding on the right of chart
|
|
1687
1696
|
* @property {number} [padding.bottom] padding on the bottom of chart
|
|
1688
1697
|
* @property {number} [padding.left] padding on the left of chart
|
|
1698
|
+
* @see [Demo](https://naver.github.io/billboard.js/demo/#ChartOptions.Padding)
|
|
1689
1699
|
* @example
|
|
1700
|
+
* // remove padding completely.
|
|
1701
|
+
* padding: false,
|
|
1702
|
+
*
|
|
1703
|
+
* // or specify padding value for each side
|
|
1690
1704
|
* padding: {
|
|
1691
1705
|
* top: 20,
|
|
1692
1706
|
* right: 20,
|
|
@@ -1694,6 +1708,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
1694
1708
|
* left: 20
|
|
1695
1709
|
* }
|
|
1696
1710
|
*/
|
|
1711
|
+
padding: !0,
|
|
1697
1712
|
padding_left: undefined,
|
|
1698
1713
|
padding_right: undefined,
|
|
1699
1714
|
padding_top: undefined,
|
|
@@ -2224,8 +2239,8 @@ var Store = /*#__PURE__*/function () {
|
|
|
2224
2239
|
* The arguments are:<br>
|
|
2225
2240
|
* - `v` is the value of the data point where the label is shown.
|
|
2226
2241
|
* - `id` is the id of the data where the label is shown.
|
|
2227
|
-
* - `i` is the index of the data point where the label is shown.
|
|
2228
|
-
* - `
|
|
2242
|
+
* - `i` is the index of the data series point where the label is shown.
|
|
2243
|
+
* - `texts` is the array of whole corresponding data series' text labels.<br><br>
|
|
2229
2244
|
* Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (ex. d3.format('$'))
|
|
2230
2245
|
* @property {string|object} [data.labels.backgroundColors] Set label text background colors.
|
|
2231
2246
|
* @property {string|object|Function} [data.labels.colors] Set label text colors.
|
|
@@ -2255,7 +2270,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
2255
2270
|
*
|
|
2256
2271
|
* // it's possible to set for each data
|
|
2257
2272
|
* format: {
|
|
2258
|
-
* data1: function(v, id, i,
|
|
2273
|
+
* data1: function(v, id, i, texts) { ... },
|
|
2259
2274
|
* ...
|
|
2260
2275
|
* },
|
|
2261
2276
|
*
|
|
@@ -2552,6 +2567,18 @@ var Store = /*#__PURE__*/function () {
|
|
|
2552
2567
|
* ]
|
|
2553
2568
|
* }
|
|
2554
2569
|
*
|
|
2570
|
+
* // for 'bar' type, data can contain:
|
|
2571
|
+
* // - an array of [start, end] data following the order
|
|
2572
|
+
* data: {
|
|
2573
|
+
* rows: [
|
|
2574
|
+
* ["data1", "data2"],
|
|
2575
|
+
* [[100, 150], 120],
|
|
2576
|
+
* [[200, 300], 55],
|
|
2577
|
+
* [[-400, 500], 60]
|
|
2578
|
+
* ],
|
|
2579
|
+
* type: "bar"
|
|
2580
|
+
* }
|
|
2581
|
+
*
|
|
2555
2582
|
* // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
|
|
2556
2583
|
* // - an array of [high, mid, low] data following the order
|
|
2557
2584
|
* // - or an object with 'high', 'mid' and 'low' key value
|
|
@@ -2628,6 +2655,16 @@ var Store = /*#__PURE__*/function () {
|
|
|
2628
2655
|
* ]
|
|
2629
2656
|
* }
|
|
2630
2657
|
*
|
|
2658
|
+
* // for 'bar' type, data can contain:
|
|
2659
|
+
* // - an array of [start, end] data following the order
|
|
2660
|
+
* data: {
|
|
2661
|
+
* columns: [
|
|
2662
|
+
* ["data1", -100, 50, [100, 200], [200, 300]],
|
|
2663
|
+
* ["data2", -200, 300, [-100, 100], [-50, -30]],
|
|
2664
|
+
* ],
|
|
2665
|
+
* type: "bar"
|
|
2666
|
+
* }
|
|
2667
|
+
*
|
|
2631
2668
|
* // for 'range' types('area-line-range' or 'area-spline-range'), data should contain:
|
|
2632
2669
|
* // - an array of [high, mid, low] data following the order
|
|
2633
2670
|
* // - or an object with 'high', 'mid' and 'low' key value
|
|
@@ -3244,9 +3281,9 @@ var Store = /*#__PURE__*/function () {
|
|
|
3244
3281
|
;// CONCATENATED MODULE: ./src/config/Options/Options.ts
|
|
3245
3282
|
|
|
3246
3283
|
|
|
3247
|
-
function Options_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
3284
|
+
function Options_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3248
3285
|
|
|
3249
|
-
function Options_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
3286
|
+
function Options_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? Options_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : Options_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3250
3287
|
|
|
3251
3288
|
/**
|
|
3252
3289
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -4421,6 +4458,7 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
|
|
|
4421
4458
|
|
|
4422
4459
|
/**
|
|
4423
4460
|
* Sort targets data
|
|
4461
|
+
* Note: For stacked bar, will sort from the total sum of data series, not for each stacked bar
|
|
4424
4462
|
* @param {Array} targetsValue Target value
|
|
4425
4463
|
* @returns {Array}
|
|
4426
4464
|
* @private
|
|
@@ -4457,8 +4495,8 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
|
|
|
4457
4495
|
};
|
|
4458
4496
|
|
|
4459
4497
|
fn = function (t1, t2) {
|
|
4460
|
-
var t1Sum = t1.values.reduce(reducer, 0),
|
|
4461
|
-
t2Sum = t2.values.reduce(reducer, 0);
|
|
4498
|
+
var t1Sum = "values" in t1 ? t1.values.reduce(reducer, 0) : t1.value,
|
|
4499
|
+
t2Sum = "values" in t2 ? t2.values.reduce(reducer, 0) : t2.value;
|
|
4462
4500
|
return isArc ? orderAsc ? t1Sum - t2Sum : t2Sum - t1Sum : orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
|
|
4463
4501
|
};
|
|
4464
4502
|
} else if (isFunction(order)) {
|
|
@@ -4572,19 +4610,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
|
|
|
4572
4610
|
}),
|
|
4573
4611
|
minDist = config.point_sensitivity,
|
|
4574
4612
|
closest;
|
|
4575
|
-
// find mouseovering bar
|
|
4613
|
+
// find mouseovering bar/candlestick
|
|
4614
|
+
// https://github.com/naver/billboard.js/issues/2434
|
|
4576
4615
|
data.filter(function (v) {
|
|
4577
|
-
return $$.isBarType(v.id);
|
|
4616
|
+
return $$.isBarType(v.id) || $$.isCandlestickType(v.id);
|
|
4578
4617
|
}).forEach(function (v) {
|
|
4579
|
-
var
|
|
4618
|
+
var selector = $$.isBarType(v.id) ? "." + config_classes.chartBar + "." + config_classes.target + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.bar + "-" + v.index : "." + config_classes.chartCandlestick + "." + config_classes.target + $$.getTargetSelectorSuffix(v.id) + " ." + config_classes.candlestick + "-" + v.index + " path";
|
|
4580
4619
|
|
|
4581
|
-
if (!closest && $$.isWithinBar(
|
|
4620
|
+
if (!closest && $$.isWithinBar(main.select(selector).node())) {
|
|
4582
4621
|
closest = v;
|
|
4583
4622
|
}
|
|
4584
|
-
}); // find closest point from non-bar
|
|
4623
|
+
}); // find closest point from non-bar/candlestick
|
|
4585
4624
|
|
|
4586
4625
|
data.filter(function (v) {
|
|
4587
|
-
return !$$.isBarType(v.id);
|
|
4626
|
+
return !$$.isBarType(v.id) && !$$.isCandlestickType(v.id);
|
|
4588
4627
|
}).forEach(function (v) {
|
|
4589
4628
|
var d = $$.dist(v, pos);
|
|
4590
4629
|
|
|
@@ -4817,6 +4856,20 @@ var external_commonjs_d3_dsv_commonjs2_d3_dsv_amd_d3_dsv_root_d3_ = __webpack_re
|
|
|
4817
4856
|
return $$.isBubbleType(d) && (isObject(d.value) && ("z" in d.value || "y" in d.value) || isArray(d.value) && d.value.length === 2);
|
|
4818
4857
|
},
|
|
4819
4858
|
|
|
4859
|
+
/**
|
|
4860
|
+
* Determine if bar has ranged data
|
|
4861
|
+
* @param {Array} d data value
|
|
4862
|
+
* @returns {boolean}
|
|
4863
|
+
* @private
|
|
4864
|
+
*/
|
|
4865
|
+
isBarRangeType: function isBarRangeType(d) {
|
|
4866
|
+
var $$ = this,
|
|
4867
|
+
value = d.value;
|
|
4868
|
+
return $$.isBarType(d) && isArray(value) && value.length === 2 && value.every(function (v) {
|
|
4869
|
+
return isNumber(v);
|
|
4870
|
+
});
|
|
4871
|
+
},
|
|
4872
|
+
|
|
4820
4873
|
/**
|
|
4821
4874
|
* Get data object by id
|
|
4822
4875
|
* @param {string} id data id
|
|
@@ -5542,48 +5595,41 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
5542
5595
|
ys = $$.getValuesAsIdKeyed(targets);
|
|
5543
5596
|
|
|
5544
5597
|
if (dataGroups.length > 0) {
|
|
5545
|
-
(
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
if (_idsInGroup.length === 0) {
|
|
5553
|
-
idsInGroup = _idsInGroup;
|
|
5554
|
-
return "continue";
|
|
5555
|
-
}
|
|
5598
|
+
var hasValue = $$["has" + (isMin ? "Negative" : "Positive") + "ValueInTargets"](targets);
|
|
5599
|
+
dataGroups.forEach(function (groupIds) {
|
|
5600
|
+
// Determine baseId
|
|
5601
|
+
var idsInGroup = groupIds.filter(function (v) {
|
|
5602
|
+
return ids.indexOf(v) >= 0;
|
|
5603
|
+
});
|
|
5556
5604
|
|
|
5557
|
-
|
|
5558
|
-
var
|
|
5605
|
+
if (idsInGroup.length) {
|
|
5606
|
+
var baseId = idsInGroup[0],
|
|
5607
|
+
baseAxisId = axis.getId(baseId);
|
|
5559
5608
|
|
|
5609
|
+
// Initialize base value. Set to 0 if not match with the condition
|
|
5560
5610
|
if (hasValue && ys[baseId]) {
|
|
5561
|
-
ys[baseId] = ys[baseId].map(
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
for (let k = 1, id; id = _idsInGroup[k]; k++) {
|
|
5565
|
-
if (!ys[id]) {
|
|
5566
|
-
continue;
|
|
5567
|
-
}
|
|
5568
|
-
|
|
5569
|
-
const axisId = axis.getId(id);
|
|
5570
|
-
ys[id].forEach((v, i) => {
|
|
5571
|
-
const val = +v;
|
|
5572
|
-
const meetCondition = isMin ? val > 0 : val < 0;
|
|
5573
|
-
|
|
5574
|
-
if (axisId === baseAxisId && !(hasValue && meetCondition)) {
|
|
5575
|
-
ys[baseId][i] += val;
|
|
5576
|
-
}
|
|
5611
|
+
ys[baseId] = ys[baseId].map(function (v) {
|
|
5612
|
+
return (isMin ? v < 0 : v > 0) ? v : 0;
|
|
5577
5613
|
});
|
|
5578
5614
|
}
|
|
5579
5615
|
|
|
5580
|
-
idsInGroup
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5616
|
+
idsInGroup.filter(function (v, i) {
|
|
5617
|
+
return i > 0;
|
|
5618
|
+
}).forEach(function (id) {
|
|
5619
|
+
if (ys[id]) {
|
|
5620
|
+
var axisId = axis.getId(id);
|
|
5621
|
+
ys[id].forEach(function (v, i) {
|
|
5622
|
+
var val = +v,
|
|
5623
|
+
meetCondition = isMin ? val > 0 : val < 0;
|
|
5624
|
+
|
|
5625
|
+
if (axisId === baseAxisId && !(hasValue && meetCondition)) {
|
|
5626
|
+
ys[baseId][i] += val;
|
|
5627
|
+
}
|
|
5628
|
+
});
|
|
5629
|
+
}
|
|
5630
|
+
});
|
|
5585
5631
|
}
|
|
5586
|
-
})
|
|
5632
|
+
});
|
|
5587
5633
|
}
|
|
5588
5634
|
|
|
5589
5635
|
return getMinMax(type, Object.keys(ys).map(function (key) {
|
|
@@ -5702,9 +5748,10 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
5702
5748
|
["bottom", "top"].forEach(function (v, i) {
|
|
5703
5749
|
padding[v] += $$.convertPixelToScale("y", lengths[i], domainLength);
|
|
5704
5750
|
});
|
|
5705
|
-
}
|
|
5706
|
-
// ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
|
|
5751
|
+
}
|
|
5707
5752
|
|
|
5753
|
+
padding = $$.getResettedPadding(padding); // if padding is set, the domain will be updated relative the current domain value
|
|
5754
|
+
// ex) $$.height=300, padding.top=150, domainLength=4 --> domain=6
|
|
5708
5755
|
|
|
5709
5756
|
var p = config[pfx + "_padding"];
|
|
5710
5757
|
|
|
@@ -5768,7 +5815,7 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
5768
5815
|
var maxDataCount = $$.getMaxDataCount();
|
|
5769
5816
|
defaultValue = maxDataCount > 1 ? diff / (maxDataCount - 1) / 2 : .5;
|
|
5770
5817
|
} else {
|
|
5771
|
-
defaultValue = diff * .01;
|
|
5818
|
+
defaultValue = $$.getResettedPadding(diff * .01);
|
|
5772
5819
|
}
|
|
5773
5820
|
|
|
5774
5821
|
var _ref = isNumber(padding) ? {
|
|
@@ -6596,8 +6643,9 @@ function getFormat($$, typeValue, v) {
|
|
|
6596
6643
|
return browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
|
|
6597
6644
|
}).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
|
|
6598
6645
|
var node = selection[idx],
|
|
6599
|
-
nodeName = node.nodeName.toLowerCase()
|
|
6600
|
-
|
|
6646
|
+
nodeName = node.nodeName.toLowerCase(),
|
|
6647
|
+
id = $$.getTargetSelectorSuffix(data);
|
|
6648
|
+
return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
|
|
6601
6649
|
});
|
|
6602
6650
|
} else {
|
|
6603
6651
|
l.append("line").attr("class", config_classes.legendItemTile).style("stroke", getColor).style("pointer-events", "none").attr("x1", isLegendRightOrInset ? x1ForLegendTile : pos).attr("y1", isLegendRightOrInset ? pos : yForLegendTile).attr("x2", isLegendRightOrInset ? x2ForLegendTile : pos).attr("y2", isLegendRightOrInset ? pos : yForLegendTile).attr("stroke-width", config.legend_item_tile_height);
|
|
@@ -6700,8 +6748,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
6700
6748
|
main = $el.main;
|
|
6701
6749
|
state.redrawing = !0;
|
|
6702
6750
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
|
6703
|
-
|
|
6704
|
-
flow =
|
|
6751
|
+
_options = options,
|
|
6752
|
+
flow = _options.flow,
|
|
6753
|
+
initializing = _options.initializing,
|
|
6705
6754
|
wth = $$.getWithOption(options),
|
|
6706
6755
|
duration = wth.Transition ? config.transition_duration : 0,
|
|
6707
6756
|
durationForExit = wth.TransitionForExit ? duration : 0,
|
|
@@ -6907,6 +6956,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
6907
6956
|
redrawWithoutRescale: function redrawWithoutRescale() {
|
|
6908
6957
|
this.redraw({
|
|
6909
6958
|
withY: !1,
|
|
6959
|
+
withLegend: !0,
|
|
6910
6960
|
withSubchart: !1,
|
|
6911
6961
|
withEventRect: !1,
|
|
6912
6962
|
withTransitionForAxis: !1
|
|
@@ -7077,15 +7127,16 @@ function getScale(type, min, max) {
|
|
|
7077
7127
|
if (hasAxis) {
|
|
7078
7128
|
var _scale$x,
|
|
7079
7129
|
isRotated = config.axis_rotated,
|
|
7130
|
+
resettedPadding = $$.getResettedPadding(1),
|
|
7080
7131
|
min = {
|
|
7081
|
-
x: isRotated ?
|
|
7132
|
+
x: isRotated ? resettedPadding : 0,
|
|
7082
7133
|
y: isRotated ? 0 : height,
|
|
7083
7134
|
subX: isRotated ? 1 : 0,
|
|
7084
7135
|
subY: isRotated ? 0 : height2
|
|
7085
7136
|
},
|
|
7086
7137
|
max = {
|
|
7087
7138
|
x: isRotated ? height : width,
|
|
7088
|
-
y: isRotated ? width :
|
|
7139
|
+
y: isRotated ? width : resettedPadding,
|
|
7089
7140
|
subX: isRotated ? height : width,
|
|
7090
7141
|
subY: isRotated ? width2 : 1
|
|
7091
7142
|
},
|
|
@@ -7341,6 +7392,9 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7341
7392
|
value = $$.getRatio("index", d, !0);
|
|
7342
7393
|
} else if ($$.isBubbleZType(d)) {
|
|
7343
7394
|
value = $$.getBubbleZData(d.value, "y");
|
|
7395
|
+
} else if ($$.isBarRangeType(d)) {
|
|
7396
|
+
// TODO use range.getEnd() like method
|
|
7397
|
+
value = value[1];
|
|
7344
7398
|
}
|
|
7345
7399
|
|
|
7346
7400
|
return $$.getYScaleById(d.id, isSub)(value);
|
|
@@ -7414,8 +7468,14 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7414
7468
|
value = d.value,
|
|
7415
7469
|
x = d.x,
|
|
7416
7470
|
ind = $$.getIndices(indices, id),
|
|
7417
|
-
scale = $$.getYScaleById(id, isSub)
|
|
7418
|
-
|
|
7471
|
+
scale = $$.getYScaleById(id, isSub);
|
|
7472
|
+
|
|
7473
|
+
if ($$.isBarRangeType(d)) {
|
|
7474
|
+
// TODO use range.getStart()
|
|
7475
|
+
return scale(value[0]);
|
|
7476
|
+
}
|
|
7477
|
+
|
|
7478
|
+
var y0 = scale($$.getShapeYMin(id)),
|
|
7419
7479
|
dataXAsNumber = +x,
|
|
7420
7480
|
offset = y0;
|
|
7421
7481
|
shapeOffsetTargets.filter(function (t) {
|
|
@@ -7424,7 +7484,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7424
7484
|
var tid = t.id,
|
|
7425
7485
|
rowValueMapByXValue = t.rowValueMapByXValue,
|
|
7426
7486
|
rowValues = t.rowValues,
|
|
7427
|
-
tvalues = t.values;
|
|
7487
|
+
tvalues = t.values; // for same stacked group (ind[tid] === ind[id])
|
|
7428
7488
|
|
|
7429
7489
|
if (ind[tid] === ind[id] && indexMapByTargetId[tid] < indexMapByTargetId[id]) {
|
|
7430
7490
|
var _row,
|
|
@@ -7554,6 +7614,22 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7554
7614
|
type = config.spline_interpolation_type,
|
|
7555
7615
|
interpolation = $$.isInterpolationType(type) ? type : "cardinal";
|
|
7556
7616
|
return $$.isSplineType(d) ? interpolation : $$.isStepType(d) ? config.line_step_type : "linear";
|
|
7617
|
+
},
|
|
7618
|
+
isWithinBar: function isWithinBar(that) {
|
|
7619
|
+
var mouse = getPointer(this.state.event, that),
|
|
7620
|
+
list = getRectSegList(that),
|
|
7621
|
+
_list = list,
|
|
7622
|
+
seg0 = _list[0],
|
|
7623
|
+
seg1 = _list[1],
|
|
7624
|
+
x = Math.min(seg0.x, seg1.x),
|
|
7625
|
+
y = Math.min(seg0.y, seg1.y),
|
|
7626
|
+
offset = this.config.bar_sensitivity,
|
|
7627
|
+
_that$getBBox = that.getBBox(),
|
|
7628
|
+
width = _that$getBBox.width,
|
|
7629
|
+
height = _that$getBBox.height,
|
|
7630
|
+
isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
|
|
7631
|
+
|
|
7632
|
+
return isWithin;
|
|
7557
7633
|
}
|
|
7558
7634
|
});
|
|
7559
7635
|
;// CONCATENATED MODULE: ./src/ChartInternal/internals/size.ts
|
|
@@ -7770,6 +7846,31 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7770
7846
|
}
|
|
7771
7847
|
},
|
|
7772
7848
|
|
|
7849
|
+
/**
|
|
7850
|
+
* Get resetted padding values when 'padding=false' option is set
|
|
7851
|
+
* https://github.com/naver/billboard.js/issues/2367
|
|
7852
|
+
* @param {number|object} v Padding values to be resetted
|
|
7853
|
+
* @returns {number|object} Padding value
|
|
7854
|
+
* @private
|
|
7855
|
+
*/
|
|
7856
|
+
getResettedPadding: function getResettedPadding(v) {
|
|
7857
|
+
var $$ = this,
|
|
7858
|
+
config = $$.config,
|
|
7859
|
+
isNum = isNumber(v),
|
|
7860
|
+
p = isNum ? 0 : {};
|
|
7861
|
+
|
|
7862
|
+
if (config.padding === !1) {
|
|
7863
|
+
isNum || Object.keys(v).forEach(function (key) {
|
|
7864
|
+
// when data.lables=true, do not reset top padding
|
|
7865
|
+
p[key] = !isEmpty(config.data_labels) && config.data_labels !== !1 && key === "top" ? v[key] : 0;
|
|
7866
|
+
});
|
|
7867
|
+
} else {
|
|
7868
|
+
p = v;
|
|
7869
|
+
}
|
|
7870
|
+
|
|
7871
|
+
return p;
|
|
7872
|
+
},
|
|
7873
|
+
|
|
7773
7874
|
/**
|
|
7774
7875
|
* Update size values
|
|
7775
7876
|
* @param {boolean} isInit If is called at initialization
|
|
@@ -7808,7 +7909,8 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7808
7909
|
right: hasArc ? 0 : $$.getCurrentPaddingRight(!0),
|
|
7809
7910
|
bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
|
|
7810
7911
|
left: hasArc ? 0 : $$.getCurrentPaddingLeft()
|
|
7811
|
-
};
|
|
7912
|
+
};
|
|
7913
|
+
state.margin = $$.getResettedPadding(state.margin); // for subchart
|
|
7812
7914
|
|
|
7813
7915
|
state.margin2 = isRotated ? {
|
|
7814
7916
|
top: state.margin.top,
|
|
@@ -7931,7 +8033,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7931
8033
|
}
|
|
7932
8034
|
|
|
7933
8035
|
return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
|
7934
|
-
}).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i,
|
|
8036
|
+
}).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i, texts) {
|
|
7935
8037
|
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
7936
8038
|
value = d.value;
|
|
7937
8039
|
|
|
@@ -7945,7 +8047,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7945
8047
|
}
|
|
7946
8048
|
}
|
|
7947
8049
|
|
|
7948
|
-
value = $$.dataLabelFormat(d.id)(value, d.id, i,
|
|
8050
|
+
value = $$.dataLabelFormat(d.id)(value, d.id, i, texts);
|
|
7949
8051
|
|
|
7950
8052
|
if (isNumber(value)) {
|
|
7951
8053
|
this.textContent = value;
|
|
@@ -8147,9 +8249,11 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
8147
8249
|
isRotated = config.axis_rotated,
|
|
8148
8250
|
xPos = points[0][0];
|
|
8149
8251
|
|
|
8150
|
-
if ($$.
|
|
8252
|
+
if ($$.isCandlestickType(d)) {
|
|
8151
8253
|
if (isRotated) {
|
|
8152
|
-
|
|
8254
|
+
var _$$$getCandlestickDat;
|
|
8255
|
+
|
|
8256
|
+
xPos = (_$$$getCandlestickDat = $$.getCandlestickData(d)) != null && _$$$getCandlestickDat._isUp ? points[2][2] + 4 : points[2][1] - 4;
|
|
8153
8257
|
} else {
|
|
8154
8258
|
xPos += (points[1][0] - xPos) / 2;
|
|
8155
8259
|
}
|
|
@@ -8641,6 +8745,11 @@ function getTextPos(pos, width) {
|
|
|
8641
8745
|
volume = _map3[4];
|
|
8642
8746
|
|
|
8643
8747
|
value = "<b>Open:</b> " + open + " <b>High:</b> " + _high + " <b>Low:</b> " + _low + " <b>Close:</b> " + close + (volume ? " <b>Volume:</b> " + volume : "");
|
|
8748
|
+
} else if ($$.isBarRangeType(row)) {
|
|
8749
|
+
var _row$value = row.value,
|
|
8750
|
+
start = _row$value[0],
|
|
8751
|
+
end = _row$value[1];
|
|
8752
|
+
value = valueFormat(start) + " ~ " + valueFormat(end);
|
|
8644
8753
|
}
|
|
8645
8754
|
|
|
8646
8755
|
if (value !== undefined) {
|
|
@@ -9407,7 +9516,15 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
9407
9516
|
$el = $$.$el;
|
|
9408
9517
|
checkModuleImport($$);
|
|
9409
9518
|
state.hasAxis = !$$.hasArcType();
|
|
9410
|
-
state.hasRadar = !state.hasAxis && $$.hasType("radar");
|
|
9519
|
+
state.hasRadar = !state.hasAxis && $$.hasType("radar"); // when 'padding=false' is set, disable axes and subchart. Because they are useless.
|
|
9520
|
+
|
|
9521
|
+
if (config.padding === !1) {
|
|
9522
|
+
config.axis_x_show = !1;
|
|
9523
|
+
config.axis_y_show = !1;
|
|
9524
|
+
config.axis_y2_show = !1;
|
|
9525
|
+
config.subchart_show = !1;
|
|
9526
|
+
}
|
|
9527
|
+
|
|
9411
9528
|
$$.initParams();
|
|
9412
9529
|
var bindto = {
|
|
9413
9530
|
element: config.bindto,
|
|
@@ -9503,7 +9620,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
9503
9620
|
state.isLegendInset = config.legend_position === "inset";
|
|
9504
9621
|
state.isLegendTop = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "top-right";
|
|
9505
9622
|
state.isLegendLeft = config.legend_inset_anchor === "top-left" || config.legend_inset_anchor === "bottom-left";
|
|
9506
|
-
state.
|
|
9623
|
+
state.rotatedPadding.top = $$.getResettedPadding(state.rotatedPadding.top);
|
|
9624
|
+
state.rotatedPadding.right = isRotated && !config.axis_x_show ? 0 : 30;
|
|
9507
9625
|
state.inputType = convertInputType(config.interaction_inputType_mouse, config.interaction_inputType_touch);
|
|
9508
9626
|
};
|
|
9509
9627
|
|
|
@@ -13402,7 +13520,7 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
13402
13520
|
}
|
|
13403
13521
|
|
|
13404
13522
|
isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
|
|
13405
|
-
var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "
|
|
13523
|
+
var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
|
13406
13524
|
axis.create(dummy);
|
|
13407
13525
|
dummy.selectAll("text").each(function (d, i) {
|
|
13408
13526
|
var currentTextWidth = this.getBoundingClientRect().width;
|
|
@@ -15652,8 +15770,8 @@ function smoothLines(el, type) {
|
|
|
15652
15770
|
|
|
15653
15771
|
/**
|
|
15654
15772
|
* Fit x axis ticks.
|
|
15655
|
-
* - **true**: ticks will be
|
|
15656
|
-
* - **false**: ticks will be
|
|
15773
|
+
* - **true**: ticks will be shown according to x value of the data points.
|
|
15774
|
+
* - **false**: ticks will be shown as to have same intervals.
|
|
15657
15775
|
* @name axis․x․tick․fit
|
|
15658
15776
|
* @memberof Options
|
|
15659
15777
|
* @type {boolean}
|
|
@@ -17002,9 +17120,9 @@ function smoothLines(el, type) {
|
|
|
17002
17120
|
;// CONCATENATED MODULE: ./src/config/Options/axis/axis.ts
|
|
17003
17121
|
|
|
17004
17122
|
|
|
17005
|
-
function axis_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
17123
|
+
function axis_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
17006
17124
|
|
|
17007
|
-
function axis_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
17125
|
+
function axis_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? axis_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : axis_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
17008
17126
|
|
|
17009
17127
|
/**
|
|
17010
17128
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -17576,11 +17694,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
17576
17694
|
|
|
17577
17695
|
if (title) {
|
|
17578
17696
|
var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
|
|
17579
|
-
|
|
17580
|
-
if (hasGauge) {
|
|
17581
|
-
text.attr("dy", "-0.3em").style("font-size", "27px");
|
|
17582
|
-
}
|
|
17583
|
-
|
|
17697
|
+
hasGauge && text.attr("dy", "-0.3em");
|
|
17584
17698
|
setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
|
|
17585
17699
|
}
|
|
17586
17700
|
},
|
|
@@ -17598,7 +17712,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
17598
17712
|
}).style("cursor", function (d) {
|
|
17599
17713
|
var _isSelectable;
|
|
17600
17714
|
|
|
17601
|
-
return (_isSelectable = isSelectable) != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
|
17715
|
+
return (_isSelectable = isSelectable) != null && _isSelectable.bind != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
|
17602
17716
|
}).style("opacity", "0").each(function (d) {
|
|
17603
17717
|
if ($$.isGaugeType(d.data)) {
|
|
17604
17718
|
d.startAngle = config.gauge_startingAngle;
|
|
@@ -18041,9 +18155,16 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18041
18155
|
|
|
18042
18156
|
/* harmony default export */ var bar = ({
|
|
18043
18157
|
initBar: function initBar() {
|
|
18044
|
-
var $el = this.$el
|
|
18158
|
+
var $el = this.$el,
|
|
18159
|
+
config = this.config,
|
|
18160
|
+
clip = this.state.clip;
|
|
18045
18161
|
$el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
|
18046
|
-
.insert("g", ":first-child").attr("class", config_classes.chartBars);
|
|
18162
|
+
.insert("g", ":first-child").attr("class", config_classes.chartBars); // set clip-path attribute when condition meet
|
|
18163
|
+
// https://github.com/naver/billboard.js/issues/2421
|
|
18164
|
+
|
|
18165
|
+
if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
|
|
18166
|
+
$el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, "#" + clip.id));
|
|
18167
|
+
}
|
|
18047
18168
|
},
|
|
18048
18169
|
updateTargetsForBar: function updateTargetsForBar(targets) {
|
|
18049
18170
|
var $$ = this,
|
|
@@ -18060,8 +18181,8 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18060
18181
|
|
|
18061
18182
|
var mainBarUpdate = $$.$el.main.select("." + config_classes.chartBars).selectAll("." + config_classes.chartBar).data( // remove
|
|
18062
18183
|
targets.filter(function (v) {
|
|
18063
|
-
return
|
|
18064
|
-
return
|
|
18184
|
+
return v.values.some(function (d) {
|
|
18185
|
+
return isNumber(d.value) || $$.isBarRangeType(d);
|
|
18065
18186
|
});
|
|
18066
18187
|
})).attr("class", function (d) {
|
|
18067
18188
|
return classChartBar(d) + classFocus(d);
|
|
@@ -18099,7 +18220,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18099
18220
|
|
|
18100
18221
|
/**
|
|
18101
18222
|
* Redraw function
|
|
18102
|
-
* @param {Function} drawFn Retuned
|
|
18223
|
+
* @param {Function} drawFn Retuned function from .getDrawShape() => .generateDrawBar()
|
|
18103
18224
|
* @param {boolean} withTransition With or without transition
|
|
18104
18225
|
* @param {boolean} isSub Subchart draw
|
|
18105
18226
|
* @returns {Array}
|
|
@@ -18114,15 +18235,35 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18114
18235
|
bar = _ref.bar;
|
|
18115
18236
|
|
|
18116
18237
|
return [$$.$T(bar, withTransition, getRandom()).attr("d", function (d) {
|
|
18117
|
-
return isNumber(d.value) && drawFn(d);
|
|
18238
|
+
return (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d);
|
|
18118
18239
|
}).style("fill", this.color).style("opacity", null)];
|
|
18119
18240
|
},
|
|
18241
|
+
|
|
18242
|
+
/**
|
|
18243
|
+
* Generate draw function
|
|
18244
|
+
* @param {object} barIndices data order within x axis.
|
|
18245
|
+
* barIndices ==> {data1: 0, data2: 0, data3: 1, data4: 1, __max__: 1}
|
|
18246
|
+
*
|
|
18247
|
+
* When gropus given as:
|
|
18248
|
+
* groups: [
|
|
18249
|
+
* ["data1", "data2"],
|
|
18250
|
+
* ["data3", "data4"]
|
|
18251
|
+
* ],
|
|
18252
|
+
*
|
|
18253
|
+
* Will be rendered as:
|
|
18254
|
+
* data1 data3 data1 data3
|
|
18255
|
+
* data2 data4 data2 data4
|
|
18256
|
+
* -------------------------
|
|
18257
|
+
* 0 1
|
|
18258
|
+
* @param {boolean} isSub If is for subchart
|
|
18259
|
+
* @returns {Function}
|
|
18260
|
+
* @private
|
|
18261
|
+
*/
|
|
18120
18262
|
generateDrawBar: function generateDrawBar(barIndices, isSub) {
|
|
18121
18263
|
var $$ = this,
|
|
18122
18264
|
config = $$.config,
|
|
18123
18265
|
getPoints = $$.generateGetBarPoints(barIndices, isSub),
|
|
18124
18266
|
isRotated = config.axis_rotated,
|
|
18125
|
-
isGrouped = config.data_groups.length,
|
|
18126
18267
|
barRadius = config.bar_radius,
|
|
18127
18268
|
barRadiusRatio = config.bar_radius_ratio,
|
|
18128
18269
|
getRadius = isNumber(barRadius) && barRadius > 0 ? function () {
|
|
@@ -18137,9 +18278,10 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18137
18278
|
indexY = +!indexX,
|
|
18138
18279
|
isNegative = d.value < 0,
|
|
18139
18280
|
pathRadius = ["", ""],
|
|
18140
|
-
radius = 0
|
|
18281
|
+
radius = 0,
|
|
18282
|
+
isRadiusData = $$.isGrouped(d.id) ? $$.isStackingRadiusData(d) : !1; // switch points if axis is rotated, not applicable for sub chart
|
|
18141
18283
|
|
|
18142
|
-
if (getRadius &&
|
|
18284
|
+
if (d.value !== 0 && getRadius && (!$$.isGrouped(d.id) || isRadiusData)) {
|
|
18143
18285
|
var index = isRotated ? indexY : indexX,
|
|
18144
18286
|
barW = points[2][index] - points[0][index];
|
|
18145
18287
|
radius = getRadius(barW);
|
|
@@ -18155,6 +18297,43 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18155
18297
|
return "M" + points[0][indexX] + "," + points[0][indexY] + path + "z";
|
|
18156
18298
|
};
|
|
18157
18299
|
},
|
|
18300
|
+
|
|
18301
|
+
/**
|
|
18302
|
+
* Determine if given stacking bar data is radius type
|
|
18303
|
+
* @param {Object} d Data row
|
|
18304
|
+
* @returns {boolean}
|
|
18305
|
+
*/
|
|
18306
|
+
isStackingRadiusData: function isStackingRadiusData(d) {
|
|
18307
|
+
var $$ = this,
|
|
18308
|
+
config = $$.config,
|
|
18309
|
+
data = $$.data,
|
|
18310
|
+
id = d.id,
|
|
18311
|
+
index = d.index,
|
|
18312
|
+
value = d.value,
|
|
18313
|
+
keys = config.data_groups.find(function (v) {
|
|
18314
|
+
return v.indexOf(id) > -1;
|
|
18315
|
+
}),
|
|
18316
|
+
sortedList = $$.orderTargets($$.filterTargetsToShow(data.targets.filter($$.isBarType, $$))).filter(function (v) {
|
|
18317
|
+
return keys.indexOf(v.id) > -1;
|
|
18318
|
+
}),
|
|
18319
|
+
sortedIds = sortedList.map(function (v) {
|
|
18320
|
+
return v.values.filter(function (v2) {
|
|
18321
|
+
return v2.index === index && (value > 0 ? v2.value > 0 : v2.value < 0);
|
|
18322
|
+
})[0];
|
|
18323
|
+
}).filter(Boolean).map(function (v) {
|
|
18324
|
+
return v.id;
|
|
18325
|
+
});
|
|
18326
|
+
// If the given id stays in the last position, then radius should be applied.
|
|
18327
|
+
return value !== 0 && sortedIds.indexOf(id) === sortedIds.length - 1;
|
|
18328
|
+
},
|
|
18329
|
+
|
|
18330
|
+
/**
|
|
18331
|
+
* Generate bar coordinate points data
|
|
18332
|
+
* @param {object} barIndices Data order within x axis.
|
|
18333
|
+
* @param {boolean} isSub If is for subchart
|
|
18334
|
+
* @returns {Array} Array of coordinate points
|
|
18335
|
+
* @private
|
|
18336
|
+
*/
|
|
18158
18337
|
generateGetBarPoints: function generateGetBarPoints(barIndices, isSub) {
|
|
18159
18338
|
var $$ = this,
|
|
18160
18339
|
config = $$.config,
|
|
@@ -18177,35 +18356,22 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18177
18356
|
posY = y0;
|
|
18178
18357
|
}
|
|
18179
18358
|
|
|
18180
|
-
|
|
18359
|
+
if (!$$.isBarRangeType(d)) {
|
|
18360
|
+
posY -= y0 - offset;
|
|
18361
|
+
}
|
|
18362
|
+
|
|
18181
18363
|
var startPosX = posX + width; // 4 points that make a bar
|
|
18182
18364
|
|
|
18183
18365
|
return [[posX, offset], [posX, posY], [startPosX, posY], [startPosX, offset]];
|
|
18184
18366
|
};
|
|
18185
|
-
},
|
|
18186
|
-
isWithinBar: function isWithinBar(that) {
|
|
18187
|
-
var mouse = getPointer(this.state.event, that),
|
|
18188
|
-
list = getRectSegList(that),
|
|
18189
|
-
_list = list,
|
|
18190
|
-
seg0 = _list[0],
|
|
18191
|
-
seg1 = _list[1],
|
|
18192
|
-
x = Math.min(seg0.x, seg1.x),
|
|
18193
|
-
y = Math.min(seg0.y, seg1.y),
|
|
18194
|
-
offset = this.config.bar_sensitivity,
|
|
18195
|
-
_that$getBBox = that.getBBox(),
|
|
18196
|
-
width = _that$getBBox.width,
|
|
18197
|
-
height = _that$getBBox.height,
|
|
18198
|
-
isWithin = x - offset < mouse[0] && mouse[0] < x + width + offset && y - offset < mouse[1] && mouse[1] < y + height + offset;
|
|
18199
|
-
|
|
18200
|
-
return isWithin;
|
|
18201
18367
|
}
|
|
18202
18368
|
});
|
|
18203
18369
|
;// CONCATENATED MODULE: ./src/ChartInternal/shape/candlestick.ts
|
|
18204
18370
|
|
|
18205
18371
|
|
|
18206
|
-
function candlestick_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
18372
|
+
function candlestick_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18207
18373
|
|
|
18208
|
-
function candlestick_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
18374
|
+
function candlestick_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? candlestick_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : candlestick_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18209
18375
|
|
|
18210
18376
|
/**
|
|
18211
18377
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -19968,7 +20134,6 @@ var cacheKey = KEY.radarPoints;
|
|
|
19968
20134
|
* @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
|
|
19969
20135
|
* @property {number} [bar.padding=0] The padding pixel value between each bar.
|
|
19970
20136
|
* @property {number} [bar.radius] Set the radius of bar edge in pixel.
|
|
19971
|
-
* - **NOTE:** Works only for non-stacked bar
|
|
19972
20137
|
* @property {number} [bar.radius.ratio] Set the radius ratio of bar edge in relative the bar's width.
|
|
19973
20138
|
* @property {number} [bar.sensitivity=2] The senstivity offset value for interaction boundary.
|
|
19974
20139
|
* @property {number} [bar.width] Change the width of bar chart.
|
|
@@ -19989,7 +20154,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
19989
20154
|
* bar: {
|
|
19990
20155
|
* padding: 1,
|
|
19991
20156
|
*
|
|
19992
|
-
* //
|
|
20157
|
+
* // bar radius
|
|
19993
20158
|
* radius: 10,
|
|
19994
20159
|
* // or
|
|
19995
20160
|
* radius: {
|
|
@@ -21325,7 +21490,8 @@ extend(zoom, {
|
|
|
21325
21490
|
isSelectionGrouped = config.data_selection_grouped,
|
|
21326
21491
|
isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
|
21327
21492
|
|
|
21328
|
-
if ($$.hasArcType() || !config.data_selection_enabled ||
|
|
21493
|
+
if ($$.hasArcType() || !config.data_selection_enabled || // do nothing if not selectable
|
|
21494
|
+
config.zoom_enabled && !$$.zoom.altDomain || // skip if zoomable because of conflict drag behavior
|
|
21329
21495
|
!config.data_selection_multiple // skip when single selection because drag is used for multiple selection
|
|
21330
21496
|
) {
|
|
21331
21497
|
return;
|
|
@@ -21428,9 +21594,9 @@ extend(zoom, {
|
|
|
21428
21594
|
;// CONCATENATED MODULE: ./src/ChartInternal/internals/selection.ts
|
|
21429
21595
|
|
|
21430
21596
|
|
|
21431
|
-
function selection_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
21597
|
+
function selection_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
21432
21598
|
|
|
21433
|
-
function selection_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = arguments[i]
|
|
21599
|
+
function selection_objectSpread(target) { for (var i = 1, source; i < arguments.length; i++) { source = null != arguments[i] ? arguments[i] : {}; i % 2 ? selection_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : selection_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21434
21600
|
|
|
21435
21601
|
/**
|
|
21436
21602
|
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
@@ -22149,8 +22315,10 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
22149
22315
|
isUnZoom = (event == null ? void 0 : event.transform) === external_commonjs_d3_zoom_commonjs2_d3_zoom_amd_d3_zoom_root_d3_.zoomIdentity;
|
|
22150
22316
|
|
|
22151
22317
|
if (((_startEvent = startEvent) == null ? void 0 : _startEvent.type.indexOf("touch")) > -1) {
|
|
22318
|
+
var _e, _e$changedTouches;
|
|
22319
|
+
|
|
22152
22320
|
startEvent = startEvent.changedTouches[0];
|
|
22153
|
-
e = e.changedTouches[0];
|
|
22321
|
+
e = (_e = e) == null ? void 0 : (_e$changedTouches = _e.changedTouches) == null ? void 0 : _e$changedTouches[0];
|
|
22154
22322
|
} // if click, do nothing. otherwise, click interaction will be canceled.
|
|
22155
22323
|
|
|
22156
22324
|
|
|
@@ -22650,7 +22818,7 @@ var _defaults = {},
|
|
|
22650
22818
|
* bb.version; // "1.0.0"
|
|
22651
22819
|
* @memberof bb
|
|
22652
22820
|
*/
|
|
22653
|
-
version: "3.2.
|
|
22821
|
+
version: "3.2.2",
|
|
22654
22822
|
|
|
22655
22823
|
/**
|
|
22656
22824
|
* Generate chart
|
|
@@ -22784,7 +22952,7 @@ var _defaults = {},
|
|
|
22784
22952
|
};
|
|
22785
22953
|
/**
|
|
22786
22954
|
* @namespace bb
|
|
22787
|
-
* @version 3.2.
|
|
22955
|
+
* @version 3.2.2
|
|
22788
22956
|
*/
|
|
22789
22957
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
22790
22958
|
/**
|