billboard.js 3.9.0-next.1 → 3.9.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 +121 -30
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +121 -30
- 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 +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist-esm/billboard.js +149 -57
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +3 -3
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +3 -3
- package/package.json +6 -6
- package/src/ChartInternal/ChartInternal.ts +9 -3
- package/src/ChartInternal/data/IData.ts +5 -0
- package/src/ChartInternal/data/data.ts +21 -8
- package/src/ChartInternal/internals/legend.ts +50 -34
- package/src/ChartInternal/shape/bar.ts +7 -3
- package/src/ChartInternal/shape/bubble.ts +0 -1
- package/src/ChartInternal/shape/point.ts +2 -0
- package/src/config/Options/common/legend.ts +37 -6
- package/src/config/Options/common/point.ts +30 -2
- package/src/config/Options/shape/bar.ts +7 -1
- package/types/options.d.ts +32 -2
- package/types/options.shape.d.ts +9 -4
package/dist-esm/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.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
*/
|
|
10
10
|
import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
|
|
11
11
|
import { pointer, select, namespaces, selectAll } from 'd3-selection';
|
|
@@ -156,7 +156,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
156
156
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
157
157
|
PERFORMANCE OF THIS SOFTWARE.
|
|
158
158
|
***************************************************************************** */
|
|
159
|
-
/* global Reflect, Promise */
|
|
159
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
160
160
|
|
|
161
161
|
var _assign = function __assign() {
|
|
162
162
|
_assign = Object.assign || function (t) {
|
|
@@ -177,6 +177,10 @@ function __spreadArray(to, from, pack) {
|
|
|
177
177
|
}
|
|
178
178
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
179
179
|
}
|
|
180
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
181
|
+
var e = new Error(message);
|
|
182
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
183
|
+
};
|
|
180
184
|
|
|
181
185
|
var isValue = function (v) { return v || v === 0; };
|
|
182
186
|
var isFunction = function (v) { return typeof v === "function"; };
|
|
@@ -2723,17 +2727,34 @@ var legend$2 = {
|
|
|
2723
2727
|
* - defines the max step the legend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns).
|
|
2724
2728
|
* @property {boolean} [legend.equally=false] Set to all items have same width size.
|
|
2725
2729
|
* @property {number} [legend.padding=0] Set padding value
|
|
2730
|
+
* @property {boolean} [legend.item.interaction=true] Set legend item interaction.
|
|
2731
|
+
* - **NOTE:**
|
|
2732
|
+
* - This setting will not have effect on `.toggle()` method.
|
|
2733
|
+
* - `legend.item.onXXX` listener options will work if set, regardless of this option value.
|
|
2734
|
+
* @property {boolean} [legend.item.interaction.dblclick=false] Set legend item to interact on double click.
|
|
2735
|
+
* - **NOTE:**
|
|
2736
|
+
* - Double clicking will make focused clicked dataseries only, hiding all others.
|
|
2737
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
2738
|
+
* - To return initial state(which all dataseries are showing), double click current focused legend item again.
|
|
2739
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
2740
|
+
* - In this case, default `click` interaction will be disabled.
|
|
2726
2741
|
* @property {Function} [legend.item.onclick=undefined] Set click event handler to the legend item.
|
|
2742
|
+
* - **NOTE:**
|
|
2743
|
+
* - When set, default `click` interaction will be disabled.
|
|
2744
|
+
* - When `interaction.dblclick=true` is set, will be called on double click.
|
|
2727
2745
|
* @property {Function} [legend.item.onover=undefined] Set mouse/touch over event handler to the legend item.
|
|
2746
|
+
* - **NOTE:** When set, default `mouseover` interaction will be disabled.
|
|
2728
2747
|
* @property {Function} [legend.item.onout=undefined] Set mouse/touch out event handler to the legend item.
|
|
2748
|
+
* - **NOTE:** When set, default `mouseout` interaction will be disabled.
|
|
2729
2749
|
* @property {number} [legend.item.tile.width=10] Set width for 'rectangle' legend item tile element.
|
|
2730
|
-
* @property {number} [legend.item.tile.height=10]
|
|
2750
|
+
* @property {number} [legend.item.tile.height=10] Set height for 'rectangle' legend item tile element.
|
|
2731
2751
|
* @property {number} [legend.item.tile.r=5] Set the radius for 'circle' legend item tile type.
|
|
2732
2752
|
* @property {string} [legend.item.tile.type="rectangle"] Set legend item shape type.<br>
|
|
2733
2753
|
* - **Available Values:**
|
|
2734
2754
|
* - circle
|
|
2735
2755
|
* - rectangle
|
|
2736
2756
|
* @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
|
|
2757
|
+
* @see [Demo: item.interaction](https://naver.github.io/billboard.js/demo/#Legend.LegendItemInteraction)
|
|
2737
2758
|
* @see [Demo: item.tile.type](https://naver.github.io/billboard.js/demo/#Legend.LegendItemTileType)
|
|
2738
2759
|
* @see [Demo: position](https://naver.github.io/billboard.js/demo/#Legend.LegendPosition)
|
|
2739
2760
|
* @see [Demo: contents.template](https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate1)
|
|
@@ -2768,6 +2789,16 @@ var legend$2 = {
|
|
|
2768
2789
|
* equally: false,
|
|
2769
2790
|
* padding: 10,
|
|
2770
2791
|
* item: {
|
|
2792
|
+
* // will disable default interaction
|
|
2793
|
+
* interaction: false,
|
|
2794
|
+
*
|
|
2795
|
+
* // set legend interact on double click
|
|
2796
|
+
* // by double clicking, will make focused clicked dataseries only, hiding all others.
|
|
2797
|
+
* interaction: {
|
|
2798
|
+
* dblclick: true
|
|
2799
|
+
* }
|
|
2800
|
+
*
|
|
2801
|
+
* // when set below callback, will disable corresponding default interactions
|
|
2771
2802
|
* onclick: function(id) { ... },
|
|
2772
2803
|
* onover: function(id) { ... },
|
|
2773
2804
|
* onout: function(id) { ... },
|
|
@@ -2788,24 +2819,26 @@ var legend$2 = {
|
|
|
2788
2819
|
* usePoint: true
|
|
2789
2820
|
* }
|
|
2790
2821
|
*/
|
|
2791
|
-
legend_show: true,
|
|
2792
|
-
legend_hide: false,
|
|
2793
2822
|
legend_contents_bindto: undefined,
|
|
2794
2823
|
legend_contents_template: "<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",
|
|
2795
|
-
|
|
2824
|
+
legend_equally: false,
|
|
2825
|
+
legend_hide: false,
|
|
2796
2826
|
legend_inset_anchor: "top-left",
|
|
2797
2827
|
legend_inset_x: 10,
|
|
2798
2828
|
legend_inset_y: 0,
|
|
2799
2829
|
legend_inset_step: undefined,
|
|
2830
|
+
legend_item_interaction: true,
|
|
2831
|
+
legend_item_dblclick: false,
|
|
2800
2832
|
legend_item_onclick: undefined,
|
|
2801
2833
|
legend_item_onover: undefined,
|
|
2802
2834
|
legend_item_onout: undefined,
|
|
2803
|
-
legend_equally: false,
|
|
2804
|
-
legend_padding: 0,
|
|
2805
2835
|
legend_item_tile_width: 10,
|
|
2806
2836
|
legend_item_tile_height: 10,
|
|
2807
2837
|
legend_item_tile_r: 5,
|
|
2808
2838
|
legend_item_tile_type: "rectangle",
|
|
2839
|
+
legend_padding: 0,
|
|
2840
|
+
legend_position: "bottom",
|
|
2841
|
+
legend_show: true,
|
|
2809
2842
|
legend_usePoint: false
|
|
2810
2843
|
};
|
|
2811
2844
|
|
|
@@ -4318,7 +4351,17 @@ var data$1 = {
|
|
|
4318
4351
|
var $$ = this;
|
|
4319
4352
|
var config = $$.config, main = $$.$el.main;
|
|
4320
4353
|
var data = values.filter(function (v) { return v && isValue(v.value); });
|
|
4321
|
-
var
|
|
4354
|
+
var getSensitivity = function (d) {
|
|
4355
|
+
var sensitivity = config.point_sensitivity;
|
|
4356
|
+
if (isFunction(sensitivity)) {
|
|
4357
|
+
sensitivity = sensitivity.call($$.api, d);
|
|
4358
|
+
}
|
|
4359
|
+
else if (sensitivity === "radius") {
|
|
4360
|
+
sensitivity = d.r;
|
|
4361
|
+
}
|
|
4362
|
+
return sensitivity;
|
|
4363
|
+
};
|
|
4364
|
+
var minDist;
|
|
4322
4365
|
var closest;
|
|
4323
4366
|
// find mouseovering bar/candlestick
|
|
4324
4367
|
// https://github.com/naver/billboard.js/issues/2434
|
|
@@ -4337,6 +4380,7 @@ var data$1 = {
|
|
|
4337
4380
|
.filter(function (v) { return !$$.isBarType(v.id) && !$$.isCandlestickType(v.id); })
|
|
4338
4381
|
.forEach(function (v) {
|
|
4339
4382
|
var d = $$.dist(v, pos);
|
|
4383
|
+
minDist = getSensitivity(v);
|
|
4340
4384
|
if (d < minDist) {
|
|
4341
4385
|
minDist = d;
|
|
4342
4386
|
closest = v;
|
|
@@ -4347,8 +4391,8 @@ var data$1 = {
|
|
|
4347
4391
|
dist: function (data, pos) {
|
|
4348
4392
|
var $$ = this;
|
|
4349
4393
|
var isRotated = $$.config.axis_rotated, scale = $$.scale;
|
|
4350
|
-
var xIndex = isRotated
|
|
4351
|
-
var yIndex = isRotated
|
|
4394
|
+
var xIndex = +isRotated; // true: 1, false: 0
|
|
4395
|
+
var yIndex = +!isRotated; // true: 0, false: 1
|
|
4352
4396
|
var y = $$.circleY(data, data.index);
|
|
4353
4397
|
var x = (scale.zoom || scale.x)(data.x);
|
|
4354
4398
|
return Math.sqrt(Math.pow(x - pos[xIndex], 2) + Math.pow(y - pos[yIndex], 2));
|
|
@@ -5996,6 +6040,7 @@ var legend$1 = {
|
|
|
5996
6040
|
var isTouch = state.inputType === "touch";
|
|
5997
6041
|
var hasGauge = $$.hasType("gauge");
|
|
5998
6042
|
var useCssRule = config.boost_useCssRule;
|
|
6043
|
+
var interaction = config.legend_item_interaction;
|
|
5999
6044
|
item
|
|
6000
6045
|
.attr("class", function (id) {
|
|
6001
6046
|
var node = select(this);
|
|
@@ -6017,42 +6062,55 @@ var legend$1 = {
|
|
|
6017
6062
|
});
|
|
6018
6063
|
}
|
|
6019
6064
|
item
|
|
6020
|
-
.
|
|
6021
|
-
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6065
|
+
.on(interaction.dblclick ? "dblclick" : "click", interaction || isFunction(config.legend_item_onclick) ?
|
|
6066
|
+
function (event, id) {
|
|
6067
|
+
if (!callFn(config.legend_item_onclick, api, id)) {
|
|
6068
|
+
var altKey = event.altKey, target = event.target, type = event.type;
|
|
6069
|
+
if (type === "dblclick" || altKey) {
|
|
6070
|
+
// when focused legend is clicked(with altKey or double clicked), reset all hiding.
|
|
6071
|
+
if (state.hiddenTargetIds.length &&
|
|
6072
|
+
target.parentNode.getAttribute("class").indexOf($LEGEND.legendItemHidden) === -1) {
|
|
6073
|
+
api.show();
|
|
6074
|
+
}
|
|
6075
|
+
else {
|
|
6076
|
+
api.hide();
|
|
6077
|
+
api.show(id);
|
|
6078
|
+
}
|
|
6079
|
+
}
|
|
6080
|
+
else {
|
|
6081
|
+
api.toggle(id);
|
|
6082
|
+
select(this)
|
|
6083
|
+
.classed($FOCUS.legendItemFocused, false);
|
|
6084
|
+
}
|
|
6031
6085
|
}
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
});
|
|
6086
|
+
isTouch && $$.hideTooltip();
|
|
6087
|
+
} : null);
|
|
6035
6088
|
!isTouch && item
|
|
6036
|
-
.on("mouseout",
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
})
|
|
6045
|
-
.on("mouseover", function (event, id) {
|
|
6046
|
-
if (!callFn(config.legend_item_onover, api, id)) {
|
|
6047
|
-
select(this).classed($FOCUS.legendItemFocused, true);
|
|
6048
|
-
if (hasGauge) {
|
|
6049
|
-
$$.markOverlapped(id, $$, ".".concat($GAUGE.gaugeValue));
|
|
6089
|
+
.on("mouseout", interaction || isFunction(config.legend_item_onout) ?
|
|
6090
|
+
function (event, id) {
|
|
6091
|
+
if (!callFn(config.legend_item_onout, api, id)) {
|
|
6092
|
+
select(this).classed($FOCUS.legendItemFocused, false);
|
|
6093
|
+
if (hasGauge) {
|
|
6094
|
+
$$.undoMarkOverlapped($$, ".".concat($GAUGE.gaugeValue));
|
|
6095
|
+
}
|
|
6096
|
+
$$.api.revert();
|
|
6050
6097
|
}
|
|
6051
|
-
|
|
6052
|
-
|
|
6098
|
+
} : null)
|
|
6099
|
+
.on("mouseover", interaction || isFunction(config.legend_item_onover) ?
|
|
6100
|
+
function (event, id) {
|
|
6101
|
+
if (!callFn(config.legend_item_onover, api, id)) {
|
|
6102
|
+
select(this).classed($FOCUS.legendItemFocused, true);
|
|
6103
|
+
if (hasGauge) {
|
|
6104
|
+
$$.markOverlapped(id, $$, ".".concat($GAUGE.gaugeValue));
|
|
6105
|
+
}
|
|
6106
|
+
if (!state.transiting && $$.isTargetToShow(id)) {
|
|
6107
|
+
api.focus(id);
|
|
6108
|
+
}
|
|
6053
6109
|
}
|
|
6054
|
-
}
|
|
6055
|
-
|
|
6110
|
+
} : null);
|
|
6111
|
+
// set cursor when has some interaction
|
|
6112
|
+
!item.empty() && item.on("click mouseout mouseover") &&
|
|
6113
|
+
item.style("cursor", $$.getStylePropValue("pointer"));
|
|
6056
6114
|
}
|
|
6057
6115
|
},
|
|
6058
6116
|
/**
|
|
@@ -9309,6 +9367,7 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9309
9367
|
.classed($COMMON.chart, true)
|
|
9310
9368
|
.attr("clip-path", hasAxis ? state.clip.path : null);
|
|
9311
9369
|
$$.callPluginHook("$init");
|
|
9370
|
+
$$.initChartElements();
|
|
9312
9371
|
if (hasAxis) {
|
|
9313
9372
|
// Cover whole with rects for events
|
|
9314
9373
|
hasInteraction && ((_a = $$.initEventRect) === null || _a === void 0 ? void 0 : _a.call($$));
|
|
@@ -9317,7 +9376,6 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9317
9376
|
// Add Axis here, when clipPath is 'true'
|
|
9318
9377
|
config.clipPath && ((_b = $$.axis) === null || _b === void 0 ? void 0 : _b.init());
|
|
9319
9378
|
}
|
|
9320
|
-
$$.initChartElements();
|
|
9321
9379
|
// Set targets
|
|
9322
9380
|
$$.updateTargets($$.data.targets);
|
|
9323
9381
|
// Draw with targets
|
|
@@ -9352,7 +9410,11 @@ var ChartInternal = /** @class */ (function () {
|
|
|
9352
9410
|
var _a = $$.state, hasAxis = _a.hasAxis, hasRadar = _a.hasRadar, hasTreemap = _a.hasTreemap;
|
|
9353
9411
|
var types = [];
|
|
9354
9412
|
if (hasAxis) {
|
|
9355
|
-
["bar", "bubble", "candlestick", "line"]
|
|
9413
|
+
var shapes = ["bar", "bubble", "candlestick", "line"];
|
|
9414
|
+
if ($$.config.bar_front) {
|
|
9415
|
+
shapes.push(shapes.shift());
|
|
9416
|
+
}
|
|
9417
|
+
shapes.forEach(function (v) {
|
|
9356
9418
|
var name = capitalize(v);
|
|
9357
9419
|
if ((v === "line" && $$.hasTypeOf(name)) || $$.hasType(v)) {
|
|
9358
9420
|
types.push(name);
|
|
@@ -17676,9 +17738,11 @@ var shapeArea = {
|
|
|
17676
17738
|
var shapeBar = {
|
|
17677
17739
|
initBar: function () {
|
|
17678
17740
|
var _a = this, $el = _a.$el, config = _a.config, clip = _a.state.clip;
|
|
17679
|
-
$el.bar = $el.main.select(".".concat($COMMON.chart))
|
|
17680
|
-
|
|
17681
|
-
.
|
|
17741
|
+
$el.bar = $el.main.select(".".concat($COMMON.chart));
|
|
17742
|
+
$el.bar = config.bar_front ?
|
|
17743
|
+
$el.bar.append("g") :
|
|
17744
|
+
$el.bar.insert("g", ":first-child");
|
|
17745
|
+
$el.bar
|
|
17682
17746
|
.attr("class", $BAR.chartBars)
|
|
17683
17747
|
.call(this.setCssRule(false, ".".concat($BAR.chartBars), ["pointer-events:none"]));
|
|
17684
17748
|
// set clip-path attribute when condition meet
|
|
@@ -18228,7 +18292,6 @@ var shapeBubble = {
|
|
|
18228
18292
|
if ($$.hasType("bubble")) {
|
|
18229
18293
|
config.point_show = true;
|
|
18230
18294
|
config.point_type = "circle";
|
|
18231
|
-
config.point_sensitivity = 25;
|
|
18232
18295
|
}
|
|
18233
18296
|
},
|
|
18234
18297
|
/**
|
|
@@ -18790,6 +18853,7 @@ var shapePoint = {
|
|
|
18790
18853
|
else if (isFunction(pointR)) {
|
|
18791
18854
|
r = pointR.bind($$.api)(d);
|
|
18792
18855
|
}
|
|
18856
|
+
d.r = r;
|
|
18793
18857
|
return r;
|
|
18794
18858
|
},
|
|
18795
18859
|
pointExpandedR: function (d) {
|
|
@@ -19666,10 +19730,6 @@ var shapeTreemap = {
|
|
|
19666
19730
|
}
|
|
19667
19731
|
};
|
|
19668
19732
|
|
|
19669
|
-
/**
|
|
19670
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
19671
|
-
* billboard.js project is licensed under the MIT license
|
|
19672
|
-
*/
|
|
19673
19733
|
/**
|
|
19674
19734
|
* point config options
|
|
19675
19735
|
*/
|
|
@@ -19691,7 +19751,20 @@ var optPoint = {
|
|
|
19691
19751
|
* - **NOTE:**
|
|
19692
19752
|
* - `null` will make to not set inline 'opacity' css prop.
|
|
19693
19753
|
* - when no value(or undefined) is set, it defaults to set opacity value according its chart types.
|
|
19694
|
-
* @property {number} [point.sensitivity=10] The senstivity value for interaction boundary.
|
|
19754
|
+
* @property {number|string|Function} [point.sensitivity=10] The senstivity value for interaction boundary.
|
|
19755
|
+
* - **Available Values:**
|
|
19756
|
+
* - {number}: Absolute sensitivity value which is the distance from the data point in pixel.
|
|
19757
|
+
* - "radius": sensitivity based on point's radius
|
|
19758
|
+
* - Function: callback for each point to determine the sensitivity<br>
|
|
19759
|
+
* ```js
|
|
19760
|
+
* sensitivity: function(d) {
|
|
19761
|
+
* // ex. of argument d:
|
|
19762
|
+
* // ==> {x: 2, value: 55, id: 'data3', index: 2, r: 19.820624179302296}
|
|
19763
|
+
*
|
|
19764
|
+
* // returning d.r, will make sensitivity same as point's radius value.
|
|
19765
|
+
* return d.r;
|
|
19766
|
+
* }
|
|
19767
|
+
* ```
|
|
19695
19768
|
* @property {number} [point.select.r=point.r*4] The radius size of each point on selected.
|
|
19696
19769
|
* @property {string} [point.type="circle"] The type of point to be drawn
|
|
19697
19770
|
* - **NOTE:**
|
|
@@ -19712,6 +19785,7 @@ var optPoint = {
|
|
|
19712
19785
|
* (ex. `<polygon points='2.5 0 0 5 5 5'></polygon>`)
|
|
19713
19786
|
* @see [Demo: point type](https://naver.github.io/billboard.js/demo/#Point.RectanglePoints)
|
|
19714
19787
|
* @see [Demo: point focus only](https://naver.github.io/billboard.js/demo/#Point.FocusOnly)
|
|
19788
|
+
* @see [Demo: point sensitivity](https://naver.github.io/billboard.js/demo/#Point.PointSensitivity)
|
|
19715
19789
|
* @example
|
|
19716
19790
|
* point: {
|
|
19717
19791
|
* show: false,
|
|
@@ -19744,6 +19818,18 @@ var optPoint = {
|
|
|
19744
19818
|
* // having lower value, means how closer to be for interaction
|
|
19745
19819
|
* sensitivity: 3,
|
|
19746
19820
|
*
|
|
19821
|
+
* // sensitivity based on point's radius
|
|
19822
|
+
* sensitivity: "radius",
|
|
19823
|
+
*
|
|
19824
|
+
* // callback for each point to determine the sensitivity
|
|
19825
|
+
* sensitivity: function(d) {
|
|
19826
|
+
* // ex. of argument d:
|
|
19827
|
+
* // ==> {x: 2, value: 55, id: 'data3', index: 2, r: 19.820624179302296}
|
|
19828
|
+
*
|
|
19829
|
+
* // returning d.r, will make sensitivity same as point's radius value.
|
|
19830
|
+
* return d.r;
|
|
19831
|
+
* }
|
|
19832
|
+
*
|
|
19747
19833
|
* // valid values are "circle" or "rectangle"
|
|
19748
19834
|
* type: "rectangle",
|
|
19749
19835
|
*
|
|
@@ -19851,6 +19937,7 @@ var optBar = {
|
|
|
19851
19937
|
* @memberof Options
|
|
19852
19938
|
* @type {object}
|
|
19853
19939
|
* @property {object} bar Bar object
|
|
19940
|
+
* @property {boolean} [bar.front=false] Set 'bar' to be positioned over(on the top) other shapes elements.
|
|
19854
19941
|
* @property {number} [bar.indices.removeNull=false] Remove nullish data on bar indices positions.
|
|
19855
19942
|
* @property {number} [bar.label.threshold=0] Set threshold ratio to show/hide labels.
|
|
19856
19943
|
* @property {boolean|object} [bar.linearGradient=false] Set the linear gradient on bar.<br><br>
|
|
@@ -19873,6 +19960,7 @@ var optBar = {
|
|
|
19873
19960
|
* @property {number} [bar.width.dataname.ratio=0.6] Change the width of bar chart by ratio.
|
|
19874
19961
|
* @property {number} [bar.width.dataname.max] The maximum width value for ratio.
|
|
19875
19962
|
* @property {boolean} [bar.zerobased=true] Set if min or max value will be 0 on bar chart.
|
|
19963
|
+
* @see [Demo: bar front](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarFront)
|
|
19876
19964
|
* @see [Demo: bar indices](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarIndices)
|
|
19877
19965
|
* @see [Demo: bar overlap](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarOverlap)
|
|
19878
19966
|
* @see [Demo: bar padding](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarPadding)
|
|
@@ -19881,6 +19969,9 @@ var optBar = {
|
|
|
19881
19969
|
* @see [Demo: bar width variant](https://naver.github.io/billboard.js/demo/#BarChartOptions.BarWidthVariant)
|
|
19882
19970
|
* @example
|
|
19883
19971
|
* bar: {
|
|
19972
|
+
* // make bar shape to be positioned over the other shape elements
|
|
19973
|
+
* front: true,
|
|
19974
|
+
*
|
|
19884
19975
|
* // remove nullish data on bar indices postions
|
|
19885
19976
|
* indices: {
|
|
19886
19977
|
* removeNull: true
|
|
@@ -19951,9 +20042,10 @@ var optBar = {
|
|
|
19951
20042
|
* zerobased: false
|
|
19952
20043
|
* }
|
|
19953
20044
|
*/
|
|
20045
|
+
bar_front: false,
|
|
20046
|
+
bar_indices_removeNull: false,
|
|
19954
20047
|
bar_label_threshold: 0,
|
|
19955
20048
|
bar_linearGradient: false,
|
|
19956
|
-
bar_indices_removeNull: false,
|
|
19957
20049
|
bar_overlap: false,
|
|
19958
20050
|
bar_padding: 0,
|
|
19959
20051
|
bar_radius: undefined,
|
|
@@ -22543,7 +22635,7 @@ var zoomModule = function () {
|
|
|
22543
22635
|
var defaults = {};
|
|
22544
22636
|
/**
|
|
22545
22637
|
* @namespace bb
|
|
22546
|
-
* @version 3.9.0
|
|
22638
|
+
* @version 3.9.0
|
|
22547
22639
|
*/
|
|
22548
22640
|
var bb = {
|
|
22549
22641
|
/**
|
|
@@ -22553,7 +22645,7 @@ var bb = {
|
|
|
22553
22645
|
* bb.version; // "1.0.0"
|
|
22554
22646
|
* @memberof bb
|
|
22555
22647
|
*/
|
|
22556
|
-
version: "3.9.0
|
|
22648
|
+
version: "3.9.0",
|
|
22557
22649
|
/**
|
|
22558
22650
|
* Generate chart
|
|
22559
22651
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -25,7 +25,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
25
25
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
26
26
|
PERFORMANCE OF THIS SOFTWARE.
|
|
27
27
|
***************************************************************************** */
|
|
28
|
-
/* global Reflect, Promise */
|
|
28
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
29
29
|
|
|
30
30
|
var _extendStatics = function extendStatics(d, b) {
|
|
31
31
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -104,7 +104,7 @@ var Plugin = /** @class */ (function () {
|
|
|
104
104
|
delete _this[key];
|
|
105
105
|
});
|
|
106
106
|
};
|
|
107
|
-
Plugin.version = "3.9.0
|
|
107
|
+
Plugin.version = "3.9.0";
|
|
108
108
|
return Plugin;
|
|
109
109
|
}());
|
|
110
110
|
var Plugin$1 = Plugin;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -23,7 +23,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
23
23
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
24
24
|
PERFORMANCE OF THIS SOFTWARE.
|
|
25
25
|
***************************************************************************** */
|
|
26
|
-
/* global Reflect, Promise */
|
|
26
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
27
27
|
|
|
28
28
|
var _extendStatics = function extendStatics(d, b) {
|
|
29
29
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -279,7 +279,7 @@ var Plugin = /** @class */ (function () {
|
|
|
279
279
|
delete _this[key];
|
|
280
280
|
});
|
|
281
281
|
};
|
|
282
|
-
Plugin.version = "3.9.0
|
|
282
|
+
Plugin.version = "3.9.0";
|
|
283
283
|
return Plugin;
|
|
284
284
|
}());
|
|
285
285
|
var Plugin$1 = Plugin;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -29,7 +29,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
29
29
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
30
30
|
PERFORMANCE OF THIS SOFTWARE.
|
|
31
31
|
***************************************************************************** */
|
|
32
|
-
/* global Reflect, Promise */
|
|
32
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
33
33
|
|
|
34
34
|
var _extendStatics = function extendStatics(d, b) {
|
|
35
35
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -487,7 +487,7 @@ var Plugin = /** @class */ (function () {
|
|
|
487
487
|
delete _this[key];
|
|
488
488
|
});
|
|
489
489
|
};
|
|
490
|
-
Plugin.version = "3.9.0
|
|
490
|
+
Plugin.version = "3.9.0";
|
|
491
491
|
return Plugin;
|
|
492
492
|
}());
|
|
493
493
|
var Plugin$1 = Plugin;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -23,7 +23,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
23
23
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
24
24
|
PERFORMANCE OF THIS SOFTWARE.
|
|
25
25
|
***************************************************************************** */
|
|
26
|
-
/* global Reflect, Promise */
|
|
26
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
27
27
|
|
|
28
28
|
var _extendStatics = function extendStatics(d, b) {
|
|
29
29
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -121,7 +121,7 @@ var Plugin = /** @class */ (function () {
|
|
|
121
121
|
delete _this[key];
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
Plugin.version = "3.9.0
|
|
124
|
+
Plugin.version = "3.9.0";
|
|
125
125
|
return Plugin;
|
|
126
126
|
}());
|
|
127
127
|
var Plugin$1 = Plugin;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.9.0
|
|
8
|
+
* @version 3.9.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -26,7 +26,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
|
26
26
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
27
27
|
PERFORMANCE OF THIS SOFTWARE.
|
|
28
28
|
***************************************************************************** */
|
|
29
|
-
/* global Reflect, Promise */
|
|
29
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
30
30
|
|
|
31
31
|
var _extendStatics = function extendStatics(d, b) {
|
|
32
32
|
_extendStatics = Object.setPrototypeOf || {
|
|
@@ -263,7 +263,7 @@ var Plugin = /** @class */ (function () {
|
|
|
263
263
|
delete _this[key];
|
|
264
264
|
});
|
|
265
265
|
};
|
|
266
|
-
Plugin.version = "3.9.0
|
|
266
|
+
Plugin.version = "3.9.0";
|
|
267
267
|
return Plugin;
|
|
268
268
|
}());
|
|
269
269
|
var Plugin$1 = Plugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "billboard.js",
|
|
3
|
-
"version": "3.9.0
|
|
3
|
+
"version": "3.9.0",
|
|
4
4
|
"description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
|
|
5
5
|
"homepage": "https://naver.github.io/billboard.js/",
|
|
6
6
|
"main": "dist/billboard.js",
|
|
@@ -126,8 +126,8 @@
|
|
|
126
126
|
"@types/d3": "^7.4.0",
|
|
127
127
|
"@types/mocha": "^10.0.1",
|
|
128
128
|
"@types/sinon": "^10.0.15",
|
|
129
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
130
|
-
"@typescript-eslint/parser": "^5.
|
|
129
|
+
"@typescript-eslint/eslint-plugin": "^5.60.0",
|
|
130
|
+
"@typescript-eslint/parser": "^5.60.0",
|
|
131
131
|
"babel-helper-modules": "^6.0.0",
|
|
132
132
|
"babel-loader": "^9.1.2",
|
|
133
133
|
"babel-plugin-add-module-exports": "^1.0.4",
|
|
@@ -147,14 +147,14 @@
|
|
|
147
147
|
"coveralls": "^3.1.1",
|
|
148
148
|
"cross-env": "^7.0.3",
|
|
149
149
|
"css-loader": "^6.8.1",
|
|
150
|
-
"css-minimizer-webpack-plugin": "^5.0.
|
|
150
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
151
151
|
"d3-color": "^3.1.0",
|
|
152
152
|
"d3-delaunay": "^6.0.4",
|
|
153
153
|
"d3-format": "^3.1.0",
|
|
154
154
|
"d3-polygon": "^3.0.1",
|
|
155
155
|
"docdash": "^2.0.1",
|
|
156
156
|
"dtslint": "^4.2.1",
|
|
157
|
-
"eslint": "^8.
|
|
157
|
+
"eslint": "^8.43.0",
|
|
158
158
|
"eslint-config-naver": "^2.1.0",
|
|
159
159
|
"eslint-plugin-import": "^2.27.5",
|
|
160
160
|
"eslint-plugin-jsdoc": "^46.2.6",
|
|
@@ -193,7 +193,7 @@
|
|
|
193
193
|
"terser-webpack-plugin": "^5.3.9",
|
|
194
194
|
"tslib": "^2.5.3",
|
|
195
195
|
"typescript": "5.1.3",
|
|
196
|
-
"webpack": "^5.
|
|
196
|
+
"webpack": "^5.87.0",
|
|
197
197
|
"webpack-bundle-analyzer": "^4.9.0",
|
|
198
198
|
"webpack-clean": "^1.2.5",
|
|
199
199
|
"webpack-cli": "^5.1.4",
|
|
@@ -479,6 +479,8 @@ export default class ChartInternal {
|
|
|
479
479
|
|
|
480
480
|
$$.callPluginHook("$init");
|
|
481
481
|
|
|
482
|
+
$$.initChartElements();
|
|
483
|
+
|
|
482
484
|
if (hasAxis) {
|
|
483
485
|
// Cover whole with rects for events
|
|
484
486
|
hasInteraction && $$.initEventRect?.();
|
|
@@ -490,8 +492,6 @@ export default class ChartInternal {
|
|
|
490
492
|
config.clipPath && $$.axis?.init();
|
|
491
493
|
}
|
|
492
494
|
|
|
493
|
-
$$.initChartElements();
|
|
494
|
-
|
|
495
495
|
// Set targets
|
|
496
496
|
$$.updateTargets($$.data.targets);
|
|
497
497
|
|
|
@@ -535,7 +535,13 @@ export default class ChartInternal {
|
|
|
535
535
|
const types: string[] = [];
|
|
536
536
|
|
|
537
537
|
if (hasAxis) {
|
|
538
|
-
["bar", "bubble", "candlestick", "line"]
|
|
538
|
+
const shapes = ["bar", "bubble", "candlestick", "line"];
|
|
539
|
+
|
|
540
|
+
if ($$.config.bar_front) {
|
|
541
|
+
shapes.push(shapes.shift() as string);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
shapes.forEach(v => {
|
|
539
545
|
const name = capitalize(v);
|
|
540
546
|
|
|
541
547
|
if ((v === "line" && $$.hasTypeOf(name)) || $$.hasType(v)) {
|
|
@@ -21,6 +21,11 @@ export interface ITreemapData {
|
|
|
21
21
|
export interface IDataRow extends TDataRow {
|
|
22
22
|
x: number | string | Date;
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface IDataPoint extends IDataRow {
|
|
26
|
+
r: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
24
29
|
export interface IArcDataRow extends TDataRow {
|
|
25
30
|
ratio: number;
|
|
26
31
|
}
|