billboard.js 3.17.4 → 3.18.0-next.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/CONTRIBUTING.md +12 -12
- package/README.md +12 -12
- package/dist/billboard.css +15 -1
- package/dist/billboard.js +1146 -463
- package/dist/billboard.min.css +2 -2
- package/dist/billboard.min.js +10 -10
- package/dist/billboard.pkgd.js +1147 -464
- package/dist/billboard.pkgd.min.js +21 -21
- 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 +117 -26
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-stanford.js +119 -28
- package/dist/plugin/billboardjs-plugin-stanford.min.js +10 -10
- package/dist/plugin/billboardjs-plugin-tableview.js +117 -27
- package/dist/plugin/billboardjs-plugin-tableview.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.js +116 -26
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +117 -26
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +10 -10
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +120 -29
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +14 -14
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +117 -27
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +12 -12
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +116 -26
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +10 -10
- package/dist/theme/dark.css +15 -1
- package/dist/theme/dark.min.css +2 -2
- package/dist/theme/datalab.css +15 -1
- package/dist/theme/datalab.min.css +2 -2
- package/dist/theme/graph.css +15 -1
- package/dist/theme/graph.min.css +2 -2
- package/dist/theme/insight.css +15 -1
- package/dist/theme/insight.min.css +2 -2
- package/dist/theme/modern.css +15 -1
- package/dist/theme/modern.min.css +2 -2
- package/dist-esm/billboard.js +1467 -536
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +3 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +5 -4
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +94 -16
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +38 -37
- package/src/Chart/Chart.ts +1 -1
- package/src/Chart/api/chart.ts +5 -5
- package/src/Chart/api/data.ts +2 -1
- package/src/Chart/api/export.ts +1 -1
- package/src/Chart/api/flow.ts +1 -1
- package/src/Chart/api/load.ts +3 -3
- package/src/Chart/api/subchart.ts +3 -3
- package/src/Chart/api/tooltip.ts +1 -1
- package/src/Chart/api/zoom.ts +1 -1
- package/src/ChartInternal/Axis/Axis.ts +1 -1
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +1 -1
- package/src/ChartInternal/ChartInternal.ts +3 -2
- package/src/ChartInternal/data/IData.ts +3 -0
- package/src/ChartInternal/data/convert.helper.ts +1 -1
- package/src/ChartInternal/data/convert.ts +9 -8
- package/src/ChartInternal/data/data.ts +135 -17
- package/src/ChartInternal/data/load.ts +8 -8
- package/src/ChartInternal/interactions/drag.ts +53 -42
- package/src/ChartInternal/interactions/eventrect.ts +15 -5
- package/src/ChartInternal/interactions/flow.ts +1 -1
- package/src/ChartInternal/interactions/interaction.ts +1 -1
- package/src/ChartInternal/interactions/zoom.ts +24 -20
- package/src/ChartInternal/internals/color.ts +27 -10
- package/src/ChartInternal/internals/domain.ts +22 -5
- package/src/ChartInternal/internals/format.ts +4 -4
- package/src/ChartInternal/internals/grid.ts +11 -11
- package/src/ChartInternal/internals/legend.ts +80 -19
- package/src/ChartInternal/internals/scale.ts +6 -6
- package/src/ChartInternal/internals/selection.ts +1 -1
- package/src/ChartInternal/internals/style.ts +3 -3
- package/src/ChartInternal/internals/text.arc.ts +304 -0
- package/src/ChartInternal/internals/text.ts +44 -14
- package/src/ChartInternal/internals/text.util.ts +19 -0
- package/src/ChartInternal/internals/title.ts +3 -3
- package/src/ChartInternal/internals/tooltip.ts +23 -15
- package/src/ChartInternal/shape/arc.ts +174 -71
- package/src/ChartInternal/shape/area.ts +2 -2
- package/src/ChartInternal/shape/bar.ts +7 -6
- package/src/ChartInternal/shape/candlestick.ts +3 -3
- package/src/ChartInternal/shape/funnel.ts +18 -18
- package/src/ChartInternal/shape/line.ts +9 -10
- package/src/ChartInternal/shape/point.common.ts +24 -6
- package/src/ChartInternal/shape/radar.ts +4 -4
- package/src/ChartInternal/shape/shape.ts +24 -6
- package/src/ChartInternal/shape/treemap.ts +19 -5
- package/src/Plugin/stanford/Options.ts +2 -2
- package/src/Plugin/tableview/Options.ts +1 -1
- package/src/config/Options/axis/axis.ts +7 -7
- package/src/config/Options/axis/x.ts +6 -6
- package/src/config/Options/axis/y.ts +4 -4
- package/src/config/Options/axis/y2.ts +16 -3
- package/src/config/Options/common/color.ts +2 -2
- package/src/config/Options/common/legend.ts +6 -5
- package/src/config/Options/common/main.ts +23 -23
- package/src/config/Options/common/point.ts +4 -3
- package/src/config/Options/common/tooltip.ts +14 -13
- package/src/config/Options/data/axis.ts +31 -6
- package/src/config/Options/data/data.ts +44 -44
- package/src/config/Options/data/selection.ts +4 -4
- package/src/config/Options/interaction/interaction.ts +2 -1
- package/src/config/Options/interaction/subchart.ts +2 -2
- package/src/config/Options/interaction/zoom.ts +4 -4
- package/src/config/Options/shape/arc.ts +4 -4
- package/src/config/Options/shape/area.ts +1 -1
- package/src/config/Options/shape/bar.ts +4 -4
- package/src/config/Options/shape/bubble.ts +2 -2
- package/src/config/Options/shape/candlestick.ts +1 -1
- package/src/config/Options/shape/donut.ts +34 -3
- package/src/config/Options/shape/gauge.ts +36 -4
- package/src/config/Options/shape/line.ts +1 -1
- package/src/config/Options/shape/pie.ts +34 -3
- package/src/config/Options/shape/polar.ts +35 -4
- package/src/config/Options/shape/radar.ts +1 -1
- package/src/config/Options/shape/scatter.ts +1 -1
- package/src/config/Options/shape/treemap.ts +31 -5
- package/src/config/Store/State.ts +11 -1
- package/src/config/classes.ts +1 -0
- package/src/core.ts +1 -1
- package/src/module/Cache.ts +29 -4
- package/src/module/generator.ts +1 -1
- package/src/module/util.ts +308 -117
- package/src/module/worker.ts +3 -3
- package/src/scss/billboard.scss +15 -0
- package/src/scss/theme/dark.scss +15 -0
- package/src/scss/theme/datalab.scss +15 -0
- package/src/scss/theme/graph.scss +15 -0
- package/src/scss/theme/insight.scss +15 -0
- package/src/scss/theme/modern.scss +15 -0
- package/types/axis.d.ts +3 -3
- package/types/chart.d.ts +4 -4
- package/types/options.d.ts +22 -9
- package/types/options.shape.d.ts +59 -2
|
@@ -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.18.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -159,7 +159,83 @@ var __spreadValues = (a, b) => {
|
|
|
159
159
|
|
|
160
160
|
|
|
161
161
|
|
|
162
|
-
|
|
162
|
+
function _getRect(relativeViewport, node, forceEval = false) {
|
|
163
|
+
const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
|
|
164
|
+
if (forceEval) {
|
|
165
|
+
return _(node);
|
|
166
|
+
} else {
|
|
167
|
+
const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
|
|
168
|
+
return needEvaluate ? node.rect = _(node) : node.rect;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
function _forEachValidItem(items, callback) {
|
|
172
|
+
for (let i = 0; i < items.length; i++) {
|
|
173
|
+
const item = items[i];
|
|
174
|
+
if (item) {
|
|
175
|
+
callback(item, i);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
const _sanitize = (() => {
|
|
180
|
+
const DANGEROUS_TAGS = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex";
|
|
181
|
+
const ENTITY_MAP = {
|
|
182
|
+
quot: 34,
|
|
183
|
+
amp: 38,
|
|
184
|
+
apos: 39,
|
|
185
|
+
lt: 60,
|
|
186
|
+
gt: 62,
|
|
187
|
+
nbsp: 160,
|
|
188
|
+
iexcl: 161,
|
|
189
|
+
cent: 162,
|
|
190
|
+
pound: 163,
|
|
191
|
+
curren: 164,
|
|
192
|
+
yen: 165
|
|
193
|
+
};
|
|
194
|
+
const LT_CODE = 60;
|
|
195
|
+
const GT_CODE = 62;
|
|
196
|
+
const MAX_ITERATIONS = 10;
|
|
197
|
+
const rx = {
|
|
198
|
+
tags: new RegExp(
|
|
199
|
+
`<(${DANGEROUS_TAGS})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${DANGEROUS_TAGS})\\s*>)?`,
|
|
200
|
+
"gi"
|
|
201
|
+
),
|
|
202
|
+
htmlEntity: /&#x([0-9a-f]+);?|&#([0-9]+);?|&([a-z]+);/gi,
|
|
203
|
+
// eslint-disable-next-line no-control-regex
|
|
204
|
+
controlChar: /[\x00-\x1F\x7F]/g,
|
|
205
|
+
eventHandler: /\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)|on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)/gi,
|
|
206
|
+
dangerousUri: /(href|src|action|xlink:href)\s*=\s*(['"`]?)([^'"`>\s]*)\2/gi,
|
|
207
|
+
dangerousProtocol: /^(javascript|data|vbscript):/
|
|
208
|
+
};
|
|
209
|
+
return {
|
|
210
|
+
ENTITY_MAP,
|
|
211
|
+
LT_CODE,
|
|
212
|
+
GT_CODE,
|
|
213
|
+
MAX_ITERATIONS,
|
|
214
|
+
rx,
|
|
215
|
+
/**
|
|
216
|
+
* Decode HTML entities to prevent bypass attacks
|
|
217
|
+
* @param {string} str String with potential HTML entities
|
|
218
|
+
* @returns {string} Decoded string
|
|
219
|
+
*/
|
|
220
|
+
decodeEntities(str) {
|
|
221
|
+
return str.replace(rx.htmlEntity, (match, hex, dec, named) => {
|
|
222
|
+
const code = hex ? parseInt(hex, 16) : dec ? parseInt(dec, 10) : named ? ENTITY_MAP[named.toLowerCase()] || 0 : 0;
|
|
223
|
+
return code && code !== LT_CODE && code !== GT_CODE ? String.fromCharCode(code) : match;
|
|
224
|
+
});
|
|
225
|
+
},
|
|
226
|
+
/**
|
|
227
|
+
* Remove dangerous URI protocols from attribute values
|
|
228
|
+
* @param {string} str String to sanitize
|
|
229
|
+
* @returns {string} Sanitized string
|
|
230
|
+
*/
|
|
231
|
+
removeDangerousUris(str) {
|
|
232
|
+
return str.replace(rx.dangerousUri, (match, attr, quote, value) => {
|
|
233
|
+
const normalized = value.toLowerCase().replace(/\s/g, "");
|
|
234
|
+
return rx.dangerousProtocol.test(normalized) ? `${attr}=${quote}${quote}` : match;
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
})();
|
|
163
239
|
const isValue = (v) => v || v === 0;
|
|
164
240
|
const isFunction = (v) => typeof v === "function";
|
|
165
241
|
const isString = (v) => typeof v === "string";
|
|
@@ -206,26 +282,20 @@ function endall(transition, cb) {
|
|
|
206
282
|
transition.call(end);
|
|
207
283
|
}
|
|
208
284
|
}
|
|
209
|
-
const DANGEROUS_TAGS = "script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex";
|
|
210
|
-
const sanitizeRx = {
|
|
211
|
-
tags: new RegExp(
|
|
212
|
-
`<(${DANGEROUS_TAGS})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${DANGEROUS_TAGS})\\s*>)?`,
|
|
213
|
-
"gi"
|
|
214
|
-
),
|
|
215
|
-
// Handles: whitespace, slash, quotes before event handlers (e.g., <img/onerror=...>, <img src="x"onerror=...>)
|
|
216
|
-
eventHandlers: /[\s/"']+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi,
|
|
217
|
-
// Handles: javascript/data/vbscript URIs with optional whitespace/newlines between protocol and colon
|
|
218
|
-
dangerousURIs: /(href|src|action|xlink:href)\s*=\s*["']?\s*(javascript|data|vbscript)\s*:/gi
|
|
219
|
-
};
|
|
220
285
|
function sanitize(str) {
|
|
221
286
|
if (!isString(str) || !str || str.indexOf("<") === -1) {
|
|
222
287
|
return str;
|
|
223
288
|
}
|
|
224
289
|
let result = str;
|
|
225
290
|
let prev;
|
|
291
|
+
let iterations = 0;
|
|
226
292
|
do {
|
|
227
293
|
prev = result;
|
|
228
|
-
result = result.replace(
|
|
294
|
+
result = _sanitize.decodeEntities(result).replace(_sanitize.rx.controlChar, "").replace(_sanitize.rx.tags, "").replace(_sanitize.rx.eventHandler, "");
|
|
295
|
+
result = _sanitize.removeDangerousUris(result);
|
|
296
|
+
if (++iterations >= _sanitize.MAX_ITERATIONS) {
|
|
297
|
+
break;
|
|
298
|
+
}
|
|
229
299
|
} while (result !== prev);
|
|
230
300
|
return result;
|
|
231
301
|
}
|
|
@@ -293,20 +363,11 @@ function getBrushSelection(ctx) {
|
|
|
293
363
|
}
|
|
294
364
|
return selection;
|
|
295
365
|
}
|
|
296
|
-
function getRect(relativeViewport, node, forceEval = false) {
|
|
297
|
-
const _ = (n) => n[relativeViewport ? "getBoundingClientRect" : "getBBox"]();
|
|
298
|
-
if (forceEval) {
|
|
299
|
-
return _(node);
|
|
300
|
-
} else {
|
|
301
|
-
const needEvaluate = !("rect" in node) || "rect" in node && node.hasAttribute("width") && node.rect.width !== +(node.getAttribute("width") || 0);
|
|
302
|
-
return needEvaluate ? node.rect = _(node) : node.rect;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
366
|
function getBoundingRect(node, forceEval = false) {
|
|
306
|
-
return
|
|
367
|
+
return _getRect(true, node, forceEval);
|
|
307
368
|
}
|
|
308
369
|
function getBBox(node, forceEval = false) {
|
|
309
|
-
return
|
|
370
|
+
return _getRect(false, node, forceEval);
|
|
310
371
|
}
|
|
311
372
|
function getRandom(asStr = true, min = 0, max = 1e4) {
|
|
312
373
|
const crpt = win.crypto || win.msCrypto;
|
|
@@ -618,6 +679,35 @@ function parseShorthand(value) {
|
|
|
618
679
|
const [a, b = a, c = a, d = b] = values;
|
|
619
680
|
return { top: a, right: b, bottom: c, left: d };
|
|
620
681
|
}
|
|
682
|
+
function scheduleRAFUpdate(rafState, callback) {
|
|
683
|
+
if (rafState.pendingRaf !== null) {
|
|
684
|
+
win.cancelAnimationFrame(rafState.pendingRaf);
|
|
685
|
+
rafState.pendingRaf = win.requestAnimationFrame(() => {
|
|
686
|
+
rafState.pendingRaf = null;
|
|
687
|
+
callback();
|
|
688
|
+
});
|
|
689
|
+
} else {
|
|
690
|
+
rafState.pendingRaf = win.requestAnimationFrame(() => {
|
|
691
|
+
rafState.pendingRaf = null;
|
|
692
|
+
});
|
|
693
|
+
callback();
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
function toSet(items, keyFn = ((item) => item)) {
|
|
697
|
+
const set = /* @__PURE__ */ new Set();
|
|
698
|
+
_forEachValidItem(items, (item, i) => {
|
|
699
|
+
set.add(keyFn(item, i));
|
|
700
|
+
});
|
|
701
|
+
return set;
|
|
702
|
+
}
|
|
703
|
+
function toMap(items, keyFn, valueFn = ((item) => item)) {
|
|
704
|
+
const map = /* @__PURE__ */ new Map();
|
|
705
|
+
_forEachValidItem(items, (item, i) => {
|
|
706
|
+
map.set(keyFn(item, i), valueFn(item, i));
|
|
707
|
+
});
|
|
708
|
+
return map;
|
|
709
|
+
}
|
|
710
|
+
|
|
621
711
|
|
|
622
712
|
;// ./src/config/config.ts
|
|
623
713
|
|
|
@@ -699,7 +789,7 @@ class Plugin {
|
|
|
699
789
|
});
|
|
700
790
|
}
|
|
701
791
|
}
|
|
702
|
-
__publicField(Plugin, "version", "3.
|
|
792
|
+
__publicField(Plugin, "version", "3.18.0-next.2");
|
|
703
793
|
|
|
704
794
|
;// ./src/Plugin/textoverlap/Options.ts
|
|
705
795
|
class Options {
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.18.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(l,
|
|
11
|
+
*/(function(l,p){typeof exports=="object"&&typeof module=="object"?module.exports=p(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-delaunay","d3-polygon","d3-brush","d3-selection"],p):typeof exports=="object"?exports.bb=p(require("d3-delaunay"),require("d3-polygon"),require("d3-brush"),require("d3-selection")):(l.bb=l.bb||{},l.bb.plugin=l.bb.plugin||{},l.bb.plugin.textoverlap=p(l.d3,l.d3,l.d3,l.d3))})(this,function(P,l,p,B){return(function(){"use strict";var N={263:(function(e){e.exports=l}),348:(function(e){e.exports=P}),747:(function(e){e.exports=B}),853:(function(e){e.exports=p})},T={};function u(e){var t=T[e];if(t!==void 0)return t.exports;var n=T[e]={exports:{}};return N[e](n,n.exports,u),n.exports}(function(){u.d=function(e,t){for(var n in t)u.o(t,n)&&!u.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var y={};u.d(y,{default:function(){return de}});var U=u(348),M=u(263),ge=u(853),_e=u(747);function V(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof global=="object"&&global!==null&&global.Object===Object&&global||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function L(e){const t=typeof(e==null?void 0:e.requestAnimationFrame)=="function"&&typeof(e==null?void 0:e.cancelAnimationFrame)=="function",n=typeof(e==null?void 0:e.requestIdleCallback)=="function"&&typeof(e==null?void 0:e.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const x=V(),X=x==null?void 0:x.document,[ye,xe,ve,we]=L(x);var Y=Object.defineProperty,$=Object.getOwnPropertySymbols,z=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,C=(e,t)=>{for(var n in t||(t={}))z.call(t,n)&&j(e,n,t[n]);if($)for(var n of $(t))G.call(t,n)&&j(e,n,t[n]);return e};function R(e,t,n=!1){const o=r=>r[e?"getBoundingClientRect":"getBBox"]();return n?o(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=o(t):t.rect}function D(e,t){for(let n=0;n<e.length;n++){const o=e[n];o&&t(o,n)}}const h=(()=>{const e="script|iframe|object|embed|form|input|button|textarea|select|style|link|meta|base|math|isindex",t={quot:34,amp:38,apos:39,lt:60,gt:62,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165},n=60,o=62,r=10,s={tags:new RegExp(`<(${e})\\b[\\s\\S]*?>([\\s\\S]*?<\\/(${e})\\s*>)?`,"gi"),htmlEntity:/&#x([0-9a-f]+);?|&#([0-9]+);?|&([a-z]+);/gi,controlChar:/[\x00-\x1F\x7F]/g,eventHandler:/\s+on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)|on\w+\s*=\s*(?:"[^"]*"|'[^']*'|`[^`]*`|[^\s>]*)/gi,dangerousUri:/(href|src|action|xlink:href)\s*=\s*(['"`]?)([^'"`>\s]*)\2/gi,dangerousProtocol:/^(javascript|data|vbscript):/};return{ENTITY_MAP:t,LT_CODE:n,GT_CODE:o,MAX_ITERATIONS:r,rx:s,decodeEntities(i){return i.replace(s.htmlEntity,(c,a,d,b)=>{const f=a?parseInt(a,16):d?parseInt(d,10):b&&t[b.toLowerCase()]||0;return f&&f!==n&&f!==o?String.fromCharCode(f):c})},removeDangerousUris(i){return i.replace(s.dangerousUri,(c,a,d,b)=>{const f=b.toLowerCase().replace(/\s/g,"");return s.dangerousProtocol.test(f)?`${a}=${d}${d}`:c})}}})(),Oe=e=>e||e===0,H=e=>typeof e=="function",m=e=>typeof e=="string",v=e=>typeof e=="number",k=e=>typeof e=="undefined",I=e=>typeof e!="undefined",Ee=e=>typeof e=="boolean",Ae=e=>Math.ceil(e/10)*10,Pe=e=>Math.ceil(e)+.5,Te=e=>e[1]-e[0],w=e=>typeof e=="object",K=e=>{for(const t in e)return!1;return!0},W=e=>k(e)||e===null||m(e)&&e.length===0||w(e)&&!(e instanceof Date)&&K(e)||v(e)&&isNaN(e),J=e=>!W(e),O=e=>Array.isArray(e),g=e=>e&&!(e!=null&&e.nodeType)&&w(e)&&!O(e);function Me(e,t,n){return I(e[t])?e[t]:n}function $e(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function je(e,t,...n){const o=H(e);return o&&e.call(t,...n),o}function Ce(e,t){let n=0;const o=function(...r){!--n&&t.apply(this,...r)};"duration"in e?e.each(()=>++n).on("end",o):(++n,e.call(o))}function Q(e){if(!m(e)||!e||e.indexOf("<")===-1)return e;let t=e,n,o=0;do if(n=t,t=h.decodeEntities(t).replace(h.rx.controlChar,"").replace(h.rx.tags,"").replace(h.rx.eventHandler,""),t=h.removeDangerousUris(t),++o>=h.MAX_ITERATIONS)break;while(t!==n);return t}function Re(e,t,n=[-1,1],o=!1){if(!(!e||!m(t)))if(t.indexOf(`
|
|
12
12
|
`)===-1)e.text(t);else{const r=[e.text(),t].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=t.split(`
|
|
13
|
-
`),i=o?s.length-1:1;e.html(""),s.forEach((c,
|
|
13
|
+
`),i=o?s.length-1:1;e.html(""),s.forEach((c,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*i:n[1]}em`).text(c)})}}}function Z(e){const{x:t,y:n,width:o,height:r}=e.getBBox();return[{x:t,y:n+r},{x:t,y:n},{x:t+o,y:n},{x:t+o,y:n+r}]}function De(e){const{width:t,height:n}=F(e),o=Z(e),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:t,height:n}}function Ie(e,t){var n;const o=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=d3Pointer(o||e,t)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function ee(e){const{event:t,$el:n}=e,o=n.subchart.main||n.main;let r;return t&&t.type==="brush"?r=t.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function F(e,t=!1){return R(!0,e,t)}function Fe(e,t=!1){return R(!1,e,t)}function Se(e=!0,t=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?t+o.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(r):r}function S(e,t,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:i,w:c=0}=e[s];return r&&(i=e[s].y,c=e[s].h),t>=i&&t<=i+c?s:t<i?S(e,t,n,s-1,r):S(e,t,s+1,o,r)}function qe(e){const t=ee(e);return t?t[0]===t[1]:!0}function Be(...e){const t=n=>{if(g(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=t(n[r]);return o}return n};return e.map(n=>t(n)).reduce((n,o)=>C(C({},n),o))}function te(e={},t){O(t)&&t.forEach(n=>te(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Ne=e=>e.charAt(0).toUpperCase()+e.slice(1);function Ue(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const ne=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,i=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](i,r.cssRules.length)}function Le(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(ne(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Xe(e){var t,n,o,r,s,i;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((i=e.scrollTop)!=null?i:0)}}function Ye(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),s=e.getScreenCTM(),i=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const c=F(e);i.x-=c.x,i.y-=c.y}return i}function ze(e){const t=e?e.transform:null,n=t&&t.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function Ge(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,s)=>s.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function He(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function E(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return g(e)&&g(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];g(r)?(!e[o]&&(e[o]={}),e[o]=E(e[o],r)):e[o]=O(r)?r.concat():r}}),E(e,...t)}function oe(e,t=!0){let n;return e[0]instanceof Date?n=t?(o,r)=>o-r:(o,r)=>r-o:t&&!e.every(isNaN)?n=(o,r)=>o-r:t||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),e.concat().sort(n)}function ke(e,t){let n=t.filter(o=>J(o));return n.length?v(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=oe(n,e==="min")[0]):n=void 0,n}const Ke=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<r;s++)o.push(e+s*n);return o},We={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,o=e())=>{t.dispatchEvent(new MouseEvent(n,o))}}catch(t){return(n,o,r=e())=>{const s=X.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,x,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(e,t,n)=>{const o=new Touch(E({identifier:Date.now(),target:e,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));e.dispatchEvent(new TouchEvent(t,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};function Je(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return Q(n)}function Qe(e){var t;let n;if(e instanceof Date)n=e;else if(m(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else v(e)&&!isNaN(e)&&(n=new Date(+e));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${e}' to Date object`),n}function Ze(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function et(e,t,n=!1){const o=!!e.node;let r=!1;for(const[s,i]of Object.entries(t))if(r=o?e.style(s)===i:e.style[s]===i,n===!1&&r)break;return r}function tt(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function nt(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let i=!1;if(t)if(r&&"maxTouchPoints"in r)i=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)i=!0;else if(s)i=!0;else{const a=r.userAgent;i=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||i&&"touch"||"mouse"}function re(e,t){t()===!1?requestAnimationFrame(()=>re(e,t)):e()}function ot(e){if(g(e)&&!m(e)){const i=e;return{top:i.top||0,right:i.right||0,bottom:i.bottom||0,left:i.left||0}}const t=(m(e)?e.trim().split(/\s+/):[e]).map(i=>+i||0),[n,o=n,r=n,s=o]=t;return{top:n,right:o,bottom:r,left:s}}function rt(e,t){e.pendingRaf!==null?(window.cancelAnimationFrame(e.pendingRaf),e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null,t()})):(e.pendingRaf=window.requestAnimationFrame(()=>{e.pendingRaf=null}),t())}function st(e,t=(n=>n)){const n=new Set;return D(e,(o,r)=>{n.add(t(o,r))}),n}function it(e,t,n=(o=>o)){const o=new Map;return D(e,(r,s)=>{o.set(t(r,s),n(r,s))}),o}function se(e){const t=this.config;let n,o,r;const s=()=>{const i=o.shift();if(i&&n&&w(n)&&i in n)return n=n[i],s();if(!i)return n};Object.keys(t).forEach(i=>{n=e,o=i.split("_"),r=s(),I(r)&&(t[i]=r)}),this.api&&(this.state.orgConfig=e)}var ie=Object.defineProperty,ce=(e,t,n)=>t in e?ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,A=(e,t,n)=>ce(e,typeof t!="symbol"?t+"":t,n);class q{constructor(t={}){A(this,"$$"),A(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}A(q,"version","3.18.0-next.2");class le{constructor(){return{selector:void 0,extent:1,area:0}}}var ae=Object.defineProperty,ue=(e,t,n)=>t in e?ae(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t,n)=>ue(e,typeof t!="symbol"?t+"":t,n);class de extends q{constructor(t){return super(t),fe(this,"config"),this.config=new le,this}$init(){se.call(this,this.options)}$redraw(){const{$$:{$el:t},config:{selector:n}}=this,o=n?t.main.selectAll(n):t.text;!o.empty()&&this.preventLabelOverlap(o)}generateVoronoi(t){const{$$:n}=this,{scale:o}=n,[r,s]=["x","y"].map(i=>o[i].domain());return[r[1],s[0]]=[s[0],r[1]],U.Delaunay.from(t).voronoi([...r,...s])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),s=this.generateVoronoi(r);let i=0;t.each(function(){const c=s.cellPolygon(i);if(c&&this){const[a,d]=r[i],[b,f]=(0,M.polygonCentroid)(c),pe=Math.abs((0,M.polygonArea)(c)),_=Math.round(Math.atan2(f-d,b-a)/Math.PI*2),he=n*(_===0?1:-1),me=_===-1?-n:n+5,be=Math.abs(_)===1?"middle":_===0?"start":"end";this.style.display=pe<o?"none":"",this.setAttribute("text-anchor",be),this.setAttribute("dy",`0.${_===1?71:35}em`),this.setAttribute("transform",`translate(${he}, ${me})`)}i++})}}return y=y.default,y})()});
|
|
@@ -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.18.0-next.2
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -23536,7 +23536,7 @@ class Plugin {
|
|
|
23536
23536
|
});
|
|
23537
23537
|
}
|
|
23538
23538
|
}
|
|
23539
|
-
__publicField(Plugin, "version", "3.
|
|
23539
|
+
__publicField(Plugin, "version", "3.18.0-next.2");
|
|
23540
23540
|
|
|
23541
23541
|
;// ./src/Plugin/bubblecompare/index.ts
|
|
23542
23542
|
var bubblecompare_defProp = Object.defineProperty;
|