billboard.js 3.9.0-next.2 → 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 +59 -18
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +59 -18
- 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 +89 -42
- 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 +1 -1
- package/src/ChartInternal/internals/legend.ts +50 -34
- package/src/config/Options/common/legend.ts +37 -6
- package/types/options.d.ts +25 -0
package/dist/billboard.pkgd.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
|
* All-in-one packaged file for ease use of 'billboard.js' with dependant d3.js modules & polyfills.
|
|
11
11
|
* - @types/d3-selection ^3.0.5
|
|
@@ -25425,17 +25425,34 @@ var data_this = undefined;
|
|
|
25425
25425
|
* - defines the max step the legend has (e.g. If 2 set and legend has 3 legend item, the legend 2 columns).
|
|
25426
25426
|
* @property {boolean} [legend.equally=false] Set to all items have same width size.
|
|
25427
25427
|
* @property {number} [legend.padding=0] Set padding value
|
|
25428
|
+
* @property {boolean} [legend.item.interaction=true] Set legend item interaction.
|
|
25429
|
+
* - **NOTE:**
|
|
25430
|
+
* - This setting will not have effect on `.toggle()` method.
|
|
25431
|
+
* - `legend.item.onXXX` listener options will work if set, regardless of this option value.
|
|
25432
|
+
* @property {boolean} [legend.item.interaction.dblclick=false] Set legend item to interact on double click.
|
|
25433
|
+
* - **NOTE:**
|
|
25434
|
+
* - Double clicking will make focused clicked dataseries only, hiding all others.
|
|
25435
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
25436
|
+
* - To return initial state(which all dataseries are showing), double click current focused legend item again.
|
|
25437
|
+
* - for single click case, `click + altKey(Win)/optionKey(Mac OS)` to have same effect.
|
|
25438
|
+
* - In this case, default `click` interaction will be disabled.
|
|
25428
25439
|
* @property {Function} [legend.item.onclick=undefined] Set click event handler to the legend item.
|
|
25440
|
+
* - **NOTE:**
|
|
25441
|
+
* - When set, default `click` interaction will be disabled.
|
|
25442
|
+
* - When `interaction.dblclick=true` is set, will be called on double click.
|
|
25429
25443
|
* @property {Function} [legend.item.onover=undefined] Set mouse/touch over event handler to the legend item.
|
|
25444
|
+
* - **NOTE:** When set, default `mouseover` interaction will be disabled.
|
|
25430
25445
|
* @property {Function} [legend.item.onout=undefined] Set mouse/touch out event handler to the legend item.
|
|
25446
|
+
* - **NOTE:** When set, default `mouseout` interaction will be disabled.
|
|
25431
25447
|
* @property {number} [legend.item.tile.width=10] Set width for 'rectangle' legend item tile element.
|
|
25432
|
-
* @property {number} [legend.item.tile.height=10]
|
|
25448
|
+
* @property {number} [legend.item.tile.height=10] Set height for 'rectangle' legend item tile element.
|
|
25433
25449
|
* @property {number} [legend.item.tile.r=5] Set the radius for 'circle' legend item tile type.
|
|
25434
25450
|
* @property {string} [legend.item.tile.type="rectangle"] Set legend item shape type.<br>
|
|
25435
25451
|
* - **Available Values:**
|
|
25436
25452
|
* - circle
|
|
25437
25453
|
* - rectangle
|
|
25438
25454
|
* @property {boolean} [legend.usePoint=false] Whether to use custom points in legend.
|
|
25455
|
+
* @see [Demo: item.interaction](https://naver.github.io/billboard.js/demo/#Legend.LegendItemInteraction)
|
|
25439
25456
|
* @see [Demo: item.tile.type](https://naver.github.io/billboard.js/demo/#Legend.LegendItemTileType)
|
|
25440
25457
|
* @see [Demo: position](https://naver.github.io/billboard.js/demo/#Legend.LegendPosition)
|
|
25441
25458
|
* @see [Demo: contents.template](https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate1)
|
|
@@ -25470,6 +25487,16 @@ var data_this = undefined;
|
|
|
25470
25487
|
* equally: false,
|
|
25471
25488
|
* padding: 10,
|
|
25472
25489
|
* item: {
|
|
25490
|
+
* // will disable default interaction
|
|
25491
|
+
* interaction: false,
|
|
25492
|
+
*
|
|
25493
|
+
* // set legend interact on double click
|
|
25494
|
+
* // by double clicking, will make focused clicked dataseries only, hiding all others.
|
|
25495
|
+
* interaction: {
|
|
25496
|
+
* dblclick: true
|
|
25497
|
+
* }
|
|
25498
|
+
*
|
|
25499
|
+
* // when set below callback, will disable corresponding default interactions
|
|
25473
25500
|
* onclick: function(id) { ... },
|
|
25474
25501
|
* onover: function(id) { ... },
|
|
25475
25502
|
* onout: function(id) { ... },
|
|
@@ -25490,24 +25517,26 @@ var data_this = undefined;
|
|
|
25490
25517
|
* usePoint: true
|
|
25491
25518
|
* }
|
|
25492
25519
|
*/
|
|
25493
|
-
legend_show: !0,
|
|
25494
|
-
legend_hide: !1,
|
|
25495
25520
|
legend_contents_bindto: undefined,
|
|
25496
25521
|
legend_contents_template: "<span style='color:#fff;padding:5px;background-color:{=COLOR}'>{=TITLE}</span>",
|
|
25497
|
-
|
|
25522
|
+
legend_equally: !1,
|
|
25523
|
+
legend_hide: !1,
|
|
25498
25524
|
legend_inset_anchor: "top-left",
|
|
25499
25525
|
legend_inset_x: 10,
|
|
25500
25526
|
legend_inset_y: 0,
|
|
25501
25527
|
legend_inset_step: undefined,
|
|
25528
|
+
legend_item_interaction: !0,
|
|
25529
|
+
legend_item_dblclick: !1,
|
|
25502
25530
|
legend_item_onclick: undefined,
|
|
25503
25531
|
legend_item_onover: undefined,
|
|
25504
25532
|
legend_item_onout: undefined,
|
|
25505
|
-
legend_equally: !1,
|
|
25506
|
-
legend_padding: 0,
|
|
25507
25533
|
legend_item_tile_width: 10,
|
|
25508
25534
|
legend_item_tile_height: 10,
|
|
25509
25535
|
legend_item_tile_r: 5,
|
|
25510
25536
|
legend_item_tile_type: "rectangle",
|
|
25537
|
+
legend_padding: 0,
|
|
25538
|
+
legend_position: "bottom",
|
|
25539
|
+
legend_show: !0,
|
|
25511
25540
|
legend_usePoint: !1
|
|
25512
25541
|
});
|
|
25513
25542
|
;// CONCATENATED MODULE: ./src/config/Options/common/title.ts
|
|
@@ -29959,7 +29988,8 @@ function getLegendColor(id) {
|
|
|
29959
29988
|
state = $$.state,
|
|
29960
29989
|
isTouch = state.inputType === "touch",
|
|
29961
29990
|
hasGauge = $$.hasType("gauge"),
|
|
29962
|
-
useCssRule = config.boost_useCssRule
|
|
29991
|
+
useCssRule = config.boost_useCssRule,
|
|
29992
|
+
interaction = config.legend_item_interaction;
|
|
29963
29993
|
item.attr("class", function (id) {
|
|
29964
29994
|
var node = src_select(this),
|
|
29965
29995
|
itemClass = !node.empty() && node.attr("class") || "";
|
|
@@ -29977,19 +30007,27 @@ function getLegendColor(id) {
|
|
|
29977
30007
|
$$.setCssRule(!1, selector, [props])($el.legend);
|
|
29978
30008
|
}.bind(this));
|
|
29979
30009
|
}
|
|
29980
|
-
item.
|
|
30010
|
+
item.on(interaction.dblclick ? "dblclick" : "click", interaction || isFunction(config.legend_item_onclick) ? function (event, id) {
|
|
29981
30011
|
if (!callFn(config.legend_item_onclick, api, id)) {
|
|
29982
|
-
|
|
29983
|
-
|
|
29984
|
-
|
|
30012
|
+
var altKey = event.altKey,
|
|
30013
|
+
target = event.target,
|
|
30014
|
+
type = event.type;
|
|
30015
|
+
if (type === "dblclick" || altKey) {
|
|
30016
|
+
// when focused legend is clicked(with altKey or double clicked), reset all hiding.
|
|
30017
|
+
if (state.hiddenTargetIds.length && target.parentNode.getAttribute("class").indexOf($LEGEND.legendItemHidden) === -1) {
|
|
30018
|
+
api.show();
|
|
30019
|
+
} else {
|
|
30020
|
+
api.hide();
|
|
30021
|
+
api.show(id);
|
|
30022
|
+
}
|
|
29985
30023
|
} else {
|
|
29986
30024
|
api.toggle(id);
|
|
29987
30025
|
src_select(this).classed($FOCUS.legendItemFocused, !1);
|
|
29988
30026
|
}
|
|
29989
30027
|
}
|
|
29990
30028
|
isTouch && $$.hideTooltip();
|
|
29991
|
-
});
|
|
29992
|
-
isTouch || item.on("mouseout", function (event, id) {
|
|
30029
|
+
} : null);
|
|
30030
|
+
isTouch || item.on("mouseout", interaction || isFunction(config.legend_item_onout) ? function (event, id) {
|
|
29993
30031
|
if (!callFn(config.legend_item_onout, api, id)) {
|
|
29994
30032
|
src_select(this).classed($FOCUS.legendItemFocused, !1);
|
|
29995
30033
|
if (hasGauge) {
|
|
@@ -29997,7 +30035,7 @@ function getLegendColor(id) {
|
|
|
29997
30035
|
}
|
|
29998
30036
|
$$.api.revert();
|
|
29999
30037
|
}
|
|
30000
|
-
}).on("mouseover", function (event, id) {
|
|
30038
|
+
} : null).on("mouseover", interaction || isFunction(config.legend_item_onover) ? function (event, id) {
|
|
30001
30039
|
if (!callFn(config.legend_item_onover, api, id)) {
|
|
30002
30040
|
src_select(this).classed($FOCUS.legendItemFocused, !0);
|
|
30003
30041
|
if (hasGauge) {
|
|
@@ -30007,7 +30045,10 @@ function getLegendColor(id) {
|
|
|
30007
30045
|
api.focus(id);
|
|
30008
30046
|
}
|
|
30009
30047
|
}
|
|
30010
|
-
});
|
|
30048
|
+
} : null);
|
|
30049
|
+
|
|
30050
|
+
// set cursor when has some interaction
|
|
30051
|
+
!item.empty() && item.on("click mouseout mouseover") && item.style("cursor", $$.getStylePropValue("pointer"));
|
|
30011
30052
|
}
|
|
30012
30053
|
},
|
|
30013
30054
|
/**
|
|
@@ -52078,7 +52119,7 @@ var _defaults = {};
|
|
|
52078
52119
|
|
|
52079
52120
|
/**
|
|
52080
52121
|
* @namespace bb
|
|
52081
|
-
* @version 3.9.0
|
|
52122
|
+
* @version 3.9.0
|
|
52082
52123
|
*/
|
|
52083
52124
|
var bb = {
|
|
52084
52125
|
/**
|
|
@@ -52088,7 +52129,7 @@ var bb = {
|
|
|
52088
52129
|
* bb.version; // "1.0.0"
|
|
52089
52130
|
* @memberof bb
|
|
52090
52131
|
*/
|
|
52091
|
-
version: "3.9.0
|
|
52132
|
+
version: "3.9.0",
|
|
52092
52133
|
/**
|
|
52093
52134
|
* Generate chart
|
|
52094
52135
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|