billboard.js 3.5.0-next.2 → 3.5.0
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 +116 -91
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +124 -96
- package/dist/billboard.pkgd.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +10 -7
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +10 -7
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +10 -7
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +10 -7
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +10 -7
- 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 +86 -60
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +14 -14
- package/src/ChartInternal/ChartInternal.ts +2 -11
- package/src/ChartInternal/internals/class.ts +1 -1
- package/src/ChartInternal/internals/color.ts +1 -25
- package/src/ChartInternal/internals/legend.ts +21 -6
- package/src/ChartInternal/internals/style.ts +54 -0
- package/src/ChartInternal/internals/text.ts +3 -4
- package/src/ChartInternal/shape/arc.ts +4 -3
- package/src/ChartInternal/shape/bar.ts +6 -5
- package/src/ChartInternal/shape/line.ts +3 -2
- package/src/ChartInternal/shape/point.ts +8 -6
- package/src/config/Store/State.ts +1 -1
package/dist/billboard.css
CHANGED
package/dist/billboard.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.5.0
|
|
8
|
+
* @version 3.5.0
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -1744,7 +1744,7 @@ var State = function () {
|
|
|
1744
1744
|
hasAxis: !1,
|
|
1745
1745
|
hasRadar: !1,
|
|
1746
1746
|
// for data CSS rule index (used when boost.useCssRule is true)
|
|
1747
|
-
|
|
1747
|
+
cssRule: {},
|
|
1748
1748
|
current: {
|
|
1749
1749
|
// chart whole dimension
|
|
1750
1750
|
width: 0,
|
|
@@ -6346,48 +6346,8 @@ function getColorFromCss(element) {
|
|
|
6346
6346
|
|
|
6347
6347
|
var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b", "#e377c2", "#7f7f7f", "#bcbd22", "#17becf"];
|
|
6348
6348
|
/* harmony default export */ var internals_color = ({
|
|
6349
|
-
/**
|
|
6350
|
-
* Add props color css rule to given selector
|
|
6351
|
-
* @param {Function} fn Color function
|
|
6352
|
-
* @param {string} selector CSS selector
|
|
6353
|
-
* @param {Array} props CSS props list
|
|
6354
|
-
* @returns {Function}
|
|
6355
|
-
* @private
|
|
6356
|
-
*/
|
|
6357
|
-
setColorByRule: function setColorByRule(fn, selector, props) {
|
|
6358
|
-
var _this3 = this,
|
|
6359
|
-
$$ = this,
|
|
6360
|
-
config = $$.config,
|
|
6361
|
-
_$$$state = $$.state,
|
|
6362
|
-
colorRule = _$$$state.colorRule,
|
|
6363
|
-
style = _$$$state.style,
|
|
6364
|
-
colorFn = fn || $$.color;
|
|
6365
|
-
|
|
6366
|
-
return config.boost_useCssRule ? function (selection) {
|
|
6367
|
-
var _this4 = this;
|
|
6368
|
-
|
|
6369
|
-
_newArrowCheck(this, _this3);
|
|
6370
|
-
|
|
6371
|
-
selection.each(function (d) {
|
|
6372
|
-
var _this5 = this;
|
|
6373
|
-
|
|
6374
|
-
_newArrowCheck(this, _this4);
|
|
6375
|
-
|
|
6376
|
-
var color = colorFn.call($$, d),
|
|
6377
|
-
shapeSelector = "" + $SHAPE.shapes + $$.getTargetSelectorSuffix(d.id) + " ." + selector;
|
|
6378
|
-
shapeSelector in colorRule && style.sheet.deleteRule(colorRule[shapeSelector]);
|
|
6379
|
-
$$.state.colorRule[shapeSelector] = addCssRules(style, shapeSelector, props.map(function (v) {
|
|
6380
|
-
_newArrowCheck(this, _this5);
|
|
6381
|
-
|
|
6382
|
-
return v + ": " + color;
|
|
6383
|
-
}.bind(this)));
|
|
6384
|
-
}.bind(this));
|
|
6385
|
-
}.bind(this) : function () {
|
|
6386
|
-
_newArrowCheck(this, _this3);
|
|
6387
|
-
}.bind(this);
|
|
6388
|
-
},
|
|
6389
6349
|
generateColor: function generateColor() {
|
|
6390
|
-
var
|
|
6350
|
+
var _this3 = this,
|
|
6391
6351
|
$$ = this,
|
|
6392
6352
|
$el = $$.$el,
|
|
6393
6353
|
config = $$.config,
|
|
@@ -6400,7 +6360,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6400
6360
|
if (isFunction(config.color_tiles)) {
|
|
6401
6361
|
var tiles = config.color_tiles.bind($$.api)(),
|
|
6402
6362
|
colorizedPatterns = pattern.map(function (p, index) {
|
|
6403
|
-
_newArrowCheck(this,
|
|
6363
|
+
_newArrowCheck(this, _this3);
|
|
6404
6364
|
|
|
6405
6365
|
var color = p.replace(/[#\(\)\s,]/g, ""),
|
|
6406
6366
|
id = $$.state.datetimeId + "-pattern-" + color + "-" + index;
|
|
@@ -6408,7 +6368,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6408
6368
|
}.bind(this)); // Add background color to patterns
|
|
6409
6369
|
|
|
6410
6370
|
pattern = colorizedPatterns.map(function (p) {
|
|
6411
|
-
_newArrowCheck(this,
|
|
6371
|
+
_newArrowCheck(this, _this3);
|
|
6412
6372
|
|
|
6413
6373
|
return "url(#" + p.id + ")";
|
|
6414
6374
|
}.bind(this));
|
|
@@ -6467,7 +6427,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6467
6427
|
* @private
|
|
6468
6428
|
*/
|
|
6469
6429
|
generateDataLabelBackgroundColorFilter: function generateDataLabelBackgroundColorFilter(color) {
|
|
6470
|
-
var
|
|
6430
|
+
var _this4 = this,
|
|
6471
6431
|
$$ = this,
|
|
6472
6432
|
$el = $$.$el,
|
|
6473
6433
|
config = $$.config,
|
|
@@ -6484,7 +6444,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6484
6444
|
}
|
|
6485
6445
|
|
|
6486
6446
|
ids.forEach(function (v) {
|
|
6487
|
-
_newArrowCheck(this,
|
|
6447
|
+
_newArrowCheck(this, _this4);
|
|
6488
6448
|
|
|
6489
6449
|
var id = state.datetimeId + "-labels-bg" + $$.getTargetSelectorSuffix(v) + (color ? $$.getTargetSelectorSuffix(color) : "");
|
|
6490
6450
|
$el.defs.append("filter").attr("x", "0").attr("y", "0").attr("width", "1").attr("height", "1").attr("id", id).html("<feFlood flood-color=\"" + (v === "" ? backgroundColors : backgroundColors[v]) + "\" /><feComposite in=\"SourceGraphic\"/>");
|
|
@@ -6500,7 +6460,7 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6500
6460
|
* @private
|
|
6501
6461
|
*/
|
|
6502
6462
|
setOverColor: function setOverColor(isOver, d) {
|
|
6503
|
-
var
|
|
6463
|
+
var _this5 = this,
|
|
6504
6464
|
$$ = this,
|
|
6505
6465
|
config = $$.config,
|
|
6506
6466
|
main = $$.$el.main,
|
|
@@ -6511,13 +6471,13 @@ var schemeCategory10 = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "
|
|
|
6511
6471
|
color = function (_ref) {
|
|
6512
6472
|
var id = _ref.id;
|
|
6513
6473
|
|
|
6514
|
-
_newArrowCheck(this,
|
|
6474
|
+
_newArrowCheck(this, _this5);
|
|
6515
6475
|
|
|
6516
6476
|
return id in onover ? onover[id] : $$.color(id);
|
|
6517
6477
|
}.bind(this);
|
|
6518
6478
|
} else if (isString(color)) {
|
|
6519
6479
|
color = function () {
|
|
6520
|
-
_newArrowCheck(this,
|
|
6480
|
+
_newArrowCheck(this, _this5);
|
|
6521
6481
|
|
|
6522
6482
|
return onover;
|
|
6523
6483
|
}.bind(this);
|
|
@@ -7423,11 +7383,13 @@ function getFormat($$, typeValue, v) {
|
|
|
7423
7383
|
setLegendItem: function setLegendItem(item) {
|
|
7424
7384
|
var _this3 = this,
|
|
7425
7385
|
$$ = this,
|
|
7386
|
+
$el = $$.$el,
|
|
7426
7387
|
api = $$.api,
|
|
7427
7388
|
config = $$.config,
|
|
7428
7389
|
state = $$.state,
|
|
7429
7390
|
isTouch = state.inputType === "touch",
|
|
7430
|
-
hasGauge = $$.hasType("gauge")
|
|
7391
|
+
hasGauge = $$.hasType("gauge"),
|
|
7392
|
+
useCssRule = config.boost_useCssRule;
|
|
7431
7393
|
|
|
7432
7394
|
item.attr("class", function (id) {
|
|
7433
7395
|
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
@@ -7440,7 +7402,17 @@ function getFormat($$, typeValue, v) {
|
|
|
7440
7402
|
}.bind(this));
|
|
7441
7403
|
|
|
7442
7404
|
if (config.interaction_enabled) {
|
|
7443
|
-
|
|
7405
|
+
if (useCssRule) {
|
|
7406
|
+
[["." + $LEGEND.legendItem, "cursor:pointer"], ["." + $LEGEND.legendItem + " text", "pointer-events:none"], ["." + $LEGEND.legendItemPoint + " text", "pointer-events:none"], ["." + $LEGEND.legendItemTile, "pointer-events:none"], ["." + $LEGEND.legendItemEvent, "fill-opacity:0"]].forEach(function (v) {
|
|
7407
|
+
_newArrowCheck(this, _this3);
|
|
7408
|
+
|
|
7409
|
+
var selector = v[0],
|
|
7410
|
+
props = v[1];
|
|
7411
|
+
$$.setCssRule(!1, selector, [props])($el.legend);
|
|
7412
|
+
}.bind(this));
|
|
7413
|
+
}
|
|
7414
|
+
|
|
7415
|
+
item.style("cursor", $$.getStylePropValue("pointer")).on("click", function (event, id) {
|
|
7444
7416
|
if (!callFn(config.legend_item_onclick, api, id)) {
|
|
7445
7417
|
if (event.altKey) {
|
|
7446
7418
|
api.hide();
|
|
@@ -7683,8 +7655,8 @@ function getFormat($$, typeValue, v) {
|
|
|
7683
7655
|
return isDefined(config.data_names[id]) ? config.data_names[id] : id;
|
|
7684
7656
|
}.bind(this)).each(function (id, i) {
|
|
7685
7657
|
updatePositions(this, id, i);
|
|
7686
|
-
}).style("pointer-events", "none").attr("x", isLegendRightOrInset ? xForLegendText : pos).attr("y", isLegendRightOrInset ? pos : yForLegendText);
|
|
7687
|
-
l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", "0").attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
|
|
7658
|
+
}).style("pointer-events", $$.getStylePropValue("none")).attr("x", isLegendRightOrInset ? xForLegendText : pos).attr("y", isLegendRightOrInset ? pos : yForLegendText);
|
|
7659
|
+
l.append("rect").attr("class", $LEGEND.legendItemEvent).style("fill-opacity", $$.getStylePropValue("0")).attr("x", isLegendRightOrInset ? xForLegendRect : pos).attr("y", isLegendRightOrInset ? pos : yForLegendRect);
|
|
7688
7660
|
|
|
7689
7661
|
var getColor = function (id) {
|
|
7690
7662
|
_newArrowCheck(this, _this4);
|
|
@@ -7708,7 +7680,7 @@ function getFormat($$, typeValue, v) {
|
|
|
7708
7680
|
}
|
|
7709
7681
|
|
|
7710
7682
|
return browser_doc.createElementNS(external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.namespaces.svg, "hasValidPointType" in $$ && $$.hasValidPointType(point) ? point : "use");
|
|
7711
|
-
}.bind(this)).attr("class", $LEGEND.legendItemPoint).style("fill", getColor).style("pointer-events", "none").attr("href", function (data, idx, selection) {
|
|
7683
|
+
}.bind(this)).attr("class", $LEGEND.legendItemPoint).style("fill", getColor).style("pointer-events", $$.getStylePropValue("none")).attr("href", function (data, idx, selection) {
|
|
7712
7684
|
_newArrowCheck(this, _this4);
|
|
7713
7685
|
|
|
7714
7686
|
var node = selection[idx],
|
|
@@ -7717,7 +7689,7 @@ function getFormat($$, typeValue, v) {
|
|
|
7717
7689
|
return nodeName === "use" ? "#" + state.datetimeId + "-point" + id : undefined;
|
|
7718
7690
|
}.bind(this));
|
|
7719
7691
|
} else {
|
|
7720
|
-
l.append("line").attr("class", $LEGEND.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);
|
|
7692
|
+
l.append("line").attr("class", $LEGEND.legendItemTile).style("stroke", getColor).style("pointer-events", $$.getStylePropValue("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);
|
|
7721
7693
|
} // Set background for inset legend
|
|
7722
7694
|
|
|
7723
7695
|
|
|
@@ -9198,6 +9170,68 @@ var external_commonjs_d3_shape_commonjs2_d3_shape_amd_d3_shape_root_d3_ = __webp
|
|
|
9198
9170
|
}
|
|
9199
9171
|
}
|
|
9200
9172
|
});
|
|
9173
|
+
;// CONCATENATED MODULE: ./src/ChartInternal/internals/style.ts
|
|
9174
|
+
|
|
9175
|
+
|
|
9176
|
+
/**
|
|
9177
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
9178
|
+
* billboard.js project is licensed under the MIT license
|
|
9179
|
+
*/
|
|
9180
|
+
|
|
9181
|
+
|
|
9182
|
+
/* harmony default export */ var style = ({
|
|
9183
|
+
/**
|
|
9184
|
+
* Add props color css rule to given selector
|
|
9185
|
+
* @param {boolean} withShape Set shpes' prefix class
|
|
9186
|
+
* @param {string} selector CSS selector
|
|
9187
|
+
* @param {Array} props CSS props list
|
|
9188
|
+
* @param {Function} propsFn Function to retrieve value or determine for props
|
|
9189
|
+
* @returns {Function}
|
|
9190
|
+
* @private
|
|
9191
|
+
*/
|
|
9192
|
+
setCssRule: function setCssRule(withShape, selector, props, propsFn) {
|
|
9193
|
+
var _this = this,
|
|
9194
|
+
$$ = this,
|
|
9195
|
+
config = $$.config,
|
|
9196
|
+
_$$$state = $$.state,
|
|
9197
|
+
cssRule = _$$$state.cssRule,
|
|
9198
|
+
style = _$$$state.style;
|
|
9199
|
+
|
|
9200
|
+
return config.boost_useCssRule ? function (selection) {
|
|
9201
|
+
var _this2 = this;
|
|
9202
|
+
|
|
9203
|
+
_newArrowCheck(this, _this);
|
|
9204
|
+
|
|
9205
|
+
selection.each(function (d) {
|
|
9206
|
+
var _this3 = this;
|
|
9207
|
+
|
|
9208
|
+
_newArrowCheck(this, _this2);
|
|
9209
|
+
|
|
9210
|
+
var res = propsFn && (propsFn == null ? void 0 : propsFn.call($$, d)),
|
|
9211
|
+
shapeSelector = "" + (withShape ? "." + ($SHAPE.shapes + $$.getTargetSelectorSuffix(d.id)) : "") + selector;
|
|
9212
|
+
selector in cssRule && style.sheet.deleteRule(cssRule[shapeSelector]);
|
|
9213
|
+
$$.state.cssRule[shapeSelector] = addCssRules(style, shapeSelector, props.filter(Boolean).map(function (v) {
|
|
9214
|
+
_newArrowCheck(this, _this3);
|
|
9215
|
+
|
|
9216
|
+
return isString(res) && v.indexOf(":") === -1 ? v + ": " + res : v || "";
|
|
9217
|
+
}.bind(this)));
|
|
9218
|
+
}.bind(this));
|
|
9219
|
+
}.bind(this) : function () {
|
|
9220
|
+
_newArrowCheck(this, _this);
|
|
9221
|
+
}.bind(this);
|
|
9222
|
+
},
|
|
9223
|
+
|
|
9224
|
+
/**
|
|
9225
|
+
* Get style prop value
|
|
9226
|
+
* @param {Function|string} v Value
|
|
9227
|
+
* @returns {string|null}
|
|
9228
|
+
* @private
|
|
9229
|
+
*/
|
|
9230
|
+
getStylePropValue: function getStylePropValue(v) {
|
|
9231
|
+
var useCssRule = this.config.boost_useCssRule;
|
|
9232
|
+
return useCssRule ? null : isFunction(v) ? v.bind(this) : v;
|
|
9233
|
+
}
|
|
9234
|
+
});
|
|
9201
9235
|
;// CONCATENATED MODULE: ./src/ChartInternal/internals/text.ts
|
|
9202
9236
|
|
|
9203
9237
|
|
|
@@ -9316,7 +9350,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
9316
9350
|
|
|
9317
9351
|
return classChartText(d) + classFocus(d);
|
|
9318
9352
|
}.bind(this)),
|
|
9319
|
-
mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).call($$.
|
|
9353
|
+
mainTextEnter = mainTextUpdate.enter().append("g").style("opacity", "0").attr("class", classChartText).call($$.setCssRule(!0, " ." + $TEXT.text, ["fill", "pointer-events:none"], $$.updateTextColor));
|
|
9320
9354
|
|
|
9321
9355
|
mainTextEnter.append("g").attr("class", classTexts);
|
|
9322
9356
|
},
|
|
@@ -9347,7 +9381,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
9347
9381
|
}
|
|
9348
9382
|
|
|
9349
9383
|
return config.axis_rotated ? isEndAnchor ? "end" : "start" : "middle";
|
|
9350
|
-
}.bind(this)).style("fill", $$.
|
|
9384
|
+
}.bind(this)).style("fill", $$.getStylePropValue($$.updateTextColor)).style("fill-opacity", "0").each(function (d, i, texts) {
|
|
9351
9385
|
var node = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this),
|
|
9352
9386
|
value = d.value;
|
|
9353
9387
|
|
|
@@ -9444,7 +9478,7 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
9444
9478
|
angle = config.data_labels.rotate,
|
|
9445
9479
|
anchorString = getRotateAnchor(angle),
|
|
9446
9480
|
rotateString = angle ? "rotate(" + angle + ")" : "";
|
|
9447
|
-
$$.$el.text.style("fill", $$.
|
|
9481
|
+
$$.$el.text.style("fill", $$.getStylePropValue($$.updateTextColor)).attr("filter", $$.updateTextBacgroundColor.bind($$)).style("fill-opacity", forFlow ? 0 : $$.opacityForText.bind($$)).each(function (d, i) {
|
|
9448
9482
|
// do not apply transition for newly added text elements
|
|
9449
9483
|
var node = $T(this, !!(withTransition && this.getAttribute("x")), t),
|
|
9450
9484
|
isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"],
|
|
@@ -10817,6 +10851,7 @@ function getTextPos(pos, width) {
|
|
|
10817
10851
|
|
|
10818
10852
|
|
|
10819
10853
|
|
|
10854
|
+
|
|
10820
10855
|
/**
|
|
10821
10856
|
* Internal chart class.
|
|
10822
10857
|
* - Note: Instantiated internally, not exposed for public.
|
|
@@ -11038,22 +11073,11 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
11038
11073
|
config = $$.config,
|
|
11039
11074
|
format = $$.format,
|
|
11040
11075
|
state = $$.state,
|
|
11041
|
-
isRotated = config.axis_rotated
|
|
11042
|
-
useCssRule = config.boost_useCssRule;
|
|
11076
|
+
isRotated = config.axis_rotated;
|
|
11043
11077
|
|
|
11044
11078
|
// color settings
|
|
11045
11079
|
$$.color = $$.generateColor();
|
|
11046
|
-
$$.
|
|
11047
|
-
$$.colorTextByRule = $$.updateTextColor.bind($$);
|
|
11048
|
-
$$.levelColor = $$.generateLevelColor();
|
|
11049
|
-
|
|
11050
|
-
if (useCssRule) {
|
|
11051
|
-
state.colorRule = {}; // to not apply inline color setting
|
|
11052
|
-
|
|
11053
|
-
$$.colorByRule = null;
|
|
11054
|
-
$$.colorTextByRule = null;
|
|
11055
|
-
} // when 'padding=false' is set, disable axes and subchart. Because they are useless.
|
|
11056
|
-
|
|
11080
|
+
$$.levelColor = $$.generateLevelColor(); // when 'padding=false' is set, disable axes and subchart. Because they are useless.
|
|
11057
11081
|
|
|
11058
11082
|
if (config.padding === !1) {
|
|
11059
11083
|
config.axis_x_show = !1;
|
|
@@ -11588,7 +11612,7 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
11588
11612
|
|
|
11589
11613
|
|
|
11590
11614
|
extend(ChartInternal.prototype, [// common
|
|
11591
|
-
convert, data_data, load, category, internals_class, internals_color, domain, interactions_interaction, format, internals_legend, redraw, scale, shape, size, internals_text, internals_title, internals_tooltip, transform, type]);
|
|
11615
|
+
convert, data_data, load, category, internals_class, internals_color, domain, interactions_interaction, format, internals_legend, redraw, scale, shape, size, style, internals_text, internals_title, internals_tooltip, transform, type]);
|
|
11592
11616
|
;// CONCATENATED MODULE: ./src/config/config.ts
|
|
11593
11617
|
|
|
11594
11618
|
|
|
@@ -19902,10 +19926,10 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
19902
19926
|
|
|
19903
19927
|
return classChartArc(d) + classFocus(d.data);
|
|
19904
19928
|
}.bind(this)),
|
|
19905
|
-
mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc);
|
|
19929
|
+
mainPieEnter = mainPieUpdate.enter().append("g").attr("class", classChartArc).call(this.setCssRule(!1, "." + $ARC.chartArcs + " text", ["pointer-events:none", "text-anchor:middle"]));
|
|
19906
19930
|
|
|
19907
19931
|
mainPieEnter.append("g").attr("class", classArcs).merge(mainPieUpdate);
|
|
19908
|
-
mainPieEnter.append("text").attr("dy", hasGauge && !$$.hasMultiTargets() ? "-.1em" : ".35em").style("opacity", "0").style("text-anchor", "middle").style("pointer-events", "none");
|
|
19932
|
+
mainPieEnter.append("text").attr("dy", hasGauge && !$$.hasMultiTargets() ? "-.1em" : ".35em").style("opacity", "0").style("text-anchor", $$.getStylePropValue("middle")).style("pointer-events", $$.getStylePropValue("none"));
|
|
19909
19933
|
$el.text = chartArcs.selectAll("." + $COMMON.target + " text"); // MEMO: can not keep same color..., but not bad to update color in redraw
|
|
19910
19934
|
// mainPieUpdate.exit().remove();
|
|
19911
19935
|
},
|
|
@@ -20454,7 +20478,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
20454
20478
|
config = this.config,
|
|
20455
20479
|
clip = this.state.clip;
|
|
20456
20480
|
$el.bar = $el.main.select("." + $COMMON.chart) // should positioned at the beginning of the shape node to not overlap others
|
|
20457
|
-
.insert("g", ":first-child").attr("class", $BAR.chartBars); // set clip-path attribute when condition meet
|
|
20481
|
+
.insert("g", ":first-child").attr("class", $BAR.chartBars).call(this.setCssRule(!1, "." + $BAR.chartBars, ["pointer-events:none"])); // set clip-path attribute when condition meet
|
|
20458
20482
|
// https://github.com/naver/billboard.js/issues/2421
|
|
20459
20483
|
|
|
20460
20484
|
if (config.clipPath === !1 && (config.bar_radius || config.bar_radius_ratio)) {
|
|
@@ -20491,13 +20515,13 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
20491
20515
|
|
|
20492
20516
|
return classChartBar(d) + classFocus(d);
|
|
20493
20517
|
}.bind(this)),
|
|
20494
|
-
mainBarEnter = mainBarUpdate.enter().append("g").attr("class", classChartBar).style("opacity", "0").style("pointer-events", "none");
|
|
20518
|
+
mainBarEnter = mainBarUpdate.enter().append("g").attr("class", classChartBar).style("opacity", "0").style("pointer-events", $$.getStylePropValue("none"));
|
|
20495
20519
|
// Bars for each data
|
|
20496
20520
|
mainBarEnter.append("g").attr("class", classBars).style("cursor", function (d) {
|
|
20497
20521
|
_newArrowCheck(this, _this);
|
|
20498
20522
|
|
|
20499
20523
|
return isSelectable != null && isSelectable.bind != null && isSelectable.bind($$.api)(d) ? "pointer" : null;
|
|
20500
|
-
}.bind(this)).call($$.
|
|
20524
|
+
}.bind(this)).call($$.setCssRule(!0, " ." + $BAR.bar, ["fill"], $$.color));
|
|
20501
20525
|
},
|
|
20502
20526
|
|
|
20503
20527
|
/**
|
|
@@ -20519,7 +20543,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
20519
20543
|
initialOpacity = $$.initialOpacity.bind($$),
|
|
20520
20544
|
bar = $root.main.selectAll("." + $BAR.bars).selectAll("." + $BAR.bar).data($$.labelishData.bind($$));
|
|
20521
20545
|
$T(bar.exit(), withTransition).style("opacity", "0").remove();
|
|
20522
|
-
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.
|
|
20546
|
+
$root.bar = bar.enter().append("path").attr("class", classBar).style("fill", $$.getStylePropValue($$.color)).merge(bar).style("opacity", initialOpacity);
|
|
20523
20547
|
},
|
|
20524
20548
|
|
|
20525
20549
|
/**
|
|
@@ -20544,7 +20568,7 @@ var external_commonjs_d3_interpolate_commonjs2_d3_interpolate_amd_d3_interpolate
|
|
|
20544
20568
|
_newArrowCheck(this, _this3);
|
|
20545
20569
|
|
|
20546
20570
|
return (isNumber(d.value) || $$.isBarRangeType(d)) && drawFn(d);
|
|
20547
|
-
}.bind(this)).style("fill", $$.
|
|
20571
|
+
}.bind(this)).style("fill", $$.getStylePropValue($$.color)).style("opacity", null)];
|
|
20548
20572
|
},
|
|
20549
20573
|
|
|
20550
20574
|
/**
|
|
@@ -21179,7 +21203,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
21179
21203
|
/* harmony default export */ var line = ({
|
|
21180
21204
|
initLine: function initLine() {
|
|
21181
21205
|
var $el = this.$el;
|
|
21182
|
-
$el.line = $el.main.select("." + $COMMON.chart).append("g").attr("class", $LINE.chartLines);
|
|
21206
|
+
$el.line = $el.main.select("." + $COMMON.chart).append("g").attr("class", $LINE.chartLines).call(this.setCssRule(!1, "." + $LINE.chartLines, ["pointer-events:none"]));
|
|
21183
21207
|
},
|
|
21184
21208
|
updateTargetsForLine: function updateTargetsForLine(t) {
|
|
21185
21209
|
var _this = this,
|
|
@@ -21206,7 +21230,7 @@ function candlestick_objectSpread(target) { for (var i = 1, source; i < argument
|
|
|
21206
21230
|
|
|
21207
21231
|
return classChartLine(d) + classFocus(d);
|
|
21208
21232
|
}.bind(this)),
|
|
21209
|
-
mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", "none");
|
|
21233
|
+
mainLineEnter = mainLineUpdate.enter().append("g").attr("class", classChartLine).style("opacity", "0").style("pointer-events", $$.getStylePropValue("none"));
|
|
21210
21234
|
// Lines for each data
|
|
21211
21235
|
mainLineEnter.append("g").attr("class", classLines); // Areas
|
|
21212
21236
|
|
|
@@ -21609,11 +21633,12 @@ var getTransitionName = function () {
|
|
|
21609
21633
|
|
|
21610
21634
|
return $$.generateClass($SELECT.selectedCircles, d.id);
|
|
21611
21635
|
}.bind(this));
|
|
21612
|
-
enterNode.append("g").attr("class", classCircles).
|
|
21636
|
+
enterNode.append("g").attr("class", classCircles).call(function (selection) {
|
|
21613
21637
|
_newArrowCheck(this, _this2);
|
|
21614
21638
|
|
|
21615
|
-
|
|
21616
|
-
|
|
21639
|
+
$$.setCssRule(!0, "." + $CIRCLE.circles, ["cursor:pointer"], isSelectable)(selection);
|
|
21640
|
+
$$.setCssRule(!0, " ." + $CIRCLE.circle, ["fill", "stroke"], $$.color)(selection);
|
|
21641
|
+
}.bind(this)).style("opacity", function () {
|
|
21617
21642
|
var parent = (0,external_commonjs_d3_selection_commonjs2_d3_selection_amd_d3_selection_root_d3_.select)(this.parentNode); // if the parent node is .bb-chart-circles (bubble, scatter), initialize <g bb-circles> with opacity "0"
|
|
21618
21643
|
|
|
21619
21644
|
return parent.attr("class").indexOf($CIRCLE.chartCircles) > -1 ? "0" : null;
|
|
@@ -21652,8 +21677,8 @@ var getTransitionName = function () {
|
|
|
21652
21677
|
return $$.isLineType(d) && $$.shouldDrawPointsForLine(d) || $$.isBubbleType(d) || $$.isRadarType(d) || $$.isScatterType(d) ? focusOnly ? [d.values[0]] : d.values : [];
|
|
21653
21678
|
}.bind(this));
|
|
21654
21679
|
circles.exit().remove();
|
|
21655
|
-
circles.enter().filter(Boolean).append($$.point("create", this, $$.pointR.bind($$), $$.
|
|
21656
|
-
$root.circle = $root.main.selectAll("." + $CIRCLE.circles + " ." + $CIRCLE.circle).style("stroke", $$.
|
|
21680
|
+
circles.enter().filter(Boolean).append($$.point("create", this, $$.pointR.bind($$), $$.getStylePropValue($$.color)));
|
|
21681
|
+
$root.circle = $root.main.selectAll("." + $CIRCLE.circles + " ." + $CIRCLE.circle).style("stroke", $$.getStylePropValue($$.color)).style("opacity", $$.initialOpacityForCircle.bind($$));
|
|
21657
21682
|
}
|
|
21658
21683
|
},
|
|
21659
21684
|
redrawCircle: function redrawCircle(cx, cy, withTransition, flow, isSub) {
|
|
@@ -21672,7 +21697,7 @@ var getTransitionName = function () {
|
|
|
21672
21697
|
return [];
|
|
21673
21698
|
}
|
|
21674
21699
|
|
|
21675
|
-
var fn = $$.point("update", $$, cx, cy, $$.
|
|
21700
|
+
var fn = $$.point("update", $$, cx, cy, $$.getStylePropValue($$.color), withTransition, flow, selectedCircles),
|
|
21676
21701
|
posAttr = $$.isCirclePoint() ? "c" : "",
|
|
21677
21702
|
t = getRandom(),
|
|
21678
21703
|
opacityStyleFn = $$.opacityForCircle.bind($$),
|
|
@@ -21705,7 +21730,7 @@ var getTransitionName = function () {
|
|
|
21705
21730
|
var cx = (hasRadar ? $$.radarCircleX : $$.circleX).bind($$),
|
|
21706
21731
|
cy = (hasRadar ? $$.radarCircleY : $$.circleY).bind($$),
|
|
21707
21732
|
withTransition = toggling || isUndefined(d),
|
|
21708
|
-
fn = $$.point("update", $$, cx, cy, $$.
|
|
21733
|
+
fn = $$.point("update", $$, cx, cy, $$.getStylePropValue($$.color), resizing ? !1 : withTransition);
|
|
21709
21734
|
|
|
21710
21735
|
if (d) {
|
|
21711
21736
|
circle = circle.filter(function (t) {
|
|
@@ -25879,7 +25904,7 @@ var _defaults = {},
|
|
|
25879
25904
|
* bb.version; // "1.0.0"
|
|
25880
25905
|
* @memberof bb
|
|
25881
25906
|
*/
|
|
25882
|
-
version: "3.5.0
|
|
25907
|
+
version: "3.5.0",
|
|
25883
25908
|
|
|
25884
25909
|
/**
|
|
25885
25910
|
* Generate chart
|
|
@@ -26014,7 +26039,7 @@ var _defaults = {},
|
|
|
26014
26039
|
};
|
|
26015
26040
|
/**
|
|
26016
26041
|
* @namespace bb
|
|
26017
|
-
* @version 3.5.0
|
|
26042
|
+
* @version 3.5.0
|
|
26018
26043
|
*/
|
|
26019
26044
|
;// CONCATENATED MODULE: ./src/index.ts
|
|
26020
26045
|
|
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.5.0
|
|
8
|
+
* @version 3.5.0
|
|
9
9
|
*/.bb svg{-webkit-tap-highlight-color:rgba(0,0,0,0);font:10px sans-serif}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-user-select:none;-moz-user-select:none;user-select:none}.bb-bars path,.bb-event-rect,.bb-legend-item-tile,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-axis{shape-rendering:crispEdges}.bb-grid{pointer-events:none}.bb-grid line{stroke:#aaa}.bb-grid text{fill:#aaa}.bb-xgrid,.bb-ygrid{stroke-dasharray:3 3}.bb-text.bb-empty{fill:grey;font-size:2em}.bb-line{stroke-width:1px}.bb-circle._expanded_{stroke-width:1px;stroke:#fff}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4}.bb-brush .extent,.bb-region,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{font-size:12px;user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font:14px sans-serif}.bb-tooltip-container{user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border-collapse:collapse;border-spacing:0;-webkit-box-shadow:7px 7px 12px -9px #777;-moz-box-shadow:7px 7px 12px -9px #777;box-shadow:7px 7px 12px -9px #777;empty-cells:show;opacity:.9}.bb-tooltip tr{border:1px solid #ccc}.bb-tooltip th{background-color:#aaa;color:#fff;font-size:14px;padding:2px 5px;text-align:left}.bb-tooltip td{background-color:#fff;border-left:1px dotted #999;font-size:13px;padding:3px 6px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:10px;margin-right:6px;width:10px}.bb-tooltip.value{text-align:right}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;font-size:11px;padding:5px}
|