billboard.js 3.2.0-next.5 → 3.2.2
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 +109 -68
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +3794 -2736
- 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 +9 -5
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +9 -5
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +9 -5
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +9 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +3433 -2617
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +3451 -2631
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +3485 -2655
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +3453 -2633
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +3450 -2630
- 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 +446 -420
- 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 +52 -53
- package/src/Chart/api/load.ts +7 -0
- package/src/Chart/api/zoom.ts +9 -6
- package/src/ChartInternal/Axis/Axis.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +1 -1
- package/src/ChartInternal/data/data.ts +1 -1
- package/src/ChartInternal/interactions/eventrect.ts +21 -3
- package/src/ChartInternal/interactions/zoom.ts +1 -1
- package/src/ChartInternal/internals/domain.ts +27 -29
- package/src/ChartInternal/internals/legend.ts +2 -1
- package/src/ChartInternal/internals/redraw.ts +2 -2
- package/src/ChartInternal/internals/text.ts +2 -2
- package/src/ChartInternal/shape/arc.ts +2 -6
- package/src/ChartInternal/shape/bar.ts +10 -2
- package/src/config/Options/data/data.ts +3 -3
- package/src/config/Options/shape/line.ts +6 -1
- package/src/module/util.ts +3 -5
- 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/chart.d.ts +2 -2
- package/types/options.d.ts +3 -3
- package/types/types.d.ts +5 -2
package/dist/billboard.css
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.2.
|
|
8
|
+
* @version 3.2.2
|
|
9
9
|
*/
|
|
10
10
|
/*-- Chart --*/
|
|
11
11
|
.bb svg {
|
|
@@ -48,11 +48,12 @@
|
|
|
48
48
|
shape-rendering: crispEdges; }
|
|
49
49
|
|
|
50
50
|
/*-- Grid --*/
|
|
51
|
-
.bb-grid
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
51
|
+
.bb-grid {
|
|
52
|
+
pointer-events: none; }
|
|
53
|
+
.bb-grid line {
|
|
54
|
+
stroke: #aaa; }
|
|
55
|
+
.bb-grid text {
|
|
56
|
+
fill: #aaa; }
|
|
56
57
|
|
|
57
58
|
.bb-xgrid, .bb-ygrid {
|
|
58
59
|
stroke-dasharray: 3 3; }
|
|
@@ -112,7 +113,6 @@
|
|
|
112
113
|
.bb-brush .extent {
|
|
113
114
|
fill-opacity: .1; }
|
|
114
115
|
|
|
115
|
-
/*-- Select - Drag --*/
|
|
116
116
|
/*-- Legend --*/
|
|
117
117
|
.bb-legend-item {
|
|
118
118
|
font-size: 12px;
|
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
dominant-baseline: middle;
|
|
177
177
|
font-size: 1.3em; }
|
|
178
178
|
|
|
179
|
-
.bb-chart-arcs-gauge-title {
|
|
179
|
+
text.bb-chart-arcs-gauge-title {
|
|
180
180
|
dominant-baseline: middle;
|
|
181
181
|
font-size: 2.7em; }
|
|
182
182
|
|
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.2.
|
|
8
|
+
* @version 3.2.2
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -691,9 +691,13 @@ function getPathBox(path) {
|
|
|
691
691
|
|
|
692
692
|
|
|
693
693
|
function getPointer(event, element) {
|
|
694
|
-
var
|
|
695
|
-
|
|
696
|
-
|
|
694
|
+
var _ref,
|
|
695
|
+
touches = event && ((_ref = event.touches || event.sourceEvent && event.sourceEvent.touches) == null ? void 0 : _ref[0]),
|
|
696
|
+
pointer = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.pointer)(touches || event, element);
|
|
697
|
+
|
|
698
|
+
return pointer.map(function (v) {
|
|
699
|
+
return isNaN(v) ? 0 : v;
|
|
700
|
+
});
|
|
697
701
|
}
|
|
698
702
|
/**
|
|
699
703
|
* Return brush selection array
|
|
@@ -2224,8 +2228,8 @@ var Store = /*#__PURE__*/function () {
|
|
|
2224
2228
|
* The arguments are:<br>
|
|
2225
2229
|
* - `v` is the value of the data point where the label is shown.
|
|
2226
2230
|
* - `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
|
-
* - `
|
|
2231
|
+
* - `i` is the index of the data series point where the label is shown.
|
|
2232
|
+
* - `texts` is the array of whole corresponding data series' text labels.<br><br>
|
|
2229
2233
|
* Formatter function can be defined for each data by specifying as an object and D3 formatter function can be set (ex. d3.format('$'))
|
|
2230
2234
|
* @property {string|object} [data.labels.backgroundColors] Set label text background colors.
|
|
2231
2235
|
* @property {string|object|Function} [data.labels.colors] Set label text colors.
|
|
@@ -2255,7 +2259,7 @@ var Store = /*#__PURE__*/function () {
|
|
|
2255
2259
|
*
|
|
2256
2260
|
* // it's possible to set for each data
|
|
2257
2261
|
* format: {
|
|
2258
|
-
* data1: function(v, id, i,
|
|
2262
|
+
* data1: function(v, id, i, texts) { ... },
|
|
2259
2263
|
* ...
|
|
2260
2264
|
* },
|
|
2261
2265
|
*
|
|
@@ -5542,48 +5546,41 @@ var colorizePattern = function (pattern, color, id) {
|
|
|
5542
5546
|
ys = $$.getValuesAsIdKeyed(targets);
|
|
5543
5547
|
|
|
5544
5548
|
if (dataGroups.length > 0) {
|
|
5545
|
-
(
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
if (_idsInGroup.length === 0) {
|
|
5553
|
-
idsInGroup = _idsInGroup;
|
|
5554
|
-
return "continue";
|
|
5555
|
-
}
|
|
5549
|
+
var hasValue = $$["has" + (isMin ? "Negative" : "Positive") + "ValueInTargets"](targets);
|
|
5550
|
+
dataGroups.forEach(function (groupIds) {
|
|
5551
|
+
// Determine baseId
|
|
5552
|
+
var idsInGroup = groupIds.filter(function (v) {
|
|
5553
|
+
return ids.indexOf(v) >= 0;
|
|
5554
|
+
});
|
|
5556
5555
|
|
|
5557
|
-
|
|
5558
|
-
var
|
|
5556
|
+
if (idsInGroup.length) {
|
|
5557
|
+
var baseId = idsInGroup[0],
|
|
5558
|
+
baseAxisId = axis.getId(baseId);
|
|
5559
5559
|
|
|
5560
|
+
// Initialize base value. Set to 0 if not match with the condition
|
|
5560
5561
|
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
|
-
}
|
|
5562
|
+
ys[baseId] = ys[baseId].map(function (v) {
|
|
5563
|
+
return (isMin ? v < 0 : v > 0) ? v : 0;
|
|
5577
5564
|
});
|
|
5578
5565
|
}
|
|
5579
5566
|
|
|
5580
|
-
idsInGroup
|
|
5581
|
-
|
|
5582
|
-
|
|
5583
|
-
|
|
5584
|
-
|
|
5567
|
+
idsInGroup.filter(function (v, i) {
|
|
5568
|
+
return i > 0;
|
|
5569
|
+
}).forEach(function (id) {
|
|
5570
|
+
if (ys[id]) {
|
|
5571
|
+
var axisId = axis.getId(id);
|
|
5572
|
+
ys[id].forEach(function (v, i) {
|
|
5573
|
+
var val = +v,
|
|
5574
|
+
meetCondition = isMin ? val > 0 : val < 0;
|
|
5575
|
+
|
|
5576
|
+
if (axisId === baseAxisId && !(hasValue && meetCondition)) {
|
|
5577
|
+
ys[baseId][i] += val;
|
|
5578
|
+
}
|
|
5579
|
+
});
|
|
5580
|
+
}
|
|
5581
|
+
});
|
|
5585
5582
|
}
|
|
5586
|
-
})
|
|
5583
|
+
});
|
|
5587
5584
|
}
|
|
5588
5585
|
|
|
5589
5586
|
return getMinMax(type, Object.keys(ys).map(function (key) {
|
|
@@ -6596,8 +6593,9 @@ function getFormat($$, typeValue, v) {
|
|
|
6596
6593
|
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
6594
|
}).attr("class", config_classes.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
|
|
6598
6595
|
var node = selection[idx],
|
|
6599
|
-
nodeName = node.nodeName.toLowerCase()
|
|
6600
|
-
|
|
6596
|
+
nodeName = node.nodeName.toLowerCase(),
|
|
6597
|
+
id = $$.getTargetSelectorSuffix(data);
|
|
6598
|
+
return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
|
|
6601
6599
|
});
|
|
6602
6600
|
} else {
|
|
6603
6601
|
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 +6698,9 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
6700
6698
|
main = $el.main;
|
|
6701
6699
|
state.redrawing = !0;
|
|
6702
6700
|
var targetsToShow = $$.filterTargetsToShow($$.data.targets),
|
|
6703
|
-
|
|
6704
|
-
flow =
|
|
6701
|
+
_options = options,
|
|
6702
|
+
flow = _options.flow,
|
|
6703
|
+
initializing = _options.initializing,
|
|
6705
6704
|
wth = $$.getWithOption(options),
|
|
6706
6705
|
duration = wth.Transition ? config.transition_duration : 0,
|
|
6707
6706
|
durationForExit = wth.TransitionForExit ? duration : 0,
|
|
@@ -6907,6 +6906,7 @@ var external_commonjs_d3_transition_commonjs2_d3_transition_amd_d3_transition_ro
|
|
|
6907
6906
|
redrawWithoutRescale: function redrawWithoutRescale() {
|
|
6908
6907
|
this.redraw({
|
|
6909
6908
|
withY: !1,
|
|
6909
|
+
withLegend: !0,
|
|
6910
6910
|
withSubchart: !1,
|
|
6911
6911
|
withEventRect: !1,
|
|
6912
6912
|
withTransitionForAxis: !1
|
|
@@ -7931,7 +7931,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7931
7931
|
}
|
|
7932
7932
|
|
|
7933
7933
|
return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
|
7934
|
-
}).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i,
|
|
7934
|
+
}).style("fill", $$.updateTextColor.bind($$)).style("fill-opacity", "0").each(function (d, i, texts) {
|
|
7935
7935
|
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
7936
7936
|
value = d.value;
|
|
7937
7937
|
|
|
@@ -7945,7 +7945,7 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
7945
7945
|
}
|
|
7946
7946
|
}
|
|
7947
7947
|
|
|
7948
|
-
value = $$.dataLabelFormat(d.id)(value, d.id, i,
|
|
7948
|
+
value = $$.dataLabelFormat(d.id)(value, d.id, i, texts);
|
|
7949
7949
|
|
|
7950
7950
|
if (isNumber(value)) {
|
|
7951
7951
|
this.textContent = value;
|
|
@@ -10819,6 +10819,13 @@ var legend_legend = {
|
|
|
10819
10819
|
* value: ["upload", "download"]
|
|
10820
10820
|
* }
|
|
10821
10821
|
* });
|
|
10822
|
+
* @example
|
|
10823
|
+
* chart.load({
|
|
10824
|
+
* json: {
|
|
10825
|
+
* data1:[30, 20, 50, 40, 60, 50],
|
|
10826
|
+
* data2:[200, 130, 90, 240, 130, 220],
|
|
10827
|
+
* }
|
|
10828
|
+
* });
|
|
10822
10829
|
*/
|
|
10823
10830
|
load: function load(args) {
|
|
10824
10831
|
var $$ = this.internal,
|
|
@@ -13395,7 +13402,7 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
13395
13402
|
}
|
|
13396
13403
|
|
|
13397
13404
|
isYAxis || this.updateXAxisTickValues(targetsToShow, axis);
|
|
13398
|
-
var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "
|
|
13405
|
+
var dummy = chart.append("svg").style("visibility", "hidden").style("position", "fixed").style("top", "0").style("left", "0");
|
|
13399
13406
|
axis.create(dummy);
|
|
13400
13407
|
dummy.selectAll("text").each(function (d, i) {
|
|
13401
13408
|
var currentTextWidth = this.getBoundingClientRect().width;
|
|
@@ -14098,13 +14105,32 @@ var Axis_Axis = /*#__PURE__*/function () {
|
|
|
14098
14105
|
$$.updateEventRect();
|
|
14099
14106
|
}).on("mousemove", function (event) {
|
|
14100
14107
|
var d = getData(event);
|
|
14101
|
-
state.event = event;
|
|
14108
|
+
state.event = event;
|
|
14102
14109
|
|
|
14103
|
-
if (
|
|
14110
|
+
if (!d) {
|
|
14104
14111
|
return;
|
|
14105
14112
|
}
|
|
14106
14113
|
|
|
14107
|
-
var index = d.index
|
|
14114
|
+
var index = d.index,
|
|
14115
|
+
stepType = config.line_step_type;
|
|
14116
|
+
|
|
14117
|
+
// tooltip position match for step-before & step-after
|
|
14118
|
+
if (config.line_step_tooltipMatch && $$.hasType("step") && /^step\-(before|after)$/.test(stepType)) {
|
|
14119
|
+
var scale = $$.scale.zoom || $$.scale.x,
|
|
14120
|
+
xs = $$.axis.xs[index],
|
|
14121
|
+
inverted = scale.invert(getPointer(event, this)[0]);
|
|
14122
|
+
|
|
14123
|
+
if (stepType === "step-after" && inverted < xs) {
|
|
14124
|
+
index -= 1;
|
|
14125
|
+
} else if (stepType === "step-before" && inverted > xs) {
|
|
14126
|
+
index += 1;
|
|
14127
|
+
}
|
|
14128
|
+
} // do nothing while dragging/flowing
|
|
14129
|
+
|
|
14130
|
+
|
|
14131
|
+
if (state.dragging || state.flowing || $$.hasArcType() || config.tooltip_grouped && index === eventReceiver.currentIdx) {
|
|
14132
|
+
return;
|
|
14133
|
+
}
|
|
14108
14134
|
|
|
14109
14135
|
if (index !== eventReceiver.currentIdx) {
|
|
14110
14136
|
$$.setOverOut(!1, eventReceiver.currentIdx);
|
|
@@ -17550,11 +17576,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
17550
17576
|
|
|
17551
17577
|
if (title) {
|
|
17552
17578
|
var text = $$.$el.arcs.append("text").attr("class", config_classes[hasGauge ? "chartArcsGaugeTitle" : "chartArcsTitle"]).style("text-anchor", "middle");
|
|
17553
|
-
|
|
17554
|
-
if (hasGauge) {
|
|
17555
|
-
text.attr("dy", "-0.3em").style("font-size", "27px");
|
|
17556
|
-
}
|
|
17557
|
-
|
|
17579
|
+
hasGauge && text.attr("dy", "-0.3em");
|
|
17558
17580
|
setTextValue(text, title, hasGauge ? undefined : [-.6, 1.35], !0);
|
|
17559
17581
|
}
|
|
17560
17582
|
},
|
|
@@ -17572,7 +17594,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
17572
17594
|
}).style("cursor", function (d) {
|
|
17573
17595
|
var _isSelectable;
|
|
17574
17596
|
|
|
17575
|
-
return (_isSelectable = isSelectable) != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
|
17597
|
+
return (_isSelectable = isSelectable) != null && _isSelectable.bind != null && _isSelectable.bind($$.api)(d) ? "pointer" : null;
|
|
17576
17598
|
}).style("opacity", "0").each(function (d) {
|
|
17577
17599
|
if ($$.isGaugeType(d.data)) {
|
|
17578
17600
|
d.startAngle = config.gauge_startingAngle;
|
|
@@ -18015,9 +18037,16 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18015
18037
|
|
|
18016
18038
|
/* harmony default export */ var bar = ({
|
|
18017
18039
|
initBar: function initBar() {
|
|
18018
|
-
var $el = this.$el
|
|
18040
|
+
var $el = this.$el,
|
|
18041
|
+
config = this.config,
|
|
18042
|
+
clip = this.state.clip;
|
|
18019
18043
|
$el.bar = $el.main.select("." + config_classes.chart) // should positioned at the beginning of the shape node to not overlap others
|
|
18020
|
-
.insert("g", ":first-child").attr("class", config_classes.chartBars);
|
|
18044
|
+
.insert("g", ":first-child").attr("class", config_classes.chartBars); // set clip-path attribute when condition meet
|
|
18045
|
+
// https://github.com/naver/billboard.js/issues/2421
|
|
18046
|
+
|
|
18047
|
+
if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
|
|
18048
|
+
$el.bar.attr("clip-path", clip.pathXAxis.replace(/#[^)]*/, "#" + clip.id));
|
|
18049
|
+
}
|
|
18021
18050
|
},
|
|
18022
18051
|
updateTargetsForBar: function updateTargetsForBar(targets) {
|
|
18023
18052
|
var $$ = this,
|
|
@@ -18113,7 +18142,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
18113
18142
|
pathRadius = ["", ""],
|
|
18114
18143
|
radius = 0; // switch points if axis is rotated, not applicable for sub chart
|
|
18115
18144
|
|
|
18116
|
-
if (getRadius && !isGrouped) {
|
|
18145
|
+
if (d.value !== 0 && getRadius && !isGrouped) {
|
|
18117
18146
|
var index = isRotated ? indexY : indexX,
|
|
18118
18147
|
barW = points[2][index] - points[0][index];
|
|
18119
18148
|
radius = getRadius(barW);
|
|
@@ -20131,6 +20160,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
20131
20160
|
* - step
|
|
20132
20161
|
* - step-before
|
|
20133
20162
|
* - step-after
|
|
20163
|
+
* @property {boolean} [line.step.tooltipMatch=false] Set to `true` for `step-before` and `step-after` types to have cursor/tooltip match to hovered step's point instead of nearest point.
|
|
20134
20164
|
* @property {boolean|Array} [line.point=true] Set to false to not draw points on linecharts. Or pass an array of line ids to draw points for.
|
|
20135
20165
|
* @property {boolean} [line.zerobased=false] Set if min or max value will be 0 on line chart.
|
|
20136
20166
|
* @example
|
|
@@ -20141,7 +20171,10 @@ var cacheKey = KEY.radarPoints;
|
|
|
20141
20171
|
* "line-class2"
|
|
20142
20172
|
* ],
|
|
20143
20173
|
* step: {
|
|
20144
|
-
* type: "step-after"
|
|
20174
|
+
* type: "step-after",
|
|
20175
|
+
*
|
|
20176
|
+
* // to have cursor/tooltip match to hovered step's point instead of nearest point.
|
|
20177
|
+
* tooltipMatch: true
|
|
20145
20178
|
* },
|
|
20146
20179
|
*
|
|
20147
20180
|
* // hide all data points ('point.show=false' also has similar effect)
|
|
@@ -20157,6 +20190,7 @@ var cacheKey = KEY.radarPoints;
|
|
|
20157
20190
|
*/
|
|
20158
20191
|
line_connectNull: !1,
|
|
20159
20192
|
line_step_type: "step",
|
|
20193
|
+
line_step_tooltipMatch: !1,
|
|
20160
20194
|
line_zerobased: !1,
|
|
20161
20195
|
line_classes: undefined,
|
|
20162
20196
|
line_point: !0
|
|
@@ -21060,6 +21094,9 @@ function withinRange(domain, current, range) {
|
|
|
21060
21094
|
* // Zoom to specified domain range
|
|
21061
21095
|
* chart.zoom([10, 20]);
|
|
21062
21096
|
*
|
|
21097
|
+
* // For timeseries, the domain value can be string, but the format should match with the 'data.xFormat' option.
|
|
21098
|
+
* chart.zoom(["2021-02-03", "2021-02-08"]);
|
|
21099
|
+
*
|
|
21063
21100
|
* // Get the current zoomed domain range
|
|
21064
21101
|
* chart.zoom();
|
|
21065
21102
|
*/
|
|
@@ -21068,15 +21105,16 @@ function withinRange(domain, current, range) {
|
|
|
21068
21105
|
var zoom = function (domainValue) {
|
|
21069
21106
|
var $$ = this.internal,
|
|
21070
21107
|
$el = $$.$el,
|
|
21108
|
+
axis = $$.axis,
|
|
21071
21109
|
config = $$.config,
|
|
21072
21110
|
org = $$.org,
|
|
21073
21111
|
scale = $$.scale,
|
|
21074
21112
|
isRotated = config.axis_rotated,
|
|
21075
|
-
isCategorized =
|
|
21113
|
+
isCategorized = axis.isCategorized(),
|
|
21076
21114
|
domain = domainValue;
|
|
21077
21115
|
|
|
21078
21116
|
if (config.zoom_enabled && domain) {
|
|
21079
|
-
if (
|
|
21117
|
+
if (axis.isTimeSeries()) {
|
|
21080
21118
|
domain = domain.map(function (x) {
|
|
21081
21119
|
return parseDate.bind($$)(x);
|
|
21082
21120
|
});
|
|
@@ -21290,7 +21328,8 @@ extend(zoom, {
|
|
|
21290
21328
|
isSelectionGrouped = config.data_selection_grouped,
|
|
21291
21329
|
isSelectable = config.interaction_enabled && config.data_selection_isselectable;
|
|
21292
21330
|
|
|
21293
|
-
if ($$.hasArcType() || !config.data_selection_enabled ||
|
|
21331
|
+
if ($$.hasArcType() || !config.data_selection_enabled || // do nothing if not selectable
|
|
21332
|
+
config.zoom_enabled && !$$.zoom.altDomain || // skip if zoomable because of conflict drag behavior
|
|
21294
21333
|
!config.data_selection_multiple // skip when single selection because drag is used for multiple selection
|
|
21295
21334
|
) {
|
|
21296
21335
|
return;
|
|
@@ -22114,8 +22153,10 @@ function selection_objectSpread(target) { for (var i = 1, source; i < arguments.
|
|
|
22114
22153
|
isUnZoom = (event == null ? void 0 : event.transform) === external_commonjs_d3_zoom_commonjs2_d3_zoom_amd_d3_zoom_root_d3_.zoomIdentity;
|
|
22115
22154
|
|
|
22116
22155
|
if (((_startEvent = startEvent) == null ? void 0 : _startEvent.type.indexOf("touch")) > -1) {
|
|
22156
|
+
var _e, _e$changedTouches;
|
|
22157
|
+
|
|
22117
22158
|
startEvent = startEvent.changedTouches[0];
|
|
22118
|
-
e = e.changedTouches[0];
|
|
22159
|
+
e = (_e = e) == null ? void 0 : (_e$changedTouches = _e.changedTouches) == null ? void 0 : _e$changedTouches[0];
|
|
22119
22160
|
} // if click, do nothing. otherwise, click interaction will be canceled.
|
|
22120
22161
|
|
|
22121
22162
|
|
|
@@ -22615,7 +22656,7 @@ var _defaults = {},
|
|
|
22615
22656
|
* bb.version; // "1.0.0"
|
|
22616
22657
|
* @memberof bb
|
|
22617
22658
|
*/
|
|
22618
|
-
version: "3.2.
|
|
22659
|
+
version: "3.2.1",
|
|
22619
22660
|
|
|
22620
22661
|
/**
|
|
22621
22662
|
* Generate chart
|
|
@@ -22749,7 +22790,7 @@ var _defaults = {},
|
|
|
22749
22790
|
};
|
|
22750
22791
|
/**
|
|
22751
22792
|
* @namespace bb
|
|
22752
|
-
* @version 3.2.
|
|
22793
|
+
* @version 3.2.1
|
|
22753
22794
|
*/
|
|
22754
22795
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
22755
22796
|
/**
|
package/dist/billboard.min.css
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.2.
|
|
9
|
-
*/.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-brush .extent,.bb-region,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}
|
|
8
|
+
* @version 3.2.2
|
|
9
|
+
*/.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-brush .extent,.bb-region,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}
|