billboard.js 3.16.0 → 3.17.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 +4 -4
- package/dist/billboard.js +645 -82
- package/dist/billboard.min.css +1 -1
- package/dist/billboard.min.js +12 -12
- package/dist/billboard.pkgd.js +1987 -786
- package/dist/billboard.pkgd.min.js +18 -17
- 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 +18 -2
- package/dist/plugin/billboardjs-plugin-sparkline.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-stanford.js +18 -2
- package/dist/plugin/billboardjs-plugin-stanford.min.js +4 -4
- package/dist/plugin/billboardjs-plugin-tableview.js +16 -2
- package/dist/plugin/billboardjs-plugin-tableview.min.js +5 -5
- package/dist/plugin/billboardjs-plugin-textoverlap.js +16 -2
- package/dist/plugin/billboardjs-plugin-textoverlap.min.js +3 -3
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.js +1344 -706
- package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.pkgd.min.js +6 -5
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.js +1454 -800
- package/dist/plugin/pkgd/billboardjs-plugin-sparkline.pkgd.min.js +8 -7
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.js +1455 -801
- package/dist/plugin/pkgd/billboardjs-plugin-stanford.pkgd.min.js +13 -12
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.js +1454 -802
- package/dist/plugin/pkgd/billboardjs-plugin-tableview.pkgd.min.js +10 -9
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.js +1455 -803
- package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.pkgd.min.js +7 -6
- package/dist/theme/dark.css +4 -4
- package/dist/theme/dark.min.css +1 -1
- package/dist/theme/datalab.css +4 -4
- package/dist/theme/datalab.min.css +1 -1
- package/dist/theme/graph.css +4 -4
- package/dist/theme/graph.min.css +1 -1
- package/dist/theme/insight.css +4 -4
- package/dist/theme/insight.min.css +1 -1
- package/dist/theme/modern.css +4 -4
- package/dist/theme/modern.min.css +1 -1
- package/dist-esm/billboard.js +697 -79
- package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-sparkline.js +4 -2
- package/dist-esm/plugin/billboardjs-plugin-stanford.js +4 -2
- package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
- package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
- package/package.json +21 -21
- package/src/ChartInternal/Axis/AxisRenderer.ts +20 -13
- package/src/ChartInternal/Axis/AxisRendererHelper.ts +9 -4
- package/src/ChartInternal/data/convert.ts +3 -3
- package/src/ChartInternal/data/data.ts +2 -2
- package/src/ChartInternal/internals/color.ts +20 -14
- package/src/ChartInternal/internals/text.ts +40 -125
- package/src/ChartInternal/internals/text.util.ts +320 -0
- package/src/ChartInternal/shape/arc.ts +41 -19
- package/src/ChartInternal/shape/treemap.ts +5 -6
- package/src/config/Options/axis/x.ts +18 -0
- package/src/config/Options/axis/y.ts +17 -0
- package/src/config/Options/axis/y2.ts +18 -0
- package/src/config/Options/common/boost.ts +1 -0
- package/src/config/Options/data/data.ts +125 -4
- package/src/config/Options/shape/donut.ts +77 -1
- package/src/config/Options/shape/gauge.ts +69 -2
- package/src/config/Options/shape/pie.ts +68 -1
- package/src/config/Options/shape/polar.ts +68 -1
- package/src/config/classes.ts +2 -0
- package/src/module/util.ts +26 -0
- package/types/axis.d.ts +10 -0
- package/types/options.d.ts +138 -1
- package/types/options.shape.d.ts +302 -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.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -135,7 +135,7 @@ class Plugin {
|
|
|
135
135
|
});
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
__publicField(Plugin, "version", "3.
|
|
138
|
+
__publicField(Plugin, "version", "3.17.0");
|
|
139
139
|
|
|
140
140
|
;// ./src/Plugin/bubblecompare/index.ts
|
|
141
141
|
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 3.
|
|
8
|
+
* @version 3.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return
|
|
11
|
+
*/(function(n,i){typeof exports=="object"&&typeof module=="object"?module.exports=i(require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-selection"],i):typeof exports=="object"?exports.bb=i(require("d3-selection")):(n.bb=n.bb||{},n.bb.plugin=n.bb.plugin||{},n.bb.plugin.bubblecompare=i(n.d3))})(this,function(p){return(function(){"use strict";var n={747:(function(r){r.exports=p})},i={};function s(r){var e=i[r];if(e!==void 0)return e.exports;var t=i[r]={exports:{}};return n[r](t,t.exports,s),t.exports}(function(){s.d=function(r,e){for(var t in e)s.o(e,t)&&!s.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:e[t]})}})(),(function(){s.o=function(r,e){return Object.prototype.hasOwnProperty.call(r,e)}})();var b={};s.d(b,{default:function(){return R}});var $=s(747),g=Object.defineProperty,v=(r,e,t)=>e in r?g(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,l=(r,e,t)=>v(r,typeof e!="symbol"?e+"":e,t);class d{constructor(e={}){l(this,"$$"),l(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}l(d,"version","3.17.0");var x=Object.defineProperty,B=(r,e,t)=>e in r?x(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,_=(r,e,t)=>B(r,typeof e!="symbol"?e+"":e,t);const f=class m extends d{constructor(e){return super(e),_(this,"$$"),this}$init(){const{$$:e}=this;e.findClosest=this.findClosest.bind(this),e.getBubbleR=this.getBubbleR.bind(this),e.pointExpandedR=this.pointExpandedR.bind(this)}pointExpandedR(e){const t=this.getBubbleR(e),{expandScale:a=1}=this.options;return m.raiseFocusedBubbleLayer(e),this.changeCursorPoint(),t*a}static raiseFocusedBubbleLayer(e){e.raise&&(0,$.select)(e.node().parentNode.parentNode).raise()}changeCursorPoint(){this.$$.$el.eventRect.style("cursor","pointer")}findClosest(e,t){const{$$:a}=this;return e.filter(o=>o&&!a.isBarType(o.id)).reduce((o,u)=>a.dist(u,t)<this.getBubbleR(u)?u:o,0)}getBubbleR(e){const{minR:t,maxR:a}=this.options,o=this.getZData(e);if(!o)return t;const[u,c]=this.$$.data.targets.reduce(([w,C],j)=>{const h=this.getZData(j.values[0]);return[Math.min(w,h),Math.max(C,h)]},[1e4,0]),P=u>0&&c===u?0:o/c;return Math.abs(P)*(a-t)+t}getZData(e){return this.$$.isBubbleZType(e)?this.$$.getBubbleZData(e.value,"z"):e.value}};_(f,"version","0.0.1");let R=f;return b=b.default,b})()});
|
|
@@ -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.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -257,6 +257,8 @@ const $TEXT = {
|
|
|
257
257
|
text: "bb-text",
|
|
258
258
|
texts: "bb-texts",
|
|
259
259
|
title: "bb-title",
|
|
260
|
+
textBorderRect: "bb-text-border",
|
|
261
|
+
textLabelImage: "bb-text-label-image",
|
|
260
262
|
TextOverlapping: "text-overlapping"
|
|
261
263
|
};
|
|
262
264
|
const $TOOLTIP = {
|
|
@@ -744,6 +746,20 @@ function runUntil(fn, conditionFn) {
|
|
|
744
746
|
fn();
|
|
745
747
|
}
|
|
746
748
|
}
|
|
749
|
+
function parseShorthand(value) {
|
|
750
|
+
if (isObject(value) && !isString(value)) {
|
|
751
|
+
const obj = value;
|
|
752
|
+
return {
|
|
753
|
+
top: obj.top || 0,
|
|
754
|
+
right: obj.right || 0,
|
|
755
|
+
bottom: obj.bottom || 0,
|
|
756
|
+
left: obj.left || 0
|
|
757
|
+
};
|
|
758
|
+
}
|
|
759
|
+
const values = (isString(value) ? value.trim().split(/\s+/) : [value]).map((v) => +v || 0);
|
|
760
|
+
const [a, b = a, c = a, d = b] = values;
|
|
761
|
+
return { top: a, right: b, bottom: c, left: d };
|
|
762
|
+
}
|
|
747
763
|
|
|
748
764
|
;// ./src/config/config.ts
|
|
749
765
|
|
|
@@ -825,7 +841,7 @@ class Plugin {
|
|
|
825
841
|
});
|
|
826
842
|
}
|
|
827
843
|
}
|
|
828
|
-
__publicField(Plugin, "version", "3.
|
|
844
|
+
__publicField(Plugin, "version", "3.17.0");
|
|
829
845
|
|
|
830
846
|
;// ./src/Plugin/sparkline/Options.ts
|
|
831
847
|
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.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(b,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=f(b.d3,b.d3))})(this,function(T,b){return
|
|
12
|
-
`)===-1)e.text(t);else{const i=[e.text(),t].map(
|
|
13
|
-
`),o=r?s.length-1:1;e.html(""),s.forEach((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*o:n[1]}em`).text(l)})}}}function we(e){const{x:t,y:n,width:r,height:i}=e.getBBox();return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function et(e){const{width:t,height:n}=B(e),r=we(e),i=r[0].x,s=Math.min(r[0].y,r[1].y);return{x:i,y:s,width:t,height:n}}function tt(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=d3Pointer(r||e,t)}catch(s){}return i.map(s=>isNaN(s)?0:s)}function Ee(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let i;return t&&t.type==="brush"?i=t.selection:r&&(i=r.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function D(e,t,n=!1){const r=i=>i[e?"getBoundingClientRect":"getBBox"]();return n?r(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=r(t):t.rect}function B(e,t=!1){return D(!0,e,t)}function nt(e,t=!1){return D(!1,e,t)}function rt(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,i=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(i):i}function F(e,t,n,r,i){if(n>r)return-1;const s=Math.floor((n+r)/2);let{x:o,w:l=0}=e[s];return i&&(o=e[s].y,l=e[s].h),t>=o&&t<=o+l?s:t<o?F(e,t,n,s-1,i):F(e,t,s+1,r,i)}function it(e){const t=Ee(e);return t?t[0]===t[1]:!0}function st(...e){const t=n=>{if(v(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)=>L(L({},n),r))}function Oe(e={},t){x(t)&&t.forEach(n=>Oe(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const ot=e=>e.charAt(0).toUpperCase()+e.slice(1);function ct(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Te=e=>[].slice.call(e);function lt(e,t,n){const{rootSelector:r="",sheet:i}=e,o=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](o,i.cssRules.length)}function at(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Te(n.cssRules)))}catch(i){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${i.toString()}`)}}),t}function ut(e){var t,n,r,i,s,o;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((s=(i=window.pageYOffset)!=null?i:window.scrollY)!=null?s:0)+((o=e.scrollTop)!=null?o:0)}}function bt(e,t=0,n=0,r=!0){const i=new DOMPoint(t,n),s=e.getScreenCTM(),o=i.matrixTransform(r?s==null?void 0:s.inverse():s);if(r===!1){const l=B(e);o.x-=l.x,o.y-=l.y}return o}function dt(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 ft(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,i,s)=>s.indexOf(r)===i);return t?n.map(r=>new Date(r)):n}function ht(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 v(e)&&v(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];v(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=x(i)?i.concat():i}}),$(e,...t)}function Ce(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 pt(e,t){let n=t.filter(r=>$e(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Ce(n,e==="min")[0]):n=void 0,n}const gt=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let s=e;s<i;s++)r.push(e+s*n);return r},mt={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 s=pe.createEvent("MouseEvent");s.initMouseEvent(r,i.bubbles,i.cancelable,g,0,i.screenX,i.screenY,i.clientX,i.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(s)}}})(),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 vt(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return n}function _t(e){var t;let n;if(e instanceof Date)n=e;else if(m(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.data_xFormat)(e))!=null?t:new Date(e)}else _(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 yt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function xt(e,t,n=!1){const r=!!e.node;let i=!1;for(const[s,o]of Object.entries(t))if(i=r?e.style(s)===o:e.style[s]===o,n===!1&&i)break;return i}function $t(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function wt(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=window,s=r==null?void 0:r("(pointer:coarse)").matches;let o=!1;if(t)if(i&&"maxTouchPoints"in i)o=i.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)o=!0;else if(s)o=!0;else{const a=i.userAgent;o=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(a)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(a)}return e&&!s&&(r==null?void 0:r("(pointer:fine)").matches)&&"mouse"||o&&"touch"||"mouse"}function Pe(e,t){t()===!1?requestAnimationFrame(()=>Pe(e,t)):e()}function Ae(e){const t=this.config;let n,r,i;const s=()=>{const o=r.shift();if(o&&n&&y(n)&&o in n)return n=n[o],s();if(!o)return n};Object.keys(t).forEach(o=>{n=e,r=o.split("_"),i=s(),M(i)&&(t[o]=i)}),this.api&&(this.state.orgConfig=e)}var Re=Object.defineProperty,Se=(e,t,n)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>Se(e,typeof t!="symbol"?t+"":t,n);class j{constructor(t={}){w(this,"$$"),w(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}w(j,"version","3.16.0");class Ie{constructor(){return{selector:void 0}}}var Le=Object.defineProperty,Me=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);class N extends j{constructor(t){return super(t),E(this,"config"),E(this,"element"),this.config=new Ie,this}$beforeInit(){Ae.call(this,this.options),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,s,o){return o==="getShapeX"?{}:r.call(this,i,s)},t.getBarW=function(i,s){return n.call(this,i,s,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:s}}}=this;let o=s.pageY-i*1.35,l=s.pageX-r/2;return o<0&&(o=0),l<0&&(l=0),{top:o,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 s=i.querySelector("svg");s[r]("mouseover",this.overHandler),s[r]("mousemove",this.moveHandler),s[r]("mouseout",this.outHandler)})}}overHandler(t){const{$$:n}=this,{state:{eventReceiver:r}}=n;r.rect=t.target.getBoundingClientRect()}moveHandler(t){var n,r,i,s;const{$$:o}=this,l=o.getDataIndexFromEvent(t),a=(n=o.api.data(t.target.__id))==null?void 0:n[0],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),o.state.event=t,(i=o.isPointFocusOnly)!=null&&i.call(o)&&u&&((s=o.showCircleFocus)==null||s.call(o,[u])),o.setExpand(l,a.id,!0),o.showTooltip([u],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 s=n.api.data(),o=(t=r.chart.html().match(/<svg[^>]*>/))==null?void 0:t[0];if(i.length<s.length){const l=r.chart.node();for(let a=s.length-i.length;a>0;a--)l.parentNode.insertBefore(i[0].cloneNode(),l.nextSibling);this.element=document.querySelectorAll(this.config.selector),i=this.element}s.map(l=>l.id).forEach((l,a)=>{const u=`.${R.target}-${l}`,O=r.main.selectAll(u);let h=i[a].querySelector("svg");h||(i[a].innerHTML=`${o}</svg>`,h=i[a].querySelector("svg"),h.__id=l),h.querySelector(u)||O.style("opacity",null),O.style("fill","none").style("opacity",null),h.innerHTML="",h.appendChild(O.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return E(N,"version","0.0.1"),p=p.default,p}()});
|
|
11
|
+
*/(function(b,f){typeof exports=="object"&&typeof module=="object"?module.exports=f(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],f):typeof exports=="object"?exports.bb=f(require("d3-brush"),require("d3-selection")):(b.bb=b.bb||{},b.bb.plugin=b.bb.plugin||{},b.bb.plugin.sparkline=f(b.d3,b.d3))})(this,function(T,b){return(function(){"use strict";var f={747:(function(e){e.exports=b}),853:(function(e){e.exports=T})},C={};function d(e){var t=C[e];if(t!==void 0)return t.exports;var n=C[e]={exports:{}};return f[e](n,n.exports,d),n.exports}(function(){d.d=function(e,t){for(var n in t)d.o(t,n)&&!d.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){d.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var m={};d.d(m,{default:function(){return N}});var q=Object.defineProperty,P=Object.getOwnPropertySymbols,k=Object.prototype.hasOwnProperty,H=Object.prototype.propertyIsEnumerable,A=(e,t,n)=>t in e?q(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,c=(e,t)=>{for(var n in t||(t={}))k.call(t,n)&&A(e,n,t[n]);if(P)for(var n of P(t))H.call(t,n)&&A(e,n,t[n]);return e};const R={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},X={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",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"},U={area:"bb-area",areas:"bb-areas"},Y={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"},V={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},G={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},z={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},W={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},K={dragarea:"bb-dragarea",INCLUDED:"_included_"},Z={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},J={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"},Q={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"},ee={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},te={eventRect:"bb-event-rect",eventRects:"bb-event-rects",eventRectsMultiple:"bb-event-rects-multiple",eventRectsSingle:"bb-event-rects-single"},ne={focused:"bb-focused",defocused:"bb-defocused",legendItemFocused:"bb-legend-item-focused",xgridFocus:"bb-xgrid-focus",ygridFocus:"bb-ygrid-focus"},re={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"},De={level:"bb-level",levels:"bb-levels"},ie={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},oe={region:"bb-region",regions:"bb-regions"},se={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},ce={shape:"bb-shape",shapes:"bb-shapes"},le={brush:"bb-brush",subchart:"bb-subchart"},ae={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"},ue={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},be={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},de={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var Be=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({},R),X),U),Y),V),G),z),W),K),J),Q),ee),te),ne),Z),re),ie),oe),se),ce),le),ae),ue),be),de),je=d(853),Fe=d(747);function fe(){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 he(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 v=fe(),pe=v==null?void 0:v.document,[Ne,qe,ke,He]=he(v);var ge=Object.defineProperty,S=Object.getOwnPropertySymbols,me=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,I=(e,t,n)=>t in e?ge(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,L=(e,t)=>{for(var n in t||(t={}))me.call(t,n)&&I(e,n,t[n]);if(S)for(var n of S(t))ve.call(t,n)&&I(e,n,t[n]);return e};const Xe=e=>e||e===0,_e=e=>typeof e=="function",h=e=>typeof e=="string",_=e=>typeof e=="number",xe=e=>typeof e=="undefined",M=e=>typeof e!="undefined",Ue=e=>typeof e=="boolean",Ye=e=>Math.ceil(e/10)*10,Ve=e=>Math.ceil(e)+.5,Ge=e=>e[1]-e[0],x=e=>typeof e=="object",ye=e=>xe(e)||e===null||h(e)&&e.length===0||x(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),$e=e=>!ye(e),y=e=>Array.isArray(e),g=e=>e&&!(e!=null&&e.nodeType)&&x(e)&&!y(e);function ze(e,t,n){return M(e[t])?e[t]:n}function We(e,t){let n=!1;return Object.keys(e).forEach(r=>e[r]===t&&(n=!0)),n}function Ke(e,t,...n){const r=_e(e);return r&&e.call(t,...n),r}function Ze(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))}function Je(e){return h(e)?e.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):e}function Qe(e,t,n=[-1,1],r=!1){if(!(!e||!h(t)))if(t.indexOf(`
|
|
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((l,a)=>{e.append("tspan").attr("x",0).attr("dy",`${a===0?n[0]*s:n[1]}em`).text(l)})}}}function we(e){const{x:t,y:n,width:r,height:i}=e.getBBox();return[{x:t,y:n+i},{x:t,y:n},{x:t+r,y:n},{x:t+r,y:n+i}]}function et(e){const{width:t,height:n}=B(e),r=we(e),i=r[0].x,o=Math.min(r[0].y,r[1].y);return{x:i,y:o,width:t,height:n}}function tt(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=d3Pointer(r||e,t)}catch(o){}return i.map(o=>isNaN(o)?0:o)}function Ee(e){const{event:t,$el:n}=e,r=n.subchart.main||n.main;let i;return t&&t.type==="brush"?i=t.selection:r&&(i=r.select(".bb-brush").node())&&(i=d3BrushSelection(i)),i}function D(e,t,n=!1){const r=i=>i[e?"getBoundingClientRect":"getBBox"]();return n?r(t):!("rect"in t)||"rect"in t&&t.hasAttribute("width")&&t.rect.width!==+(t.getAttribute("width")||0)?t.rect=r(t):t.rect}function B(e,t=!1){return D(!0,e,t)}function nt(e,t=!1){return D(!1,e,t)}function rt(e=!0,t=0,n=1e4){const r=window.crypto||window.msCrypto,i=r?t+r.getRandomValues(new Uint32Array(1))[0]%(n-t+1):Math.floor(Math.random()*(n-t)+t);return e?String(i):i}function j(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?j(e,t,n,o-1,i):j(e,t,o+1,r,i)}function it(e){const t=Ee(e);return t?t[0]===t[1]:!0}function ot(...e){const t=n=>{if(g(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)=>L(L({},n),r))}function Oe(e={},t){y(t)&&t.forEach(n=>Oe(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const st=e=>e.charAt(0).toUpperCase()+e.slice(1);function ct(e,t="-"){return e.split(t).map((n,r)=>r?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Te=e=>[].slice.call(e);function lt(e,t,n){const{rootSelector:r="",sheet:i}=e,s=`${r} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return i[i.insertRule?"insertRule":"addRule"](s,i.cssRules.length)}function at(e){let t=[];return e.forEach(n=>{var r;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Te(n.cssRules)))}catch(i){(r=window.console)==null||r.warn(`Error while reading rules from ${n.href}: ${i.toString()}`)}}),t}function ut(e){var t,n,r,i,o,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((r=e.scrollLeft)!=null?r:0),y:((o=(i=window.pageYOffset)!=null?i:window.scrollY)!=null?o:0)+((s=e.scrollTop)!=null?s:0)}}function bt(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=B(e);s.x-=l.x,s.y-=l.y}return s}function dt(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 ft(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((r,i,o)=>o.indexOf(r)===i);return t?n.map(r=>new Date(r)):n}function ht(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 g(e)&&g(n)&&Object.keys(n).forEach(r=>{if(!/^(__proto__|constructor|prototype)$/i.test(r)){const i=n[r];g(i)?(!e[r]&&(e[r]={}),e[r]=$(e[r],i)):e[r]=y(i)?i.concat():i}}),$(e,...t)}function Ce(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 pt(e,t){let n=t.filter(r=>$e(r));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=Ce(n,e==="min")[0]):n=void 0,n}const gt=(e,t,n=1)=>{const r=[],i=Math.max(0,Math.ceil((t-e)/n))|0;for(let o=e;o<i;o++)r.push(e+o*n);return r},mt={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=pe.createEvent("MouseEvent");o.initMouseEvent(r,i.bubbles,i.cancelable,v,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 vt(e,t){let n=e;for(const r in t)n=n.replace(new RegExp(`{=${r}}`,"g"),t[r]);return n}function _t(e){var t;let n;if(e instanceof Date)n=e;else if(h(e)){const{config:r,format:i}=this;n=(t=i.dataTime(r.data_xFormat)(e))!=null?t:new Date(e)}else _(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 xt(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function yt(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===!1&&i)break;return i}function $t(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function wt(e,t){const{DocumentTouch:n,matchMedia:r,navigator:i}=window,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 window||n&&document 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 Pe(e,t){t()===!1?requestAnimationFrame(()=>Pe(e,t)):e()}function Et(e){if(g(e)&&!h(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(h(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 Ae(e){const t=this.config;let n,r,i;const o=()=>{const s=r.shift();if(s&&n&&x(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(),M(i)&&(t[s]=i)}),this.api&&(this.state.orgConfig=e)}var Re=Object.defineProperty,Se=(e,t,n)=>t in e?Re(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,w=(e,t,n)=>Se(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){w(this,"$$"),w(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}w(F,"version","3.17.0");class Ie{constructor(){return{selector:void 0}}}var Le=Object.defineProperty,Me=(e,t,n)=>t in e?Le(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,E=(e,t,n)=>Me(e,typeof t!="symbol"?t+"":t,n);class N extends F{constructor(t){return super(t),E(this,"config"),E(this,"element"),this.config=new Ie,this}$beforeInit(){Ae.call(this,this.options),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=t.target.getBoundingClientRect()}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],u=(r=a==null?void 0:a.values)==null?void 0:r[l];u&&!u.name&&(u.name=u.id),s.state.event=t,(i=s.isPointFocusOnly)!=null&&i.call(s)&&u&&((o=s.showCircleFocus)==null||o.call(s,[u])),s.setExpand(l,a.id,!0),s.showTooltip([u],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 u=`.${R.target}-${l}`,O=r.main.selectAll(u);let p=i[a].querySelector("svg");p||(i[a].innerHTML=`${s}</svg>`,p=i[a].querySelector("svg"),p.__id=l),p.querySelector(u)||O.style("opacity",null),O.style("fill","none").style("opacity",null),p.innerHTML="",p.appendChild(O.node())})}$willDestroy(){this.bindEvents(!1),this.element.forEach(t=>{t.innerHTML=""})}}return E(N,"version","0.0.1"),m=m.default,m})()});
|
|
@@ -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.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -294,6 +294,8 @@ const $TEXT = {
|
|
|
294
294
|
text: "bb-text",
|
|
295
295
|
texts: "bb-texts",
|
|
296
296
|
title: "bb-title",
|
|
297
|
+
textBorderRect: "bb-text-border",
|
|
298
|
+
textLabelImage: "bb-text-label-image",
|
|
297
299
|
TextOverlapping: "text-overlapping"
|
|
298
300
|
};
|
|
299
301
|
const $TOOLTIP = {
|
|
@@ -781,6 +783,20 @@ function runUntil(fn, conditionFn) {
|
|
|
781
783
|
fn();
|
|
782
784
|
}
|
|
783
785
|
}
|
|
786
|
+
function parseShorthand(value) {
|
|
787
|
+
if (isObject(value) && !isString(value)) {
|
|
788
|
+
const obj = value;
|
|
789
|
+
return {
|
|
790
|
+
top: obj.top || 0,
|
|
791
|
+
right: obj.right || 0,
|
|
792
|
+
bottom: obj.bottom || 0,
|
|
793
|
+
left: obj.left || 0
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
const values = (isString(value) ? value.trim().split(/\s+/) : [value]).map((v) => +v || 0);
|
|
797
|
+
const [a, b = a, c = a, d = b] = values;
|
|
798
|
+
return { top: a, right: b, bottom: c, left: d };
|
|
799
|
+
}
|
|
784
800
|
|
|
785
801
|
;// ./src/config/config.ts
|
|
786
802
|
|
|
@@ -862,7 +878,7 @@ class Plugin {
|
|
|
862
878
|
});
|
|
863
879
|
}
|
|
864
880
|
}
|
|
865
|
-
__publicField(Plugin, "version", "3.
|
|
881
|
+
__publicField(Plugin, "version", "3.17.0");
|
|
866
882
|
|
|
867
883
|
// EXTERNAL MODULE: external {"commonjs":"d3-axis","commonjs2":"d3-axis","amd":"d3-axis","root":"d3"}
|
|
868
884
|
var external_commonjs_d3_axis_commonjs2_d3_axis_amd_d3_axis_root_d3_ = __webpack_require__(8);
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(f,
|
|
11
|
+
*/(function(f,x){typeof exports=="object"&&typeof module=="object"?module.exports=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):typeof define=="function"&&define.amd?define("bb",["d3-color","d3-interpolate","d3-scale","d3-brush","d3-selection","d3-axis","d3-format"],x):typeof exports=="object"?exports.bb=x(require("d3-color"),require("d3-interpolate"),require("d3-scale"),require("d3-brush"),require("d3-selection"),require("d3-axis"),require("d3-format")):(f.bb=f.bb||{},f.bb.plugin=f.bb.plugin||{},f.bb.plugin.stanford=x(f.d3,f.d3,f.d3,f.d3,f.d3,f.d3,f.d3))})(this,function(j,f,x,K,W,Z,J){return(function(){"use strict";var Q={218:(function(t){t.exports=j}),390:(function(t){t.exports=J}),455:(function(t){t.exports=x}),747:(function(t){t.exports=W}),798:(function(t){t.exports=f}),853:(function(t){t.exports=K}),996:(function(t){t.exports=Z})},M={};function h(t){var e=M[t];if(e!==void 0)return e.exports;var n=M[t]={exports:{}};return Q[t](n,n.exports,h),n.exports}(function(){h.d=function(t,e){for(var n in e)h.o(e,n)&&!h.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})}})(),(function(){h.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)}})();var v={};h.d(v,{default:function(){return ie}});var D=h(218),tt=h(798),E=h(455),et=Object.defineProperty,I=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,ot=Object.prototype.propertyIsEnumerable,N=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,u=(t,e)=>{for(var n in e||(e={}))nt.call(e,n)&&N(t,n,e[n]);if(I)for(var n of I(e))ot.call(e,n)&&N(t,n,e[n]);return t};const rt={button:"bb-button",chart:"bb-chart",empty:"bb-empty",main:"bb-main",target:"bb-target",EXPANDED:"_expanded_",dummy:"_dummy_"},st={arc:"bb-arc",arcLabelLine:"bb-arc-label-line",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"},at={area:"bb-area",areas:"bb-areas"},it={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"},ct={bar:"bb-bar",bars:"bb-bars",chartBar:"bb-chart-bar",chartBars:"bb-chart-bars",barConnectLine:"bb-bar-connectLine"},lt={candlestick:"bb-candlestick",candlesticks:"bb-candlesticks",chartCandlestick:"bb-chart-candlestick",chartCandlesticks:"bb-chart-candlesticks",valueDown:"bb-value-down",valueUp:"bb-value-up"},ut={chartCircles:"bb-chart-circles",circle:"bb-circle",circles:"bb-circles"},dt={colorPattern:"bb-color-pattern",colorScale:"bb-colorscale"},bt={dragarea:"bb-dragarea",INCLUDED:"_included_"},ft={funnel:"bb-funnel",chartFunnel:"bb-chart-funnel",chartFunnels:"bb-chart-funnels",funnelBackground:"bb-funnel-background"},ht={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"},pt={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"},gt={chartLine:"bb-chart-line",chartLines:"bb-chart-lines",line:"bb-line",lines:"bb-lines"},mt={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"},xt={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"},yt={chartRadar:"bb-chart-radar",chartRadars:"bb-chart-radars"},vt={region:"bb-region",regions:"bb-regions"},$t={selectedCircle:"bb-selected-circle",selectedCircles:"bb-selected-circles",SELECTED:"_selected_"},wt={shape:"bb-shape",shapes:"bb-shapes"},Et={brush:"bb-brush",subchart:"bb-subchart"},St={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"},S={tooltip:"bb-tooltip",tooltipContainer:"bb-tooltip-container",tooltipName:"bb-tooltip-name"},Ct={treemap:"bb-treemap",chartTreemap:"bb-chart-treemap",chartTreemaps:"bb-chart-treemaps"},Ot={buttonZoomReset:"bb-zoom-reset",zoomBrush:"bb-zoom-brush"};var ue=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({},rt),st),at),it),ct),lt),ut),dt),bt),ht),pt),gt),mt),_t),ft),xt),yt),vt),$t),wt),Et),St),S),Ct),Ot),de=h(853),be=h(747);function Pt(){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 Rt(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 $=Pt(),Tt=$==null?void 0:$.document,[fe,he,pe,ge]=Rt($);var At=Object.defineProperty,F=Object.getOwnPropertySymbols,Lt=Object.prototype.hasOwnProperty,jt=Object.prototype.propertyIsEnumerable,B=(t,e,n)=>e in t?At(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,q=(t,e)=>{for(var n in e||(e={}))Lt.call(e,n)&&B(t,n,e[n]);if(F)for(var n of F(e))jt.call(e,n)&&B(t,n,e[n]);return t};const me=t=>t||t===0,C=t=>typeof t=="function",_=t=>typeof t=="string",O=t=>typeof t=="number",Mt=t=>typeof t=="undefined",U=t=>typeof t!="undefined",_e=t=>typeof t=="boolean",xe=t=>Math.ceil(t/10)*10,ye=t=>Math.ceil(t)+.5,ve=t=>t[1]-t[0],P=t=>typeof t=="object",X=t=>Mt(t)||t===null||_(t)&&t.length===0||P(t)&&!(t instanceof Date)&&Object.keys(t).length===0||O(t)&&isNaN(t),Dt=t=>!X(t),R=t=>Array.isArray(t),y=t=>t&&!(t!=null&&t.nodeType)&&P(t)&&!R(t);function $e(t,e,n){return U(t[e])?t[e]:n}function we(t,e){let n=!1;return Object.keys(t).forEach(o=>t[o]===e&&(n=!0)),n}function Ee(t,e,...n){const o=C(t);return o&&t.call(e,...n),o}function Se(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))}function Ce(t){return _(t)?t.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):t}function Oe(t,e,n=[-1,1],o=!1){if(!(!t||!_(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
|
-
`),a=o?s.length-1:1;t.html(""),s.forEach((i,d)=>{t.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function It(t){const{x:e,y:n,width:o,height:r}=t.getBBox();return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function Pe(t){const{width:e,height:n}=V(t),o=It(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function Re(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=d3Pointer(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function Nt(t){const{event:e,$el:n}=t,o=n.subchart.main||n.main;let r;return e&&e.type==="brush"?r=e.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function Y(t,e,n=!1){const o=r=>r[t?"getBoundingClientRect":"getBBox"]();return n?o(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=o(e):e.rect}function V(t,e=!1){return Y(!0,t,e)}function Te(t,e=!1){return Y(!1,t,e)}function Ae(t=!0,e=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?e+o.getRandomValues(new Uint32Array(1))[0]%(n-e+1):Math.floor(Math.random()*(n-e)+e);return t?String(r):r}function G(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=t[s];return r&&(a=t[s].y,i=t[s].h),e>=a&&e<=a+i?s:e<a?G(t,e,n,s-1,r):G(t,e,s+1,o,r)}function Le(t){const e=Nt(t);return e?e[0]===e[1]:!0}function je(...t){const e=n=>{if($(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)=>q(q({},n),o))}function Ft(t={},e){R(e)&&e.forEach(n=>Ft(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}const Me=t=>t.charAt(0).toUpperCase()+t.slice(1);function De(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Bt=t=>[].slice.call(t);function Ie(t,e,n){const{rootSelector:o="",sheet:r}=t,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function Ne(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(Bt(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),e}function Fe(t){var e,n,o,r,s,a;return{x:((n=(e=window.pageXOffset)!=null?e:window.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((a=t.scrollTop)!=null?a:0)}}function Be(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=V(t);a.x-=i.x,a.y-=i.y}return a}function qe(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 Ue(t){const e=t[0]instanceof Date,n=(e?t.map(Number):t).filter((o,r,s)=>s.indexOf(o)===r);return e?n.map(o=>new Date(o)):n}function Xe(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function T(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return $(t)&&$(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];$(r)?(!t[o]&&(t[o]={}),t[o]=T(t[o],r)):t[o]=R(r)?r.concat():r}}),T(t,...e)}function qt(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=>Dt(o));return n.length?O(n[0])?n=Math[t](...n):n[0]instanceof Date&&(n=qt(n,t==="min")[0]):n=void 0,n}const Ut=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=t;s<r;s++)o.push(t+s*n);return o},Ve={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=Tt.createEvent("MouseEvent");s.initMouseEvent(o,r.bubbles,r.cancelable,v,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(T({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]}))}};function Ge(t,e){let n=t;for(const o in e)n=n.replace(new RegExp(`{=${o}}`,"g"),e[o]);return n}function Xt(t){var e;let n;if(t instanceof Date)n=t;else if(x(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else O(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){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function ze(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,a]of Object.entries(e))if(r=o?t.style(s)===a:t.style[s]===a,n===!1&&r)break;return r}function He(){var t,e;return((t=document)==null?void 0:t.hidden)===!1||((e=document)==null?void 0:e.visibilityState)==="visible"}function Ke(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(e)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function Yt(t,e){e()===!1?requestAnimationFrame(()=>Yt(t,e)):t()}function Vt(t){const e=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(e).forEach(a=>{n=t,o=a.split("_"),r=s(),U(r)&&(e[a]=r)}),this.api&&(this.state.orgConfig=t)}var Gt=Object.defineProperty,kt=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>kt(t,typeof e!="symbol"?e+"":e,n);class k{constructor(e={}){A(this,"$$"),A(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}A(k,"version","3.16.0");var zt=h(996),Ht=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Kt=Object.defineProperty,Wt=(t,e,n)=>e in t?Kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e,n)=>Wt(t,typeof e!="symbol"?e+"":e,n);class Zt{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,a=5,i=Ut(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,ce)=>ce*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,zt.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,Ht.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function Jt(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const i=e[s].x,d=e[s].y,b=e[a].x,c=e[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function Qt(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function te(t){let e=0,n,o;for(let r=0,s=t.length,a=s-1;r<s;a=r,r++)n=t[r],o=t[a],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function w(t){const e=te(t);let n=0,o=0,r;for(let s=0,a=t.length,i=a-1;s<a;i=s,s++){const d=t[s],b=t[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=e*6,{x:n/r,y:o/r}}var ee=Object.defineProperty,ne=(t,e,n)=>e in t?ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oe=(t,e,n)=>ne(t,typeof e!="symbol"?e+"":e,n);class re{constructor(e){oe(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(e).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(e).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}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 a=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?a=Xt.call(o,a):r.isCategorized()&&x(a)&&(a=s.axis_x_categories.indexOf(e.value)),o.scale.x(a)}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 H{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 se=Object.defineProperty,ae=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>ae(t,typeof e!="symbol"?e+"":e,n);class ie extends k{constructor(e){return super(e),L(this,"config"),L(this,"colorScale"),L(this,"elements"),this.config=new H,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;Vt.call(this,this.options),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new Zt(this),this.elements=new re(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 H}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(Qt);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(e.scale_min)?Math.min(...o):e.scale_min,n.maxEpochs=isNaN(e.scale_max)?Math.max(...o):e.scale_max,n.colors=C(e.colors)?e.colors:(0,tt.interpolateHslLong)((0,D.hsl)(250,1,.5),(0,D.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;X(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:a}=e;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
|
|
13
|
+
`),a=o?s.length-1:1;t.html(""),s.forEach((i,d)=>{t.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*a:n[1]}em`).text(i)})}}}function It(t){const{x:e,y:n,width:o,height:r}=t.getBBox();return[{x:e,y:n+r},{x:e,y:n},{x:e+o,y:n},{x:e+o,y:n+r}]}function Pe(t){const{width:e,height:n}=V(t),o=It(t),r=o[0].x,s=Math.min(o[0].y,o[1].y);return{x:r,y:s,width:e,height:n}}function Re(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=d3Pointer(o||t,e)}catch(s){}return r.map(s=>isNaN(s)?0:s)}function Nt(t){const{event:e,$el:n}=t,o=n.subchart.main||n.main;let r;return e&&e.type==="brush"?r=e.selection:o&&(r=o.select(".bb-brush").node())&&(r=d3BrushSelection(r)),r}function Y(t,e,n=!1){const o=r=>r[t?"getBoundingClientRect":"getBBox"]();return n?o(e):!("rect"in e)||"rect"in e&&e.hasAttribute("width")&&e.rect.width!==+(e.getAttribute("width")||0)?e.rect=o(e):e.rect}function V(t,e=!1){return Y(!0,t,e)}function Te(t,e=!1){return Y(!1,t,e)}function Ae(t=!0,e=0,n=1e4){const o=window.crypto||window.msCrypto,r=o?e+o.getRandomValues(new Uint32Array(1))[0]%(n-e+1):Math.floor(Math.random()*(n-e)+e);return t?String(r):r}function G(t,e,n,o,r){if(n>o)return-1;const s=Math.floor((n+o)/2);let{x:a,w:i=0}=t[s];return r&&(a=t[s].y,i=t[s].h),e>=a&&e<=a+i?s:e<a?G(t,e,n,s-1,r):G(t,e,s+1,o,r)}function Le(t){const e=Nt(t);return e?e[0]===e[1]:!0}function je(...t){const e=n=>{if(y(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)=>q(q({},n),o))}function Ft(t={},e){R(e)&&e.forEach(n=>Ft(t,n));for(const n in e)/^\d+$/.test(n)||n in t||(t[n]=e[n]);return t}const Me=t=>t.charAt(0).toUpperCase()+t.slice(1);function De(t,e="-"){return t.split(e).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Bt=t=>[].slice.call(t);function Ie(t,e,n){const{rootSelector:o="",sheet:r}=t,a=`${o} ${(i=>i.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(e)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](a,r.cssRules.length)}function Ne(t){let e=[];return t.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(e=e.concat(Bt(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),e}function Fe(t){var e,n,o,r,s,a;return{x:((n=(e=window.pageXOffset)!=null?e:window.scrollX)!=null?n:0)+((o=t.scrollLeft)!=null?o:0),y:((s=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?s:0)+((a=t.scrollTop)!=null?a:0)}}function Be(t,e=0,n=0,o=!0){const r=new DOMPoint(e,n),s=t.getScreenCTM(),a=r.matrixTransform(o?s==null?void 0:s.inverse():s);if(o===!1){const i=V(t);a.x-=i.x,a.y-=i.y}return a}function qe(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 Ue(t){const e=t[0]instanceof Date,n=(e?t.map(Number):t).filter((o,r,s)=>s.indexOf(o)===r);return e?n.map(o=>new Date(o)):n}function Xe(t){return t&&t.length?t.reduce((e,n)=>e.concat(n)):[]}function T(t,...e){if(!e.length||e.length===1&&!e[0])return t;const n=e.shift();return y(t)&&y(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];y(r)?(!t[o]&&(t[o]={}),t[o]=T(t[o],r)):t[o]=R(r)?r.concat():r}}),T(t,...e)}function qt(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=>Dt(o));return n.length?O(n[0])?n=Math[t](...n):n[0]instanceof Date&&(n=qt(n,t==="min")[0]):n=void 0,n}const Ut=(t,e,n=1)=>{const o=[],r=Math.max(0,Math.ceil((e-t)/n))|0;for(let s=t;s<r;s++)o.push(t+s*n);return o},Ve={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=Tt.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(T({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]}))}};function Ge(t,e){let n=t;for(const o in e)n=n.replace(new RegExp(`{=${o}}`,"g"),e[o]);return n}function Xt(t){var e;let n;if(t instanceof Date)n=t;else if(_(t)){const{config:o,format:r}=this;n=(e=r.dataTime(o.data_xFormat)(t))!=null?e:new Date(t)}else O(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){const e=t.attr("viewBox");return e?/(\d+(\.\d+)?){3}/.test(e):!1}function ze(t,e,n=!1){const o=!!t.node;let r=!1;for(const[s,a]of Object.entries(e))if(r=o?t.style(s)===a:t.style[s]===a,n===!1&&r)break;return r}function He(){var t,e;return((t=document)==null?void 0:t.hidden)===!1||((e=document)==null?void 0:e.visibilityState)==="visible"}function Ke(t,e){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,s=o==null?void 0:o("(pointer:coarse)").matches;let a=!1;if(e)if(r&&"maxTouchPoints"in r)a=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)a=!0;else if(s)a=!0;else{const d=r.userAgent;a=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return t&&!s&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||a&&"touch"||"mouse"}function Yt(t,e){e()===!1?requestAnimationFrame(()=>Yt(t,e)):t()}function We(t){if(y(t)&&!_(t)){const a=t;return{top:a.top||0,right:a.right||0,bottom:a.bottom||0,left:a.left||0}}const e=(_(t)?t.trim().split(/\s+/):[t]).map(a=>+a||0),[n,o=n,r=n,s=o]=e;return{top:n,right:o,bottom:r,left:s}}function Vt(t){const e=this.config;let n,o,r;const s=()=>{const a=o.shift();if(a&&n&&P(n)&&a in n)return n=n[a],s();if(!a)return n};Object.keys(e).forEach(a=>{n=t,o=a.split("_"),r=s(),U(r)&&(e[a]=r)}),this.api&&(this.state.orgConfig=t)}var Gt=Object.defineProperty,kt=(t,e,n)=>e in t?Gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,A=(t,e,n)=>kt(t,typeof e!="symbol"?e+"":e,n);class k{constructor(e={}){A(this,"$$"),A(this,"options"),this.options=e}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(e=>{this[e]=null,delete this[e]})}}A(k,"version","3.17.0");var zt=h(996),Ht=h(390),p={colorScale:"bb-colorscale",stanfordElements:"bb-stanford-elements",stanfordLine:"bb-stanford-line",stanfordLines:"bb-stanford-lines",stanfordRegion:"bb-stanford-region",stanfordRegions:"bb-stanford-regions"},Kt=Object.defineProperty,Wt=(t,e,n)=>e in t?Kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,z=(t,e,n)=>Wt(t,typeof e!="symbol"?e+"":e,n);class Zt{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,a=5,i=Ut(n.padding_bottom,r,a),d=(0,E.scaleSequential)(o.colors).domain([i[i.length-1],i[0]]);this.colorScale&&this.colorScale.remove(),this.colorScale=e.$el.svg.append("g").attr("width",50).attr("height",r).attr("class",p.colorScale),this.colorScale.append("g").attr("transform",`translate(0, ${n.padding_top})`).selectAll("bars").data(i).enter().append("rect").attr("y",(m,ce)=>ce*a).attr("x",0).attr("width",s).attr("height",a).attr("fill",m=>d(m));const b=(0,E.scaleSymlog)().domain([o.minEpochs,o.maxEpochs]).range([i[0]+n.padding_top+i[i.length-1]+a-1,i[0]+n.padding_top]),c=(0,zt.axisRight)(b),l=n.scale_format;l==="pow10"?c.tickValues([1,10,100,1e3,1e4,1e5,1e6,1e7]):C(l)?c.tickFormat(l):c.tickFormat((0,Ht.format)("d"));const g=this.colorScale.append("g").attr("class","legend axis").attr("transform",`translate(${s},0)`).call(c);l==="pow10"&&g.selectAll(".tick text").text(null).filter(m=>m/Math.pow(10,Math.ceil(Math.log(m)/Math.LN10-1e-12))===1).text(10).append("tspan").attr("dy","-.7em").text(m=>Math.round(Math.log(m)/Math.LN10)),this.colorScale.attr("transform",`translate(${e.state.current.width-this.xForColorScale()}, 0)`)}xForColorScale(){return this.owner.config.padding_right+this.colorScale.node().getBBox().width}getColorScalePadding(){return this.xForColorScale()+this.owner.config.padding_left+20}}function Jt(t,e){const n=t.x,o=t.value;let r=!1;for(let s=0,a=e.length-1;s<e.length;a=s++){const i=e[s].x,d=e[s].y,b=e[a].x,c=e[a].y;d>o!=c>o&&n<(b-i)*(o-d)/(c-d)+i&&(r=!r)}return r}function Qt(t,e){return t.epochs<e.epochs?-1:t.epochs>e.epochs?1:0}function te(t){let e=0,n,o;for(let r=0,s=t.length,a=s-1;r<s;a=r,r++)n=t[r],o=t[a],e+=n.x*o.y,e-=n.y*o.x;return e/=2,e}function w(t){const e=te(t);let n=0,o=0,r;for(let s=0,a=t.length,i=a-1;s<a;i=s,s++){const d=t[s],b=t[i];r=d.x*b.y-b.x*d.y,n+=(d.x+b.x)*r,o+=(d.y+b.y)*r}return r=e*6,{x:n/r,y:o/r}}var ee=Object.defineProperty,ne=(t,e,n)=>e in t?ee(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,oe=(t,e,n)=>ne(t,typeof e!="symbol"?e+"":e,n);class re{constructor(e){oe(this,"owner"),this.owner=e;const n=e.$$.$el.main.select(".bb-chart").append("g").attr("class",p.stanfordElements);n.append("g").attr("class",p.stanfordLines),n.append("g").attr("class",p.stanfordRegions)}updateStanfordLines(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=r.select(`.${p.stanfordLines}`).style("shape-rendering","geometricprecision").selectAll(`.${p.stanfordLine}`).data(this.owner.config.lines);d.exit().transition().duration(e).style("opacity","0").remove();const b=d.enter().append("g");b.append("line").style("opacity","0"),b.merge(d).attr("class",c=>p.stanfordLine+(c.class?` ${c.class}`:"")).select("line").transition().duration(e).attr("x1",c=>s?i(c,"y1"):a(c,"x1")).attr("x2",c=>s?i(c,"y2"):a(c,"x2")).attr("y1",c=>s?a(c,"x1"):i(c,"y1")).attr("y2",c=>s?a(c,"x2"):i(c,"y2")).transition().style("opacity",null)}updateStanfordRegions(e){const{$$:n}=this.owner,{config:o,$el:{main:r}}=n,s=o.axis_rotated,a=this.xvCustom.bind(n),i=this.yvCustom.bind(n),d=this.owner.countEpochsInRegion.bind(n);let b=r.select(`.${p.stanfordRegions}`).selectAll(`.${p.stanfordRegion}`).data(this.owner.config.regions);b.exit().transition().duration(e).style("opacity","0").remove();const c=b.enter().append("g");c.append("polygon").style("opacity","0"),c.append("text").attr("transform",s?"rotate(-90)":"").style("opacity","0"),b=c.merge(b),b.attr("class",l=>p.stanfordRegion+(l.class?` ${l.class}`:"")).select("polygon").transition().duration(e).attr("points",l=>l.points.map(g=>[s?i(g,"y"):a(g,"x"),s?a(g,"x"):i(g,"y")].join(",")).join(" ")).transition().style("opacity",l=>String(l.opacity?l.opacity:.2)),b.select("text").transition().duration(e).attr("x",l=>s?i(w(l.points),"y"):a(w(l.points),"x")).attr("y",l=>s?a(w(l.points),"x"):i(w(l.points),"y")).text(l=>{if(l.text){const{value:g,percentage:m}=d(l.points);return l.text(g,m)}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 a=n?e[n]:o.getBaseValue(e);return r.isTimeSeries()?a=Xt.call(o,a):r.isCategorized()&&_(a)&&(a=s.axis_x_categories.indexOf(e.value)),o.scale.x(a)}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 H{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 se=Object.defineProperty,ae=(t,e,n)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,L=(t,e,n)=>ae(t,typeof e!="symbol"?e+"":e,n);class ie extends k{constructor(e){return super(e),L(this,"config"),L(this,"colorScale"),L(this,"elements"),this.config=new H,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;Vt.call(this,this.options),e.color=this.getStanfordPointColor.bind(e),this.colorScale=new Zt(this),this.elements=new re(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 H}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(Qt);const o=n.values.map(r=>r.epochs);n.minEpochs=isNaN(e.scale_min)?Math.min(...o):e.scale_min,n.maxEpochs=isNaN(e.scale_max)?Math.max(...o):e.scale_max,n.colors=C(e.colors)?e.colors:(0,tt.interpolateHslLong)((0,D.hsl)(250,1,.5),(0,D.hsl)(0,1,.5)),n.colorscale=(0,E.scaleSequentialLog)(n.colors).domain([n.minEpochs,n.maxEpochs])}getStanfordPointColor(e){return this.data.targets[0].colorscale(e.epochs)}setStanfordTooltip(){const{config:e}=this.$$;X(e.tooltip_contents)&&(e.tooltip_contents=function(n,o,r,s){const{data_x:a}=e;let i=`<table class="${S.tooltip}"><tbody>`;return n.forEach(d=>{const{id:b="",value:c=0,epochs:l=0,x:g=""}=d;i+=`<tr>
|
|
14
14
|
<th>${a||""}</th>
|
|
15
15
|
<th class="value">${o(g)}</th>
|
|
16
16
|
</tr>
|
|
@@ -21,4 +21,4 @@
|
|
|
21
21
|
<tr class="${S.tooltipName}-${b}">
|
|
22
22
|
<td class="name"><span style="background-color:${s(d)}"></span>Epochs</td>
|
|
23
23
|
<td class="value">${r(l)}</td>
|
|
24
|
-
</tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>Jt(i,e)?a+Number(i.epochs):a,0);return{value:s,percentage:s!==0?+(s/r*100).toFixed(1):0}}}return
|
|
24
|
+
</tr>`}),`${i}</tbody></table>`})}countEpochsInRegion(e){const o=this.data.targets[0],r=o.values.reduce((a,i)=>a+Number(i.epochs),0),s=o.values.reduce((a,i)=>Jt(i,e)?a+Number(i.epochs):a,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 3.
|
|
8
|
+
* @version 3.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -559,6 +559,20 @@ function runUntil(fn, conditionFn) {
|
|
|
559
559
|
fn();
|
|
560
560
|
}
|
|
561
561
|
}
|
|
562
|
+
function parseShorthand(value) {
|
|
563
|
+
if (isObject(value) && !isString(value)) {
|
|
564
|
+
const obj = value;
|
|
565
|
+
return {
|
|
566
|
+
top: obj.top || 0,
|
|
567
|
+
right: obj.right || 0,
|
|
568
|
+
bottom: obj.bottom || 0,
|
|
569
|
+
left: obj.left || 0
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
const values = (isString(value) ? value.trim().split(/\s+/) : [value]).map((v) => +v || 0);
|
|
573
|
+
const [a, b = a, c = a, d = b] = values;
|
|
574
|
+
return { top: a, right: b, bottom: c, left: d };
|
|
575
|
+
}
|
|
562
576
|
|
|
563
577
|
;// ./src/config/config.ts
|
|
564
578
|
|
|
@@ -640,7 +654,7 @@ class Plugin {
|
|
|
640
654
|
});
|
|
641
655
|
}
|
|
642
656
|
}
|
|
643
|
-
__publicField(Plugin, "version", "3.
|
|
657
|
+
__publicField(Plugin, "version", "3.17.0");
|
|
644
658
|
|
|
645
659
|
;// ./src/Plugin/tableview/const.ts
|
|
646
660
|
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(c,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=u(c.d3,c.d3))})(this,function(j,c){return
|
|
11
|
+
*/(function(c,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(require("d3-brush"),require("d3-selection")):typeof define=="function"&&define.amd?define("bb",["d3-brush","d3-selection"],u):typeof exports=="object"?exports.bb=u(require("d3-brush"),require("d3-selection")):(c.bb=c.bb||{},c.bb.plugin=c.bb.plugin||{},c.bb.plugin.tableview=u(c.d3,c.d3))})(this,function(j,c){return(function(){"use strict";var u={747:(function(e){e.exports=c}),853:(function(e){e.exports=j})},S={};function a(e){var t=S[e];if(t!==void 0)return t.exports;var n=S[e]={exports:{}};return u[e](n,n.exports,a),n.exports}(function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var _={};a.d(_,{default:function(){return be}});var pe=a(853),me=a(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=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const y=V(),U=y==null?void 0:y.document,[ge,_e,ye,ve]=L(y);var z=Object.defineProperty,C=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable,M=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,D=(e,t)=>{for(var n in t||(t={}))X.call(t,n)&&M(e,n,t[n]);if(C)for(var n of C(t))Y.call(t,n)&&M(e,n,t[n]);return e};const we=e=>e||e===0,H=e=>typeof e=="function",f=e=>typeof e=="string",v=e=>typeof e=="number",k=e=>typeof e=="undefined",B=e=>typeof e!="undefined",xe=e=>typeof e=="boolean",Oe=e=>Math.ceil(e/10)*10,Ee=e=>Math.ceil(e)+.5,Pe=e=>e[1]-e[0],O=e=>typeof e=="object",G=e=>k(e)||e===null||f(e)&&e.length===0||O(e)&&!(e instanceof Date)&&Object.keys(e).length===0||v(e)&&isNaN(e),K=e=>!G(e),E=e=>Array.isArray(e),m=e=>e&&!(e!=null&&e.nodeType)&&O(e)&&!E(e);function Te(e,t,n){return B(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 Se(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 Ce(e){return f(e)?e.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):e}function Me(e,t,n=[-1,1],o=!1){if(!(!e||!f(t)))if(t.indexOf(`
|
|
12
12
|
`)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
|
|
13
|
-
`),s=o?i.length-1:1;e.html(""),i.forEach((l,
|
|
13
|
+
`),s=o?i.length-1:1;e.html(""),i.forEach((l,b)=>{e.append("tspan").attr("x",0).attr("dy",`${b===0?n[0]*s:n[1]}em`).text(l)})}}}function W(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}=N(e),o=W(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Be(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(i){}return r.map(i=>isNaN(i)?0:i)}function J(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 A(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 N(e,t=!1){return A(!0,e,t)}function Ae(e,t=!1){return A(!1,e,t)}function Ne(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 I(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:l=0}=e[i];return r&&(s=e[i].y,l=e[i].h),t>=s&&t<=s+l?i:t<s?I(e,t,n,i-1,r):I(e,t,i+1,o,r)}function Ie(e){const t=J(e);return t?t[0]===t[1]:!0}function Fe(...e){const t=n=>{if(m(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)=>D(D({},n),o))}function Q(e={},t){E(t)&&t.forEach(n=>Q(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Re=e=>e.charAt(0).toUpperCase()+e.slice(1);function qe(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const Z=e=>[].slice.call(e);function Ve(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(l=>l.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Le(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(Z(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Ue(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function ze(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const l=N(e);s.x-=l.x,s.y-=l.y}return s}function Xe(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 Ye(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.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 P(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return m(e)&&m(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];m(r)?(!e[o]&&(e[o]={}),e[o]=P(e[o],r)):e[o]=E(r)?r.concat():r}}),P(e,...t)}function ee(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=>K(o));return n.length?v(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=ee(n,e==="min")[0]):n=void 0,n}const Ge=(e,t,n=1)=>{const o=[],r=Math.max(0,Math.ceil((t-e)/n))|0;for(let i=e;i<r;i++)o.push(e+i*n);return o},Ke={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 i=U.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,y,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(P({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 w(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function We(e){var t;let n;if(e instanceof Date)n=e;else if(f(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 Je(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Qe(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function Ze(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function et(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const b=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(b)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(b)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function te(e,t){t()===!1?requestAnimationFrame(()=>te(e,t)):e()}function tt(e){if(m(e)&&!f(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(f(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function ne(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&O(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),B(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var oe=Object.defineProperty,re=(e,t,n)=>t in e?oe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,T=(e,t,n)=>re(e,typeof t!="symbol"?t+"":t,n);class F{constructor(t={}){T(this,"$$"),T(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}T(F,"version","3.17.0");const d={id:"__tableview-style__",class:"bb-tableview",rule:`.bb-tableview {
|
|
14
14
|
border-collapse:collapse;
|
|
15
15
|
border-spacing:0;
|
|
16
16
|
background:#fff;
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
font-size:1.1em;
|
|
35
35
|
font-weight:700;
|
|
36
36
|
margin-bottom: -1px;
|
|
37
|
-
}`},
|
|
37
|
+
}`},g={body:`<caption>{=title}</caption>
|
|
38
38
|
<thead><tr>{=thead}</tr></thead>
|
|
39
|
-
<tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class ie{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var se=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))ae.call(t,n)&&$(e,n,t[n]);if(R)for(var n of R(t))ue.call(t,n)&&$(e,n,t[n]);return e},de=(e,t)=>le(e,ce(t)),q=(e,t,n)=>$(e,typeof t!="symbol"?t+"":t,n);class be extends F{constructor(t){return super(t),q(this,"config"),q(this,"element"),this.config=new ie,this}$beforeInit(){ne.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||
|
|
39
|
+
<tbody>{=tbody}</tbody>`,thead:'<th scope="col">{=title}</th>',tbodyHeader:'<th scope="row">{=value}</th>',tbody:"<td>{=value}</td>"};class ie{constructor(){return{selector:void 0,categoryTitle:"Category",categoryFormat:function(t){let n=t;return this.$$.axis.isCategorized()?n=this.$$.categoryName(t):this.$$.axis.isTimeSeries()&&(n=t.toLocaleDateString()),n},class:void 0,style:!0,title:void 0,updateOnToggle:!0,nullString:"-"}}}var se=Object.defineProperty,le=Object.defineProperties,ce=Object.getOwnPropertyDescriptors,R=Object.getOwnPropertySymbols,ae=Object.prototype.hasOwnProperty,ue=Object.prototype.propertyIsEnumerable,$=(e,t,n)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,fe=(e,t)=>{for(var n in t||(t={}))ae.call(t,n)&&$(e,n,t[n]);if(R)for(var n of R(t))ue.call(t,n)&&$(e,n,t[n]);return e},de=(e,t)=>le(e,ce(t)),q=(e,t,n)=>$(e,typeof t!="symbol"?t+"":t,n);class be extends F{constructor(t){return super(t),q(this,"config"),q(this,"element"),this.config=new ie,this}$beforeInit(){ne.call(this,this.options)}$init(){const{class:t,selector:n,style:o}=this.config;let r=document.querySelector(n||`.${t||d.class}`);if(!r){const i=this.$$.$el.chart.node();r=document.createElement("table"),i.parentNode.insertBefore(r,i.nextSibling)}if(r.tagName!=="TABLE"){const i=document.createElement("table");r.appendChild(i),r=i}if(o&&!document.getElementById(d.id)){const i=document.createElement("style");i.id=d.id,i.innerHTML=d.rule,(document.head||document.getElementsByTagName("head")[0]).appendChild(i)}r.classList.add(...[o&&d.class,t].filter(Boolean)),this.element=r}generateTable(){const{$$:t,config:n,element:o}=this,r=t.filterTargetsToShow(t.data.targets);let i=w(g.thead,{title:r.length?this.config.categoryTitle:""}),s="";const l=[];r.forEach(x=>{i+=w(g.thead,{title:x.id}),x.values.forEach((h,p)=>{l[p]||(l[p]=[h.x]),l[p].push(h.value)})}),l.forEach(x=>{s+=`<tr>${x.map((h,p)=>w(p?g.tbody:g.tbodyHeader,{value:p===0?n.categoryFormat.bind(this)(h):v(h)?h.toLocaleString():n.nullString})).join("")}</tr>`});const b=/(<\/?(script|img)[^>]*>|<[^>]+><\/[^>]+>)/ig,he=w(g.body,de(fe({},n),{title:n.title||t.config.title_text||"",thead:i,tbody:s})).replace(b,"");o.innerHTML=he}$redraw(){const{state:t}=this.$$;!(t.resizing||!this.config.updateOnToggle&&t.toggling)&&this.generateTable()}$willDestroy(){var t,n;if((t=this.element.parentNode)==null||t.removeChild(this.element),this.$$.charts.length===1){const o=document.getElementById(d.id);(n=o==null?void 0:o.parentNode)==null||n.removeChild(o)}}}return _=_.default,_})()});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* billboard.js, JavaScript chart library
|
|
6
6
|
* https://naver.github.io/billboard.js/
|
|
7
7
|
*
|
|
8
|
-
* @version 3.
|
|
8
|
+
* @version 3.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
11
|
*/
|
|
@@ -578,6 +578,20 @@ function runUntil(fn, conditionFn) {
|
|
|
578
578
|
fn();
|
|
579
579
|
}
|
|
580
580
|
}
|
|
581
|
+
function parseShorthand(value) {
|
|
582
|
+
if (isObject(value) && !isString(value)) {
|
|
583
|
+
const obj = value;
|
|
584
|
+
return {
|
|
585
|
+
top: obj.top || 0,
|
|
586
|
+
right: obj.right || 0,
|
|
587
|
+
bottom: obj.bottom || 0,
|
|
588
|
+
left: obj.left || 0
|
|
589
|
+
};
|
|
590
|
+
}
|
|
591
|
+
const values = (isString(value) ? value.trim().split(/\s+/) : [value]).map((v) => +v || 0);
|
|
592
|
+
const [a, b = a, c = a, d = b] = values;
|
|
593
|
+
return { top: a, right: b, bottom: c, left: d };
|
|
594
|
+
}
|
|
581
595
|
|
|
582
596
|
;// ./src/config/config.ts
|
|
583
597
|
|
|
@@ -659,7 +673,7 @@ class Plugin {
|
|
|
659
673
|
});
|
|
660
674
|
}
|
|
661
675
|
}
|
|
662
|
-
__publicField(Plugin, "version", "3.
|
|
676
|
+
__publicField(Plugin, "version", "3.17.0");
|
|
663
677
|
|
|
664
678
|
;// ./src/Plugin/textoverlap/Options.ts
|
|
665
679
|
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.17.0
|
|
9
9
|
* @requires billboard.js
|
|
10
10
|
* @summary billboard.js plugin
|
|
11
|
-
*/(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(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"],u):typeof exports=="object"?exports.bb=u(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=u(l.d3,l.d3,l.d3,l.d3))})(this,function(w,l,u,q){return
|
|
11
|
+
*/(function(l,u){typeof exports=="object"&&typeof module=="object"?module.exports=u(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"],u):typeof exports=="object"?exports.bb=u(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=u(l.d3,l.d3,l.d3,l.d3))})(this,function(w,l,u,q){return(function(){"use strict";var R={263:(function(e){e.exports=l}),348:(function(e){e.exports=w}),747:(function(e){e.exports=q}),853:(function(e){e.exports=u})},O={};function a(e){var t=O[e];if(t!==void 0)return t.exports;var n=O[e]={exports:{}};return R[e](n,n.exports,a),n.exports}(function(){a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}})(),(function(){a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}})();var b={};a.d(b,{default:function(){return ie}});var S=a(348),P=a(263),pe=a(853),he=a(747);function B(){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 F(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=i=>setTimeout(i,1),r=i=>clearTimeout(i);return[t?e.requestAnimationFrame:o,t?e.cancelAnimationFrame:r,n?e.requestIdleCallback:o,n?e.cancelIdleCallback:r]}const m=B(),I=m==null?void 0:m.document,[be,me,_e,ge]=F(m);var N=Object.defineProperty,E=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable,j=(e,t,n)=>t in e?N(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,M=(e,t)=>{for(var n in t||(t={}))V.call(t,n)&&j(e,n,t[n]);if(E)for(var n of E(t))U.call(t,n)&&j(e,n,t[n]);return e};const ye=e=>e||e===0,X=e=>typeof e=="function",f=e=>typeof e=="string",_=e=>typeof e=="number",Y=e=>typeof e=="undefined",T=e=>typeof e!="undefined",xe=e=>typeof e=="boolean",ve=e=>Math.ceil(e/10)*10,we=e=>Math.ceil(e)+.5,Oe=e=>e[1]-e[0],g=e=>typeof e=="object",L=e=>Y(e)||e===null||f(e)&&e.length===0||g(e)&&!(e instanceof Date)&&Object.keys(e).length===0||_(e)&&isNaN(e),z=e=>!L(e),y=e=>Array.isArray(e),p=e=>e&&!(e!=null&&e.nodeType)&&g(e)&&!y(e);function Pe(e,t,n){return T(e[t])?e[t]:n}function Ee(e,t){let n=!1;return Object.keys(e).forEach(o=>e[o]===t&&(n=!0)),n}function je(e,t,...n){const o=X(e);return o&&e.call(t,...n),o}function Me(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 Te(e){return f(e)?e.replace(/<(script|img)?/ig,"<").replace(/(script)?>/ig,">"):e}function $e(e,t,n=[-1,1],o=!1){if(!(!e||!f(t)))if(t.indexOf(`
|
|
12
12
|
`)===-1)e.text(t);else{const r=[e.text(),t].map(i=>i.replace(/[\s\n]/g,""));if(r[0]!==r[1]){const i=t.split(`
|
|
13
|
-
`),s=o?i.length-1:1;e.html(""),i.forEach((c,
|
|
13
|
+
`),s=o?i.length-1:1;e.html(""),i.forEach((c,d)=>{e.append("tspan").attr("x",0).attr("dy",`${d===0?n[0]*s:n[1]}em`).text(c)})}}}function k(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 Ae(e){const{width:t,height:n}=A(e),o=k(e),r=o[0].x,i=Math.min(o[0].y,o[1].y);return{x:r,y:i,width:t,height:n}}function Ce(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(i){}return r.map(i=>isNaN(i)?0:i)}function G(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 $(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 A(e,t=!1){return $(!0,e,t)}function De(e,t=!1){return $(!1,e,t)}function qe(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 C(e,t,n,o,r){if(n>o)return-1;const i=Math.floor((n+o)/2);let{x:s,w:c=0}=e[i];return r&&(s=e[i].y,c=e[i].h),t>=s&&t<=s+c?i:t<s?C(e,t,n,i-1,r):C(e,t,i+1,o,r)}function Re(e){const t=G(e);return t?t[0]===t[1]:!0}function Se(...e){const t=n=>{if(p(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)=>M(M({},n),o))}function H(e={},t){y(t)&&t.forEach(n=>H(e,n));for(const n in t)/^\d+$/.test(n)||n in e||(e[n]=t[n]);return e}const Be=e=>e.charAt(0).toUpperCase()+e.slice(1);function Fe(e,t="-"){return e.split(t).map((n,o)=>o?n.charAt(0).toUpperCase()+n.slice(1).toLowerCase():n.toLowerCase()).join("")}const K=e=>[].slice.call(e);function Ie(e,t,n){const{rootSelector:o="",sheet:r}=e,s=`${o} ${(c=>c.replace(/\s?(bb-)/g,".$1").replace(/\.+/g,"."))(t)} {${n.join(";")}}`;return r[r.insertRule?"insertRule":"addRule"](s,r.cssRules.length)}function Ne(e){let t=[];return e.forEach(n=>{var o;try{n.cssRules&&n.cssRules.length&&(t=t.concat(K(n.cssRules)))}catch(r){(o=window.console)==null||o.warn(`Error while reading rules from ${n.href}: ${r.toString()}`)}}),t}function Ve(e){var t,n,o,r,i,s;return{x:((n=(t=window.pageXOffset)!=null?t:window.scrollX)!=null?n:0)+((o=e.scrollLeft)!=null?o:0),y:((i=(r=window.pageYOffset)!=null?r:window.scrollY)!=null?i:0)+((s=e.scrollTop)!=null?s:0)}}function Ue(e,t=0,n=0,o=!0){const r=new DOMPoint(t,n),i=e.getScreenCTM(),s=r.matrixTransform(o?i==null?void 0:i.inverse():i);if(o===!1){const c=A(e);s.x-=c.x,s.y-=c.y}return s}function Xe(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 Ye(e){const t=e[0]instanceof Date,n=(t?e.map(Number):e).filter((o,r,i)=>i.indexOf(o)===r);return t?n.map(o=>new Date(o)):n}function Le(e){return e&&e.length?e.reduce((t,n)=>t.concat(n)):[]}function x(e,...t){if(!t.length||t.length===1&&!t[0])return e;const n=t.shift();return p(e)&&p(n)&&Object.keys(n).forEach(o=>{if(!/^(__proto__|constructor|prototype)$/i.test(o)){const r=n[o];p(r)?(!e[o]&&(e[o]={}),e[o]=x(e[o],r)):e[o]=y(r)?r.concat():r}}),x(e,...t)}function W(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 ze(e,t){let n=t.filter(o=>z(o));return n.length?_(n[0])?n=Math[e](...n):n[0]instanceof Date&&(n=W(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 i=e;i<r;i++)o.push(e+i*n);return o},Ge={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 i=I.createEvent("MouseEvent");i.initMouseEvent(o,r.bubbles,r.cancelable,m,0,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),n.dispatchEvent(i)}}})(),touch:(e,t,n)=>{const o=new Touch(x({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 He(e,t){let n=e;for(const o in t)n=n.replace(new RegExp(`{=${o}}`,"g"),t[o]);return n}function Ke(e){var t;let n;if(e instanceof Date)n=e;else if(f(e)){const{config:o,format:r}=this;n=(t=r.dataTime(o.data_xFormat)(e))!=null?t:new Date(e)}else _(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 We(e){const t=e.attr("viewBox");return t?/(\d+(\.\d+)?){3}/.test(t):!1}function Je(e,t,n=!1){const o=!!e.node;let r=!1;for(const[i,s]of Object.entries(t))if(r=o?e.style(i)===s:e.style[i]===s,n===!1&&r)break;return r}function Qe(){var e,t;return((e=document)==null?void 0:e.hidden)===!1||((t=document)==null?void 0:t.visibilityState)==="visible"}function Ze(e,t){const{DocumentTouch:n,matchMedia:o,navigator:r}=window,i=o==null?void 0:o("(pointer:coarse)").matches;let s=!1;if(t)if(r&&"maxTouchPoints"in r)s=r.maxTouchPoints>0;else if("ontouchmove"in window||n&&document instanceof n)s=!0;else if(i)s=!0;else{const d=r.userAgent;s=/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(d)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(d)}return e&&!i&&(o==null?void 0:o("(pointer:fine)").matches)&&"mouse"||s&&"touch"||"mouse"}function J(e,t){t()===!1?requestAnimationFrame(()=>J(e,t)):e()}function et(e){if(p(e)&&!f(e)){const s=e;return{top:s.top||0,right:s.right||0,bottom:s.bottom||0,left:s.left||0}}const t=(f(e)?e.trim().split(/\s+/):[e]).map(s=>+s||0),[n,o=n,r=n,i=o]=t;return{top:n,right:o,bottom:r,left:i}}function Q(e){const t=this.config;let n,o,r;const i=()=>{const s=o.shift();if(s&&n&&g(n)&&s in n)return n=n[s],i();if(!s)return n};Object.keys(t).forEach(s=>{n=e,o=s.split("_"),r=i(),T(r)&&(t[s]=r)}),this.api&&(this.state.orgConfig=e)}var Z=Object.defineProperty,ee=(e,t,n)=>t in e?Z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,v=(e,t,n)=>ee(e,typeof t!="symbol"?t+"":t,n);class D{constructor(t={}){v(this,"$$"),v(this,"options"),this.options=t}$beforeInit(){}$init(){}$afterInit(){}$redraw(){}$willDestroy(){Object.keys(this).forEach(t=>{this[t]=null,delete this[t]})}}v(D,"version","3.17.0");class te{constructor(){return{selector:void 0,extent:1,area:0}}}var ne=Object.defineProperty,oe=(e,t,n)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,re=(e,t,n)=>oe(e,typeof t!="symbol"?t+"":t,n);class ie extends D{constructor(t){return super(t),re(this,"config"),this.config=new te,this}$init(){Q.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,i]=["x","y"].map(s=>o[s].domain());return[r[1],i[0]]=[i[0],r[1]],S.Delaunay.from(t).voronoi([...r,...i])}preventLabelOverlap(t){const{extent:n,area:o}=this.config,r=t.data().map(c=>[c.index,c.value]),i=this.generateVoronoi(r);let s=0;t.each(function(){const c=i.cellPolygon(s);if(c&&this){const[d,se]=r[s],[ce,le]=(0,P.polygonCentroid)(c),ae=Math.abs((0,P.polygonArea)(c)),h=Math.round(Math.atan2(le-se,ce-d)/Math.PI*2),ue=n*(h===0?1:-1),fe=h===-1?-n:n+5,de=Math.abs(h)===1?"middle":h===0?"start":"end";this.style.display=ae<o?"none":"",this.setAttribute("text-anchor",de),this.setAttribute("dy",`0.${h===1?71:35}em`),this.setAttribute("transform",`translate(${ue}, ${fe})`)}s++})}}return b=b.default,b})()});
|