billboard.js 3.11.2 → 3.12.0-next.1
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/README.md +2 -6
- package/dist/billboard.css +5 -1
- package/dist/billboard.js +19431 -24292
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +26 -3
- package/dist/billboard.pkgd.js +22301 -29057
- package/dist/billboard.pkgd.min.js +33 -3
- package/dist/plugin/billboardjs-plugin-bubblecompare.js +77 -175
- package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -3
- package/dist/plugin/billboardjs-plugin-sparkline.js +423 -1134
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +660 -1524
- package/dist/plugin/billboardjs-plugin-stanford.min.js +15 -3
- package/dist/plugin/billboardjs-plugin-tableview.js +503 -1175
- package/dist/plugin/billboardjs-plugin-tableview.min.js +30 -3
- package/dist/plugin/billboardjs-plugin-textoverlap.js +351 -1055
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +4 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +339 -1324
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +5 -3
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1701 -3424
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +7 -3
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +2385 -4462
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +18 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1783 -3467
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +33 -3
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2031 -3979
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -3
- package/dist/theme/dark.css +5 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +5 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +5 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +5 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +5 -1
- package/dist/theme/modern.min.css +3 -4
- package/dist-esm/billboard.js +9051 -8666
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +19 -25
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +149 -148
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +295 -286
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +235 -234
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +40 -41
- package/package.json +26 -46
- package/src/Chart/api/axis.ts +6 -13
- package/src/Chart/api/chart.ts +12 -11
- package/src/Chart/api/data.ts +8 -7
- package/src/Chart/api/export.ts +28 -21
- package/src/Chart/api/flow.ts +4 -2
- package/src/Chart/api/grid.ts +1 -5
- package/src/Chart/api/load.ts +2 -2
- package/src/Chart/api/regions.ts +29 -5
- package/src/Chart/api/selection.ts +2 -2
- package/src/Chart/api/show.ts +2 -3
- package/src/Chart/api/subchart.ts +2 -2
- package/src/Chart/api/tooltip.ts +5 -7
- package/src/Chart/api/x.ts +2 -2
- package/src/Chart/api/zoom.ts +2 -2
- package/src/ChartInternal/Axis/Axis.ts +119 -44
- package/src/ChartInternal/Axis/AxisRenderer.ts +53 -38
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +2 -2
- package/src/ChartInternal/ChartInternal.ts +79 -51
- package/src/ChartInternal/data/IData.ts +22 -29
- package/src/ChartInternal/data/convert.helper.ts +66 -68
- package/src/ChartInternal/data/convert.ts +11 -11
- package/src/ChartInternal/data/data.ts +40 -23
- package/src/ChartInternal/data/load.ts +7 -6
- package/src/ChartInternal/interactions/drag.ts +2 -1
- package/src/ChartInternal/interactions/eventrect.ts +54 -25
- package/src/ChartInternal/interactions/flow.ts +14 -4
- package/src/ChartInternal/interactions/interaction.ts +34 -12
- package/src/ChartInternal/interactions/subchart.ts +27 -25
- package/src/ChartInternal/interactions/zoom.ts +29 -18
- package/src/ChartInternal/internals/category.ts +1 -1
- package/src/ChartInternal/internals/class.ts +5 -5
- package/src/ChartInternal/internals/clip.ts +9 -10
- package/src/ChartInternal/internals/color.ts +70 -42
- package/src/ChartInternal/internals/domain.ts +59 -28
- package/src/ChartInternal/internals/format.ts +5 -5
- package/src/ChartInternal/internals/grid.ts +130 -47
- package/src/ChartInternal/internals/legend.ts +99 -66
- package/src/ChartInternal/internals/redraw.ts +3 -2
- package/src/ChartInternal/internals/region.ts +5 -3
- package/src/ChartInternal/internals/scale.ts +28 -15
- package/src/ChartInternal/internals/selection.ts +14 -13
- package/src/ChartInternal/internals/size.axis.ts +18 -10
- package/src/ChartInternal/internals/size.ts +97 -66
- package/src/ChartInternal/internals/style.ts +21 -19
- package/src/ChartInternal/internals/text.ts +64 -39
- package/src/ChartInternal/internals/title.ts +2 -2
- package/src/ChartInternal/internals/tooltip.ts +83 -34
- package/src/ChartInternal/internals/transform.ts +2 -2
- package/src/ChartInternal/internals/type.ts +12 -12
- package/src/ChartInternal/shape/arc.ts +78 -44
- package/src/ChartInternal/shape/area.ts +19 -22
- package/src/ChartInternal/shape/bar.ts +41 -31
- package/src/ChartInternal/shape/bubble.ts +5 -5
- package/src/ChartInternal/shape/candlestick.ts +15 -13
- package/src/ChartInternal/shape/gauge.ts +16 -9
- package/src/ChartInternal/shape/line.ts +62 -46
- package/src/ChartInternal/shape/point.common.ts +1 -4
- package/src/ChartInternal/shape/point.ts +52 -32
- package/src/ChartInternal/shape/polar.ts +4 -2
- package/src/ChartInternal/shape/radar.ts +40 -22
- package/src/ChartInternal/shape/shape.ts +84 -58
- package/src/ChartInternal/shape/treemap.ts +29 -20
- package/src/Plugin/bubblecompare/index.ts +1 -3
- package/src/Plugin/sparkline/index.ts +3 -4
- package/src/Plugin/stanford/ColorScale.ts +3 -2
- package/src/Plugin/stanford/Elements.ts +15 -6
- package/src/Plugin/stanford/Options.ts +5 -5
- package/src/Plugin/stanford/index.ts +13 -9
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/Plugin/tableview/const.ts +1 -4
- package/src/Plugin/tableview/index.ts +11 -9
- package/src/Plugin/textoverlap/index.ts +4 -6
- package/src/config/Options/Options.ts +3 -3
- package/src/config/Options/axis/axis.ts +36 -0
- package/src/config/Options/axis/x.ts +12 -13
- package/src/config/Options/axis/y.ts +13 -13
- package/src/config/Options/axis/y2.ts +23 -10
- package/src/config/Options/common/color.ts +4 -4
- package/src/config/Options/common/grid.ts +4 -4
- package/src/config/Options/common/legend.ts +13 -14
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +17 -18
- package/src/config/Options/common/title.ts +2 -2
- package/src/config/Options/common/tooltip.ts +13 -11
- package/src/config/Options/data/axis.ts +2 -2
- package/src/config/Options/data/data.ts +45 -45
- package/src/config/Options/interaction/interaction.ts +1 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +9 -9
- package/src/config/Options/shape/arc.ts +10 -13
- package/src/config/Options/shape/area.ts +5 -7
- package/src/config/Options/shape/bar.ts +8 -10
- package/src/config/Options/shape/bubble.ts +1 -1
- package/src/config/Options/shape/candlestick.ts +2 -2
- package/src/config/Options/shape/donut.ts +4 -4
- package/src/config/Options/shape/gauge.ts +6 -6
- package/src/config/Options/shape/line.ts +3 -3
- package/src/config/Options/shape/pie.ts +5 -5
- package/src/config/Options/shape/polar.ts +3 -3
- package/src/config/Options/shape/radar.ts +2 -2
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +1 -1
- package/src/config/Store/Element.ts +8 -5
- package/src/config/Store/State.ts +19 -13
- package/src/config/classes.ts +6 -4
- package/src/config/config.ts +1 -1
- package/src/config/resolver/axis.ts +4 -4
- package/src/config/resolver/interaction.ts +3 -7
- package/src/config/resolver/shape.ts +11 -12
- package/src/core.ts +2 -3
- package/src/index.esm.ts +2 -6
- package/src/index.ts +2 -2
- package/src/module/Cache.ts +2 -3
- package/src/module/browser.ts +15 -10
- package/src/module/error.ts +9 -8
- package/src/module/generator.ts +3 -5
- package/src/module/util.ts +60 -37
- package/src/module/worker.ts +14 -11
- package/src/scss/billboard.scss +6 -0
- package/src/scss/theme/dark.scss +6 -0
- package/src/scss/theme/datalab.scss +6 -0
- package/src/scss/theme/graph.scss +6 -0
- package/src/scss/theme/insight.scss +6 -0
- package/src/scss/theme/modern.scss +6 -0
- package/types/axis.d.ts +7 -0
- package/types/options.d.ts +7 -0
- package/types/options.shape.d.ts +7 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -22,45 +22,214 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
22
22
|
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
|
-
***************************************************************************** */
|
|
26
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
25
|
+
***************************************************************************** */
|
|
26
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
27
|
+
|
|
28
|
+
var extendStatics = function(d, b) {
|
|
29
|
+
extendStatics = Object.setPrototypeOf ||
|
|
30
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
31
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
32
|
+
return extendStatics(d, b);
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function __extends(d, b) {
|
|
36
|
+
if (typeof b !== "function" && b !== null)
|
|
37
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
38
|
+
extendStatics(d, b);
|
|
39
|
+
function __() { this.constructor = d; }
|
|
40
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
var __assign = function() {
|
|
44
|
+
__assign = Object.assign || function __assign(t) {
|
|
45
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
46
|
+
s = arguments[i];
|
|
47
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
48
|
+
}
|
|
49
|
+
return t;
|
|
50
|
+
};
|
|
51
|
+
return __assign.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function __spreadArray(to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
}
|
|
27
63
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
66
|
+
* billboard.js project is licensed under the MIT license
|
|
67
|
+
*/
|
|
68
|
+
/**
|
|
69
|
+
* Window object
|
|
70
|
+
* @private
|
|
71
|
+
*/
|
|
72
|
+
/* eslint-disable no-new-func, no-undef */
|
|
73
|
+
/**
|
|
74
|
+
* Get global object
|
|
75
|
+
* @returns {object} window object
|
|
76
|
+
* @private
|
|
77
|
+
*/
|
|
78
|
+
function getGlobal() {
|
|
79
|
+
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
80
|
+
globalThis) ||
|
|
81
|
+
(typeof global === "object" && global !== null && global.Object === Object && global) ||
|
|
82
|
+
(typeof self === "object" && self !== null && self.Object === Object && self) ||
|
|
83
|
+
Function("return this")();
|
|
45
84
|
}
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
85
|
+
var win = getGlobal();
|
|
86
|
+
var doc = win === null || win === void 0 ? void 0 : win.document;
|
|
87
|
+
|
|
88
|
+
var isNumber = function (v) { return typeof v === "number"; };
|
|
89
|
+
var isDefined = function (v) { return typeof v !== "undefined"; };
|
|
90
|
+
var isObjectType = function (v) { return typeof v === "object"; };
|
|
91
|
+
/**
|
|
92
|
+
* Check if is array
|
|
93
|
+
* @param {Array} arr Data to be checked
|
|
94
|
+
* @returns {boolean}
|
|
95
|
+
* @private
|
|
96
|
+
*/
|
|
97
|
+
var isArray = function (arr) { return Array.isArray(arr); };
|
|
98
|
+
/**
|
|
99
|
+
* Check if is object
|
|
100
|
+
* @param {object} obj Data to be checked
|
|
101
|
+
* @returns {boolean}
|
|
102
|
+
* @private
|
|
103
|
+
*/
|
|
104
|
+
var isObject = function (obj) { return obj && !(obj === null || obj === void 0 ? void 0 : obj.nodeType) && isObjectType(obj) && !isArray(obj); };
|
|
105
|
+
/**
|
|
106
|
+
* Merge object returning new object
|
|
107
|
+
* @param {object} target Target object
|
|
108
|
+
* @param {object} objectN Source object
|
|
109
|
+
* @returns {object} merged target object
|
|
110
|
+
* @private
|
|
111
|
+
*/
|
|
112
|
+
function mergeObj(target) {
|
|
113
|
+
var objectN = [];
|
|
114
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
115
|
+
objectN[_i - 1] = arguments[_i];
|
|
51
116
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
117
|
+
if (!objectN.length || (objectN.length === 1 && !objectN[0])) {
|
|
118
|
+
return target;
|
|
119
|
+
}
|
|
120
|
+
var source = objectN.shift();
|
|
121
|
+
if (isObject(target) && isObject(source)) {
|
|
122
|
+
Object.keys(source).forEach(function (key) {
|
|
123
|
+
var value = source[key];
|
|
124
|
+
if (isObject(value)) {
|
|
125
|
+
!target[key] && (target[key] = {});
|
|
126
|
+
target[key] = mergeObj(target[key], value);
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
target[key] = isArray(value) ? value.concat() : value;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
return mergeObj.apply(void 0, __spreadArray([target], objectN, false));
|
|
134
|
+
}
|
|
135
|
+
// emulate event
|
|
136
|
+
({
|
|
137
|
+
mouse: (function () {
|
|
138
|
+
var getParams = function () { return ({
|
|
139
|
+
bubbles: false,
|
|
140
|
+
cancelable: false,
|
|
141
|
+
screenX: 0,
|
|
142
|
+
screenY: 0,
|
|
143
|
+
clientX: 0,
|
|
144
|
+
clientY: 0
|
|
145
|
+
}); };
|
|
146
|
+
try {
|
|
147
|
+
// eslint-disable-next-line no-new
|
|
148
|
+
new MouseEvent("t");
|
|
149
|
+
return function (el, eventType, params) {
|
|
150
|
+
if (params === void 0) { params = getParams(); }
|
|
151
|
+
el.dispatchEvent(new MouseEvent(eventType, params));
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
// Polyfills DOM4 MouseEvent
|
|
156
|
+
return function (el, eventType, params) {
|
|
157
|
+
if (params === void 0) { params = getParams(); }
|
|
158
|
+
var mouseEvent = doc.createEvent("MouseEvent");
|
|
159
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
|
|
160
|
+
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
|
|
161
|
+
params.screenX, params.screenY, params.clientX, params.clientY, false, false, false, false, 0, null);
|
|
162
|
+
el.dispatchEvent(mouseEvent);
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
})(),
|
|
166
|
+
touch: function (el, eventType, params) {
|
|
167
|
+
var touchObj = new Touch(mergeObj({
|
|
168
|
+
identifier: Date.now(),
|
|
169
|
+
target: el,
|
|
170
|
+
radiusX: 2.5,
|
|
171
|
+
radiusY: 2.5,
|
|
172
|
+
rotationAngle: 10,
|
|
173
|
+
force: 0.5
|
|
174
|
+
}, params));
|
|
175
|
+
el.dispatchEvent(new TouchEvent(eventType, {
|
|
176
|
+
cancelable: true,
|
|
177
|
+
bubbles: true,
|
|
178
|
+
shiftKey: true,
|
|
179
|
+
touches: [touchObj],
|
|
180
|
+
targetTouches: [],
|
|
181
|
+
changedTouches: [touchObj]
|
|
182
|
+
}));
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
/**
|
|
186
|
+
* Process the template & return bound string
|
|
187
|
+
* @param {string} tpl Template string
|
|
188
|
+
* @param {object} data Data value to be replaced
|
|
189
|
+
* @returns {string}
|
|
190
|
+
* @private
|
|
191
|
+
*/
|
|
192
|
+
function tplProcess(tpl, data) {
|
|
193
|
+
var res = tpl;
|
|
194
|
+
for (var x in data) {
|
|
195
|
+
res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
|
|
196
|
+
}
|
|
197
|
+
return res;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Load configuration option
|
|
202
|
+
* @param {object} config User's generation config value
|
|
203
|
+
* @private
|
|
204
|
+
*/
|
|
205
|
+
function loadConfig(config) {
|
|
206
|
+
var thisConfig = this.config;
|
|
207
|
+
var target;
|
|
208
|
+
var keys;
|
|
209
|
+
var read;
|
|
210
|
+
var find = function () {
|
|
211
|
+
var key = keys.shift();
|
|
212
|
+
if (key && target && isObjectType(target) && key in target) {
|
|
213
|
+
target = target[key];
|
|
214
|
+
return find();
|
|
215
|
+
}
|
|
216
|
+
else if (!key) {
|
|
217
|
+
return target;
|
|
218
|
+
}
|
|
219
|
+
return undefined;
|
|
220
|
+
};
|
|
221
|
+
Object.keys(thisConfig).forEach(function (key) {
|
|
222
|
+
target = config;
|
|
223
|
+
keys = key.split("_");
|
|
224
|
+
read = find();
|
|
225
|
+
if (isDefined(read)) {
|
|
226
|
+
thisConfig[key] = read;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
// only should run in the ChartInternal context
|
|
230
|
+
if (this.api) {
|
|
231
|
+
this.state.orgConfig = config;
|
|
61
232
|
}
|
|
62
|
-
}
|
|
63
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
64
233
|
}
|
|
65
234
|
|
|
66
235
|
/**
|
|
@@ -121,11 +290,32 @@ var Plugin = /** @class */ (function () {
|
|
|
121
290
|
delete _this[key];
|
|
122
291
|
});
|
|
123
292
|
};
|
|
124
|
-
Plugin.version = "3.
|
|
293
|
+
Plugin.version = "3.12.0-next.1";
|
|
125
294
|
return Plugin;
|
|
126
295
|
}());
|
|
127
296
|
var Plugin$1 = Plugin;
|
|
128
297
|
|
|
298
|
+
/**
|
|
299
|
+
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
300
|
+
* billboard.js project is licensed under the MIT license
|
|
301
|
+
*/
|
|
302
|
+
/**
|
|
303
|
+
* Constants values for plugin option
|
|
304
|
+
* @ignore
|
|
305
|
+
*/
|
|
306
|
+
var defaultStyle = {
|
|
307
|
+
id: "__tableview-style__",
|
|
308
|
+
class: "bb-tableview",
|
|
309
|
+
rule: ".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}"
|
|
310
|
+
};
|
|
311
|
+
// template
|
|
312
|
+
var tpl = {
|
|
313
|
+
body: "<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",
|
|
314
|
+
thead: "<th scope=\"col\">{=title}</th>",
|
|
315
|
+
tbodyHeader: "<th scope=\"row\">{=value}</th>",
|
|
316
|
+
tbody: "<td>{=value}</td>"
|
|
317
|
+
};
|
|
318
|
+
|
|
129
319
|
/**
|
|
130
320
|
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
131
321
|
* billboard.js project is licensed under the MIT license
|
|
@@ -238,197 +428,6 @@ var Options = /** @class */ (function () {
|
|
|
238
428
|
return Options;
|
|
239
429
|
}());
|
|
240
430
|
|
|
241
|
-
/**
|
|
242
|
-
* Copyright (c) 2021 ~ present NAVER Corp.
|
|
243
|
-
* billboard.js project is licensed under the MIT license
|
|
244
|
-
*/
|
|
245
|
-
/**
|
|
246
|
-
* Constants values for plugin option
|
|
247
|
-
* @ignore
|
|
248
|
-
*/
|
|
249
|
-
var defaultStyle = {
|
|
250
|
-
id: "__tableview-style__",
|
|
251
|
-
class: "bb-tableview",
|
|
252
|
-
rule: ".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}"
|
|
253
|
-
};
|
|
254
|
-
// template
|
|
255
|
-
var tpl = {
|
|
256
|
-
body: "<caption>{=title}</caption>\n\t\t<thead><tr>{=thead}</tr></thead>\n\t\t<tbody>{=tbody}</tbody>",
|
|
257
|
-
thead: "<th scope=\"col\">{=title}</th>",
|
|
258
|
-
tbodyHeader: "<th scope=\"row\">{=value}</th>",
|
|
259
|
-
tbody: "<td>{=value}</td>"
|
|
260
|
-
};
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
264
|
-
* billboard.js project is licensed under the MIT license
|
|
265
|
-
*/
|
|
266
|
-
/**
|
|
267
|
-
* Window object
|
|
268
|
-
* @private
|
|
269
|
-
*/
|
|
270
|
-
/* eslint-disable no-new-func, no-undef */
|
|
271
|
-
/**
|
|
272
|
-
* Get global object
|
|
273
|
-
* @returns {object} window object
|
|
274
|
-
* @private
|
|
275
|
-
*/
|
|
276
|
-
function getGlobal() {
|
|
277
|
-
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object && globalThis) ||
|
|
278
|
-
(typeof global === "object" && global !== null && global.Object === Object && global) ||
|
|
279
|
-
(typeof self === "object" && self !== null && self.Object === Object && self) ||
|
|
280
|
-
Function("return this")();
|
|
281
|
-
}
|
|
282
|
-
var win = getGlobal();
|
|
283
|
-
var doc = win === null || win === void 0 ? void 0 : win.document;
|
|
284
|
-
|
|
285
|
-
var isNumber = function (v) { return typeof v === "number"; };
|
|
286
|
-
var isDefined = function (v) { return typeof v !== "undefined"; };
|
|
287
|
-
var isObjectType = function (v) { return typeof v === "object"; };
|
|
288
|
-
/**
|
|
289
|
-
* Check if is array
|
|
290
|
-
* @param {Array} arr Data to be checked
|
|
291
|
-
* @returns {boolean}
|
|
292
|
-
* @private
|
|
293
|
-
*/
|
|
294
|
-
var isArray = function (arr) { return Array.isArray(arr); };
|
|
295
|
-
/**
|
|
296
|
-
* Check if is object
|
|
297
|
-
* @param {object} obj Data to be checked
|
|
298
|
-
* @returns {boolean}
|
|
299
|
-
* @private
|
|
300
|
-
*/
|
|
301
|
-
var isObject = function (obj) { return obj && !(obj === null || obj === void 0 ? void 0 : obj.nodeType) && isObjectType(obj) && !isArray(obj); };
|
|
302
|
-
/**
|
|
303
|
-
* Merge object returning new object
|
|
304
|
-
* @param {object} target Target object
|
|
305
|
-
* @param {object} objectN Source object
|
|
306
|
-
* @returns {object} merged target object
|
|
307
|
-
* @private
|
|
308
|
-
*/
|
|
309
|
-
function mergeObj(target) {
|
|
310
|
-
var objectN = [];
|
|
311
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
312
|
-
objectN[_i - 1] = arguments[_i];
|
|
313
|
-
}
|
|
314
|
-
if (!objectN.length || (objectN.length === 1 && !objectN[0])) {
|
|
315
|
-
return target;
|
|
316
|
-
}
|
|
317
|
-
var source = objectN.shift();
|
|
318
|
-
if (isObject(target) && isObject(source)) {
|
|
319
|
-
Object.keys(source).forEach(function (key) {
|
|
320
|
-
var value = source[key];
|
|
321
|
-
if (isObject(value)) {
|
|
322
|
-
!target[key] && (target[key] = {});
|
|
323
|
-
target[key] = mergeObj(target[key], value);
|
|
324
|
-
}
|
|
325
|
-
else {
|
|
326
|
-
target[key] = isArray(value) ?
|
|
327
|
-
value.concat() : value;
|
|
328
|
-
}
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
return mergeObj.apply(void 0, __spreadArray([target], objectN, false));
|
|
332
|
-
}
|
|
333
|
-
// emulate event
|
|
334
|
-
({
|
|
335
|
-
mouse: (function () {
|
|
336
|
-
var getParams = function () { return ({
|
|
337
|
-
bubbles: false, cancelable: false, screenX: 0, screenY: 0, clientX: 0, clientY: 0
|
|
338
|
-
}); };
|
|
339
|
-
try {
|
|
340
|
-
// eslint-disable-next-line no-new
|
|
341
|
-
new MouseEvent("t");
|
|
342
|
-
return function (el, eventType, params) {
|
|
343
|
-
if (params === void 0) { params = getParams(); }
|
|
344
|
-
el.dispatchEvent(new MouseEvent(eventType, params));
|
|
345
|
-
};
|
|
346
|
-
}
|
|
347
|
-
catch (e) {
|
|
348
|
-
// Polyfills DOM4 MouseEvent
|
|
349
|
-
return function (el, eventType, params) {
|
|
350
|
-
if (params === void 0) { params = getParams(); }
|
|
351
|
-
var mouseEvent = doc.createEvent("MouseEvent");
|
|
352
|
-
// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/initMouseEvent
|
|
353
|
-
mouseEvent.initMouseEvent(eventType, params.bubbles, params.cancelable, win, 0, // the event's mouse click count
|
|
354
|
-
params.screenX, params.screenY, params.clientX, params.clientY, false, false, false, false, 0, null);
|
|
355
|
-
el.dispatchEvent(mouseEvent);
|
|
356
|
-
};
|
|
357
|
-
}
|
|
358
|
-
})(),
|
|
359
|
-
touch: function (el, eventType, params) {
|
|
360
|
-
var touchObj = new Touch(mergeObj({
|
|
361
|
-
identifier: Date.now(),
|
|
362
|
-
target: el,
|
|
363
|
-
radiusX: 2.5,
|
|
364
|
-
radiusY: 2.5,
|
|
365
|
-
rotationAngle: 10,
|
|
366
|
-
force: 0.5
|
|
367
|
-
}, params));
|
|
368
|
-
el.dispatchEvent(new TouchEvent(eventType, {
|
|
369
|
-
cancelable: true,
|
|
370
|
-
bubbles: true,
|
|
371
|
-
shiftKey: true,
|
|
372
|
-
touches: [touchObj],
|
|
373
|
-
targetTouches: [],
|
|
374
|
-
changedTouches: [touchObj]
|
|
375
|
-
}));
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
/**
|
|
379
|
-
* Process the template & return bound string
|
|
380
|
-
* @param {string} tpl Template string
|
|
381
|
-
* @param {object} data Data value to be replaced
|
|
382
|
-
* @returns {string}
|
|
383
|
-
* @private
|
|
384
|
-
*/
|
|
385
|
-
function tplProcess(tpl, data) {
|
|
386
|
-
var res = tpl;
|
|
387
|
-
for (var x in data) {
|
|
388
|
-
res = res.replace(new RegExp("{=".concat(x, "}"), "g"), data[x]);
|
|
389
|
-
}
|
|
390
|
-
return res;
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
/**
|
|
394
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
395
|
-
* billboard.js project is licensed under the MIT license
|
|
396
|
-
*/
|
|
397
|
-
/**
|
|
398
|
-
* Load configuration option
|
|
399
|
-
* @param {object} config User's generation config value
|
|
400
|
-
* @private
|
|
401
|
-
*/
|
|
402
|
-
function loadConfig(config) {
|
|
403
|
-
var thisConfig = this.config;
|
|
404
|
-
var target;
|
|
405
|
-
var keys;
|
|
406
|
-
var read;
|
|
407
|
-
var find = function () {
|
|
408
|
-
var key = keys.shift();
|
|
409
|
-
if (key && target && isObjectType(target) && key in target) {
|
|
410
|
-
target = target[key];
|
|
411
|
-
return find();
|
|
412
|
-
}
|
|
413
|
-
else if (!key) {
|
|
414
|
-
return target;
|
|
415
|
-
}
|
|
416
|
-
return undefined;
|
|
417
|
-
};
|
|
418
|
-
Object.keys(thisConfig).forEach(function (key) {
|
|
419
|
-
target = config;
|
|
420
|
-
keys = key.split("_");
|
|
421
|
-
read = find();
|
|
422
|
-
if (isDefined(read)) {
|
|
423
|
-
thisConfig[key] = read;
|
|
424
|
-
}
|
|
425
|
-
});
|
|
426
|
-
// only should run in the ChartInternal context
|
|
427
|
-
if (this.api) {
|
|
428
|
-
this.state.orgConfig = config;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
|
|
432
431
|
/**
|
|
433
432
|
* Table view plugin.<br>
|
|
434
433
|
* Generates table view for bound dataset.
|
|
@@ -532,14 +531,16 @@ var TableView = /** @class */ (function (_super) {
|
|
|
532
531
|
});
|
|
533
532
|
});
|
|
534
533
|
rows.forEach(function (v) {
|
|
535
|
-
tbody += "<tr>".concat(v.map(function (d, i) {
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
534
|
+
tbody += "<tr>".concat(v.map(function (d, i) {
|
|
535
|
+
return tplProcess(i ? tpl.tbody : tpl.tbodyHeader, {
|
|
536
|
+
value: i === 0 ?
|
|
537
|
+
config.categoryFormat.bind(_this)(d) :
|
|
538
|
+
(isNumber(d) ? d.toLocaleString() : config.nullString)
|
|
539
|
+
});
|
|
540
|
+
}).join(""), "</tr>");
|
|
540
541
|
});
|
|
541
542
|
var rx = /(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig;
|
|
542
|
-
var r = tplProcess(tpl.body,
|
|
543
|
+
var r = tplProcess(tpl.body, __assign(__assign({}, config), { title: config.title || $$.config.title_text || "", thead: thead, tbody: tbody })).replace(rx, "");
|
|
543
544
|
element.innerHTML = r;
|
|
544
545
|
};
|
|
545
546
|
TableView.prototype.$redraw = function () {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.12.0-next.1
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -25,35 +25,32 @@ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
|
25
25
|
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
|
-
***************************************************************************** */
|
|
29
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
30
|
-
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
d
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
28
|
+
***************************************************************************** */
|
|
29
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
30
|
+
|
|
31
|
+
var extendStatics = function(d, b) {
|
|
32
|
+
extendStatics = Object.setPrototypeOf ||
|
|
33
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
34
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
35
|
+
return extendStatics(d, b);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
function __extends(d, b) {
|
|
39
|
+
if (typeof b !== "function" && b !== null)
|
|
40
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
41
|
+
extendStatics(d, b);
|
|
42
|
+
function __() { this.constructor = d; }
|
|
43
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function __spreadArray(to, from, pack) {
|
|
47
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
48
|
+
if (ar || !(i in from)) {
|
|
49
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
50
|
+
ar[i] = from[i];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
57
54
|
}
|
|
58
55
|
|
|
59
56
|
/**
|
|
@@ -71,7 +68,8 @@ function __spreadArray(to, from, pack) {
|
|
|
71
68
|
* @private
|
|
72
69
|
*/
|
|
73
70
|
function getGlobal() {
|
|
74
|
-
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
71
|
+
return (typeof globalThis === "object" && globalThis !== null && globalThis.Object === Object &&
|
|
72
|
+
globalThis) ||
|
|
75
73
|
(typeof global === "object" && global !== null && global.Object === Object && global) ||
|
|
76
74
|
(typeof self === "object" && self !== null && self.Object === Object && self) ||
|
|
77
75
|
Function("return this")();
|
|
@@ -119,8 +117,7 @@ function mergeObj(target) {
|
|
|
119
117
|
target[key] = mergeObj(target[key], value);
|
|
120
118
|
}
|
|
121
119
|
else {
|
|
122
|
-
target[key] = isArray(value) ?
|
|
123
|
-
value.concat() : value;
|
|
120
|
+
target[key] = isArray(value) ? value.concat() : value;
|
|
124
121
|
}
|
|
125
122
|
});
|
|
126
123
|
}
|
|
@@ -130,7 +127,12 @@ function mergeObj(target) {
|
|
|
130
127
|
({
|
|
131
128
|
mouse: (function () {
|
|
132
129
|
var getParams = function () { return ({
|
|
133
|
-
bubbles: false,
|
|
130
|
+
bubbles: false,
|
|
131
|
+
cancelable: false,
|
|
132
|
+
screenX: 0,
|
|
133
|
+
screenY: 0,
|
|
134
|
+
clientX: 0,
|
|
135
|
+
clientY: 0
|
|
134
136
|
}); };
|
|
135
137
|
try {
|
|
136
138
|
// eslint-disable-next-line no-new
|
|
@@ -172,10 +174,6 @@ function mergeObj(target) {
|
|
|
172
174
|
}
|
|
173
175
|
});
|
|
174
176
|
|
|
175
|
-
/**
|
|
176
|
-
* Copyright (c) 2017 ~ present NAVER Corp.
|
|
177
|
-
* billboard.js project is licensed under the MIT license
|
|
178
|
-
*/
|
|
179
177
|
/**
|
|
180
178
|
* Load configuration option
|
|
181
179
|
* @param {object} config User's generation config value
|
|
@@ -269,7 +267,7 @@ var Plugin = /** @class */ (function () {
|
|
|
269
267
|
delete _this[key];
|
|
270
268
|
});
|
|
271
269
|
};
|
|
272
|
-
Plugin.version = "3.
|
|
270
|
+
Plugin.version = "3.12.0-next.1";
|
|
273
271
|
return Plugin;
|
|
274
272
|
}());
|
|
275
273
|
var Plugin$1 = Plugin;
|
|
@@ -360,7 +358,7 @@ var Options = /** @class */ (function () {
|
|
|
360
358
|
* ]
|
|
361
359
|
* });
|
|
362
360
|
* @example
|
|
363
|
-
*
|
|
361
|
+
* import {bb} from "billboard.js";
|
|
364
362
|
* import TextOverlap from "billboard.js/dist/billboardjs-plugin-textoverlap";
|
|
365
363
|
*
|
|
366
364
|
* bb.generate({
|
|
@@ -422,7 +420,8 @@ var TextOverlap = /** @class */ (function (_super) {
|
|
|
422
420
|
var xTranslate = extent * (angle === 0 ? 1 : -1);
|
|
423
421
|
var yTranslate = angle === -1 ? -extent : extent + 5;
|
|
424
422
|
var txtAnchor = Math.abs(angle) === 1 ?
|
|
425
|
-
"middle" :
|
|
423
|
+
"middle" :
|
|
424
|
+
(angle === 0 ? "start" : "end");
|
|
426
425
|
this.style.display = polygonArea$1 < area ? "none" : "";
|
|
427
426
|
this.setAttribute("text-anchor", txtAnchor);
|
|
428
427
|
this.setAttribute("dy", "0.".concat(angle === 1 ? 71 : 35, "em"));
|