billboard.js 3.3.0 → 3.3.3
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 +489 -399
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +2 -2
- package/dist/billboard.pkgd.js +2491 -2239
- 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 +166 -103
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-stanford.js +166 -103
- package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-tableview.js +32 -130
- package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.js +32 -130
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +2004 -1842
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +2168 -1943
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +2170 -1945
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +2036 -1972
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +2037 -1973
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist-esm/billboard.js +481 -412
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -4
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +129 -77
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +135 -80
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +4 -8
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +4 -7
- package/package.json +28 -28
- package/src/Chart/api/chart.ts +1 -1
- package/src/Chart/api/focus.ts +8 -8
- package/src/Chart/api/regions.ts +3 -3
- package/src/Chart/api/selection.ts +15 -15
- package/src/Chart/api/subchart.ts +10 -10
- package/src/ChartInternal/Axis/Axis.ts +16 -14
- package/src/ChartInternal/ChartInternal.ts +7 -8
- package/src/ChartInternal/data/data.ts +3 -3
- package/src/ChartInternal/data/load.ts +2 -2
- package/src/ChartInternal/interactions/drag.ts +15 -15
- package/src/ChartInternal/interactions/eventrect.ts +18 -18
- package/src/ChartInternal/interactions/interaction.ts +10 -10
- package/src/ChartInternal/interactions/zoom.ts +4 -4
- package/src/ChartInternal/internals/color.ts +4 -4
- package/src/ChartInternal/internals/domain.ts +1 -1
- package/src/ChartInternal/internals/format.ts +9 -4
- package/src/ChartInternal/internals/grid.ts +32 -32
- package/src/ChartInternal/internals/legend.ts +27 -27
- package/src/ChartInternal/internals/redraw.ts +6 -5
- package/src/ChartInternal/internals/region.ts +3 -3
- package/src/ChartInternal/internals/selection.ts +16 -15
- package/src/ChartInternal/internals/size.ts +3 -3
- package/src/ChartInternal/internals/text.ts +8 -8
- package/src/ChartInternal/internals/title.ts +4 -4
- package/src/ChartInternal/internals/tooltip.ts +5 -5
- package/src/ChartInternal/internals/transform.ts +5 -5
- package/src/ChartInternal/shape/arc.ts +22 -22
- package/src/ChartInternal/shape/area.ts +4 -4
- package/src/ChartInternal/shape/bar.ts +7 -7
- package/src/ChartInternal/shape/candlestick.ts +8 -8
- package/src/ChartInternal/shape/gauge.ts +8 -8
- package/src/ChartInternal/shape/line.ts +7 -7
- package/src/ChartInternal/shape/point.ts +18 -18
- package/src/ChartInternal/shape/radar.ts +10 -10
- package/src/ChartInternal/shape/shape.ts +4 -2
- package/src/Plugin/sparkline/index.ts +2 -2
- package/src/Plugin/stanford/index.ts +3 -3
- package/src/Plugin/stanford/util.ts +0 -1
- package/src/config/Options/common/tooltip.ts +10 -1
- package/src/config/classes.ts +154 -66
- package/src/module/util.ts +21 -13
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.3.
|
|
8
|
+
* @version 3.3.3
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -212,7 +212,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
212
212
|
return Plugin;
|
|
213
213
|
}();
|
|
214
214
|
|
|
215
|
-
Plugin.version = "3.
|
|
215
|
+
Plugin.version = "3.3.3";
|
|
216
216
|
|
|
217
217
|
;// CONCATENATED MODULE: ./src/Plugin/tableview/Options.ts
|
|
218
218
|
/**
|
|
@@ -380,121 +380,6 @@ win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
|
|
|
380
380
|
};
|
|
381
381
|
|
|
382
382
|
var doc = win == null ? void 0 : win.document;
|
|
383
|
-
;// CONCATENATED MODULE: ./src/config/classes.ts
|
|
384
|
-
/**
|
|
385
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
386
|
-
* billboard.js project is licensed under the MIT license
|
|
387
|
-
*/
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* CSS class names definition
|
|
391
|
-
* @private
|
|
392
|
-
*/
|
|
393
|
-
/* harmony default export */ var classes = ({
|
|
394
|
-
arc: "bb-arc",
|
|
395
|
-
arcLabelLine: "bb-arc-label-line",
|
|
396
|
-
arcs: "bb-arcs",
|
|
397
|
-
area: "bb-area",
|
|
398
|
-
areas: "bb-areas",
|
|
399
|
-
axis: "bb-axis",
|
|
400
|
-
axisX: "bb-axis-x",
|
|
401
|
-
axisXLabel: "bb-axis-x-label",
|
|
402
|
-
axisY: "bb-axis-y",
|
|
403
|
-
axisY2: "bb-axis-y2",
|
|
404
|
-
axisY2Label: "bb-axis-y2-label",
|
|
405
|
-
axisYLabel: "bb-axis-y-label",
|
|
406
|
-
bar: "bb-bar",
|
|
407
|
-
bars: "bb-bars",
|
|
408
|
-
brush: "bb-brush",
|
|
409
|
-
button: "bb-button",
|
|
410
|
-
buttonZoomReset: "bb-zoom-reset",
|
|
411
|
-
candlestick: "bb-candlestick",
|
|
412
|
-
candlesticks: "bb-candlesticks",
|
|
413
|
-
chart: "bb-chart",
|
|
414
|
-
chartArc: "bb-chart-arc",
|
|
415
|
-
chartArcs: "bb-chart-arcs",
|
|
416
|
-
chartArcsBackground: "bb-chart-arcs-background",
|
|
417
|
-
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
418
|
-
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
419
|
-
chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
|
420
|
-
chartArcsTitle: "bb-chart-arcs-title",
|
|
421
|
-
chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
|
422
|
-
chartBar: "bb-chart-bar",
|
|
423
|
-
chartBars: "bb-chart-bars",
|
|
424
|
-
chartCandlestick: "bb-chart-candlestick",
|
|
425
|
-
chartCandlesticks: "bb-chart-candlesticks",
|
|
426
|
-
chartCircles: "bb-chart-circles",
|
|
427
|
-
chartLine: "bb-chart-line",
|
|
428
|
-
chartLines: "bb-chart-lines",
|
|
429
|
-
chartRadar: "bb-chart-radar",
|
|
430
|
-
chartRadars: "bb-chart-radars",
|
|
431
|
-
chartText: "bb-chart-text",
|
|
432
|
-
chartTexts: "bb-chart-texts",
|
|
433
|
-
circle: "bb-circle",
|
|
434
|
-
circles: "bb-circles",
|
|
435
|
-
colorPattern: "bb-color-pattern",
|
|
436
|
-
colorScale: "bb-colorscale",
|
|
437
|
-
defocused: "bb-defocused",
|
|
438
|
-
dragarea: "bb-dragarea",
|
|
439
|
-
empty: "bb-empty",
|
|
440
|
-
eventRect: "bb-event-rect",
|
|
441
|
-
eventRects: "bb-event-rects",
|
|
442
|
-
eventRectsMultiple: "bb-event-rects-multiple",
|
|
443
|
-
eventRectsSingle: "bb-event-rects-single",
|
|
444
|
-
focused: "bb-focused",
|
|
445
|
-
gaugeValue: "bb-gauge-value",
|
|
446
|
-
grid: "bb-grid",
|
|
447
|
-
gridLines: "bb-grid-lines",
|
|
448
|
-
legend: "bb-legend",
|
|
449
|
-
legendBackground: "bb-legend-background",
|
|
450
|
-
legendItem: "bb-legend-item",
|
|
451
|
-
legendItemEvent: "bb-legend-item-event",
|
|
452
|
-
legendItemFocused: "bb-legend-item-focused",
|
|
453
|
-
legendItemHidden: "bb-legend-item-hidden",
|
|
454
|
-
legendItemPoint: "bb-legend-item-point",
|
|
455
|
-
legendItemTile: "bb-legend-item-tile",
|
|
456
|
-
level: "bb-level",
|
|
457
|
-
levels: "bb-levels",
|
|
458
|
-
line: "bb-line",
|
|
459
|
-
lines: "bb-lines",
|
|
460
|
-
main: "bb-main",
|
|
461
|
-
region: "bb-region",
|
|
462
|
-
regions: "bb-regions",
|
|
463
|
-
selectedCircle: "bb-selected-circle",
|
|
464
|
-
selectedCircles: "bb-selected-circles",
|
|
465
|
-
shape: "bb-shape",
|
|
466
|
-
shapes: "bb-shapes",
|
|
467
|
-
stanfordElements: "bb-stanford-elements",
|
|
468
|
-
stanfordLine: "bb-stanford-line",
|
|
469
|
-
stanfordLines: "bb-stanford-lines",
|
|
470
|
-
stanfordRegion: "bb-stanford-region",
|
|
471
|
-
stanfordRegions: "bb-stanford-regions",
|
|
472
|
-
subchart: "bb-subchart",
|
|
473
|
-
target: "bb-target",
|
|
474
|
-
text: "bb-text",
|
|
475
|
-
texts: "bb-texts",
|
|
476
|
-
title: "bb-title",
|
|
477
|
-
tooltip: "bb-tooltip",
|
|
478
|
-
tooltipContainer: "bb-tooltip-container",
|
|
479
|
-
tooltipName: "bb-tooltip-name",
|
|
480
|
-
valueDown: "bb-value-down",
|
|
481
|
-
valueUp: "bb-value-up",
|
|
482
|
-
xgrid: "bb-xgrid",
|
|
483
|
-
xgridFocus: "bb-xgrid-focus",
|
|
484
|
-
xgridLine: "bb-xgrid-line",
|
|
485
|
-
xgridLines: "bb-xgrid-lines",
|
|
486
|
-
xgrids: "bb-xgrids",
|
|
487
|
-
ygrid: "bb-ygrid",
|
|
488
|
-
ygridFocus: "bb-ygrid-focus",
|
|
489
|
-
ygridLine: "bb-ygrid-line",
|
|
490
|
-
ygridLines: "bb-ygrid-lines",
|
|
491
|
-
ygrids: "bb-ygrids",
|
|
492
|
-
zoomBrush: "bb-zoom-brush",
|
|
493
|
-
EXPANDED: "_expanded_",
|
|
494
|
-
SELECTED: "_selected_",
|
|
495
|
-
INCLUDED: "_included_",
|
|
496
|
-
TextOverlapping: "text-overlapping"
|
|
497
|
-
});
|
|
498
383
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
499
384
|
|
|
500
385
|
|
|
@@ -512,7 +397,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
|
|
|
512
397
|
|
|
513
398
|
|
|
514
399
|
|
|
515
|
-
|
|
516
400
|
var isValue = function (v) {
|
|
517
401
|
return v || v === 0;
|
|
518
402
|
},
|
|
@@ -783,7 +667,7 @@ function getBrushSelection(ctx) {
|
|
|
783
667
|
// check from event
|
|
784
668
|
if (event && event.type === "brush") {
|
|
785
669
|
selection = event.selection; // check from brush area selection
|
|
786
|
-
} else if (main && (selection = main.select("."
|
|
670
|
+
} else if (main && (selection = main.select(".bb-brush").node())) {
|
|
787
671
|
selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
|
|
788
672
|
}
|
|
789
673
|
|
|
@@ -805,17 +689,27 @@ function getBoundingRect(node) {
|
|
|
805
689
|
/**
|
|
806
690
|
* Retrun random number
|
|
807
691
|
* @param {boolean} asStr Convert returned value as string
|
|
692
|
+
* @param {number} min Minimum value
|
|
693
|
+
* @param {number} max Maximum value
|
|
808
694
|
* @returns {number|string}
|
|
809
695
|
* @private
|
|
810
696
|
*/
|
|
811
697
|
|
|
812
698
|
|
|
813
|
-
function getRandom(asStr) {
|
|
699
|
+
function getRandom(asStr, min, max) {
|
|
814
700
|
if (asStr === void 0) {
|
|
815
701
|
asStr = !0;
|
|
816
702
|
}
|
|
817
703
|
|
|
818
|
-
|
|
704
|
+
if (min === void 0) {
|
|
705
|
+
min = 0;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (max === void 0) {
|
|
709
|
+
max = 1e4;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
var rand = Math.floor(Math.random() * (max - min) + min);
|
|
819
713
|
return asStr ? rand + "" : rand;
|
|
820
714
|
}
|
|
821
715
|
/**
|
|
@@ -1289,19 +1183,27 @@ function isTabVisible() {
|
|
|
1289
1183
|
|
|
1290
1184
|
|
|
1291
1185
|
function convertInputType(mouse, touch) {
|
|
1292
|
-
var
|
|
1186
|
+
var hasTouch = !1;
|
|
1293
1187
|
|
|
1294
|
-
if (
|
|
1188
|
+
if (touch) {
|
|
1295
1189
|
// Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1190
|
+
if (win.navigator && "maxTouchPoints" in win.navigator) {
|
|
1191
|
+
hasTouch = win.navigator.maxTouchPoints > 0; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
|
|
1192
|
+
// On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
|
|
1193
|
+
} else if ("ontouchmove" in win || win.DocumentTouch && doc instanceof win.DocumentTouch) {
|
|
1194
|
+
hasTouch = !0;
|
|
1195
|
+
} else {
|
|
1196
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
|
|
1197
|
+
var mQ = win.matchMedia && matchMedia("(pointer:coarse)");
|
|
1198
|
+
|
|
1199
|
+
if (mQ && mQ.media === "(pointer:coarse)") {
|
|
1200
|
+
hasTouch = !!mQ.matches;
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1301
1203
|
}
|
|
1302
1204
|
|
|
1303
|
-
var hasMouse = mouse && !
|
|
1304
|
-
return hasMouse && "mouse" ||
|
|
1205
|
+
var hasMouse = mouse && !hasTouch ? "onmouseover" in win : !1;
|
|
1206
|
+
return hasMouse && "mouse" || hasTouch && "touch" || null;
|
|
1305
1207
|
}
|
|
1306
1208
|
;// CONCATENATED MODULE: ./src/config/config.ts
|
|
1307
1209
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.3.
|
|
8
|
+
* @version 3.3.3
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();r.version="3.
|
|
12
|
+
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-selection","d3-brush"],e):"object"==typeof exports?exports.bb=e(require("d3-selection"),require("d3-brush")):(t.bb=t.bb||{},t.bb.plugin=t.bb.plugin||{},t.bb.plugin.tableview=e(t.d3,t.d3))}(this,(function(t,e){return function(){"use strict";var n=[,function(e){e.exports=t},,function(t){t.exports=e}],r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var i={};return function(){function t(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function e(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function n(t,e){return n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t},n(t,e)}o.d(i,{default:function(){return $}});var r=function(){function t(t){void 0===t&&(t={}),this.$$=void 0,this.options=void 0,this.options=t}var e=t.prototype;return e.$beforeInit=function(){},e.$init=function(){},e.$afterInit=function(){},e.$redraw=function(){},e.$willDestroy=function(){var t=this;Object.keys(this).forEach((function(e){t[e]=null,delete t[e]}))},t}();r.version="3.3.3";var c=function(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){var e=t;return this.$$.axis.isCategorized()?e=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(e=t.toLocaleDateString()),e},class:void 0,style:!0,title:void 0,updateOnToggle:!0}},l="__tableview-style__",a="bb-tableview",u=".bb-tableview {\n\t\tborder-collapse:collapse;\n\t\tborder-spacing:0;\n\t\tbackground:#fff;\n\t\tmin-width:100%;\n\t\tmargin-top:10px;\n\t\tfont-family:sans-serif;\n\t\tfont-size:.9em;\n\t}\n\t.bb-tableview tr:hover {\n\t\tbackground:#eef7ff;\n\t}\n\t.bb-tableview thead tr {\n\t\tbackground:#f8f8f8;\n\t}\n\t.bb-tableview caption,.bb-tableview td,.bb-tableview th {\n\t\ttext-align: center;\n\t\tborder:1px solid silver;\n\t\tpadding:.5em;\n\t}\n\t.bb-tableview caption {\n\t\tfont-size:1.1em;\n\t\tfont-weight:700;\n\t\tmargin-bottom: -1px;\n\t}",s="<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",f='<th scope="col">{=title}</th>',b='<th scope="row">{=value}</th>',d="<td>{=value}</td>",p=(o(1),o(3),"object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")());p.requestIdleCallback=p.requestIdleCallback||function(t){return setTimeout(t,1)},p.cancelIdleCallback=p.cancelIdleCallback||function(t){return clearTimeout(t)};var h=null==p?void 0:p.document;var v=function(t){return"number"==typeof t},g=function(t){return void 0!==t},y=function(t){return"object"==typeof t};!function(){try{new MouseEvent("t")}catch(t){return function(t,e,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var r=h.createEvent("MouseEvent");r.initMouseEvent(e,n.bubbles,n.cancelable,p,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),t.dispatchEvent(r)}}}();function m(t,e){var n=t;for(var r in e)n=n.replace(new RegExp("{="+r+"}","g"),e[r]);return n}function O(t){var e,n,r,o=this.config,i=function(){var t=n.shift();return t&&e&&y(e)&&t in e?(e=e[t],i()):t?void 0:e};Object.keys(o).forEach((function(c){e=t,n=c.split("_"),r=i(),g(r)&&(o[c]=r)}))}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function w(e){for(var n,r=1;r<arguments.length;r++)n=null!=arguments[r]?arguments[r]:{},r%2?j(Object(n),!0).forEach((function(r){t(e,r,n[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}));return e}var $=function(t){var r,o;function i(n){var r=t.call(this,n)||this;return r.config=void 0,r.element=void 0,r.config=new c,e(r)||e(r)}o=t,(r=i).prototype=Object.create(o.prototype),r.prototype.constructor=r,n(r,o);var p=i.prototype;return p.$beforeInit=function(){O.call(this,this.options)},p.$init=function(){var t,e=this.config,n=e.class,r=e.selector,o=e.style,i=document.querySelector(r||"."+(n||a));if(!i){var c=this.$$.$el.chart.node();i=document.createElement("table"),c.parentNode.insertBefore(i,c.nextSibling)}if("TABLE"!==i.tagName){var s=document.createElement("table");i.appendChild(s),i=s}if(o&&!document.getElementById(l)){var f=document.createElement("style");f.id=l,f.innerHTML=u,(document.head||document.getElementsByTagName("head")[0]).appendChild(f)}(t=i.classList).add.apply(t,[o&&a,n].filter(Boolean)),this.element=i},p.generateTable=function(){var t=this,e=this.$$,n=this.config,r=this.element,o=e.filterTargetsToShow(e.data.targets),i=m(f,{title:o.length?this.config.categoryTitle:""}),c="",l=[];o.forEach((function(t){i+=m(f,{title:t.id}),t.values.forEach((function(t,e){l[e]||(l[e]=[t.x]),l[e].push(t.value)}))})),l.forEach((function(e){c+="<tr>"+e.map((function(e,r){return m(r?d:b,{value:0===r?n.categoryFormat.bind(t)(e):v(e)?e.toLocaleString():""})})).join("")+"</tr>"}));var a=m(s,w(w({},n),{},{title:n.title||e.config.title_text||"",thead:i,tbody:c})).replace(/<[^>]+><\/[^>]+>/g,"");r.innerHTML=a},p.$redraw=function(){var t=this.$$.state;t.resizing||!this.config.updateOnToggle&&t.toggling||this.generateTable()},p.$willDestroy=function(){if(this.element.parentNode.removeChild(this.element),1===this.$$.charts.length){var t,e=document.getElementById(l);null==e||null==(t=e.parentNode)||t.removeChild(e)}},i}(r)}(),i=i.default}()}));
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.3.
|
|
8
|
+
* @version 3.3.3
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -183,121 +183,6 @@ win.cancelIdleCallback = win.cancelIdleCallback || function (id) {
|
|
|
183
183
|
};
|
|
184
184
|
|
|
185
185
|
var doc = win == null ? void 0 : win.document;
|
|
186
|
-
;// CONCATENATED MODULE: ./src/config/classes.ts
|
|
187
|
-
/**
|
|
188
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
189
|
-
* billboard.js project is licensed under the MIT license
|
|
190
|
-
*/
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* CSS class names definition
|
|
194
|
-
* @private
|
|
195
|
-
*/
|
|
196
|
-
/* harmony default export */ var classes = ({
|
|
197
|
-
arc: "bb-arc",
|
|
198
|
-
arcLabelLine: "bb-arc-label-line",
|
|
199
|
-
arcs: "bb-arcs",
|
|
200
|
-
area: "bb-area",
|
|
201
|
-
areas: "bb-areas",
|
|
202
|
-
axis: "bb-axis",
|
|
203
|
-
axisX: "bb-axis-x",
|
|
204
|
-
axisXLabel: "bb-axis-x-label",
|
|
205
|
-
axisY: "bb-axis-y",
|
|
206
|
-
axisY2: "bb-axis-y2",
|
|
207
|
-
axisY2Label: "bb-axis-y2-label",
|
|
208
|
-
axisYLabel: "bb-axis-y-label",
|
|
209
|
-
bar: "bb-bar",
|
|
210
|
-
bars: "bb-bars",
|
|
211
|
-
brush: "bb-brush",
|
|
212
|
-
button: "bb-button",
|
|
213
|
-
buttonZoomReset: "bb-zoom-reset",
|
|
214
|
-
candlestick: "bb-candlestick",
|
|
215
|
-
candlesticks: "bb-candlesticks",
|
|
216
|
-
chart: "bb-chart",
|
|
217
|
-
chartArc: "bb-chart-arc",
|
|
218
|
-
chartArcs: "bb-chart-arcs",
|
|
219
|
-
chartArcsBackground: "bb-chart-arcs-background",
|
|
220
|
-
chartArcsGaugeMax: "bb-chart-arcs-gauge-max",
|
|
221
|
-
chartArcsGaugeMin: "bb-chart-arcs-gauge-min",
|
|
222
|
-
chartArcsGaugeUnit: "bb-chart-arcs-gauge-unit",
|
|
223
|
-
chartArcsTitle: "bb-chart-arcs-title",
|
|
224
|
-
chartArcsGaugeTitle: "bb-chart-arcs-gauge-title",
|
|
225
|
-
chartBar: "bb-chart-bar",
|
|
226
|
-
chartBars: "bb-chart-bars",
|
|
227
|
-
chartCandlestick: "bb-chart-candlestick",
|
|
228
|
-
chartCandlesticks: "bb-chart-candlesticks",
|
|
229
|
-
chartCircles: "bb-chart-circles",
|
|
230
|
-
chartLine: "bb-chart-line",
|
|
231
|
-
chartLines: "bb-chart-lines",
|
|
232
|
-
chartRadar: "bb-chart-radar",
|
|
233
|
-
chartRadars: "bb-chart-radars",
|
|
234
|
-
chartText: "bb-chart-text",
|
|
235
|
-
chartTexts: "bb-chart-texts",
|
|
236
|
-
circle: "bb-circle",
|
|
237
|
-
circles: "bb-circles",
|
|
238
|
-
colorPattern: "bb-color-pattern",
|
|
239
|
-
colorScale: "bb-colorscale",
|
|
240
|
-
defocused: "bb-defocused",
|
|
241
|
-
dragarea: "bb-dragarea",
|
|
242
|
-
empty: "bb-empty",
|
|
243
|
-
eventRect: "bb-event-rect",
|
|
244
|
-
eventRects: "bb-event-rects",
|
|
245
|
-
eventRectsMultiple: "bb-event-rects-multiple",
|
|
246
|
-
eventRectsSingle: "bb-event-rects-single",
|
|
247
|
-
focused: "bb-focused",
|
|
248
|
-
gaugeValue: "bb-gauge-value",
|
|
249
|
-
grid: "bb-grid",
|
|
250
|
-
gridLines: "bb-grid-lines",
|
|
251
|
-
legend: "bb-legend",
|
|
252
|
-
legendBackground: "bb-legend-background",
|
|
253
|
-
legendItem: "bb-legend-item",
|
|
254
|
-
legendItemEvent: "bb-legend-item-event",
|
|
255
|
-
legendItemFocused: "bb-legend-item-focused",
|
|
256
|
-
legendItemHidden: "bb-legend-item-hidden",
|
|
257
|
-
legendItemPoint: "bb-legend-item-point",
|
|
258
|
-
legendItemTile: "bb-legend-item-tile",
|
|
259
|
-
level: "bb-level",
|
|
260
|
-
levels: "bb-levels",
|
|
261
|
-
line: "bb-line",
|
|
262
|
-
lines: "bb-lines",
|
|
263
|
-
main: "bb-main",
|
|
264
|
-
region: "bb-region",
|
|
265
|
-
regions: "bb-regions",
|
|
266
|
-
selectedCircle: "bb-selected-circle",
|
|
267
|
-
selectedCircles: "bb-selected-circles",
|
|
268
|
-
shape: "bb-shape",
|
|
269
|
-
shapes: "bb-shapes",
|
|
270
|
-
stanfordElements: "bb-stanford-elements",
|
|
271
|
-
stanfordLine: "bb-stanford-line",
|
|
272
|
-
stanfordLines: "bb-stanford-lines",
|
|
273
|
-
stanfordRegion: "bb-stanford-region",
|
|
274
|
-
stanfordRegions: "bb-stanford-regions",
|
|
275
|
-
subchart: "bb-subchart",
|
|
276
|
-
target: "bb-target",
|
|
277
|
-
text: "bb-text",
|
|
278
|
-
texts: "bb-texts",
|
|
279
|
-
title: "bb-title",
|
|
280
|
-
tooltip: "bb-tooltip",
|
|
281
|
-
tooltipContainer: "bb-tooltip-container",
|
|
282
|
-
tooltipName: "bb-tooltip-name",
|
|
283
|
-
valueDown: "bb-value-down",
|
|
284
|
-
valueUp: "bb-value-up",
|
|
285
|
-
xgrid: "bb-xgrid",
|
|
286
|
-
xgridFocus: "bb-xgrid-focus",
|
|
287
|
-
xgridLine: "bb-xgrid-line",
|
|
288
|
-
xgridLines: "bb-xgrid-lines",
|
|
289
|
-
xgrids: "bb-xgrids",
|
|
290
|
-
ygrid: "bb-ygrid",
|
|
291
|
-
ygridFocus: "bb-ygrid-focus",
|
|
292
|
-
ygridLine: "bb-ygrid-line",
|
|
293
|
-
ygridLines: "bb-ygrid-lines",
|
|
294
|
-
ygrids: "bb-ygrids",
|
|
295
|
-
zoomBrush: "bb-zoom-brush",
|
|
296
|
-
EXPANDED: "_expanded_",
|
|
297
|
-
SELECTED: "_selected_",
|
|
298
|
-
INCLUDED: "_included_",
|
|
299
|
-
TextOverlapping: "text-overlapping"
|
|
300
|
-
});
|
|
301
186
|
;// CONCATENATED MODULE: ./src/module/util.ts
|
|
302
187
|
|
|
303
188
|
|
|
@@ -315,7 +200,6 @@ function _objectSpread(target) { for (var i = 1, source; i < arguments.length; i
|
|
|
315
200
|
|
|
316
201
|
|
|
317
202
|
|
|
318
|
-
|
|
319
203
|
var isValue = function (v) {
|
|
320
204
|
return v || v === 0;
|
|
321
205
|
},
|
|
@@ -586,7 +470,7 @@ function getBrushSelection(ctx) {
|
|
|
586
470
|
// check from event
|
|
587
471
|
if (event && event.type === "brush") {
|
|
588
472
|
selection = event.selection; // check from brush area selection
|
|
589
|
-
} else if (main && (selection = main.select("."
|
|
473
|
+
} else if (main && (selection = main.select(".bb-brush").node())) {
|
|
590
474
|
selection = (0,external_commonjs_d3_brush_commonjs2_d3_brush_amd_d3_brush_root_d3_.brushSelection)(selection);
|
|
591
475
|
}
|
|
592
476
|
|
|
@@ -608,17 +492,27 @@ function getBoundingRect(node) {
|
|
|
608
492
|
/**
|
|
609
493
|
* Retrun random number
|
|
610
494
|
* @param {boolean} asStr Convert returned value as string
|
|
495
|
+
* @param {number} min Minimum value
|
|
496
|
+
* @param {number} max Maximum value
|
|
611
497
|
* @returns {number|string}
|
|
612
498
|
* @private
|
|
613
499
|
*/
|
|
614
500
|
|
|
615
501
|
|
|
616
|
-
function getRandom(asStr) {
|
|
502
|
+
function getRandom(asStr, min, max) {
|
|
617
503
|
if (asStr === void 0) {
|
|
618
504
|
asStr = !0;
|
|
619
505
|
}
|
|
620
506
|
|
|
621
|
-
|
|
507
|
+
if (min === void 0) {
|
|
508
|
+
min = 0;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
if (max === void 0) {
|
|
512
|
+
max = 1e4;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
var rand = Math.floor(Math.random() * (max - min) + min);
|
|
622
516
|
return asStr ? rand + "" : rand;
|
|
623
517
|
}
|
|
624
518
|
/**
|
|
@@ -1092,19 +986,27 @@ function isTabVisible() {
|
|
|
1092
986
|
|
|
1093
987
|
|
|
1094
988
|
function convertInputType(mouse, touch) {
|
|
1095
|
-
var
|
|
989
|
+
var hasTouch = !1;
|
|
1096
990
|
|
|
1097
|
-
if (
|
|
991
|
+
if (touch) {
|
|
1098
992
|
// Some Edge desktop return true: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/20417074/
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
993
|
+
if (win.navigator && "maxTouchPoints" in win.navigator) {
|
|
994
|
+
hasTouch = win.navigator.maxTouchPoints > 0; // Ref: https://github.com/Modernizr/Modernizr/blob/master/feature-detects/touchevents.js
|
|
995
|
+
// On IE11 with IE9 emulation mode, ('ontouchstart' in window) is returning true
|
|
996
|
+
} else if ("ontouchmove" in win || win.DocumentTouch && doc instanceof win.DocumentTouch) {
|
|
997
|
+
hasTouch = !0;
|
|
998
|
+
} else {
|
|
999
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Browser_detection_using_the_user_agent#avoiding_user_agent_detection
|
|
1000
|
+
var mQ = win.matchMedia && matchMedia("(pointer:coarse)");
|
|
1001
|
+
|
|
1002
|
+
if (mQ && mQ.media === "(pointer:coarse)") {
|
|
1003
|
+
hasTouch = !!mQ.matches;
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1104
1006
|
}
|
|
1105
1007
|
|
|
1106
|
-
var hasMouse = mouse && !
|
|
1107
|
-
return hasMouse && "mouse" ||
|
|
1008
|
+
var hasMouse = mouse && !hasTouch ? "onmouseover" in win : !1;
|
|
1009
|
+
return hasMouse && "mouse" || hasTouch && "touch" || null;
|
|
1108
1010
|
}
|
|
1109
1011
|
;// CONCATENATED MODULE: ./src/config/config.ts
|
|
1110
1012
|
/**
|
|
@@ -1229,7 +1131,7 @@ var Plugin = /*#__PURE__*/function () {
|
|
|
1229
1131
|
return Plugin;
|
|
1230
1132
|
}();
|
|
1231
1133
|
|
|
1232
|
-
Plugin.version = "3.
|
|
1134
|
+
Plugin.version = "3.3.3";
|
|
1233
1135
|
|
|
1234
1136
|
;// CONCATENATED MODULE: ./src/Plugin/textoverlap/Options.ts
|
|
1235
1137
|
/**
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.3.
|
|
8
|
+
* @version 3.3.3
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
12
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.
|
|
12
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):"function"==typeof define&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-selection","d3-brush"],t):"object"==typeof exports?exports.bb=t(require("d3-delaunay"),require("d3-polygon"),require("d3-selection"),require("d3-brush")):(e.bb=e.bb||{},e.bb.plugin=e.bb.plugin||{},e.bb.plugin.textoverlap=t(e.d3,e.d3,e.d3,e.d3))}(this,(function(e,t,n,o){return function(){"use strict";var r={3:function(e){e.exports=o},12:function(t){t.exports=e},13:function(e){e.exports=t},1:function(e){e.exports=n}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var n=i[e]={exports:{}};return r[e](n,n.exports,c),n.exports}c.d=function(e,t){for(var n in t)c.o(t,n)&&!c.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var u={};return function(){function e(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function t(e,n){return t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},t(e,n)}c.d(u,{default:function(){return d}});var n=c(12),o=c(13);c(1),c(3);var r="object"==typeof globalThis&&null!==globalThis&&globalThis.Object===Object&&globalThis||"object"==typeof global&&null!==global&&global.Object===Object&&global||"object"==typeof self&&null!==self&&self.Object===Object&&self||Function("return this")();r.requestIdleCallback=r.requestIdleCallback||function(e){return setTimeout(e,1)},r.cancelIdleCallback=r.cancelIdleCallback||function(e){return clearTimeout(e)};var i=null==r?void 0:r.document;var a=function(e){return void 0!==e},l=function(e){return"object"==typeof e};!function(){try{new MouseEvent("t")}catch(e){return function(e,t,n){void 0===n&&(n={bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});var o=i.createEvent("MouseEvent");o.initMouseEvent(t,n.bubbles,n.cancelable,r,0,n.screenX,n.screenY,n.clientX,n.clientY,!1,!1,!1,!1,0,null),e.dispatchEvent(o)}}}();function s(e){var t,n,o,r=this.config,i=function(){var e=n.shift();return e&&t&&l(t)&&e in t?(t=t[e],i()):e?void 0:t};Object.keys(r).forEach((function(c){t=e,n=c.split("_"),o=i(),a(o)&&(r[c]=o)}))}var f=function(){function e(e){void 0===e&&(e={}),this.$$=void 0,this.options=void 0,this.options=e}var t=e.prototype;return t.$beforeInit=function(){},t.$init=function(){},t.$afterInit=function(){},t.$redraw=function(){},t.$willDestroy=function(){var e=this;Object.keys(this).forEach((function(t){e[t]=null,delete e[t]}))},e}();f.version="3.3.3";var b=function(){return{selector:void 0,extent:1,area:0}},d=function(r){var i,c;function u(t){var n=r.call(this,t)||this;return n.config=void 0,n.config=new b,e(n)||e(n)}c=r,(i=u).prototype=Object.create(c.prototype),i.prototype.constructor=i,t(i,c);var a=u.prototype;return a.$init=function(){s.call(this,this.options)},a.$redraw=function(){var e=this.$$.$el,t=this.config.selector,n=t?e.main.selectAll(t):e.text;n.empty()||this.preventLabelOverlap(n)},a.generateVoronoi=function(e){var t=this.$$.scale,o=["x","y"].map((function(e){return t[e].domain()})),r=o[0],i=o[1],c=[i[0],r[1]];return r[1]=c[0],i[0]=c[1],n.Delaunay.from(e).voronoi([].concat(r,i))},a.preventLabelOverlap=function(e){var t=this.config,n=t.extent,r=t.area,i=e.data().map((function(e){return[e.index,e.value]})),c=this.generateVoronoi(i),u=0;e.each((function(){var e=c.cellPolygon(u);if(e&&this){var t=i[u],a=t[0],l=t[1],s=(0,o.polygonCentroid)(e),f=s[0],b=s[1],d=Math.abs((0,o.polygonArea)(e)),p=Math.round(Math.atan2(b-l,f-a)/Math.PI*2),v=n*(0===p?1:-1),h=-1===p?-n:n+5,y=1===Math.abs(p)?"middle":0===p?"start":"end";this.style.display=d<r?"none":"",this.setAttribute("text-anchor",y),this.setAttribute("dy","0."+(1===p?71:35)+"em"),this.setAttribute("transform","translate("+v+", "+h+")")}u++}))},u}(f)}(),u=u.default}()}));
|