billboard.js 4.0.0-next.3 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billboard.css +1 -1
- package/dist/billboard.js +240 -149
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +20 -20
- package/dist/billboard.pkgd.js +240 -149
- package/dist/billboard.pkgd.min.js +27 -27
- 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 +11 -13
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +3 -3
- package/dist/plugin/billboardjs-plugin-stanford.js +11 -13
- package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-tableview.js +28 -15
- package/dist/plugin/billboardjs-plugin-tableview.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.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 +11 -13
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +9 -9
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +11 -13
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +28 -15
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +6 -6
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +2 -2
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +2 -2
- package/dist/theme/dark.css +1 -1
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +1 -1
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +1 -1
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +1 -1
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +1 -1
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/Chart/Chart.js +1 -1
- package/dist-esm/Chart/api/axis.js +1 -1
- package/dist-esm/Chart/api/category.js +1 -1
- package/dist-esm/Chart/api/chart.js +1 -1
- package/dist-esm/Chart/api/color.js +1 -1
- package/dist-esm/Chart/api/data.js +1 -1
- package/dist-esm/Chart/api/export.js +1 -1
- package/dist-esm/Chart/api/flow.js +1 -1
- package/dist-esm/Chart/api/focus.js +1 -1
- package/dist-esm/Chart/api/grid.js +1 -1
- package/dist-esm/Chart/api/group.js +1 -1
- package/dist-esm/Chart/api/legend.js +1 -1
- package/dist-esm/Chart/api/load.js +1 -1
- package/dist-esm/Chart/api/regions.js +1 -1
- package/dist-esm/Chart/api/selection.js +1 -1
- package/dist-esm/Chart/api/show.js +1 -1
- package/dist-esm/Chart/api/stubs.js +53 -0
- package/dist-esm/Chart/api/subchart.js +2 -2
- package/dist-esm/Chart/api/tooltip.js +1 -1
- package/dist-esm/Chart/api/x.js +1 -1
- package/dist-esm/Chart/api/zoom.js +2 -2
- package/dist-esm/ChartInternal/Axis/Axis.js +1 -1
- package/dist-esm/ChartInternal/Axis/AxisRenderer.js +149 -96
- package/dist-esm/ChartInternal/Axis/AxisRendererHelper.js +1 -1
- package/dist-esm/ChartInternal/ChartInternal.js +8 -4
- package/dist-esm/ChartInternal/data/convert.helper.js +1 -1
- package/dist-esm/ChartInternal/data/convert.js +1 -1
- package/dist-esm/ChartInternal/data/data.js +1 -1
- package/dist-esm/ChartInternal/data/load.js +1 -1
- package/dist-esm/ChartInternal/interactions/drag.js +1 -1
- package/dist-esm/ChartInternal/interactions/eventrect.js +2 -2
- package/dist-esm/ChartInternal/interactions/flow.js +1 -1
- package/dist-esm/ChartInternal/interactions/interaction.js +1 -1
- package/dist-esm/ChartInternal/interactions/subchart.js +1 -1
- package/dist-esm/ChartInternal/interactions/zoom.js +1 -1
- package/dist-esm/ChartInternal/internals/category.js +1 -1
- package/dist-esm/ChartInternal/internals/class.js +1 -1
- package/dist-esm/ChartInternal/internals/clip.js +1 -1
- package/dist-esm/ChartInternal/internals/color.js +1 -1
- package/dist-esm/ChartInternal/internals/domain.js +1 -1
- package/dist-esm/ChartInternal/internals/format.js +1 -1
- package/dist-esm/ChartInternal/internals/grid.js +1 -1
- package/dist-esm/ChartInternal/internals/legend.js +1 -1
- package/dist-esm/ChartInternal/internals/redraw.js +1 -1
- package/dist-esm/ChartInternal/internals/region.js +1 -1
- package/dist-esm/ChartInternal/internals/scale.js +1 -1
- package/dist-esm/ChartInternal/internals/selection.js +1 -1
- package/dist-esm/ChartInternal/internals/size.axis.js +1 -1
- package/dist-esm/ChartInternal/internals/size.js +1 -1
- package/dist-esm/ChartInternal/internals/style.js +1 -1
- package/dist-esm/ChartInternal/internals/text.arc.js +1 -1
- package/dist-esm/ChartInternal/internals/text.js +1 -1
- package/dist-esm/ChartInternal/internals/text.util.js +1 -1
- package/dist-esm/ChartInternal/internals/title.js +1 -1
- package/dist-esm/ChartInternal/internals/tooltip.js +1 -1
- package/dist-esm/ChartInternal/internals/transform.js +1 -1
- package/dist-esm/ChartInternal/internals/type.js +1 -1
- package/dist-esm/ChartInternal/shape/arc.js +1 -1
- package/dist-esm/ChartInternal/shape/area.js +1 -1
- package/dist-esm/ChartInternal/shape/bar.js +1 -1
- package/dist-esm/ChartInternal/shape/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/barRadius.js +1 -1
- package/dist-esm/ChartInternal/shape/core/bubble.js +1 -1
- package/dist-esm/ChartInternal/shape/core/candlestick.js +1 -1
- package/dist-esm/ChartInternal/shape/core/dataRegion.js +1 -1
- package/dist-esm/ChartInternal/shape/core/geometry.js +1 -1
- package/dist-esm/ChartInternal/shape/core/path.js +1 -1
- package/dist-esm/ChartInternal/shape/core/point.js +1 -1
- package/dist-esm/ChartInternal/shape/core/treemap.js +1 -1
- package/dist-esm/ChartInternal/shape/funnel.js +1 -1
- package/dist-esm/ChartInternal/shape/gauge.js +1 -1
- package/dist-esm/ChartInternal/shape/line.js +1 -1
- package/dist-esm/ChartInternal/shape/point.js +1 -1
- package/dist-esm/ChartInternal/shape/polar.js +1 -1
- package/dist-esm/ChartInternal/shape/radar.js +1 -1
- package/dist-esm/ChartInternal/shape/shape.js +6 -4
- package/dist-esm/ChartInternal/shape/treemap.js +1 -1
- package/dist-esm/canvas/CanvasAxisRenderer.js +1 -1
- package/dist-esm/canvas/CanvasEngine.js +18 -5
- package/dist-esm/canvas/CanvasPainter.js +1 -1
- package/dist-esm/canvas/CanvasRenderer.js +58 -35
- package/dist-esm/canvas/CanvasTheme.js +1 -1
- package/dist-esm/canvas/HitDetector.js +1 -1
- package/dist-esm/canvas/axisTicks.js +1 -1
- package/dist-esm/canvas/classes.js +1 -1
- package/dist-esm/canvas/color.js +1 -1
- package/dist-esm/canvas/geometry.js +1 -1
- package/dist-esm/canvas/labels.js +1 -1
- package/dist-esm/canvas/pointPattern.js +1 -1
- package/dist-esm/canvas/util.js +1 -1
- package/dist-esm/config/Options/Options.js +1 -1
- package/dist-esm/config/Options/axis/axis.js +1 -1
- package/dist-esm/config/Options/axis/x.js +1 -1
- package/dist-esm/config/Options/axis/y.js +1 -1
- package/dist-esm/config/Options/axis/y2.js +1 -13
- package/dist-esm/config/Options/common/boost.js +1 -1
- package/dist-esm/config/Options/common/color.js +1 -1
- package/dist-esm/config/Options/common/grid.js +1 -1
- package/dist-esm/config/Options/common/legend.js +1 -1
- package/dist-esm/config/Options/common/main.js +1 -1
- package/dist-esm/config/Options/common/point.js +1 -1
- package/dist-esm/config/Options/common/title.js +1 -1
- package/dist-esm/config/Options/common/tooltip.js +1 -1
- package/dist-esm/config/Options/data/axis.js +1 -1
- package/dist-esm/config/Options/data/data.js +1 -1
- package/dist-esm/config/Options/data/selection.js +1 -1
- package/dist-esm/config/Options/interaction/interaction.js +1 -1
- package/dist-esm/config/Options/interaction/subchart.js +1 -1
- package/dist-esm/config/Options/interaction/zoom.js +1 -1
- package/dist-esm/config/Options/shape/arc.js +1 -1
- package/dist-esm/config/Options/shape/area.js +1 -1
- package/dist-esm/config/Options/shape/bar.js +1 -1
- package/dist-esm/config/Options/shape/bubble.js +1 -1
- package/dist-esm/config/Options/shape/candlestick.js +1 -1
- package/dist-esm/config/Options/shape/donut.js +1 -1
- package/dist-esm/config/Options/shape/funnel.js +1 -1
- package/dist-esm/config/Options/shape/gauge.js +1 -1
- package/dist-esm/config/Options/shape/line.js +1 -1
- package/dist-esm/config/Options/shape/pie.js +1 -1
- package/dist-esm/config/Options/shape/polar.js +1 -1
- package/dist-esm/config/Options/shape/radar.js +1 -1
- package/dist-esm/config/Options/shape/scatter.js +1 -1
- package/dist-esm/config/Options/shape/spline.js +1 -1
- package/dist-esm/config/Options/shape/treemap.js +1 -1
- package/dist-esm/config/Store/Element.js +1 -1
- package/dist-esm/config/Store/State.js +1 -1
- package/dist-esm/config/Store/Store.js +1 -1
- package/dist-esm/config/classes.js +1 -1
- package/dist-esm/config/config.js +1 -1
- package/dist-esm/config/const.js +17 -2
- package/dist-esm/config/resolver/axis.core.js +1 -1
- package/dist-esm/config/resolver/axis.js +1 -1
- package/dist-esm/config/resolver/canvas.js +1 -1
- package/dist-esm/config/resolver/canvasShape.js +1 -1
- package/dist-esm/config/resolver/category.js +1 -1
- package/dist-esm/config/resolver/export.js +1 -1
- package/dist-esm/config/resolver/flow.js +1 -1
- package/dist-esm/config/resolver/grid.js +1 -1
- package/dist-esm/config/resolver/interaction/selection.js +1 -1
- package/dist-esm/config/resolver/interaction/subchart.js +1 -1
- package/dist-esm/config/resolver/interaction/zoom.js +1 -1
- package/dist-esm/config/resolver/regions.js +1 -1
- package/dist-esm/config/resolver/shape/arc.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/area.js +1 -1
- package/dist-esm/config/resolver/shape/axis.helpers.js +1 -1
- package/dist-esm/config/resolver/shape/bar.js +1 -1
- package/dist-esm/config/resolver/shape/bubble.js +1 -1
- package/dist-esm/config/resolver/shape/candlestick.js +1 -1
- package/dist-esm/config/resolver/shape/donut.js +1 -1
- package/dist-esm/config/resolver/shape/funnel.js +1 -1
- package/dist-esm/config/resolver/shape/gauge.js +1 -1
- package/dist-esm/config/resolver/shape/line.js +1 -1
- package/dist-esm/config/resolver/shape/pie.js +1 -1
- package/dist-esm/config/resolver/shape/polar.js +1 -1
- package/dist-esm/config/resolver/shape/radar.js +1 -1
- package/dist-esm/config/resolver/shape/scatter.js +1 -1
- package/dist-esm/config/resolver/shape/treemap.js +1 -1
- package/dist-esm/core.js +3 -3
- package/dist-esm/index.canvas.js +2 -1
- package/dist-esm/index.esm.js +2 -1
- package/dist-esm/module/Cache.js +1 -1
- package/dist-esm/module/browser.js +1 -1
- package/dist-esm/module/dsv.js +1 -1
- package/dist-esm/module/error.js +16 -3
- package/dist-esm/module/generator.js +1 -1
- package/dist-esm/module/sanitize.js +14 -18
- package/dist-esm/module/util/brush.js +1 -1
- package/dist-esm/module/util/dom.js +1 -1
- package/dist-esm/module/util/object.js +7 -4
- package/dist-esm/module/util/type-checks.js +1 -1
- package/dist-esm/module/worker.js +32 -22
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +32 -21
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +37 -11
- package/src/ChartInternal/Axis/AxisRenderer.ts +179 -105
- package/src/ChartInternal/ChartInternal.ts +11 -3
- package/src/ChartInternal/interactions/eventrect.ts +3 -1
- package/src/ChartInternal/shape/shape.ts +5 -3
- package/src/Plugin/tableview/Options.ts +17 -1
- package/src/Plugin/tableview/index.ts +1 -1
- package/src/canvas/CanvasEngine.ts +18 -5
- package/src/canvas/CanvasRenderer.ts +71 -36
- package/src/config/Options/axis/y2.ts +0 -13
- package/src/module/sanitize.ts +13 -20
- package/src/module/util/object.ts +4 -2
- package/src/module/worker.ts +34 -24
- package/types/index.d.ts +0 -3
- package/types/plugin/tableview/options.d.ts +5 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -198,7 +198,7 @@ class Plugin {
|
|
|
198
198
|
});
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
__publicField(Plugin, "version", "4.0.0
|
|
201
|
+
__publicField(Plugin, "version", "4.0.0");
|
|
202
202
|
|
|
203
203
|
;// ./src/Plugin/bubblecompare/index.ts
|
|
204
204
|
var bubblecompare_defProp = Object.defineProperty;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(a,c){typeof exports=="object"&&typeof module=="object"?module.exports=c(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],c):typeof exports=="object"?exports.bb=c(require("d3-selection")):(a.bb=a.bb||{},a.bb.plugin=a.bb.plugin||{},a.bb.plugin.bubblecompare=c(a.d3))})(this,function(f){return(function(){"use strict";var a={747:(function(e){e.exports=f})},c={};function u(e){var t=c[e];if(t!==void 0)return t.exports;var n=c[e]={exports:{}};return a[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 l={};u.d(l,{default:function(){return M}});var g=u(747);const q=e=>e||e===0,A=e=>typeof e=="function",y=e=>typeof e=="string"
|
|
11
|
+
*/(function(a,c){typeof exports=="object"&&typeof module=="object"?module.exports=c(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],c):typeof exports=="object"?exports.bb=c(require("d3-selection")):(a.bb=a.bb||{},a.bb.plugin=a.bb.plugin||{},a.bb.plugin.bubblecompare=c(a.d3))})(this,function(f){return(function(){"use strict";var a={747:(function(e){e.exports=f})},c={};function u(e){var t=c[e];if(t!==void 0)return t.exports;var n=c[e]={exports:{}};return a[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 l={};u.d(l,{default:function(){return M}});var g=u(747);const q=e=>e||e===0,A=e=>typeof e=="function",y=e=>typeof e=="string",$=e=>typeof e=="number",x=e=>typeof e=="undefined",v=e=>typeof e!="undefined",z=e=>typeof e=="boolean",L=e=>Math.ceil(e/10)*10,S=e=>Math.ceil(e)+.5,U=e=>e[1]-e[0],p=e=>typeof e=="object",B=e=>{for(const t in e)return!1;return!0},C=e=>x(e)||e===null||y(e)&&e.length===0||p(e)&&!(e instanceof Date)&&B(e)||$(e)&&isNaN(e),V=e=>!C(e),P=e=>Array.isArray(e),H=e=>e&&!(e!=null&&e.nodeType)&&p(e)&&!P(e);function R(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&p(n)&&s in n)return n=n[s],o();if(!s)return n};Object.keys(t).forEach(s=>{n=e,r=s.split("_"),i=o(),v(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var w=Object.defineProperty,O=(e,t,n)=>t in e?w(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,b=(e,t,n)=>O(e,typeof t!="symbol"?t+"":t,n);class d{constructor(t={}){b(this,"$$"),b(this,"options"),b(this,"config"),this.options=t}loadConfig(){R.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}b(d,"version","4.0.0");var D=Object.defineProperty,E=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,j=(e,t,n)=>E(e,typeof t!="symbol"?t+"":t,n);const h=class m extends d{constructor(t){return super(t),this}$init(){const{$$:t}=this;t.findClosest=this.findClosest.bind(this),t.getBubbleR=this.getBubbleR.bind(this),t.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(t){const n=this.getBubbleR(t),{expandScale:r=1}=this.options;return m.raiseFocusedBubbleLayer(t),this.changeCursorPoint(),n*r}static raiseFocusedBubbleLayer(t){t.raise&&(0,g.select)(t.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(t,n){const{$$:r}=this;return t.filter(i=>i&&!r.isBarType(i.id)).reduce((i,o)=>r.dist(o,n)<this.getBubbleR(o)?o:i,0)}getBubbleR(t){const{minR:n,maxR:r}=this.options,i=this.getZData(t);if(!i)return n;const[o,s]=this.$$.data.targets.reduce(([F,Z],T)=>{const _=this.getZData(T.values[0]);return[Math.min(F,_),Math.max(Z,_)]},[1e4,0]),N=o>0&&s===o?0:i/s;return Math.abs(N)*(r-n)+n}getZData(t){return this.$$.isBubbleZType(t)?this.$$.getBubbleZData(t.value,"z"):t.value}};j(h,"version","0.0.1");let M=h;return l=l.default,l})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -473,7 +473,7 @@ const DANGEROUS_CSS_PATTERNS = [
|
|
|
473
473
|
"-moz-binding:"
|
|
474
474
|
];
|
|
475
475
|
function decodeHTMLEntities(str) {
|
|
476
|
-
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+)
|
|
476
|
+
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
|
|
477
477
|
}
|
|
478
478
|
function isSafeURI(uri) {
|
|
479
479
|
const decoded = decodeHTMLEntities(uri).trim();
|
|
@@ -481,15 +481,11 @@ function isSafeURI(uri) {
|
|
|
481
481
|
if (!normalized || normalized.startsWith("#")) {
|
|
482
482
|
return true;
|
|
483
483
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const colonIndex = normalized.indexOf(":");
|
|
488
|
-
if (colonIndex > 0) {
|
|
489
|
-
const protocol = normalized.substring(0, colonIndex + 1);
|
|
490
|
-
return ALLOWED_URI_PROTOCOLS.has(protocol);
|
|
484
|
+
const schemeMatch = normalized.match(/^[^/?#]*:/);
|
|
485
|
+
if (schemeMatch) {
|
|
486
|
+
return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);
|
|
491
487
|
}
|
|
492
|
-
return
|
|
488
|
+
return true;
|
|
493
489
|
}
|
|
494
490
|
function sanitizeStyleValue(style) {
|
|
495
491
|
const decoded = decodeHTMLEntities(style);
|
|
@@ -669,7 +665,7 @@ var object_spreadValues = (a, b) => {
|
|
|
669
665
|
function _forEachValidItem(items, callback) {
|
|
670
666
|
for (let i = 0; i < items.length; i++) {
|
|
671
667
|
const item = items[i];
|
|
672
|
-
if (item) {
|
|
668
|
+
if (item !== null && isDefined(item)) {
|
|
673
669
|
callback(item, i);
|
|
674
670
|
}
|
|
675
671
|
}
|
|
@@ -749,7 +745,9 @@ function mergeObj(target, ...objectN) {
|
|
|
749
745
|
Object.keys(source).forEach((key) => {
|
|
750
746
|
if (!/^(__proto__|constructor|prototype)$/i.test(key)) {
|
|
751
747
|
const value = source[key];
|
|
752
|
-
if (
|
|
748
|
+
if (value instanceof Date) {
|
|
749
|
+
target[key] = new Date(value.getTime());
|
|
750
|
+
} else if (isObject(value)) {
|
|
753
751
|
!target[key] && (target[key] = {});
|
|
754
752
|
target[key] = mergeObj(target[key], value);
|
|
755
753
|
} else {
|
|
@@ -1218,7 +1216,7 @@ class Plugin {
|
|
|
1218
1216
|
});
|
|
1219
1217
|
}
|
|
1220
1218
|
}
|
|
1221
|
-
__publicField(Plugin, "version", "4.0.0
|
|
1219
|
+
__publicField(Plugin, "version", "4.0.0");
|
|
1222
1220
|
|
|
1223
1221
|
;// ./src/Plugin/sparkline/Options.ts
|
|
1224
1222
|
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 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(f,d){typeof exports=="object"&&typeof module=="object"?module.exports=d(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],d):typeof exports=="object"?exports.bb=d(require("d3-selection")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.sparkline=d(f.d3))})(this,function(w){return(function(){"use strict";var f={747:(function(e){e.exports=w})},d={};function h(e){var t=d[e];if(t!==void 0)return t.exports;var n=d[e]={exports:{}};return f[e](n,n.exports,h),n.exports}(function(){h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var g={};h.d(g,{default:function(){return
|
|
11
|
+
*/(function(f,d){typeof exports=="object"&&typeof module=="object"?module.exports=d(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],d):typeof exports=="object"?exports.bb=d(require("d3-selection")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.sparkline=d(f.d3))})(this,function(w){return(function(){"use strict";var f={747:(function(e){e.exports=w})},d={};function h(e){var t=d[e];if(t!==void 0)return t.exports;var n=d[e]={exports:{}};return f[e](n,n.exports,h),n.exports}(function(){h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var g={};h.d(g,{default:function(){return X}});var U=Object.defineProperty,A=Object.getOwnPropertySymbols,Y=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable,C=(e,t,n)=>t in e?U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))Y.call(t,n)&&C(e,n,t[n]);if(A)for(var n of A(t))V.call(t,n)&&C(e,n,t[n]);return e};const P={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},G={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcLabelLineText:"bb-arc-label-line-text",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},z={area:"bb-area",areas:"bb-areas"},W={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},K={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},Z={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},J={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},Q={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},ee={dragarea:"bb-dragarea",INCLUDED:"_included_"},te={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},ne={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},re={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},ie={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},oe={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},se={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},ce={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},le={level:"bb-level",levels:"bb-levels"},ae={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},ue={region:"bb-region",regions:"bb-regions"},be={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},fe={shape:"bb-shape",shapes:"bb-shapes"},de={brush:"bb-brush",subchart:"bb-subchart"},he={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},pe={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},ge={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},me={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var Qe=c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c(c({},P),G),z),W),K),Z),J),Q),ee),ne),re),ie),oe),se),te),ce),le),ae),ue),be),fe),de),he),pe),ge),me),et=h(747);function ve(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function _e(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",r=o=>setTimeout(o,1),i=o=>clearTimeout(o);return[t?e.requestAnimationFrame:r,t?e.cancelAnimationFrame:i,n?e.requestIdleCallback:r,n?e.cancelIdleCallback:i]}const m=ve(),xe=m==null?void 0:m.document,[tt,nt,rt,it]=_e(m),ot=e=>e||e===0,st=e=>typeof e=="function",ye=e=>typeof e=="string",$e=e=>typeof e=="number",Ee=e=>typeof e=="undefined",Oe=e=>typeof e!="undefined",ct=e=>typeof e=="boolean",lt=e=>Math.ceil(e/10)*10,at=e=>Math.ceil(e)+.5,ut=e=>e[1]-e[0],_=e=>typeof e=="object",Te=e=>{for(const t in e)return!1;return!0},we=e=>Ee(e)||e===null||ye(e)&&e.length===0||_(e)&&!(e instanceof Date)&&Te(e)||$e(e)&&isNaN(e),bt=e=>!we(e),R=e=>Array.isArray(e),x=e=>e&&!(e!=null&&e.nodeType)&&_(e)&&!R(e);var Ae,Ce,I,Pe,S,j,Re,D,y,Ie=Object.defineProperty,L=Object.getOwnPropertySymbols,Se=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable,F=(e,t,n)=>t in e?Ie(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))Se.call(t,n)&&F(e,n,t[n]);if(L)for(var n of L(t))je.call(t,n)&&F(e,n,t[n]);return e};function B(e,t){for(let n=0;n<e.length;n++){const r=e[n];r!==null&&I(r)&&t(r,n)}}function ft(e,t,n){return I(e[t])?e[t]:n}function dt(e,t){for(const n in e)if(e[n]===t)return!0;return!1}function ht(e,t,...n){const r=Pe(e);return r&&e.call(t,...n),r}function pt(e,t){let n=0;const r=function(...i){!--n&&t.apply(this,i)};"duration"in e?e.each(()=>++n).on("end",r):(++n,e.call(r))}const gt=e=>e.charAt(0).toUpperCase()+e.slice(1);function mt(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const vt=e=>[].slice.call(e);function _t(...e){const t=n=>{if(S(n))return n.map(t);if(j(n)&&n.constructor){const r=new n.constructor;for(const i in n)r[i]=t(n[i]);return r}return n};return e.map(n=>t(n)).reduce((n,r)=>M(M({},n),r))}function De(e={},t){S(t)&&t.forEach(n=>De(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}function xt(e){const t=e[0]instanceof Date,n=Array.from(new Set(t?e.map(Number):e));return t?n.map(r=>new Date(r)):n}function yt(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function $(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return x(e)&&x(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];i instanceof Date?e[r]=new Date(i.getTime()):x(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=R(i)?i.concat():i}}),$(e,...t)}function Le(e,t=!0){let n;return e[0]instanceof Date?n=t?(r,i)=>r-i:(r,i)=>i-r:t&&!e.every(isNaN)?n=(r,i)=>r-i:t||(n=(r,i)=>r>i&&-1||r<i&&1||r===i&&0),e.concat().sort(n)}function $t(e,t){let n=t.filter(r=>Re(r));if(n.length)if(D(n[0])){let r=e==="min"?1/0:-1/0;for(const i of n)(e==="min"?i<r:i>r)&&(r=i);n=r}else n[0]instanceof Date&&(n=Le(n,e==="min")[0]);else n=void 0;return n}const Et=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let o=0;o<i;o++)r.push(e+o*n);return r};let Fe=0;function Ot(e=!0){const t=++Fe;return e?String(t):t}function N(e,t,n,r,i){if(n>r)return-1;const o=Math.floor((n+r)/2);let{x:s,w:l=0}=e[o];return i&&(s=e[o].y,l=e[o].h),t>=s&&t<=s+l?o:t<s?N(e,t,n,o-1,i):N(e,t,o+1,r,i)}function Tt(e,t){return Ce(e.replace(/\{=([^}]+)\}/g,(n,r)=>{var i;return(i=t[r])!=null?i:""}))}function wt(e){var t;let n;if(e instanceof Date)n=e;else if(y(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.data_xFormat)(e))!=null?t:new Date(e)}else D(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 At(e){if(j(e)&&!y(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(y(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,r=n,i=n,o=r]=t;return{top:n,right:r,bottom:i,left:o}}function Me(e,t){t()===!1?Ae(()=>Me(e,t)):e()}function Ct(e,t=(n=>n)){const n=new Set;return B(e,(r,i)=>{n.add(t(r,i))}),n}function Pt(e,t,n=(r=>r)){const r=new Map;return B(e,(i,o)=>{r.set(t(i,o),n(i,o))}),r}var Be,u,E,Ne,qe;const He=/\s?(bb-)/g,ke=/\.+/g;function Xe(e){return e.replace(He,".$1").replace(ke,".")}function q(e,t,n=!1){const r=o=>o[e?"getBoundingClientRect":"getBBox"](),i=e?"rectClient":"rectBBox";return n?r(t):!(i in t)||t.hasAttribute("width")&&t[i].width!==+(t.getAttribute("width")||0)?t[i]=r(t):t[i]}function Rt(e,t,n=[-1,1],r=!1){if(!(!e||!qe(t)))if(t.indexOf(`
|
|
12
12
|
`)===-1)e.text(t);else{const i=[e.text(),t].map(o=>o.replace(/[\s\n]/g,""));if(i[0]!==i[1]){const o=t.split(`
|
|
13
|
-
`),s=r?o.length-1:1;e.html(""),o.forEach((a
|
|
13
|
+
`),s=r?o.length-1:1;e.html(""),o.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*s:n[1]}em`).text(l)})}}}function Ue(e){const{x:t,y:n,width:r,height:i}=Ye(e,!0);return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function It(e){const{width:t,height:n}=O(e),r=Ue(e),i=r[0].x,o=Math.min(r[0].y,r[1].y);return{x:i,y:o,width:t,height:n}}function St(e,t){var n;const r=e&&((n=e.touches||e.sourceEvent&&e.sourceEvent.touches)==null?void 0:n[0]);let i=[0,0];try{i=Be(r||e,t)}catch(o){}return i.map(o=>isNaN(o)?0:o)}function O(e,t=!1){return q(!0,e,t)}function Ye(e,t=!1){return q(!1,e,t)}function jt(e,t,n){const{rootSelector:r="",sheet:i}=e,o=`${r} ${Xe(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](o,i.cssRules.length)}function Dt(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Ne(n.cssRules)))}catch(i){(r=u.console)==null||r.warn(`Error while reading rules from ${n.href}: ${String(i)}`)}}),t}function Lt(e){var t,n,r,i,o,s;return{x:((n=(t=u.pageXOffset)!=null?t:u.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((o=(i=u.pageYOffset)!=null?i:u.scrollY)!=null?o:0)+((s=e.scrollTop)!=null?s:0)}}function Ft(e,t=0,n=0,r=!0){const i=new DOMPoint(t,n),o=e.getScreenCTM(),s=i.matrixTransform(r?o==null?void 0:o.inverse():o);if(r===!1){const l=O(e);s.x-=l.x,s.y-=l.y}return s}function Ve(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 Mt(e,t){var n;const r=(n=e==null?void 0:e.getAttribute)==null?void 0:n.call(e,t);if(r)return parseFloat(r);const i=Ve(e);return t==="x"?i.e:i.f}function Bt(e){const t=e.attr("viewBox");return t?t.trim().split(/[\s,]+/).length===4:!1}function Nt(e,t,n=!1){const r=!!e.node;let i=!1;for(const[o,s]of Object.entries(t))if(i=r?e.style(o)===s:e.style[o]===s,n?!i:i)break;return i}function qt(){var e,t;return((e=E)==null?void 0:e.hidden)===!1||((t=E)==null?void 0:t.visibilityState)==="visible"}function Ht(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=u,o=r==null?void 0:r("(pointer:coarse)").matches;let s=!1;if(t)if(i&&"maxTouchPoints"in i)s=i.maxTouchPoints>0;else if("ontouchmove"in u||n&&E instanceof n)s=!0;else if(o)s=!0;else{const a=i.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!o&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function kt(e,t){e.pendingRaf!==null?(u.cancelAnimationFrame(e.pendingRaf),e.pendingRaf=u.requestAnimationFrame(()=>{e.pendingRaf=null,t()})):(e.pendingRaf=u.requestAnimationFrame(()=>{e.pendingRaf=null}),t())}const Xt={mouse:(()=>{const e=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(t,n,r=e())=>{t.dispatchEvent(new MouseEvent(n,r))}}catch(t){return(n,r,i=e())=>{const o=xe.createEvent("MouseEvent");o.initMouseEvent(r,i.bubbles,i.cancelable,m,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(o)}}})(),touch:(e,t,n)=>{const r=new Touch($({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:[r],targetTouches:[],changedTouches:[r]}))}};function Ge(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&_(n)&&s in n)return n=n[s],o();if(!s)return n};Object.keys(t).forEach(s=>{n=e,r=s.split("_"),i=o(),Oe(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var ze=Object.defineProperty,We=(e,t,n)=>t in e?ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>We(e,typeof t!="symbol"?t+"":t,n);class H{constructor(t={}){v(this,"$$"),v(this,"options"),v(this,"config"),this.options=t}loadConfig(){Ge.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}v(H,"version","4.0.0");class Ke{constructor(){return{selector:void 0}}}var Ze=Object.defineProperty,Je=(e,t,n)=>t in e?Ze(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,k=(e,t,n)=>Je(e,typeof t!="symbol"?t+"":t,n);class X extends H{constructor(t){return super(t),k(this,"element"),this.config=new Ke,this}$beforeInit(){this.loadConfig(),this.validate(),this.element=[].slice.call(document.querySelectorAll(this.config.selector)),this.overrideInternals(),this.overrideOptions(),this.overHandler=this.overHandler.bind(this),this.moveHandler=this.moveHandler.bind(this),this.outHandler=this.outHandler.bind(this)}validate(){const{$$:t,config:n}=this;let r="";if((!n.selector||!document.querySelector(n.selector))&&(r="No holder elements found from given selector option."),(t.hasType("bubble")||t.hasType("scatter")||t.hasArcType(t.data.targets))&&(r="Contains non supported chart types."),r)throw new Error(`[Sparkline plugin] ${r}`)}overrideInternals(){const{$$:t}=this,{getBarW:n,getIndices:r}=t;t.getIndices=function(i,o,s){return s==="getShapeX"?{}:r.call(this,i,o)},t.getBarW=function(i,o){return n.call(this,i,o,1)}}overrideOptions(){const{config:t}=this.$$;if(t.legend_show=!1,t.resize_auto=!1,t.axis_x_show=!1,t.padding!==!1){const n=r=>Object.keys(r||{}).length>0;n(t.axis_x_padding)&&(t.axis_x_padding={left:15,right:15,unit:"px"}),n(t.axis_y_padding)&&(t.axis_y_padding=5)}t.axis_y_show=!1,t.tooltip_position||(t.tooltip_position=function(n,r,i){const{internal:{state:{event:o}}}=this;let s=o.pageY-i*1.35,l=o.pageX-r/2;return s<0&&(s=0),l<0&&(l=0),{top:s,left:l}})}$init(){var t;const{$$:{$el:n}}=this;n.chart.style("width","0").style("height","0").style("pointer-events","none"),(t=n.tooltip)!=null&&t.node()&&document.body.appendChild(n.tooltip.node())}$afterInit(){const{$$:t}=this;t.$el.svg.attr("style",null).style("width","0").style("height","0"),this.bindEvents(!0)}bindEvents(t=!0){const{$$:{config:n}}=this;if(n.interaction_enabled&&n.tooltip_show){const r=`${t?"add":"remove"}EventListener`;this.element.forEach(i=>{const o=i.querySelector("svg");o[r]("mouseover",this.overHandler),o[r]("mousemove",this.moveHandler),o[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=O(t.target,!0)}moveHandler(t){var n,r,i,o;const{$$:s}=this,l=s.getDataIndexFromEvent(t),a=(n=s.api.data(t.target.__id))==null?void 0:n[0],b=(r=a==null?void 0:a.values)==null?void 0:r[l];b&&!b.name&&(b.name=b.id),s.state.event=t,(i=s.isPointFocusOnly)!=null&&i.call(s)&&b&&((o=s.showCircleFocus)==null||o.call(s,[b])),s.setExpand(l,a.id,!0),s.showTooltip([b],t.target)}outHandler(t){const{$$:n}=this;n.state.event=t,n.isPointFocusOnly()?n.hideCircleFocus():n.unexpandCircles(),n.hideTooltip()}$redraw(){var t;const{$$:n}=this,{$el:r}=n;let i=this.element;const o=n.api.data(),s=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(i.length<o.length){const l=r.chart.node();for(let a=o.length-i.length;a>0;a--)l.parentNode.insertBefore(i[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),i=this.element}o.map(l=>l.id).forEach((l,a)=>{const b=`.${P.target}-${l}`,T=r.main.selectAll(b);let p=i[a].querySelector("svg");p||(i[a].innerHTML=`${s}</svg>`,p=i[a].querySelector("svg"),p.__id=l),p.querySelector(b)||T.style("opacity",null),T.style("fill","none").style("opacity",null),p.innerHTML="",p.appendChild(T.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return k(X,"version","0.0.1"),g=g.default,g})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -408,7 +408,7 @@ class Plugin {
|
|
|
408
408
|
});
|
|
409
409
|
}
|
|
410
410
|
}
|
|
411
|
-
__publicField(Plugin, "version", "4.0.0
|
|
411
|
+
__publicField(Plugin, "version", "4.0.0");
|
|
412
412
|
|
|
413
413
|
// EXTERNAL MODULE: external {"commonjs":"d3-axis","commonjs2":"d3-axis","amd":"d3-axis","root":"d3"}
|
|
414
414
|
var external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_ = __webpack_require__(6);
|
|
@@ -622,7 +622,7 @@ const DANGEROUS_CSS_PATTERNS = [
|
|
|
622
622
|
"-moz-binding:"
|
|
623
623
|
];
|
|
624
624
|
function decodeHTMLEntities(str) {
|
|
625
|
-
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+)
|
|
625
|
+
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
|
|
626
626
|
}
|
|
627
627
|
function isSafeURI(uri) {
|
|
628
628
|
const decoded = decodeHTMLEntities(uri).trim();
|
|
@@ -630,15 +630,11 @@ function isSafeURI(uri) {
|
|
|
630
630
|
if (!normalized || normalized.startsWith("#")) {
|
|
631
631
|
return true;
|
|
632
632
|
}
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
const colonIndex = normalized.indexOf(":");
|
|
637
|
-
if (colonIndex > 0) {
|
|
638
|
-
const protocol = normalized.substring(0, colonIndex + 1);
|
|
639
|
-
return ALLOWED_URI_PROTOCOLS.has(protocol);
|
|
633
|
+
const schemeMatch = normalized.match(/^[^/?#]*:/);
|
|
634
|
+
if (schemeMatch) {
|
|
635
|
+
return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);
|
|
640
636
|
}
|
|
641
|
-
return
|
|
637
|
+
return true;
|
|
642
638
|
}
|
|
643
639
|
function sanitizeStyleValue(style) {
|
|
644
640
|
const decoded = decodeHTMLEntities(style);
|
|
@@ -794,7 +790,7 @@ var object_spreadValues = (a, b) => {
|
|
|
794
790
|
function _forEachValidItem(items, callback) {
|
|
795
791
|
for (let i = 0; i < items.length; i++) {
|
|
796
792
|
const item = items[i];
|
|
797
|
-
if (item) {
|
|
793
|
+
if (item !== null && isDefined(item)) {
|
|
798
794
|
callback(item, i);
|
|
799
795
|
}
|
|
800
796
|
}
|
|
@@ -874,7 +870,9 @@ function mergeObj(target, ...objectN) {
|
|
|
874
870
|
Object.keys(source).forEach((key) => {
|
|
875
871
|
if (!/^(__proto__|constructor|prototype)$/i.test(key)) {
|
|
876
872
|
const value = source[key];
|
|
877
|
-
if (
|
|
873
|
+
if (value instanceof Date) {
|
|
874
|
+
target[key] = new Date(value.getTime());
|
|
875
|
+
} else if (isObject(value)) {
|
|
878
876
|
!target[key] && (target[key] = {});
|
|
879
877
|
target[key] = mergeObj(target[key], value);
|
|
880
878
|
} else {
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(f,_){typeof exports=="object"&&typeof module=="object"?module.exports=_(require("d3-interpolate"),require("d3-scale"),require("d3-axis"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-interpolate","d3-scale","d3-axis","d3-selection"],_):typeof exports=="object"?exports.bb=_(require("d3-interpolate"),require("d3-scale"),require("d3-axis"),require("d3-selection")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=_(f.d3,f.d3,f.d3,f.d3))})(this,function(T,f,_,et){return(function(){"use strict";var nt={996:(function(t){t.exports=_}),798:(function(t){t.exports=T}),455:(function(t){t.exports=f}),747:(function(t){t.exports=et})},L={};function p(t){var e=L[t];if(e!==void 0)return e.exports;var n=L[t]={exports:{}};return nt[t](n,n.exports,p),n.exports}(function(){p.d=function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(function(){p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}})();var y={};p.d(y,{default:function(){return Se}});var ot=p(798),S=p(455),rt=Object.defineProperty,j=Object.getOwnPropertySymbols,st=Object.prototype.hasOwnProperty,it=Object.prototype.propertyIsEnumerable,I=(t,e,n)=>e in t?rt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))st.call(e,n)&&I(t,n,e[n]);if(j)for(var n of j(e))it.call(e,n)&&I(t,n,e[n]);return t};const at={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},ct={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcLabelLineText:"bb-arc-label-line-text",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},lt={area:"bb-area",areas:"bb-areas"},ut={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},bt={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},dt={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ft={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},pt={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},ht={dragarea:"bb-dragarea",INCLUDED:"_included_"},gt={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},mt={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},xt={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},_t={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},yt={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},vt={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},$t={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},Et={level:"bb-level",levels:"bb-levels"},St={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},Ct={region:"bb-region",regions:"bb-regions"},wt={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},Rt={shape:"bb-shape",shapes:"bb-shapes"},Pt={brush:"bb-brush",subchart:"bb-subchart"},Ot={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},C={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},At={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Tt={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var we=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},at),ct),lt),ut),bt),dt),ft),pt),ht),mt),xt),_t),yt),vt),gt),$t),Et),St),Ct),wt),Rt),Pt),Ot),C),At),Tt);const Re=t=>t||t===0,F=t=>typeof t=="function",w=t=>typeof t=="string",M=t=>typeof t=="number",Lt=t=>typeof t=="undefined",jt=t=>typeof t!="undefined",Pe=t=>typeof t=="boolean",Oe=t=>Math.ceil(t/10)*10,Ae=t=>Math.ceil(t)+.5,Te=t=>t[1]-t[0],R=t=>typeof t=="object",It=t=>{for(const e in t)return!1;return!0},D=t=>Lt(t)||t===null||w(t)&&t.length===0||R(t)&&!(t instanceof Date)&&It(t)||M(t)&&isNaN(t),Le=t=>!D(t),N=t=>Array.isArray(t),P=t=>t&&!(t!=null&&t.nodeType)&&R(t)&&!N(t);function Ft(t){const e=this.config;let n,o,r;const s=()=>{const i=o.shift();if(i&&n&&R(n)&&i in n)return n=n[i],s();if(!i)return n};Object.keys(e).forEach(i=>{n=t,o=i.split("_"),r=s(),jt(r)&&(e[i]=r)}),this.api&&(this.state.orgConfig=t)}var Mt=Object.defineProperty,Dt=(t,e,n)=>e in t?Mt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,v=(t,e,n)=>Dt(t,typeof e!="symbol"?e+"":e,n);class B{constructor(e={}){v(this,"$$"),v(this,"options"),v(this,"config"),this.options=e}loadConfig(){Ft.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}v(B,"version","4.0.0-next.3");var Nt=p(996),h={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Bt,qt,Ut,Xt,q,U,Yt,Gt,X,Vt=Object.defineProperty,Y=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,G=(t,e,n)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,V=(t,e)=>{for(var n in e||(e={}))kt.call(e,n)&&G(t,n,e[n]);if(Y)for(var n of Y(e))zt.call(e,n)&&G(t,n,e[n]);return t};function k(t,e){for(let n=0;n<t.length;n++){const o=t[n];o&&e(o,n)}}function je(t,e,n){return Ut(t[e])?t[e]:n}function Ie(t,e){for(const n in t)if(t[n]===e)return!0;return!1}function Fe(t,e,...n){const o=Xt(t);return o&&t.call(e,...n),o}function Me(t,e){let n=0;const o=function(...r){!--n&&e.apply(this,r)};"duration"in t?t.each(()=>++n).on("end",o):(++n,t.call(o))}const De=t=>t.charAt(0).toUpperCase()+t.slice(1);function Ne(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Be=t=>[].slice.call(t);function qe(...t){const e=n=>{if(q(n))return n.map(e);if(U(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=e(n[r]);return o}return n};return t.map(n=>e(n)).reduce((n,o)=>V(V({},n),o))}function Ht(t={},e){q(e)&&e.forEach(n=>Ht(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}function Ue(t){const e=t[0]instanceof Date,n=Array.from(new Set(e?t.map(Number):t));return e?n.map(o=>new Date(o)):n}function Xe(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function O(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return P(t)&&P(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];P(r)?(!t[o]&&(t[o]={}),t[o]=O(t[o],r)):t[o]=N(r)?r.concat():r}}),O(t,...e)}function Kt(t,e=!0){let n;return t[0]instanceof Date?n=e?(o,r)=>o-r:(o,r)=>r-o:e&&!t.every(isNaN)?n=(o,r)=>o-r:e||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),t.concat().sort(n)}function Ye(t,e){let n=e.filter(o=>Yt(o));if(n.length)if(Gt(n[0])){let o=t==="min"?1/0:-1/0;for(const r of n)(t==="min"?r<o:r>o)&&(o=r);n=o}else n[0]instanceof Date&&(n=Kt(n,t==="min")[0]);else n=void 0;return n}const Wt=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=0;s<r;s++)o.push(t+s*n);return o};let Zt=0;function Ge(t=!0){const e=++Zt;return t?String(e):e}function z(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:i,w:a=0}=t[s];return r&&(i=t[s].y,a=t[s].h),e>=i&&e<=i+a?s:e<i?z(t,e,n,s-1,r):z(t,e,s+1,o,r)}function Ve(t,e){return qt(t.replace(/\{=([^}]+)\}/g,(n,o)=>{var r;return(r=e[o])!=null?r:""}))}function Jt(t){var e;let n;if(t instanceof Date)n=t;else if(w(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else M(t)&&!isNaN(t)&&(n=new Date(+t));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),n}function ke(t){if(U(t)&&!X(t)){const i=t;return{top:i.top||0,right:i.right||0,bottom:i.bottom||0,left:i.left||0}}const e=(X(t)?t.trim().split(/\s+/):[t]).map(i=>+i||0),[n,o=n,r=n,s=o]=e;return{top:n,right:o,bottom:r,left:s}}function Qt(t,e){e()===!1?Bt(()=>Qt(t,e)):t()}function ze(t,e=(n=>n)){const n=new Set;return k(t,(o,r)=>{n.add(e(o,r))}),n}function He(t,e,n=(o=>o)){const o=new Map;return k(t,(r,s)=>{o.set(e(r,s),n(r,s))}),o}var Ke=p(747);function te(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function ee(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",n=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[e?t.requestAnimationFrame:o,e?t.cancelAnimationFrame:r,n?t.requestIdleCallback:o,n?t.cancelIdleCallback:r]}const $=te(),ne=$==null?void 0:$.document,[We,Ze,Je,Qe]=ee($);var oe,g,A,re,se;const ie=/\s?(bb-)/g,ae=/\.+/g;function ce(t){return t.replace(ie,".$1").replace(ae,".")}function H(t,e,n=!1){const o=s=>s[t?"getBoundingClientRect":"getBBox"](),r=t?"rectClient":"rectBBox";return n?o(e):!(r in e)||e.hasAttribute("width")&&e[r].width!==+(e.getAttribute("width")||0)?e[r]=o(e):e[r]}function tn(t,e,n=[-1,1],o=!1){if(!(!t||!se(e)))if(e.indexOf(`
|
|
11
|
+
*/(function(f,_){typeof exports=="object"&&typeof module=="object"?module.exports=_(require("d3-interpolate"),require("d3-scale"),require("d3-axis"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-interpolate","d3-scale","d3-axis","d3-selection"],_):typeof exports=="object"?exports.bb=_(require("d3-interpolate"),require("d3-scale"),require("d3-axis"),require("d3-selection")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=_(f.d3,f.d3,f.d3,f.d3))})(this,function(T,f,_,nt){return(function(){"use strict";var ot={996:(function(t){t.exports=_}),798:(function(t){t.exports=T}),455:(function(t){t.exports=f}),747:(function(t){t.exports=nt})},L={};function p(t){var e=L[t];if(e!==void 0)return e.exports;var n=L[t]={exports:{}};return ot[t](n,n.exports,p),n.exports}(function(){p.d=function(t,e){for(var n in e)p.o(e,n)&&!p.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(function(){p.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}})();var v={};p.d(v,{default:function(){return Se}});var rt=p(798),S=p(455),st=Object.defineProperty,j=Object.getOwnPropertySymbols,it=Object.prototype.hasOwnProperty,at=Object.prototype.propertyIsEnumerable,I=(t,e,n)=>e in t?st(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))it.call(e,n)&&I(t,n,e[n]);if(j)for(var n of j(e))at.call(e,n)&&I(t,n,e[n]);return t};const ct={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},lt={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",arcLabelLineText:"bb-arc-label-line-text",arcRange:"bb-arc-range",arcs:"bb-arcs",chartArc:"bb-chart-arc",chartArcs:"bb-chart-arcs",chartArcsBackground:"bb-chart-arcs-background",chartArcsTitle:"bb-chart-arcs-title",needle:"bb-needle"},ut={area:"bb-area",areas:"bb-areas"},bt={axis:"bb-axis",axisX:"bb-axis-x",axisXLabel:"bb-axis-x-label",axisY:"bb-axis-y",axisY2:"bb-axis-y2",axisY2Label:"bb-axis-y2-label",axisYLabel:"bb-axis-y-label",axisXTooltip:"bb-axis-x-tooltip",axisYTooltip:"bb-axis-y-tooltip",axisY2Tooltip:"bb-axis-y2-tooltip",axisTooltipX:"bb-axis-tooltip-x",axisTooltipY:"bb-axis-tooltip-y"},dt={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},ft={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},pt={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},ht={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},gt={dragarea:"bb-dragarea",INCLUDED:"_included_"},mt={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},xt={chartArcsGaugeMax:"bb-chart-arcs-gauge-max",chartArcsGaugeMin:"bb-chart-arcs-gauge-min",chartArcsGaugeUnit:"bb-chart-arcs-gauge-unit",chartArcsGaugeTitle:"bb-chart-arcs-gauge-title",gaugeValue:"bb-gauge-value"},_t={legend:"bb-legend",legendBackground:"bb-legend-background",legendItem:"bb-legend-item",legendItemEvent:"bb-legend-item-event",legendItemHidden:"bb-legend-item-hidden",legendItemPoint:"bb-legend-item-point",legendItemTile:"bb-legend-item-tile"},vt={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},yt={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},$t={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},Et={grid:"bb-grid",gridLines:"bb-grid-lines",xgrid:"bb-xgrid",xgridLine:"bb-xgrid-line",xgridLines:"bb-xgrid-lines",xgrids:"bb-xgrids",ygrid:"bb-ygrid",ygridLine:"bb-ygrid-line",ygridLines:"bb-ygrid-lines",ygrids:"bb-ygrids"},St={level:"bb-level",levels:"bb-levels"},Ct={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},wt={region:"bb-region",regions:"bb-regions"},Rt={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},Pt={shape:"bb-shape",shapes:"bb-shapes"},Ot={brush:"bb-brush",subchart:"bb-subchart"},At={chartText:"bb-chart-text",chartTexts:"bb-chart-texts",text:"bb-text",texts:"bb-texts",title:"bb-title",textBorderRect:"bb-text-border",textLabelImage:"bb-text-label-image",TextOverlapping:"text-overlapping"},C={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Tt={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Lt={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var we=u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u(u({},ct),lt),ut),bt),dt),ft),pt),ht),gt),xt),_t),vt),yt),$t),mt),Et),St),Ct),wt),Rt),Pt),Ot),At),C),Tt),Lt);const Re=t=>t||t===0,D=t=>typeof t=="function",w=t=>typeof t=="string",F=t=>typeof t=="number",jt=t=>typeof t=="undefined",It=t=>typeof t!="undefined",Pe=t=>typeof t=="boolean",Oe=t=>Math.ceil(t/10)*10,Ae=t=>Math.ceil(t)+.5,Te=t=>t[1]-t[0],R=t=>typeof t=="object",Dt=t=>{for(const e in t)return!1;return!0},M=t=>jt(t)||t===null||w(t)&&t.length===0||R(t)&&!(t instanceof Date)&&Dt(t)||F(t)&&isNaN(t),Le=t=>!M(t),N=t=>Array.isArray(t),P=t=>t&&!(t!=null&&t.nodeType)&&R(t)&&!N(t);function Ft(t){const e=this.config;let n,o,r;const s=()=>{const i=o.shift();if(i&&n&&R(n)&&i in n)return n=n[i],s();if(!i)return n};Object.keys(e).forEach(i=>{n=t,o=i.split("_"),r=s(),It(r)&&(e[i]=r)}),this.api&&(this.state.orgConfig=t)}var Mt=Object.defineProperty,Nt=(t,e,n)=>e in t?Mt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,y=(t,e,n)=>Nt(t,typeof e!="symbol"?e+"":e,n);class B{constructor(e={}){y(this,"$$"),y(this,"options"),y(this,"config"),this.options=e}loadConfig(){Ft.call(this,this.options)}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}y(B,"version","4.0.0");var Bt=p(996),h={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},qt,Ut,q,Xt,U,X,Yt,Gt,Y,Vt=Object.defineProperty,G=Object.getOwnPropertySymbols,kt=Object.prototype.hasOwnProperty,zt=Object.prototype.propertyIsEnumerable,V=(t,e,n)=>e in t?Vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,k=(t,e)=>{for(var n in e||(e={}))kt.call(e,n)&&V(t,n,e[n]);if(G)for(var n of G(e))zt.call(e,n)&&V(t,n,e[n]);return t};function z(t,e){for(let n=0;n<t.length;n++){const o=t[n];o!==null&&q(o)&&e(o,n)}}function je(t,e,n){return q(t[e])?t[e]:n}function Ie(t,e){for(const n in t)if(t[n]===e)return!0;return!1}function De(t,e,...n){const o=Xt(t);return o&&t.call(e,...n),o}function Fe(t,e){let n=0;const o=function(...r){!--n&&e.apply(this,r)};"duration"in t?t.each(()=>++n).on("end",o):(++n,t.call(o))}const Me=t=>t.charAt(0).toUpperCase()+t.slice(1);function Ne(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Be=t=>[].slice.call(t);function qe(...t){const e=n=>{if(U(n))return n.map(e);if(X(n)&&n.constructor){const o=new n.constructor;for(const r in n)o[r]=e(n[r]);return o}return n};return t.map(n=>e(n)).reduce((n,o)=>k(k({},n),o))}function Ht(t={},e){U(e)&&e.forEach(n=>Ht(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}function Ue(t){const e=t[0]instanceof Date,n=Array.from(new Set(e?t.map(Number):t));return e?n.map(o=>new Date(o)):n}function Xe(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function O(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return P(t)&&P(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];r instanceof Date?t[o]=new Date(r.getTime()):P(r)?(!t[o]&&(t[o]={}),t[o]=O(t[o],r)):t[o]=N(r)?r.concat():r}}),O(t,...e)}function Kt(t,e=!0){let n;return t[0]instanceof Date?n=e?(o,r)=>o-r:(o,r)=>r-o:e&&!t.every(isNaN)?n=(o,r)=>o-r:e||(n=(o,r)=>o>r&&-1||o<r&&1||o===r&&0),t.concat().sort(n)}function Ye(t,e){let n=e.filter(o=>Yt(o));if(n.length)if(Gt(n[0])){let o=t==="min"?1/0:-1/0;for(const r of n)(t==="min"?r<o:r>o)&&(o=r);n=o}else n[0]instanceof Date&&(n=Kt(n,t==="min")[0]);else n=void 0;return n}const Wt=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=0;s<r;s++)o.push(t+s*n);return o};let Zt=0;function Ge(t=!0){const e=++Zt;return t?String(e):e}function H(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:i,w:a=0}=t[s];return r&&(i=t[s].y,a=t[s].h),e>=i&&e<=i+a?s:e<i?H(t,e,n,s-1,r):H(t,e,s+1,o,r)}function Ve(t,e){return Ut(t.replace(/\{=([^}]+)\}/g,(n,o)=>{var r;return(r=e[o])!=null?r:""}))}function Jt(t){var e;let n;if(t instanceof Date)n=t;else if(w(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else F(t)&&!isNaN(t)&&(n=new Date(+t));return(!n||isNaN(+n))&&console&&console.error&&console.error(`Failed to parse x '${t}' to Date object`),n}function ke(t){if(X(t)&&!Y(t)){const i=t;return{top:i.top||0,right:i.right||0,bottom:i.bottom||0,left:i.left||0}}const e=(Y(t)?t.trim().split(/\s+/):[t]).map(i=>+i||0),[n,o=n,r=n,s=o]=e;return{top:n,right:o,bottom:r,left:s}}function Qt(t,e){e()===!1?qt(()=>Qt(t,e)):t()}function ze(t,e=(n=>n)){const n=new Set;return z(t,(o,r)=>{n.add(e(o,r))}),n}function He(t,e,n=(o=>o)){const o=new Map;return z(t,(r,s)=>{o.set(e(r,s),n(r,s))}),o}var Ke=p(747);function te(){return typeof globalThis=="object"&&globalThis!==null&&globalThis.Object===Object&&globalThis||typeof self=="object"&&self!==null&&self.Object===Object&&self||Function("return this")()}function ee(t){const e=typeof(t==null?void 0:t.requestAnimationFrame)=="function"&&typeof(t==null?void 0:t.cancelAnimationFrame)=="function",n=typeof(t==null?void 0:t.requestIdleCallback)=="function"&&typeof(t==null?void 0:t.cancelIdleCallback)=="function",o=s=>setTimeout(s,1),r=s=>clearTimeout(s);return[e?t.requestAnimationFrame:o,e?t.cancelAnimationFrame:r,n?t.requestIdleCallback:o,n?t.cancelIdleCallback:r]}const $=te(),ne=$==null?void 0:$.document,[We,Ze,Je,Qe]=ee($);var oe,g,A,re,se;const ie=/\s?(bb-)/g,ae=/\.+/g;function ce(t){return t.replace(ie,".$1").replace(ae,".")}function K(t,e,n=!1){const o=s=>s[t?"getBoundingClientRect":"getBBox"](),r=t?"rectClient":"rectBBox";return n?o(e):!(r in e)||e.hasAttribute("width")&&e[r].width!==+(e.getAttribute("width")||0)?e[r]=o(e):e[r]}function tn(t,e,n=[-1,1],o=!1){if(!(!t||!se(e)))if(e.indexOf(`
|
|
12
12
|
`)===-1)t.text(e);else{const r=[t.text(),e].map(s=>s.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const s=e.split(`
|
|
13
|
-
`),i=o?s.length-1:1;t.html(""),s.forEach((a,b)=>{t.append("tspan").attr("x",0).attr("dy",`${b===0?n[0]*i:n[1]}em`).text(a)})}}}function le(t){const{x:e,y:n,width:o,height:r}=W(t,!0);return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function en(t){const{width:e,height:n}=K(t),o=le(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function nn(t,e){var n;const o=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=oe(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function K(t,e=!1){return H(!0,t,e)}function W(t,e=!1){return H(!1,t,e)}function on(t,e,n){const{rootSelector:o="",sheet:r}=t,s=`${o} ${ce(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function rn(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(re(n.cssRules)))}catch(r){(o=g.console)==null||o.warn(`Error while reading rules from ${n.href}: ${String(r)}`)}}),e}function sn(t){var e,n,o,r,s,i;return{x:((n=(e=g.pageXOffset)!=null?e:g.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=g.pageYOffset)!=null?r:g.scrollY)!=null?s:0)+((i=t.scrollTop)!=null?i:0)}}function an(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),i=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const a=K(t);i.x-=a.x,i.y-=a.y}return i}function ue(t){const e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function cn(t,e){var n;const o=(n=t==null?void 0:t.getAttribute)==null?void 0:n.call(t,e);if(o)return parseFloat(o);const r=ue(t);return e==="x"?r.e:r.f}function ln(t){const e=t.attr("viewBox");return e?e.trim().split(/[\s,]+/).length===4:!1}function un(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,i]of Object.entries(e))if(r=o?t.style(s)===i:t.style[s]===i,n?!r:r)break;return r}function bn(){var t,e;return((t=A)==null?void 0:t.hidden)===!1||((e=A)==null?void 0:e.visibilityState)==="visible"}function dn(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=g,s=o==null?void 0:o("(pointer:coarse)").matches;let i=!1;if(e)if(r&&"maxTouchPoints"in r)i=r.maxTouchPoints>0;else if("ontouchmove"in g||n&&A instanceof n)i=!0;else if(s)i=!0;else{const b=r.userAgent;i=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(b)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(b)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||i&&"touch"||"mouse"}function fn(t,e){t.pendingRaf!==null?(g.cancelAnimationFrame(t.pendingRaf),t.pendingRaf=g.requestAnimationFrame(()=>{t.pendingRaf=null,e()})):(t.pendingRaf=g.requestAnimationFrame(()=>{t.pendingRaf=null}),e())}const pn={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,n,o=t())=>{e.dispatchEvent(new MouseEvent(n,o))}}catch(e){return(n,o,r=t())=>{const s=ne.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,$,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(t,e,n)=>{const o=new Touch(O({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};var be=Object.defineProperty,de=(t,e,n)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Z=(t,e,n)=>de(t,typeof e!="symbol"?e+"":e,n);function fe(t){return t==="d"?e=>Math.round(e).toString():e=>String(e)}class pe{constructor(e){Z(this,"owner"),Z(this,"colorScale"),this.owner=e}drawColorScale(){const{$$:e,config:n}=this.owner,o=e.data.targets[0],r=e.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,i=5,a=Wt(n.padding_bottom,r,i),b=(0,S.scaleSequential)(o.colors).domain([a[a.length-1],a[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",h.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(a).enter().append("rect").attr("y",(x,Ce)=>Ce*i).attr("x",0).attr("width",s).attr("height",i).attr("fill",x=>b(x));const d=(0,S.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([a[0]+n.padding_top+a[a.length-1]+i-1,a[0]+n.padding_top]),c=(0,Nt.axisRight)(d),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):F(l)?c.tickFormat(l):c.tickFormat(fe("d"));const m=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&m.selectAll(".tick text").text(null).filter(x=>x/Math.pow(10,Math.ceil(Math.log(x)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(x=>Math.round(Math.log(x)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+W(this.colorScale.node(),!0).width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function he(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s].x,b=e[s].y,d=e[i].x,c=e[i].y;b>o!=c>o&&n<(d-a)*(o-b)/(c-b)+a&&(r=!r)}return r}function ge(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function me(t){let e=0,n,o;for(let r=0,s=t.length,i=s-1;r<s;i=r,r++)n=t[r],o=t[i],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function E(t){const e=me(t);let n=0,o=0,r;for(let s=0,i=t.length,a=i-1;s<i;a=s,s++){const b=t[s],d=t[a];r=b.x*d.y-d.x*b.y,n+=(b.x+d.x)*r,o+=(b.y+d.y)*r}return r=e*6,{x:n/r,y:o/r}}var xe=Object.defineProperty,_e=(t,e,n)=>e in t?xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ye=(t,e,n)=>_e(t,typeof e!="symbol"?e+"":e,n);class ve{constructor(e){ye(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",h.stanfordElements);n.append("g").attr("class",h.stanfordLines),n.append("g").attr("class",h.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,i=this.xvCustom.bind(n),a=this.yvCustom.bind(n),b=r.select(`.${h.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${h.stanfordLine}`).data(this.owner.config.lines);b.exit().transition().duration(e).style("opacity","0").remove();const d=b.enter().append("g");d.append("line").style("opacity","0"),d.merge(b).attr("class",c=>h.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?a(c,"y1"):i(c,"x1")).attr("x2",c=>s?a(c,"y2"):i(c,"x2")).attr("y1",c=>s?i(c,"x1"):a(c,"y1")).attr("y2",c=>s?i(c,"x2"):a(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,i=this.xvCustom.bind(n),a=this.yvCustom.bind(n),b=this.owner.countEpochsInRegion.bind(n);let d=r.select(`.${h.stanfordRegions}`).selectAll(`.${h.stanfordRegion}`).data(this.owner.config.regions);d.exit().transition().duration(e).style("opacity","0").remove();const c=d.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),d=c.merge(d),d.attr("class",l=>h.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(m=>[s?a(m,"y"):i(m,"x"),s?i(m,"x"):a(m,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),d.select("text").transition().duration(e).attr("x",l=>s?a(E(l.points),"y"):i(E(l.points),"x")).attr("y",l=>s?i(E(l.points),"x"):a(E(l.points),"y")).text(l=>{if(l.text){const{value:m,percentage:x}=b(l.points);return l.text(m,x)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(e=0){this.updateStanfordLines(e),this.updateStanfordRegions(e)}xvCustom(e,n){const o=this,{axis:r,config:s}=o;let i=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?i=Jt.call(o,i):r.isCategorized()&&w(i)&&(i=s.axis_x_categories.indexOf(e.value)),o.scale.x(i)}yvCustom(e,n){const o=this,r=e.axis&&e.axis==="y2"?o.scale.y2:o.scale.y,s=n?e[n]:o.getBaseValue(e);return r(s)}}class J{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var $e=Object.defineProperty,Ee=(t,e,n)=>e in t?$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Q=(t,e,n)=>Ee(t,typeof e!="symbol"?e+"":e,n);function tt(t,e,n,o=1){return{h:+t,s:+e,l:+n,opacity:+o}}class Se extends B{constructor(e){return super(e),Q(this,"colorScale"),Q(this,"elements"),this.config=new J,this}$beforeInit(){const{$$:e}=this;e.config.data_xSort=!1,e.isMultipleX=()=>!0,e.showGridFocus=()=>{},e.labelishData=o=>o.values,e.opacityForCircle=()=>1;const n=e.getCurrentPadding.bind(e);e.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:e}=this;this.loadConfig(),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new pe(this),this.elements=new ve(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),e.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(e){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(e)}getOptions(){return new J}convertData(){const e=this.$$.data.targets,n=this.options.epochs;e.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:e}=this,n=this.$$.data.targets[0];n.values.sort(ge);let o=1/0,r=-1/0;for(let s=0;s<n.values.length;s++){const i=n.values[s].epochs;i<o&&(o=i),i>r&&(r=i)}n.minEpochs=isNaN(e.scale_min)?o:e.scale_min,n.maxEpochs=isNaN(e.scale_max)?r:e.scale_max,n.colors=F(e.colors)?e.colors:(0,ot.interpolateHslLong)(tt(250,1,.5),tt(0,1,.5)),n.colorscale=(0,S.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;D(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:i}=e;let a=`<table class="${C.tooltip}"><tbody>`;return n.forEach(b=>{const{id:d="",value:c=0,epochs:l=0,x:m=""}=b;a+=`<tr>
|
|
13
|
+
`),i=o?s.length-1:1;t.html(""),s.forEach((a,b)=>{t.append("tspan").attr("x",0).attr("dy",`${b===0?n[0]*i:n[1]}em`).text(a)})}}}function le(t){const{x:e,y:n,width:o,height:r}=Z(t,!0);return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function en(t){const{width:e,height:n}=W(t),o=le(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function nn(t,e){var n;const o=t&&((n=t.touches||t.sourceEvent&&t.sourceEvent.touches)==null?void 0:n[0]);let r=[0,0];try{r=oe(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function W(t,e=!1){return K(!0,t,e)}function Z(t,e=!1){return K(!1,t,e)}function on(t,e,n){const{rootSelector:o="",sheet:r}=t,s=`${o} ${ce(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function rn(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(re(n.cssRules)))}catch(r){(o=g.console)==null||o.warn(`Error while reading rules from ${n.href}: ${String(r)}`)}}),e}function sn(t){var e,n,o,r,s,i;return{x:((n=(e=g.pageXOffset)!=null?e:g.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=g.pageYOffset)!=null?r:g.scrollY)!=null?s:0)+((i=t.scrollTop)!=null?i:0)}}function an(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),i=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const a=W(t);i.x-=a.x,i.y-=a.y}return i}function ue(t){const e=t?t.transform:null,n=e&&e.baseVal;return n&&n.numberOfItems?n.getItem(0).matrix:{a:0,b:0,c:0,d:0,e:0,f:0}}function cn(t,e){var n;const o=(n=t==null?void 0:t.getAttribute)==null?void 0:n.call(t,e);if(o)return parseFloat(o);const r=ue(t);return e==="x"?r.e:r.f}function ln(t){const e=t.attr("viewBox");return e?e.trim().split(/[\s,]+/).length===4:!1}function un(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,i]of Object.entries(e))if(r=o?t.style(s)===i:t.style[s]===i,n?!r:r)break;return r}function bn(){var t,e;return((t=A)==null?void 0:t.hidden)===!1||((e=A)==null?void 0:e.visibilityState)==="visible"}function dn(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=g,s=o==null?void 0:o("(pointer:coarse)").matches;let i=!1;if(e)if(r&&"maxTouchPoints"in r)i=r.maxTouchPoints>0;else if("ontouchmove"in g||n&&A instanceof n)i=!0;else if(s)i=!0;else{const b=r.userAgent;i=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(b)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(b)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||i&&"touch"||"mouse"}function fn(t,e){t.pendingRaf!==null?(g.cancelAnimationFrame(t.pendingRaf),t.pendingRaf=g.requestAnimationFrame(()=>{t.pendingRaf=null,e()})):(t.pendingRaf=g.requestAnimationFrame(()=>{t.pendingRaf=null}),e())}const pn={mouse:(()=>{const t=()=>({bubbles:!1,cancelable:!1,screenX:0,screenY:0,clientX:0,clientY:0});try{return new MouseEvent("t"),(e,n,o=t())=>{e.dispatchEvent(new MouseEvent(n,o))}}catch(e){return(n,o,r=t())=>{const s=ne.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,$,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),touch:(t,e,n)=>{const o=new Touch(O({identifier:Date.now(),target:t,radiusX:2.5,radiusY:2.5,rotationAngle:10,force:.5},n));t.dispatchEvent(new TouchEvent(e,{cancelable:!0,bubbles:!0,shiftKey:!0,touches:[o],targetTouches:[],changedTouches:[o]}))}};var be=Object.defineProperty,de=(t,e,n)=>e in t?be(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,J=(t,e,n)=>de(t,typeof e!="symbol"?e+"":e,n);function fe(t){return t==="d"?e=>Math.round(e).toString():e=>String(e)}class pe{constructor(e){J(this,"owner"),J(this,"colorScale"),this.owner=e}drawColorScale(){const{$$:e,config:n}=this.owner,o=e.data.targets[0],r=e.state.height-n.padding_bottom-n.padding_top,s=n.scale_width,i=5,a=Wt(n.padding_bottom,r,i),b=(0,S.scaleSequential)(o.colors).domain([a[a.length-1],a[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",h.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(a).enter().append("rect").attr("y",(x,Ce)=>Ce*i).attr("x",0).attr("width",s).attr("height",i).attr("fill",x=>b(x));const d=(0,S.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([a[0]+n.padding_top+a[a.length-1]+i-1,a[0]+n.padding_top]),c=(0,Bt.axisRight)(d),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):D(l)?c.tickFormat(l):c.tickFormat(fe("d"));const m=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&m.selectAll(".tick text").text(null).filter(x=>x/Math.pow(10,Math.ceil(Math.log(x)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(x=>Math.round(Math.log(x)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+Z(this.colorScale.node(),!0).width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function he(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,i=e.length-1;s<e.length;i=s++){const a=e[s].x,b=e[s].y,d=e[i].x,c=e[i].y;b>o!=c>o&&n<(d-a)*(o-b)/(c-b)+a&&(r=!r)}return r}function ge(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function me(t){let e=0,n,o;for(let r=0,s=t.length,i=s-1;r<s;i=r,r++)n=t[r],o=t[i],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function E(t){const e=me(t);let n=0,o=0,r;for(let s=0,i=t.length,a=i-1;s<i;a=s,s++){const b=t[s],d=t[a];r=b.x*d.y-d.x*b.y,n+=(b.x+d.x)*r,o+=(b.y+d.y)*r}return r=e*6,{x:n/r,y:o/r}}var xe=Object.defineProperty,_e=(t,e,n)=>e in t?xe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,ve=(t,e,n)=>_e(t,typeof e!="symbol"?e+"":e,n);class ye{constructor(e){ve(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",h.stanfordElements);n.append("g").attr("class",h.stanfordLines),n.append("g").attr("class",h.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,i=this.xvCustom.bind(n),a=this.yvCustom.bind(n),b=r.select(`.${h.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${h.stanfordLine}`).data(this.owner.config.lines);b.exit().transition().duration(e).style("opacity","0").remove();const d=b.enter().append("g");d.append("line").style("opacity","0"),d.merge(b).attr("class",c=>h.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?a(c,"y1"):i(c,"x1")).attr("x2",c=>s?a(c,"y2"):i(c,"x2")).attr("y1",c=>s?i(c,"x1"):a(c,"y1")).attr("y2",c=>s?i(c,"x2"):a(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,i=this.xvCustom.bind(n),a=this.yvCustom.bind(n),b=this.owner.countEpochsInRegion.bind(n);let d=r.select(`.${h.stanfordRegions}`).selectAll(`.${h.stanfordRegion}`).data(this.owner.config.regions);d.exit().transition().duration(e).style("opacity","0").remove();const c=d.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),d=c.merge(d),d.attr("class",l=>h.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(m=>[s?a(m,"y"):i(m,"x"),s?i(m,"x"):a(m,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),d.select("text").transition().duration(e).attr("x",l=>s?a(E(l.points),"y"):i(E(l.points),"x")).attr("y",l=>s?i(E(l.points),"x"):a(E(l.points),"y")).text(l=>{if(l.text){const{value:m,percentage:x}=b(l.points);return l.text(m,x)}return""}).attr("text-anchor","middle").attr("dominant-baseline","middle").transition().style("opacity",null)}updateStanfordElements(e=0){this.updateStanfordLines(e),this.updateStanfordRegions(e)}xvCustom(e,n){const o=this,{axis:r,config:s}=o;let i=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?i=Jt.call(o,i):r.isCategorized()&&w(i)&&(i=s.axis_x_categories.indexOf(e.value)),o.scale.x(i)}yvCustom(e,n){const o=this,r=e.axis&&e.axis==="y2"?o.scale.y2:o.scale.y,s=n?e[n]:o.getBaseValue(e);return r(s)}}class Q{constructor(){return{colors:void 0,epochs:[],lines:[],scale_min:void 0,scale_max:void 0,scale_width:20,scale_format:void 0,padding_top:0,padding_right:0,padding_bottom:0,padding_left:0,regions:[]}}}var $e=Object.defineProperty,Ee=(t,e,n)=>e in t?$e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,tt=(t,e,n)=>Ee(t,typeof e!="symbol"?e+"":e,n);function et(t,e,n,o=1){return{h:+t,s:+e,l:+n,opacity:+o}}class Se extends B{constructor(e){return super(e),tt(this,"colorScale"),tt(this,"elements"),this.config=new Q,this}$beforeInit(){const{$$:e}=this;e.config.data_xSort=!1,e.isMultipleX=()=>!0,e.showGridFocus=()=>{},e.labelishData=o=>o.values,e.opacityForCircle=()=>1;const n=e.getCurrentPadding.bind(e);e.getCurrentPadding=()=>{const o=n();return o.right+=this.colorScale?this.colorScale.getColorScalePadding():0,o}}$init(){const{$$:e}=this;this.loadConfig(),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new pe(this),this.elements=new ye(this),this.convertData(),this.initStanfordData(),this.setStanfordTooltip(),this.colorScale.drawColorScale(),e.right+=this.colorScale?this.colorScale.getColorScalePadding():0,this.$redraw()}$redraw(e){var n,o;(n=this.colorScale)==null||n.drawColorScale(),(o=this.elements)==null||o.updateStanfordElements(e)}getOptions(){return new Q}convertData(){const e=this.$$.data.targets,n=this.options.epochs;e.forEach(o=>{o.values.forEach((r,s)=>{r.epochs=n[s]}),o.minEpochs=void 0,o.maxEpochs=void 0,o.colors=void 0,o.colorscale=void 0})}initStanfordData(){const{config:e}=this,n=this.$$.data.targets[0];n.values.sort(ge);let o=1/0,r=-1/0;for(let s=0;s<n.values.length;s++){const i=n.values[s].epochs;i<o&&(o=i),i>r&&(r=i)}n.minEpochs=isNaN(e.scale_min)?o:e.scale_min,n.maxEpochs=isNaN(e.scale_max)?r:e.scale_max,n.colors=D(e.colors)?e.colors:(0,rt.interpolateHslLong)(et(250,1,.5),et(0,1,.5)),n.colorscale=(0,S.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;M(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:i}=e;let a=`<table class="${C.tooltip}"><tbody>`;return n.forEach(b=>{const{id:d="",value:c=0,epochs:l=0,x:m=""}=b;a+=`<tr>
|
|
14
14
|
<th>${i||""}</th>
|
|
15
15
|
<th class="value">${o(m)}</th>
|
|
16
16
|
</tr>
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
<tr class="${C.tooltipName}-${d}">
|
|
22
22
|
<td class="name"><span style="background-color:${s(b)}"></span>Epochs</td>
|
|
23
23
|
<td class="value">${r(l)}</td>
|
|
24
|
-
</tr>`}),`${a}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((i,a)=>i+Number(a.epochs),0),s=o.values.reduce((i,a)=>he(a,e)?i+Number(a.epochs):i,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return
|
|
24
|
+
</tr>`}),`${a}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((i,a)=>i+Number(a.epochs),0),s=o.values.reduce((i,a)=>he(a,e)?i+Number(a.epochs):i,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return v=v.default,v})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 4.0.0
|
|
8
|
+
* @version 4.0.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -250,7 +250,7 @@ const DANGEROUS_CSS_PATTERNS = [
|
|
|
250
250
|
"-moz-binding:"
|
|
251
251
|
];
|
|
252
252
|
function decodeHTMLEntities(str) {
|
|
253
|
-
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+)
|
|
253
|
+
return str.replace(/:/gi, ":").replace(/&newline;/gi, "\n").replace(/&tab;/gi, " ").replace(/ /gi, " ").replace(/</gi, "<").replace(/>/gi, ">").replace(/&/gi, "&").replace(/"/gi, '"').replace(/'/gi, "'").replace(/&#(\d+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 10))).replace(/&#x([0-9a-f]+);?/gi, (_, code) => String.fromCharCode(parseInt(code, 16)));
|
|
254
254
|
}
|
|
255
255
|
function isSafeURI(uri) {
|
|
256
256
|
const decoded = decodeHTMLEntities(uri).trim();
|
|
@@ -258,15 +258,11 @@ function isSafeURI(uri) {
|
|
|
258
258
|
if (!normalized || normalized.startsWith("#")) {
|
|
259
259
|
return true;
|
|
260
260
|
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const colonIndex = normalized.indexOf(":");
|
|
265
|
-
if (colonIndex > 0) {
|
|
266
|
-
const protocol = normalized.substring(0, colonIndex + 1);
|
|
267
|
-
return ALLOWED_URI_PROTOCOLS.has(protocol);
|
|
261
|
+
const schemeMatch = normalized.match(/^[^/?#]*:/);
|
|
262
|
+
if (schemeMatch) {
|
|
263
|
+
return ALLOWED_URI_PROTOCOLS.has(schemeMatch[0]);
|
|
268
264
|
}
|
|
269
|
-
return
|
|
265
|
+
return true;
|
|
270
266
|
}
|
|
271
267
|
function sanitizeStyleValue(style) {
|
|
272
268
|
const decoded = decodeHTMLEntities(style);
|
|
@@ -446,7 +442,7 @@ var __spreadValues = (a, b) => {
|
|
|
446
442
|
function _forEachValidItem(items, callback) {
|
|
447
443
|
for (let i = 0; i < items.length; i++) {
|
|
448
444
|
const item = items[i];
|
|
449
|
-
if (item) {
|
|
445
|
+
if (item !== null && isDefined(item)) {
|
|
450
446
|
callback(item, i);
|
|
451
447
|
}
|
|
452
448
|
}
|
|
@@ -526,7 +522,9 @@ function mergeObj(target, ...objectN) {
|
|
|
526
522
|
Object.keys(source).forEach((key) => {
|
|
527
523
|
if (!/^(__proto__|constructor|prototype)$/i.test(key)) {
|
|
528
524
|
const value = source[key];
|
|
529
|
-
if (
|
|
525
|
+
if (value instanceof Date) {
|
|
526
|
+
target[key] = new Date(value.getTime());
|
|
527
|
+
} else if (isObject(value)) {
|
|
530
528
|
!target[key] && (target[key] = {});
|
|
531
529
|
target[key] = mergeObj(target[key], value);
|
|
532
530
|
} else {
|
|
@@ -745,7 +743,7 @@ class Plugin {
|
|
|
745
743
|
});
|
|
746
744
|
}
|
|
747
745
|
}
|
|
748
|
-
__publicField(Plugin, "version", "4.0.0
|
|
746
|
+
__publicField(Plugin, "version", "4.0.0");
|
|
749
747
|
|
|
750
748
|
;// ./src/Plugin/tableview/const.ts
|
|
751
749
|
|
|
@@ -881,7 +879,22 @@ class Options {
|
|
|
881
879
|
* @example
|
|
882
880
|
* nullString: "N/A"
|
|
883
881
|
*/
|
|
884
|
-
nullString: "-"
|
|
882
|
+
nullString: "-",
|
|
883
|
+
/**
|
|
884
|
+
* Set number format function.
|
|
885
|
+
* @name numberFormat
|
|
886
|
+
* @memberof plugin-tableview
|
|
887
|
+
* @type {function}
|
|
888
|
+
* @returns {string}
|
|
889
|
+
* @default function(v) { // will return formatted value according to locale settings }
|
|
890
|
+
* @example
|
|
891
|
+
* numberFormat: function(v) {
|
|
892
|
+
* return v.toLocaleString();
|
|
893
|
+
* }
|
|
894
|
+
*/
|
|
895
|
+
numberFormat: function(v) {
|
|
896
|
+
return v.toLocaleString();
|
|
897
|
+
}
|
|
885
898
|
};
|
|
886
899
|
}
|
|
887
900
|
}
|
|
@@ -969,7 +982,7 @@ class TableView extends Plugin {
|
|
|
969
982
|
rows.forEach((v) => {
|
|
970
983
|
tbody += `<tr>${v.map(
|
|
971
984
|
(d, i) => tplProcess(i ? tpl.tbody : tpl.tbodyHeader, {
|
|
972
|
-
value: i === 0 ? config.categoryFormat.bind(this)(d) : isNumber(d) ?
|
|
985
|
+
value: i === 0 ? config.categoryFormat.bind(this)(d) : isNumber(d) ? config.numberFormat.bind(this)(d) : config.nullString
|
|
973
986
|
})
|
|
974
987
|
).join("")}</tr>`;
|
|
975
988
|
});
|