billboard.js 3.7.0 → 3.7.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 +1 -1
- package/dist/billboard.js +48 -37
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +1256 -1206
- 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 +1159 -1130
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1160 -1131
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1204 -1165
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1161 -1132
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1161 -1132
- 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 +46 -37
- 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 +9 -9
- package/src/Chart/api/data.ts +2 -2
- package/src/Chart/api/grid.x.ts +2 -2
- package/src/Chart/api/grid.y.ts +4 -2
- package/src/Chart/api/regions.ts +2 -2
- package/src/Chart/api/tooltip.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +2 -2
- package/src/ChartInternal/internals/clip.ts +12 -14
- package/src/ChartInternal/internals/text.ts +14 -4
- package/src/ChartInternal/shape/bar.ts +4 -2
- package/src/ChartInternal/shape/treemap.ts +7 -4
- package/types/chart.d.ts +13 -3
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.7.
|
|
8
|
+
* @version 3.7.2
|
|
9
9
|
*/
|
|
10
10
|
(function webpackUniversalModuleDefinition(root, factory) {
|
|
11
11
|
if(typeof exports === 'object' && typeof module === 'object')
|
|
@@ -8799,14 +8799,17 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
8799
8799
|
$el = $$.$el,
|
|
8800
8800
|
$T = $$.$T,
|
|
8801
8801
|
config = $$.config,
|
|
8802
|
+
axis = $$.axis,
|
|
8802
8803
|
classText = $$.getClass("text", "index"),
|
|
8803
8804
|
labelsCentered = config.data_labels.centered,
|
|
8804
8805
|
text = $el.main.selectAll("." + $TEXT.texts).selectAll("." + $TEXT.text).data($$.labelishData.bind($$));
|
|
8805
8806
|
$T(text.exit()).style("fill-opacity", "0").remove();
|
|
8806
8807
|
$el.text = text.enter().append("text").merge(text).attr("class", classText).attr("text-anchor", function (d) {
|
|
8807
8808
|
_newArrowCheck(this, _this2);
|
|
8809
|
+
var isInverted = config["axis_" + (axis == null ? void 0 : axis.getId(d.id)) + "_inverted"];
|
|
8810
|
+
|
|
8808
8811
|
// when value is negative or
|
|
8809
|
-
var isEndAnchor = d.value < 0;
|
|
8812
|
+
var isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
|
|
8810
8813
|
if ($$.isCandlestickType(d)) {
|
|
8811
8814
|
var data = $$.getCandlestickData(d);
|
|
8812
8815
|
isEndAnchor = !(data != null && data._isUp);
|
|
@@ -9047,8 +9050,15 @@ function setRotatePos(d, pos, anchor, isRotated, isInverted) {
|
|
|
9047
9050
|
xPos += config.data_labels.centered ? 0 : 5;
|
|
9048
9051
|
} else {
|
|
9049
9052
|
if (isRotated) {
|
|
9050
|
-
var
|
|
9051
|
-
|
|
9053
|
+
var isInverted = config["axis_" + $$.axis.getId(d.id) + "_inverted"],
|
|
9054
|
+
padding = $$.isBarType(d) ? 4 : 6,
|
|
9055
|
+
value = d.value;
|
|
9056
|
+
xPos = points[2][1];
|
|
9057
|
+
if (isInverted) {
|
|
9058
|
+
xPos -= padding * (value > 0 ? 1 : -1);
|
|
9059
|
+
} else {
|
|
9060
|
+
xPos += padding * (value < 0 ? -1 : 1);
|
|
9061
|
+
}
|
|
9052
9062
|
} else {
|
|
9053
9063
|
xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
|
|
9054
9064
|
}
|
|
@@ -10368,8 +10378,8 @@ var ChartInternal = /*#__PURE__*/function () {
|
|
|
10368
10378
|
if ($$.hasPointType()) {
|
|
10369
10379
|
$$.point = $$.generatePoint();
|
|
10370
10380
|
}
|
|
10371
|
-
$$.initClip();
|
|
10372
10381
|
if (state.hasAxis) {
|
|
10382
|
+
$$.initClip();
|
|
10373
10383
|
format.extraLineClasses = $$.generateExtraLineClass();
|
|
10374
10384
|
format.dataTime = config.data_xLocaltime ? external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.timeParse : external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.utcParse;
|
|
10375
10385
|
format.axisTime = config.axis_x_localtime ? external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.timeFormat : external_commonjs_d3_time_format_commonjs2_d3_time_format_amd_d3_time_format_root_d3_.utcFormat;
|
|
@@ -11145,7 +11155,7 @@ function loadConfig(config) {
|
|
|
11145
11155
|
* // Get all data
|
|
11146
11156
|
* chart.data();
|
|
11147
11157
|
*/
|
|
11148
|
-
function
|
|
11158
|
+
var api_data_data = function (targetIds) {
|
|
11149
11159
|
var _this = this,
|
|
11150
11160
|
targets = this.internal.data.targets;
|
|
11151
11161
|
if (!isUndefined(targetIds)) {
|
|
@@ -11160,7 +11170,7 @@ function api_data_data(targetIds) {
|
|
|
11160
11170
|
}.bind(this));
|
|
11161
11171
|
}
|
|
11162
11172
|
return targets;
|
|
11163
|
-
}
|
|
11173
|
+
};
|
|
11164
11174
|
extend(api_data_data, {
|
|
11165
11175
|
/**
|
|
11166
11176
|
* Get data shown in the chart.
|
|
@@ -12324,9 +12334,9 @@ var tooltip_tooltip = {
|
|
|
12324
12334
|
// reset last touch point index
|
|
12325
12335
|
inputType === "touch" && $$.callOverOutForTouch();
|
|
12326
12336
|
$$.hideTooltip(!0);
|
|
12327
|
-
$$.hideGridFocus();
|
|
12337
|
+
$$.hideGridFocus == null ? void 0 : $$.hideGridFocus();
|
|
12328
12338
|
$$.unexpandCircles == null ? void 0 : $$.unexpandCircles();
|
|
12329
|
-
$$.expandBarTypeShapes(!1);
|
|
12339
|
+
$$.expandBarTypeShapes == null ? void 0 : $$.expandBarTypeShapes(!1);
|
|
12330
12340
|
}
|
|
12331
12341
|
};
|
|
12332
12342
|
/* harmony default export */ var api_tooltip = ({
|
|
@@ -12749,7 +12759,7 @@ var axis = {
|
|
|
12749
12759
|
* ]);
|
|
12750
12760
|
* // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
|
|
12751
12761
|
*/
|
|
12752
|
-
function
|
|
12762
|
+
var xgrids = function (grids) {
|
|
12753
12763
|
var $$ = this.internal,
|
|
12754
12764
|
config = $$.config;
|
|
12755
12765
|
if (!grids) {
|
|
@@ -12758,7 +12768,7 @@ function xgrids(grids) {
|
|
|
12758
12768
|
config.grid_x_lines = grids;
|
|
12759
12769
|
$$.redrawWithoutRescale();
|
|
12760
12770
|
return config.grid_x_lines;
|
|
12761
|
-
}
|
|
12771
|
+
};
|
|
12762
12772
|
extend(xgrids, {
|
|
12763
12773
|
/**
|
|
12764
12774
|
* Add x grid lines.<br>
|
|
@@ -12832,7 +12842,7 @@ extend(xgrids, {
|
|
|
12832
12842
|
* ]);
|
|
12833
12843
|
* // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
|
|
12834
12844
|
*/
|
|
12835
|
-
function
|
|
12845
|
+
var ygrids = function (grids) {
|
|
12836
12846
|
var $$ = this.internal,
|
|
12837
12847
|
config = $$.config;
|
|
12838
12848
|
if (!grids) {
|
|
@@ -12841,7 +12851,7 @@ function ygrids(grids) {
|
|
|
12841
12851
|
config.grid_y_lines = grids;
|
|
12842
12852
|
$$.redrawWithoutRescale();
|
|
12843
12853
|
return config.grid_y_lines;
|
|
12844
|
-
}
|
|
12854
|
+
};
|
|
12845
12855
|
extend(ygrids, {
|
|
12846
12856
|
/**
|
|
12847
12857
|
* Add y grid lines.<br>
|
|
@@ -12948,16 +12958,16 @@ extend(ygrids, {
|
|
|
12948
12958
|
* {axis: "y", end: 50, class: "regionY"}
|
|
12949
12959
|
* ]);
|
|
12950
12960
|
*/
|
|
12951
|
-
function
|
|
12961
|
+
var regions = function (_regions) {
|
|
12952
12962
|
var $$ = this.internal,
|
|
12953
12963
|
config = $$.config;
|
|
12954
|
-
if (!
|
|
12964
|
+
if (!_regions) {
|
|
12955
12965
|
return config.regions;
|
|
12956
12966
|
}
|
|
12957
|
-
config.regions =
|
|
12967
|
+
config.regions = _regions;
|
|
12958
12968
|
$$.redrawWithoutRescale();
|
|
12959
|
-
return
|
|
12960
|
-
}
|
|
12969
|
+
return _regions;
|
|
12970
|
+
};
|
|
12961
12971
|
extend(regions, {
|
|
12962
12972
|
/**
|
|
12963
12973
|
* Add new region.<br><br>
|
|
@@ -15544,20 +15554,18 @@ var external_commonjs_d3_ease_commonjs2_d3_ease_amd_d3_ease_root_d3_ = __webpack
|
|
|
15544
15554
|
var $$ = this,
|
|
15545
15555
|
_$$$state = $$.state,
|
|
15546
15556
|
clip = _$$$state.clip,
|
|
15547
|
-
|
|
15557
|
+
datetimeId = _$$$state.datetimeId;
|
|
15548
15558
|
// MEMO: clipId needs to be unique because it conflicts when multiple charts exist
|
|
15549
|
-
clip.id =
|
|
15550
|
-
|
|
15551
|
-
|
|
15552
|
-
|
|
15553
|
-
clip.idGrid = clip.id + "-grid";
|
|
15559
|
+
clip.id = datetimeId + "-clip";
|
|
15560
|
+
clip.idXAxis = clip.id + "-xaxis";
|
|
15561
|
+
clip.idYAxis = clip.id + "-yaxis";
|
|
15562
|
+
clip.idGrid = clip.id + "-grid";
|
|
15554
15563
|
|
|
15555
|
-
|
|
15556
|
-
|
|
15557
|
-
|
|
15558
|
-
|
|
15559
|
-
|
|
15560
|
-
}
|
|
15564
|
+
// Define 'clip-path' attribute values
|
|
15565
|
+
clip.path = $$.getClipPath(clip.id);
|
|
15566
|
+
clip.pathXAxis = $$.getClipPath(clip.idXAxis);
|
|
15567
|
+
clip.pathYAxis = $$.getClipPath(clip.idYAxis);
|
|
15568
|
+
clip.pathGrid = $$.getClipPath(clip.idGrid);
|
|
15561
15569
|
},
|
|
15562
15570
|
getClipPath: function getClipPath(id) {
|
|
15563
15571
|
var $$ = this,
|
|
@@ -19391,15 +19399,17 @@ function getAttrTweenFn(fn) {
|
|
|
19391
19399
|
yScale = $$.getYScaleById.bind($$);
|
|
19392
19400
|
return function (d, i) {
|
|
19393
19401
|
_newArrowCheck(this, _this7);
|
|
19394
|
-
var
|
|
19402
|
+
var id = d.id,
|
|
19403
|
+
y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id)),
|
|
19395
19404
|
offset = barOffset(d, i) || y0,
|
|
19396
19405
|
width = isNumber(barW) ? barW : barW[d.id] || barW._$width,
|
|
19406
|
+
isInverted = config["axis_" + $$.axis.getId(id) + "_inverted"],
|
|
19397
19407
|
value = d.value,
|
|
19398
19408
|
posX = barX(d);
|
|
19399
19409
|
var posY = barY(d);
|
|
19400
19410
|
|
|
19401
19411
|
// fix posY not to overflow opposite quadrant
|
|
19402
|
-
if (config.axis_rotated && (value > 0 && posY < y0 || value < 0 && y0 < posY)) {
|
|
19412
|
+
if (config.axis_rotated && !isInverted && (value > 0 && posY < y0 || value < 0 && y0 < posY)) {
|
|
19403
19413
|
posY = y0;
|
|
19404
19414
|
}
|
|
19405
19415
|
if (!$$.isBarRangeType(d)) {
|
|
@@ -21164,7 +21174,8 @@ function convertDataToTreemapData(data) {
|
|
|
21164
21174
|
width = _$$$state$current.width,
|
|
21165
21175
|
height = _$$$state$current.height,
|
|
21166
21176
|
clip = _$$$state.clip,
|
|
21167
|
-
|
|
21177
|
+
datetimeId = _$$$state.datetimeId;
|
|
21178
|
+
clip.id = datetimeId + "-clip";
|
|
21168
21179
|
$$.treemap = (0,external_commonjs_d3_hierarchy_commonjs2_d3_hierarchy_amd_d3_hierarchy_root_d3_.treemap)().tile($$.getTreemapTile());
|
|
21169
21180
|
$$.treemapFn = function (data) {
|
|
21170
21181
|
var _this4 = this;
|
|
@@ -21176,8 +21187,8 @@ function convertDataToTreemapData(data) {
|
|
|
21176
21187
|
sortFn = $$.getSortCompareFn(!0);
|
|
21177
21188
|
return $$.treemap(sortFn ? hierarchyData.sort(sortFn) : hierarchyData);
|
|
21178
21189
|
}.bind(this);
|
|
21179
|
-
$el.defs.append("clipPath").attr("id",
|
|
21180
|
-
$el.treemap = $el.main.select("." + $COMMON.chart).attr("clip-path", "url(#" +
|
|
21190
|
+
$el.defs.append("clipPath").attr("id", clip.id).append("rect").attr("width", width).attr("height", height);
|
|
21191
|
+
$el.treemap = $el.main.select("." + $COMMON.chart).attr("clip-path", "url(#" + clip.id + ")").append("g").classed($TREEMAP.chartTreemaps, !0);
|
|
21181
21192
|
$$.bindTreemapEvent();
|
|
21182
21193
|
},
|
|
21183
21194
|
/**
|
|
@@ -24490,7 +24501,7 @@ var _defaults = {};
|
|
|
24490
24501
|
|
|
24491
24502
|
/**
|
|
24492
24503
|
* @namespace bb
|
|
24493
|
-
* @version 3.7.
|
|
24504
|
+
* @version 3.7.2
|
|
24494
24505
|
*/
|
|
24495
24506
|
var bb = {
|
|
24496
24507
|
/**
|
|
@@ -24500,7 +24511,7 @@ var bb = {
|
|
|
24500
24511
|
* bb.version; // "1.0.0"
|
|
24501
24512
|
* @memberof bb
|
|
24502
24513
|
*/
|
|
24503
|
-
version: "3.7.
|
|
24514
|
+
version: "3.7.2",
|
|
24504
24515
|
/**
|
|
24505
24516
|
* Generate chart
|
|
24506
24517
|
* - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
|
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.7.
|
|
8
|
+
* @version 3.7.2
|
|
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-chart-treemaps rect{stroke:#fff;stroke-width:1px}.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}
|