@carbon/charts 1.11.4 → 1.11.6
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/CHANGELOG.md +30 -0
- package/dist/angle-utils-264ed176.mjs.map +1 -1
- package/dist/angle-utils-ccc0d890.js.map +1 -1
- package/dist/{choropleth-b1a3729f.js → choropleth-300f112d.js} +15 -15
- package/dist/{choropleth-b1a3729f.js.map → choropleth-300f112d.js.map} +1 -1
- package/dist/{choropleth-141685a0.mjs → choropleth-9123f871.mjs} +1577 -1577
- package/dist/{choropleth-141685a0.mjs.map → choropleth-9123f871.mjs.map} +1 -1
- package/dist/color-scale-utils-2cd523be.js.map +1 -1
- package/dist/color-scale-utils-b9604b2c.mjs.map +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index.mjs +1 -1
- package/dist/demo/index.js +10 -10
- package/dist/demo/index.js.map +1 -1
- package/dist/demo/index.mjs +290 -299
- package/dist/demo/index.mjs.map +1 -1
- package/dist/demo/utils/package-versions.d.ts +5 -5
- package/dist/index-4b5d1e49.mjs.map +1 -1
- package/dist/index-becfb567.mjs.map +1 -1
- package/dist/index-d865d500.js.map +1 -1
- package/dist/index-eace9da9.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.map +1 -1
- package/dist/model/index.js +1 -1
- package/dist/model/index.js.map +1 -1
- package/dist/model/index.mjs +1 -1
- package/dist/model/index.mjs.map +1 -1
- package/package.json +16 -18
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";const y=require("d3"),c=require("./color-scale-utils-2cd523be.js"),r=require("./enums-aa2efd99.js"),
|
|
1
|
+
"use strict";const y=require("d3"),c=require("./color-scale-utils-2cd523be.js"),r=require("./enums-aa2efd99.js"),B=require("./a11y-c7c9d087.js"),O=require("./angle-utils-ccc0d890.js"),ie=require("d3-sankey"),dt=require("./_baseEach-326db134.js"),Nt=require("d3-cloud");function Bt(l,e,t,s){var n=-1,a=l==null?0:l.length;for(s&&a&&(t=l[++n]);++n<a;)t=e(t,l[n],n,l);return t}function Gt(l){return function(e){return l==null?void 0:l[e]}}var $t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ht=Gt($t);const zt=Ht;var Ft=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Wt="\\u0300-\\u036f",jt="\\ufe20-\\ufe2f",Zt="\\u20d0-\\u20ff",Xt=Wt+jt+Zt,qt="["+Xt+"]",Yt=RegExp(qt,"g");function Kt(l){return l=c.toString(l),l&&l.replace(Ft,zt).replace(Yt,"")}var Jt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Qt(l){return l.match(Jt)||[]}var es=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function ts(l){return es.test(l)}var ht="\\ud800-\\udfff",ss="\\u0300-\\u036f",ns="\\ufe20-\\ufe2f",as="\\u20d0-\\u20ff",is=ss+ns+as,ut="\\u2700-\\u27bf",pt="a-z\\xdf-\\xf6\\xf8-\\xff",rs="\\xac\\xb1\\xd7\\xf7",os="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",ls="\\u2000-\\u206f",cs=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",gt="A-Z\\xc0-\\xd6\\xd8-\\xde",ds="\\ufe0e\\ufe0f",mt=rs+os+ls+cs,vt="['’]",Fe="["+mt+"]",hs="["+is+"]",ft="\\d+",us="["+ut+"]",yt="["+pt+"]",Et="[^"+ht+mt+ft+ut+pt+gt+"]",ps="\\ud83c[\\udffb-\\udfff]",gs="(?:"+hs+"|"+ps+")",ms="[^"+ht+"]",Ot="(?:\\ud83c[\\udde6-\\uddff]){2}",bt="[\\ud800-\\udbff][\\udc00-\\udfff]",te="["+gt+"]",vs="\\u200d",We="(?:"+yt+"|"+Et+")",fs="(?:"+te+"|"+Et+")",je="(?:"+vt+"(?:d|ll|m|re|s|t|ve))?",Ze="(?:"+vt+"(?:D|LL|M|RE|S|T|VE))?",St=gs+"?",xt="["+ds+"]?",ys="(?:"+vs+"(?:"+[ms,Ot,bt].join("|")+")"+xt+St+")*",Es="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Os="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",bs=xt+St+ys,Ss="(?:"+[us,Ot,bt].join("|")+")"+bs,xs=RegExp([te+"?"+yt+"+"+je+"(?="+[Fe,te,"$"].join("|")+")",fs+"+"+Ze+"(?="+[Fe,te+We,"$"].join("|")+")",te+"?"+We+"+"+je,te+"+"+Ze,Os,Es,ft,Ss].join("|"),"g");function Ts(l){return l.match(xs)||[]}function Ms(l,e,t){return l=c.toString(l),e=t?void 0:e,e===void 0?ts(l)?Ts(l):Qt(l):l.match(e)||[]}var Cs="['’]",Ls=RegExp(Cs,"g");function Tt(l){return function(e){return Bt(Ms(Kt(e).replace(Ls,"")),l,"")}}function As(l,e,t){return l===l&&(t!==void 0&&(l=l<=t?l:t),e!==void 0&&(l=l>=e?l:e)),l}function Mt(l,e,t){return t===void 0&&(t=e,e=void 0),t!==void 0&&(t=O.toNumber(t),t=t===t?t:0),e!==void 0&&(e=O.toNumber(e),e=e===e?e:0),As(O.toNumber(l),e,t)}function Ds(l,e){var t=-1,s=c.isArrayLike(l)?Array(l.length):[];return dt.baseEach(l,function(n,a,i){s[++t]=e(n,a,i)}),s}function ws(l,e){var t=c.isArray(l)?c.arrayMap:Ds;return t(l,c.baseIteratee(e))}var Ps=1/0;function Rs(l,e){return c.baseFlatten(ws(l,e),Ps)}function Ct(l,e){return c.baseIsEqual(l,e)}var ks=Tt(function(l,e,t){return l+(t?"-":"")+e.toLowerCase()});const J=ks;function Is(l,e){var t;return dt.baseEach(l,function(s,n,a){return t=e(s,n,a),!t}),!!t}function _s(l,e,t){var s=c.isArray(l)?c.arraySome:Is;return t&&c.isIterateeCall(l,e,t)&&(e=void 0),s(l,c.baseIteratee(e))}class G{constructor(e,t,s){if(this.type="",this.renderType=r.RenderTypes.HTML,this.id="",this.parent=void 0,this.configs={},this.model=e,this.services=t,s&&(this.configs=s,this.configs.id)){const n=c.getProperty(this.model.getOptions(),"style","prefix");this.id=`${n}--${this.configs.id}`}this.parent||this.setParent(y.select(this.services.domUtils.getMainContainer()))}init(){}render(e=!0){console.error("Error: Component did not provide the required render function.")}destroy(){}setModel(e){this.model=e}setServices(e){this.services=e}setParent(e){var s;const t=this.parent;if(this.parent=e,!(t&&t.node()===e.node())&&this.type){const n=c.getProperty(this.model.getOptions(),"style","prefix");(s=this.parent)==null||s.classed(`${c.carbonPrefix}--${n}--${this.type}`,!0),t&&t.classed(`${c.carbonPrefix}--${n}--${this.type}`,!1)}}getParent(){return this.parent}getComponentContainer(e={withinChartClip:!1}){if(this.type){const t=c.getProperty(this.model.getOptions(),"style","prefix"),s=this.id?`#${this.id}`:"",n=O.DOMUtils.appendOrSelect(this.parent,`${this.renderType===r.RenderTypes.SVG?"svg":"div"}${s}.${c.carbonPrefix}--${t}--${this.type}`);if(e.withinChartClip){const a=this.model.get("chartClipId");if(a){const o=y.select(`#${a}`).select("rect");o.size()!==0&&parseFloat(o.attr("height"))>0&&n.attr("clip-path",`url(#${a})`)}}return n.attr("width","100%").attr("height","100%")}return this.parent}getOptions(){return this.configs.options?c.merge({},this.model.getOptions(),this.configs.options):this.model.getOptions()}}const ge=class ge extends G{constructor(){super(...arguments),this.type="toolbar",this.renderType=r.RenderTypes.HTML}init(){const e=()=>this.updateOverflowMenu(!1);this.services.events.addEventListener(r.Events.Toolbar.SHOW_OVERFLOW_MENU,()=>{this.renderOverflowMenu(),document.body.addEventListener("click",e)}),this.services.events.addEventListener(r.Events.Toolbar.HIDE_OVERFLOW_MENU,()=>{document.body.removeEventListener("click",e)})}render(e=!0){const t=this.getComponentContainer().attr("role","toolbar").attr("aria-label",`chart-${this.services.domUtils.getChartID()} toolbar`);if(c.getProperty(this.getOptions(),"data","loading"))t.html(""),this.overflowMenu=null;else{this.overflowMenu||(this.overflowMenu=t.append("div").attr("class","cds--overflow-menu-options cds--overflow-menu--flip cds--overflow-menu-options cds--overflow-menu--flip").attr("tabindex",-1).html("<ul role='menu'></ul>"));const{buttonList:n,overflowMenuItemList:a}=this.getControlConfigs();a&&n.push(this.getOverflowButtonConfig());const i=t.selectAll("div.toolbar-control").data(n,h=>h.id);i.exit().remove();const o=i.enter().append("div").attr("class","toolbar-control cds--overflow-menu cds--overflow-menu").attr("role","button"),d=this;o.merge(i).classed("disabled",h=>h.shouldBeDisabled()).attr("aria-disabled",h=>h.shouldBeDisabled()).attr("aria-label",h=>h.title).html(h=>`
|
|
2
2
|
<button
|
|
3
3
|
class="cds--overflow-menu__trigger cds--overflow-menu__trigger"
|
|
4
|
-
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${
|
|
4
|
+
aria-haspopup="true" aria-expanded="false" id="${this.services.domUtils.generateElementIDString(`control-${h.id}`)}" aria-label="${h.title}">
|
|
5
5
|
<svg focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" class="cds--overflow-menu__icon cds--overflow-menu__icon" viewBox="0 0 32 32" aria-hidden="true">
|
|
6
|
-
${
|
|
6
|
+
${h.iconSVG.content}
|
|
7
7
|
</svg>
|
|
8
|
-
</button>`).each(function(
|
|
8
|
+
</button>`).each(function(h,u){y.select(this).select("svg").style("will-change","transform").style("width",h.iconSVG.width!==void 0?h.iconSVG.width:"20px").style("height",h.iconSVG.height!==void 0?h.iconSVG.height:"20px"),y.select(this).select("button").on("click",m=>{h.shouldBeDisabled()||d.triggerFunctionAndEvent(h,m,this)}).on("keydown",m=>{m.key&&m.key==="Enter"||m.key===" "?(m.preventDefault(),d.triggerFunctionAndEvent(h,m,this)):m.key&&m.key==="ArrowLeft"?d.focusOnPreviousEnabledToolbarItem(u):m.key&&m.key==="ArrowRight"&&d.focusOnNextEnabledToolbarItem(u)})}),this.overflowButton=this.getComponentContainer().select(`button.cds--overflow-menu__trigger#${this.services.domUtils.generateElementIDString("control-toolbar-overflow-menu")}`)}}renderOverflowMenu(){const{overflowMenuItemList:e}=this.getControlConfigs(),t=this.overflowMenu.select("ul").selectAll("li.cds--overflow-menu-options__option").data(e,n=>c.getProperty(n,"id"));t.exit().remove();const s=t.enter().append("li").attr("id",n=>this.services.domUtils.generateElementIDString(`control-${n.id}`)).attr("class","cds--overflow-menu-options__option cds--overflow-menu-options__option").attr("role","menuitem").attr("tabindex",1);s.append("button").attr("class","cds--overflow-menu-options__btn cds--overflow-menu-options__btn"),s.merge(t).classed("cds--overflow-menu-options__option--disabled",n=>n.shouldBeDisabled()).classed("cds--overflow-menu-options__option--disabled",n=>n.shouldBeDisabled()).attr("aria-disabled",n=>n.shouldBeDisabled()).selectAll("button").text(n=>n.text)}isOverflowMenuOpen(){return this.overflowMenu.classed("is-open")}updateOverflowMenu(e){this.overflowMenu&&(this.overflowMenu.classed("is-open",e),this.overflowButton&&(this.overflowButton.attr("aria-expanded",e),y.select(this.overflowButton.node().parentNode).classed("cds--overflow-menu--open",e).classed("cds--overflow-menu--open",e)),e?this.services.events.dispatchEvent(r.Events.Toolbar.SHOW_OVERFLOW_MENU):this.services.events.dispatchEvent(r.Events.Toolbar.HIDE_OVERFLOW_MENU))}focusOnPreviousEnabledToolbarItem(e){const t=this.getToolbarButtonItems();let s=t.length;for(let n=e-1;n>=0;n--)if(!t[n].shouldBeDisabled()){s=n;break}if(s<t.length){const n=y.select(`button#${this.services.domUtils.generateElementIDString(`control-${t[s].id}`)}`).node();"focus"in n&&n.focus()}}focusOnNextEnabledToolbarItem(e){const t=this.getToolbarButtonItems();let s=-1;for(let n=e+1;n<t.length;n++)if(!t[n].shouldBeDisabled()){s=n;break}if(s>-1){const n=y.select(`button#${this.services.domUtils.generateElementIDString(`control-${t[s].id}`)}`).node();"focus"in n&&n.focus()}}focusOnPreviousEnabledMenuItem(e){const t=this.getOverflowMenuItems();let s=t.length;for(let n=e-1;n>=0;n--)if(!t[n].shouldBeDisabled()){s=n;break}if(s<t.length){const n=y.select(`#${this.services.domUtils.generateElementIDString(`control-${t[s].id}`)} button`).node();"focus"in n&&n.focus()}}focusOnNextEnabledMenuItem(e){const t=this.getOverflowMenuItems();let s=-1;for(let n=e+1;n<t.length;n++)if(!t[n].shouldBeDisabled()){s=n;break}if(s>-1){const n=y.select(`#${this.services.domUtils.generateElementIDString(`control-${t[s].id}`)} button`).node();"focus"in n&&n.focus()}}toggleOverflowMenu(e){if(this.isOverflowMenuOpen())this.updateOverflowMenu(!1);else{this.updateOverflowMenu(!0);const t=this;this.getOverflowMenuItems().forEach((n,a)=>{const i=y.select(`#${this.services.domUtils.generateElementIDString(`control-${n.id}`)}`);i!==null&&(i.on("click",()=>{t.triggerFunctionAndEvent(n,e,i.node()),t.updateOverflowMenu(!1)}),i.on("keydown",o=>{o&&o.key==="Enter"?t.triggerFunctionAndEvent(n,e,i.node()):o&&o.key==="ArrowUp"?t.focusOnPreviousEnabledMenuItem(a):o&&o.key==="ArrowDown"?t.focusOnNextEnabledMenuItem(a):o&&o.key==="Escape"&&t.updateOverflowMenu(!1),o.preventDefault()}))}),t.focusOnNextEnabledMenuItem(-1)}e&&e.stopImmediatePropagation()}triggerFunctionAndEvent(e,t,s){typeof e.shouldBeDisabled=="function"&&e.shouldBeDisabled()||(typeof e.clickFunction=="function"&&e.clickFunction(t),this.services.events.dispatchEvent(r.Events.Toolbar.BUTTON_CLICK,{control:e,event:t,element:s}))}getControlConfigs(){const e=c.getProperty(this.getOptions(),"toolbar","numberOfIcons")-1,t=c.getProperty(this.getOptions(),"toolbar","controls"),s=[],n=[],a=[];return t.forEach(i=>{let o=null;i.type===r.ToolbarControlTypes.CUSTOM?(c.getProperty(i,"id")===null&&(i.id=`toolbar-button-${ge.buttonID++}`),c.getProperty(i,"shouldBeDisabled")===null&&(i.shouldBeDisabled=()=>!1),o=i):o=this.getControlConfigByType(i.type),o&&(o.text=i.text?i.text:i.type,o.id.indexOf("toolbar-export")!==-1?s.push(o):n.length<e?c.getProperty(o,"iconSVG","content")===null?a.push(o):n.push(o):a.push(o))}),a.push(...s),a.length?{buttonList:n,overflowMenuItemList:a}:{buttonList:n}}getToolbarButtonItems(){const{buttonList:e,overflowMenuItemList:t}=this.getControlConfigs();return t&&e.push(this.getOverflowButtonConfig()),e||[]}getOverflowMenuItems(){const{overflowMenuItemList:e}=this.getControlConfigs();return e||[]}getOverflowButtonConfig(){return{id:"toolbar-overflow-menu",title:"More options",shouldBeDisabled:()=>!1,iconSVG:{content:`<circle cx="16" cy="8" r="2"></circle>
|
|
9
9
|
<circle cx="16" cy="16" r="2"></circle>
|
|
10
|
-
<circle cx="16" cy="24" r="2"></circle>`},clickFunction:
|
|
10
|
+
<circle cx="16" cy="24" r="2"></circle>`},clickFunction:e=>this.toggleOverflowMenu(e)}}getControlConfigByType(e){const t=this.services.zoom&&this.services.zoom.isZoomBarEnabled()&&!this.services.zoom.isEmptyState(),s=this.model.getDisplayData();let n;switch(e){case r.ToolbarControlTypes.ZOOM_IN:t&&(n={id:"toolbar-zoomIn",title:"Zoom in",shouldBeDisabled:()=>this.services.zoom.isMinZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.zoomIn()});break;case r.ToolbarControlTypes.ZOOM_OUT:t&&(n={id:"toolbar-zoomOut",title:"Zoom out",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.zoomOut()});break;case r.ToolbarControlTypes.RESET_ZOOM:t&&(n={id:"toolbar-resetZoom",title:"Reset zoom",shouldBeDisabled:()=>this.services.zoom.isMaxZoomDomain(),iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.zoom.resetZoomDomain()});break;case r.ToolbarControlTypes.MAKE_FULLSCREEN:n={id:"toolbar-makefullscreen",iconSVG:{content:this.getControlIconByType(e),width:"15px",height:"15px"},title:"Make fullscreen",shouldBeDisabled:()=>!1,clickFunction:()=>{this.services.domUtils.toggleFullscreen()}};break;case r.ToolbarControlTypes.SHOW_AS_DATATABLE:n={id:"toolbar-showasdatatable",iconSVG:{content:this.getControlIconByType(e)},title:"Show as table",shouldBeDisabled:()=>s.length===0,clickFunction:()=>this.services.events.dispatchEvent(r.Events.Modal.SHOW)};break;case r.ToolbarControlTypes.EXPORT_CSV:n={id:"toolbar-export-CSV",title:"Export as CSV",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.model.exportToCSV()};break;case r.ToolbarControlTypes.EXPORT_PNG:n={id:"toolbar-export-PNG",title:"Export as PNG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.domUtils.exportToPNG()};break;case r.ToolbarControlTypes.EXPORT_JPG:n={id:"toolbar-export-JPG",title:"Export as JPG",shouldBeDisabled:()=>!1,iconSVG:{content:this.getControlIconByType(e)},clickFunction:()=>this.services.domUtils.exportToJPG()};break;default:throw Error("Not supported toolbar control type: "+e)}return n}getControlIconByType(e){switch(e){case r.ToolbarControlTypes.ZOOM_IN:return`<polygon points="19 13 15 13 15 9 13 9 13 13 9 13 9 15 13 15 13 19 15 19 15 15 19 15 19 13"/>
|
|
11
11
|
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case r.ToolbarControlTypes.ZOOM_OUT:return`<rect x="9" y="13" width="10" height="2"/>
|
|
12
|
-
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case r.ToolbarControlTypes.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case r.ToolbarControlTypes.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case r.ToolbarControlTypes.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+
|
|
12
|
+
<path d="M22.45,21A10.87,10.87,0,0,0,25,14,11,11,0,1,0,14,25a10.87,10.87,0,0,0,7-2.55L28.59,30,30,28.59ZM14,23a9,9,0,1,1,9-9A9,9,0,0,1,14,23Z"/>`;case r.ToolbarControlTypes.RESET_ZOOM:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.MAKE_FULLSCREEN:return'<polygon points="21 2 21 4 26.59 4 17 13.58 18.41 15 28 5.41 28 11 30 11 30 2 21 2"/><polygon points="15 18.42 13.59 17 4 26.59 4 21 2 21 2 30 11 30 11 28 5.41 28 15 18.42"/>';case r.ToolbarControlTypes.SHOW_AS_DATATABLE:return'<rect x="4" y="6" width="18" height="2"/><rect x="4" y="12" width="18" height="2"/><rect x="4" y="18" width="18" height="2"/><rect x="4" y="24" width="18" height="2"/><rect x="26" y="6" width="2" height="2"/><rect x="26" y="12" width="2" height="2"/><rect x="26" y="18" width="2" height="2"/><rect x="26" y="24" width="2" height="2"/>';case r.ToolbarControlTypes.EXPORT_CSV:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_JPG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';case r.ToolbarControlTypes.EXPORT_PNG:return'<path d="M22.4478,21A10.855,10.855,0,0,0,25,14,10.99,10.99,0,0,0,6,6.4658V2H4v8h8V8H7.332a8.9768,8.9768,0,1,1-2.1,8H3.1912A11.0118,11.0118,0,0,0,14,25a10.855,10.855,0,0,0,7-2.5522L28.5859,30,30,28.5859Z"/>';default:throw Error("Not supported toolbar control type: "+e)}}};ge.buttonID=0;let Se=ge;const me=class me extends G{constructor(e,t,s,n){super(e,t,n),this.type="layout",this.configs=n,this.children=s,this._instanceID=me.instanceID++,this.init()}init(){this.children.forEach(e=>{e.components.forEach(t=>{t.init()})})}getPreferedAndFixedSizeSum(){const e=this.parent;let t=0;return e.selectAll(`div.layout-child-${this._instanceID}`).filter(s=>{const n=c.getProperty(s,"growth");return n===r.LayoutGrowth.PREFERRED||n===r.LayoutGrowth.FIXED}).each(function(s){t+=s.size}),t}getNumOfStretchChildren(){return this.parent.selectAll(`div.layout-child-${this._instanceID}`).filter(t=>c.getProperty(t,"growth")===r.LayoutGrowth.STRETCH).size()}render(e=!0){const t=this.parent,{width:s,height:n}=O.DOMUtils.getHTMLElementSize(t.node()),a=this.configs.direction===r.LayoutDirection.ROW||this.configs.direction===r.LayoutDirection.ROW_REVERSE,i=c.getProperty(this.model.getOptions(),"style","prefix"),o=t.classed(`${c.carbonPrefix}--${i}--layout-row`,this.configs.direction===r.LayoutDirection.ROW).classed(`${c.carbonPrefix}--${i}--layout-row-reverse`,this.configs.direction===r.LayoutDirection.ROW_REVERSE).classed(`${c.carbonPrefix}--${i}--layout-column`,this.configs.direction===r.LayoutDirection.COLUMN).classed(`${c.carbonPrefix}--${i}--layout-column-reverse`,this.configs.direction===r.LayoutDirection.COLUMN_REVERSE).classed(`${c.carbonPrefix}--${i}--layout-alignitems-center`,this.configs.alignItems===r.LayoutAlignItems.CENTER).selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);o.enter().append("div").merge(t.selectAll(`div.layout-child-${this._instanceID}`)).attr("class",u=>`layout-child layout-child-${this._instanceID} ${u.id}`).each(function(u){u.components.forEach(m=>{const p=y.select(this),v=c.getProperty(u,"renderType")===r.RenderTypes.SVG;m.setParent(v?O.DOMUtils.appendOrSelect(p,"svg.layout-svg-wrapper").attr("width","100%").attr("height","100%"):p);const f=c.getProperty(u,"growth");(f===r.LayoutGrowth.PREFERRED||f===r.LayoutGrowth.FIXED)&&m.render(e)})}),t.selectAll(`div.layout-child-${this._instanceID}`).style("height",null).style("width",null).each(function(u){const m=c.getProperty(u,"growth"),g=c.getProperty(u,"renderType")===r.RenderTypes.SVG?O.DOMUtils.getSVGElementSize(y.select(this).select("svg.layout-svg-wrapper"),{useBBox:!0}):O.DOMUtils.getHTMLElementSize(this);if(m===r.LayoutGrowth.PREFERRED){const v=a?g.width:g.height,f=a?s:n;u.size=v/f*100}}),o.exit().remove(),this.children.filter(u=>c.getProperty(u,"growth")===r.LayoutGrowth.STRETCH).forEach(u=>{u.size=(100-+this.getPreferedAndFixedSizeSum())/+this.getNumOfStretchChildren()});const h=t.selectAll(`div.layout-child-${this._instanceID}`).data(this.children,u=>u.id);a?h.style("width",u=>`${u.size/100*s}px`).style("height","100%"):h.style("height",u=>`${u.size/100*n}px`).style("width","100%"),h.each(function(u){u.components.forEach(m=>{c.getProperty(u,"growth")===r.LayoutGrowth.STRETCH&&m.render(e)})})}setModel(e){super.setModel(e),this.children.forEach(t=>{t.components.forEach(s=>s.setModel(e))})}setServices(e){super.setServices(e),this.children.forEach(t=>{t.components.forEach(s=>s.setServices(e))})}destroy(){this.children.forEach(e=>{e.components.forEach(t=>t.destroy())})}};me.instanceID=Math.floor(Math.random()*99999999999);let xe=me;class Us extends G{constructor(){super(...arguments),this.type="spacer"}render(e=!1){this.getComponentContainer().style("width",`${this.configs.size||c.spacers.default.size}px`).style("height",`${this.configs.size||c.spacers.default.size}px`).attr("opacity",0)}}var Vs={prefix:"bx",selectorTabbable:`
|
|
13
13
|
a[href], area[href], input:not([disabled]):not([tabindex='-1']),
|
|
14
14
|
button:not([disabled]):not([tabindex='-1']),select:not([disabled]):not([tabindex='-1']),
|
|
15
15
|
textarea:not([disabled]):not([tabindex='-1']),
|
|
@@ -19,9 +19,9 @@
|
|
|
19
19
|
button:not([disabled]),select:not([disabled]),
|
|
20
20
|
textarea:not([disabled]),
|
|
21
21
|
iframe, object, embed, *[tabindex], *[contenteditable=true]
|
|
22
|
-
`},
|
|
23
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hs(
|
|
24
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(o,e){if(o){if(typeof o=="string")return Ce(o,e);var t=Object.prototype.toString.call(o).slice(8,-1);if(t==="Object"&&o.constructor&&(t=o.constructor.name),t==="Map"||t==="Set")return Array.from(o);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Ce(o,e)}}function un(o){if(typeof Symbol<"u"&&o[Symbol.iterator]!=null||o["@@iterator"]!=null)return Array.from(o)}function pn(o){if(Array.isArray(o))return Ce(o)}function Ce(o,e){(e==null||e>o.length)&&(e=o.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=o[t];return s}function gn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function je(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function mn(o,e,t){return e&&je(o.prototype,e),t&&je(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function vn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Le(o,e)}function Le(o,e){return Le=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Le(o,e)}function fn(o){var e=On();return function(){var s=de(o),n;if(e){var a=de(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return yn(this,n)}}function yn(o,e){if(e&&(Me(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return En(o)}function En(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function On(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function de(o){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},de(o)}function bn(o){var e=function(t){vn(n,t);var s=fn(n);function n(){return gn(this,n),s.apply(this,arguments)}return mn(n,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var i=this,l=arguments.length,d=new Array(l),h=0;h<l;h++)d[h]=arguments[h];var u=typeof d[0]=="string"?d.shift():void 0,m=Object(d[0])===d[0]&&typeof d[0]!="function"?d.shift():void 0,p=typeof d[0]=="function"?d.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,m)){p&&p(null,!0);return}var g={group:m&&m.group,state:u},v=[g.group,u].filter(Boolean).join("-").split("-").map(function(M){return M[0].toUpperCase()+M.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(v)],{bubbles:!0,cancelable:!0,detail:m}),b=m&&m.delegatorNode||this.element,E=!b.dispatchEvent(f);if(E){if(p){var S=new Error("Changing state (".concat(JSON.stringify(g),") has been canceled."));S.canceled=!0,p(S)}}else{var T=[u,m].filter(Boolean);this._changeState.apply(this,cn(T).concat([function(){b.dispatchEvent(new CustomEvent(i.options["eventAfter".concat(v)],{bubbles:!0,cancelable:!0,detail:m})),p&&p()}]))}}}]),n}(o);return e}function Ae(o,e){var t=o.target,s=o.currentTarget;if(typeof t.matches=="function"){if(t.matches(e))return t;if(t.matches("".concat(e," *"))){var n=t.closest(e);if((s.nodeType===Node.DOCUMENT_NODE?s.documentElement:s).contains(n))return n}}}function Ze(o){if(!o||typeof o=="function")return{launchingElement:null,launchingEvent:null};var e=o.delegateTarget||o.currentTarget||o,t=o.currentTarget&&o;if(e&&!e.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(t&&!t.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:e,launchingEvent:t}}function De(o){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(o)}function Sn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Xe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function xn(o,e,t){return e&&Xe(o.prototype,e),t&&Xe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Tn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&we(o,e)}function we(o,e){return we=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},we(o,e)}function Mn(o){var e=An();return function(){var s=he(o),n;if(e){var a=he(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Cn(this,n)}}function Cn(o,e){if(e&&(De(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ln(o)}function Ln(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function An(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(o){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},he(o)}function Dn(o){var e=function(t){Tn(n,t);var s=Mn(n);function n(){return Sn(this,n),s.apply(this,arguments)}return xn(n,[{key:"show",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("shown",Ze(i),l)}},{key:"hide",value:function(i,l){(!i||typeof i=="function")&&(l=i),this.changeState("hidden",Ze(i),l)}}]),n}(o);return e}var wn=[bn,Dn];const Pn=wn;function Rn(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var At=function(){};process.env.NODE_ENV!=="production"&&(At=function(o,e,t){var s=arguments.length;t=new Array(s>2?s-2:0);for(var n=2;n<s;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!o){var a=0,i="Warning: "+e.replace(/%s/g,function(){return t[a++]});typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}});var kn=At;const In=Rn(kn);function Pe(o){"@babel/helpers - typeof";return Pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Pe(o)}function _n(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function Un(o,e,t){return e&&qe(o.prototype,e),t&&qe(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Vn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Re(o,e)}function Re(o,e){return Re=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Re(o,e)}function Bn(o){var e=$n();return function(){var s=ue(o),n;if(e){var a=ue(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Nn(this,n)}}function Nn(o,e){if(e&&(Pe(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gn(o)}function Gn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function $n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(o){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(o)}function Hn(o){var e=function(t){Vn(n,t);var s=Bn(n);function n(){return _n(this,n),s.apply(this,arguments)}return Un(n,null,[{key:"init",value:function(){var i=this,l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=Object.assign(Object.create(this.options),d);if(!l||l.nodeType!==Node.ELEMENT_NODE&&l.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(l.nodeType===Node.ELEMENT_NODE&&l.matches(h.selectorInit))this.create(l,d);else{var u=h.initEventNames.map(function(m){return ie(l,m,function(p){var g=Ae(p,"[".concat(h.attribInitTarget,"]"));if(g){p.delegateTarget=g;var v=g.ownerDocument.querySelectorAll(g.getAttribute(h.attribInitTarget));if(v.length>1)throw new Error("Target widget must be unique.");if(v.length===1){g.tagName==="A"&&p.preventDefault();var f=i.create(v[0],d);typeof f.createdByLauncher=="function"&&f.createdByLauncher(p)}}})});return{release:function(){for(var p=u.pop();p;p=u.pop())p.release()}}}return""}}]),n.forLazyInit=!0,n}(o);return e}function ke(o){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(o)}function zn(o,e){if(!(o instanceof e))throw new TypeError("Cannot call a class as a function")}function Ye(o,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(o,s.key,s)}}function Fn(o,e,t){return e&&Ye(o.prototype,e),t&&Ye(o,t),Object.defineProperty(o,"prototype",{writable:!1}),o}function Wn(o,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(e&&e.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),e&&Ie(o,e)}function Ie(o,e){return Ie=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ie(o,e)}function jn(o){var e=qn();return function(){var s=pe(o),n;if(e){var a=pe(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Zn(this,n)}}function Zn(o,e){if(e&&(ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xn(o)}function Xn(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function qn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pe(o){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pe(o)}var Yn=function(o){Wn(t,o);var e=jn(t);function t(s,n){var a;return zn(this,t),a=e.call(this,s,n),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(i){var l=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!l.contains(i.target)&&a.options.selectorsFloatingMenus.every(function(d){return!Ae(i,d)})&&a.element.querySelector(Ee.selectorTabbable).focus()},a._hookCloseActions(),a}return Fn(t,[{key:"createdByLauncher",value:function(n){this.show(n)}},{key:"shouldStateBeChanged",value:function(n){return n==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(n,a,i){var l=this,d,h=function(){if(d&&(d=l.unmanage(d).release()),n==="shown"&&l.element.offsetWidth>0&&l.element.offsetHeight>0){l.previouslyFocusedNode=l.element.ownerDocument.activeElement;var g=l.element.querySelector(l.options.selectorPrimaryFocus)||l.element.querySelector(Ee.selectorTabbable);g.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&In(g,"Modals need to contain a focusable element by either using "+"`".concat(l.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}i()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),n==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,m=u?"focusin":"focus";this._handleFocusinListener=this.manage(ie(this.element.ownerDocument,m,this._handleFocusin,!u))}n==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):n==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),d=this.manage(ie(this.element,"transitionend",h))}},{key:"_hookCloseActions",value:function(){var n=this;this.manage(ie(this.element,"click",function(a){var i=Ae(a,n.options.selectorModalClose);i&&(a.delegateTarget=i),(i||a.target===n.element)&&n.hide(a)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(ie(this.element.ownerDocument.body,"keydown",function(a){a.which===27&&n.shouldStateBeChanged("hidden")&&(a.stopPropagation(),n.hide(a))}))}}],[{key:"options",get:function(){var n=Ee.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(n,"--overflow-menu-options"),".".concat(n,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(n,"--modal-container"),classVisible:"is-visible",classBody:"".concat(n,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),t.components=new WeakMap,t}(Ws(Js,Hn,Pn,ln));const Kn=Yn;class Jn extends G{constructor(e,t,s){super(e,t,s),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Kn.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(r.Events.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(r.Events.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),t=c.getProperty(e,"style","prefix"),s=this.model.getTabularDataArray();return`
|
|
22
|
+
`},be=Vs;function Xe(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function Ns(l,e,t){return e&&Xe(l.prototype,e),t&&Xe(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function Bs(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function Gs(l){return Fs(l)||zs(l)||Hs(l)||$s()}function $s(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
23
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hs(l,e){if(l){if(typeof l=="string")return Te(l,e);var t=Object.prototype.toString.call(l).slice(8,-1);if(t==="Object"&&l.constructor&&(t=l.constructor.name),t==="Map"||t==="Set")return Array.from(l);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Te(l,e)}}function zs(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function Fs(l){if(Array.isArray(l))return Te(l)}function Te(l,e){(e==null||e>l.length)&&(e=l.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=l[t];return s}function Lt(l){return l.reduce(function(e,t){return Array.isArray(t)?e.push.apply(e,Gs(Lt(t))):e.push(t),e},[])}function Ws(){for(var l=arguments.length,e=new Array(l),t=0;t<l;t++)e[t]=arguments[t];return Lt(e).reduce(function(s,n){return n(s)},function(){function s(){Bs(this,s)}return Ns(s)}())}function Me(l){"@babel/helpers - typeof";return Me=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Me(l)}function js(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function qe(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function Zs(l,e,t){return e&&qe(l.prototype,e),t&&qe(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function Xs(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Ce(l,e)}function Ce(l,e){return Ce=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ce(l,e)}function qs(l){var e=Ks();return function(){var s=ce(l),n;if(e){var a=ce(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Ys(this,n)}}function Ys(l,e){if(e&&(Me(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return At(l)}function At(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Ks(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ce(l){return ce=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ce(l)}function Js(l){var e=function(t){Xs(n,t);var s=qs(n);function n(a){var i,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(js(this,n),i=s.call(this,a,o),i.children=[],!a||a.nodeType!==Node.ELEMENT_NODE)throw new TypeError("DOM element should be given to initialize this widget.");return i.element=a,i.options=Object.assign(Object.create(i.constructor.options),o),i.constructor.components.set(i.element,At(i)),i}return Zs(n,[{key:"release",value:function(){for(var i=this.children.pop();i;i=this.children.pop())i.release();return this.constructor.components.delete(this.element),null}}],[{key:"create",value:function(i,o){return this.components.get(i)||new this(i,o)}}]),n}(l);return e}function Le(l){"@babel/helpers - typeof";return Le=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Le(l)}function Qs(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function Ye(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function en(l,e,t){return e&&Ye(l.prototype,e),t&&Ye(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function le(){return typeof Reflect<"u"&&Reflect.get?le=Reflect.get:le=function(e,t,s){var n=tn(e,t);if(n){var a=Object.getOwnPropertyDescriptor(n,t);return a.get?a.get.call(arguments.length<3?e:s):a.value}},le.apply(this,arguments)}function tn(l,e){for(;!Object.prototype.hasOwnProperty.call(l,e)&&(l=ne(l),l!==null););return l}function sn(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Ae(l,e)}function Ae(l,e){return Ae=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ae(l,e)}function nn(l){var e=on();return function(){var s=ne(l),n;if(e){var a=ne(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return an(this,n)}}function an(l,e){if(e&&(Le(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return rn(l)}function rn(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function on(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ne(l){return ne=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ne(l)}function ln(l){var e=function(t){sn(n,t);var s=nn(n);function n(){var a;Qs(this,n);for(var i=arguments.length,o=new Array(i),d=0;d<i;d++)o[d]=arguments[d];return a=s.call.apply(s,[this].concat(o)),a.handles=new Set,a}return en(n,[{key:"manage",value:function(i){return this.handles.add(i),i}},{key:"unmanage",value:function(i){return this.handles.delete(i),i}},{key:"release",value:function(){var i=this;return this.handles.forEach(function(o){o.release(),i.handles.delete(o)}),le(ne(n.prototype),"release",this).call(this)}}]),n}(l);return e}function re(l){for(var e=arguments.length,t=new Array(e>1?e-1:0),s=1;s<e;s++)t[s-1]=arguments[s];return l.addEventListener.apply(l,t),{release:function(){return l.removeEventListener.apply(l,t),null}}}function De(l){"@babel/helpers - typeof";return De=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(l)}function cn(l){return pn(l)||un(l)||hn(l)||dn()}function dn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
24
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hn(l,e){if(l){if(typeof l=="string")return we(l,e);var t=Object.prototype.toString.call(l).slice(8,-1);if(t==="Object"&&l.constructor&&(t=l.constructor.name),t==="Map"||t==="Set")return Array.from(l);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return we(l,e)}}function un(l){if(typeof Symbol<"u"&&l[Symbol.iterator]!=null||l["@@iterator"]!=null)return Array.from(l)}function pn(l){if(Array.isArray(l))return we(l)}function we(l,e){(e==null||e>l.length)&&(e=l.length);for(var t=0,s=new Array(e);t<e;t++)s[t]=l[t];return s}function gn(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function Ke(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function mn(l,e,t){return e&&Ke(l.prototype,e),t&&Ke(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function vn(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Pe(l,e)}function Pe(l,e){return Pe=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Pe(l,e)}function fn(l){var e=On();return function(){var s=de(l),n;if(e){var a=de(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return yn(this,n)}}function yn(l,e){if(e&&(De(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return En(l)}function En(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function On(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function de(l){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},de(l)}function bn(l){var e=function(t){vn(n,t);var s=fn(n);function n(){return gn(this,n),s.apply(this,arguments)}return mn(n,[{key:"_changeState",value:function(){throw new Error("_changeState() should be overridden to perform actual change in state.")}},{key:"changeState",value:function(){for(var i=this,o=arguments.length,d=new Array(o),h=0;h<o;h++)d[h]=arguments[h];var u=typeof d[0]=="string"?d.shift():void 0,m=Object(d[0])===d[0]&&typeof d[0]!="function"?d.shift():void 0,p=typeof d[0]=="function"?d.shift():void 0;if(typeof this.shouldStateBeChanged=="function"&&!this.shouldStateBeChanged(u,m)){p&&p(null,!0);return}var g={group:m&&m.group,state:u},v=[g.group,u].filter(Boolean).join("-").split("-").map(function(C){return C[0].toUpperCase()+C.substr(1)}).join(""),f=new CustomEvent(this.options["eventBefore".concat(v)],{bubbles:!0,cancelable:!0,detail:m}),b=m&&m.delegatorNode||this.element,E=!b.dispatchEvent(f);if(E){if(p){var S=new Error("Changing state (".concat(JSON.stringify(g),") has been canceled."));S.canceled=!0,p(S)}}else{var T=[u,m].filter(Boolean);this._changeState.apply(this,cn(T).concat([function(){b.dispatchEvent(new CustomEvent(i.options["eventAfter".concat(v)],{bubbles:!0,cancelable:!0,detail:m})),p&&p()}]))}}}]),n}(l);return e}function Re(l,e){var t=l.target,s=l.currentTarget;if(typeof t.matches=="function"){if(t.matches(e))return t;if(t.matches("".concat(e," *"))){var n=t.closest(e);if((s.nodeType===Node.DOCUMENT_NODE?s.documentElement:s).contains(n))return n}}}function Je(l){if(!l||typeof l=="function")return{launchingElement:null,launchingEvent:null};var e=l.delegateTarget||l.currentTarget||l,t=l.currentTarget&&l;if(e&&!e.nodeType)throw new TypeError("DOM Node should be given for launching element.");if(t&&!t.type)throw new TypeError("DOM event should be given for launching event.");return{launchingElement:e,launchingEvent:t}}function ke(l){"@babel/helpers - typeof";return ke=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ke(l)}function Sn(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function Qe(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function xn(l,e,t){return e&&Qe(l.prototype,e),t&&Qe(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function Tn(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Ie(l,e)}function Ie(l,e){return Ie=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ie(l,e)}function Mn(l){var e=An();return function(){var s=he(l),n;if(e){var a=he(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Cn(this,n)}}function Cn(l,e){if(e&&(ke(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ln(l)}function Ln(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function An(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function he(l){return he=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},he(l)}function Dn(l){var e=function(t){Tn(n,t);var s=Mn(n);function n(){return Sn(this,n),s.apply(this,arguments)}return xn(n,[{key:"show",value:function(i,o){(!i||typeof i=="function")&&(o=i),this.changeState("shown",Je(i),o)}},{key:"hide",value:function(i,o){(!i||typeof i=="function")&&(o=i),this.changeState("hidden",Je(i),o)}}]),n}(l);return e}var wn=[bn,Dn];const Pn=wn;function Rn(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Dt=function(){};process.env.NODE_ENV!=="production"&&(Dt=function(l,e,t){var s=arguments.length;t=new Array(s>2?s-2:0);for(var n=2;n<s;n++)t[n-2]=arguments[n];if(e===void 0)throw new Error("`warning(condition, format, ...args)` requires a warning message argument");if(e.length<10||/^[s\W]*$/.test(e))throw new Error("The warning format should be able to uniquely identify this warning. Please, use a more descriptive format than: "+e);if(!l){var a=0,i="Warning: "+e.replace(/%s/g,function(){return t[a++]});typeof console<"u"&&console.error(i);try{throw new Error(i)}catch{}}});var kn=Dt;const In=Rn(kn);function _e(l){"@babel/helpers - typeof";return _e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_e(l)}function _n(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function et(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function Un(l,e,t){return e&&et(l.prototype,e),t&&et(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function Vn(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Ue(l,e)}function Ue(l,e){return Ue=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ue(l,e)}function Nn(l){var e=$n();return function(){var s=ue(l),n;if(e){var a=ue(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Bn(this,n)}}function Bn(l,e){if(e&&(_e(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gn(l)}function Gn(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function $n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ue(l){return ue=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},ue(l)}function Hn(l){var e=function(t){Vn(n,t);var s=Nn(n);function n(){return _n(this,n),s.apply(this,arguments)}return Un(n,null,[{key:"init",value:function(){var i=this,o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=Object.assign(Object.create(this.options),d);if(!o||o.nodeType!==Node.ELEMENT_NODE&&o.nodeType!==Node.DOCUMENT_NODE)throw new TypeError("DOM document or DOM element should be given to search for and initialize this widget.");if(o.nodeType===Node.ELEMENT_NODE&&o.matches(h.selectorInit))this.create(o,d);else{var u=h.initEventNames.map(function(m){return re(o,m,function(p){var g=Re(p,"[".concat(h.attribInitTarget,"]"));if(g){p.delegateTarget=g;var v=g.ownerDocument.querySelectorAll(g.getAttribute(h.attribInitTarget));if(v.length>1)throw new Error("Target widget must be unique.");if(v.length===1){g.tagName==="A"&&p.preventDefault();var f=i.create(v[0],d);typeof f.createdByLauncher=="function"&&f.createdByLauncher(p)}}})});return{release:function(){for(var p=u.pop();p;p=u.pop())p.release()}}}return""}}]),n.forLazyInit=!0,n}(l);return e}function Ve(l){"@babel/helpers - typeof";return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(l)}function zn(l,e){if(!(l instanceof e))throw new TypeError("Cannot call a class as a function")}function tt(l,e){for(var t=0;t<e.length;t++){var s=e[t];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(l,s.key,s)}}function Fn(l,e,t){return e&&tt(l.prototype,e),t&&tt(l,t),Object.defineProperty(l,"prototype",{writable:!1}),l}function Wn(l,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&Ne(l,e)}function Ne(l,e){return Ne=Object.setPrototypeOf||function(s,n){return s.__proto__=n,s},Ne(l,e)}function jn(l){var e=qn();return function(){var s=pe(l),n;if(e){var a=pe(this).constructor;n=Reflect.construct(s,arguments,a)}else n=s.apply(this,arguments);return Zn(this,n)}}function Zn(l,e){if(e&&(Ve(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Xn(l)}function Xn(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function qn(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function pe(l){return pe=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},pe(l)}var Yn=function(l){Wn(t,l);var e=jn(t);function t(s,n){var a;return zn(this,t),a=e.call(this,s,n),a._handleFocusinListener=void 0,a._handleKeydownListener=void 0,a._handleFocusin=function(i){var o=a.element.querySelector(a.options.selectorModalContainer)||a.element;a.element.classList.contains(a.options.classVisible)&&!o.contains(i.target)&&a.options.selectorsFloatingMenus.every(function(d){return!Re(i,d)})&&a.element.querySelector(be.selectorTabbable).focus()},a._hookCloseActions(),a}return Fn(t,[{key:"createdByLauncher",value:function(n){this.show(n)}},{key:"shouldStateBeChanged",value:function(n){return n==="shown"?!this.element.classList.contains(this.options.classVisible):this.element.classList.contains(this.options.classVisible)}},{key:"_changeState",value:function(n,a,i){var o=this,d,h=function(){if(d&&(d=o.unmanage(d).release()),n==="shown"&&o.element.offsetWidth>0&&o.element.offsetHeight>0){o.previouslyFocusedNode=o.element.ownerDocument.activeElement;var g=o.element.querySelector(o.options.selectorPrimaryFocus)||o.element.querySelector(be.selectorTabbable);g.focus(),process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="production"&&In(g,"Modals need to contain a focusable element by either using "+"`".concat(o.options.selectorPrimaryFocus,"` or settings.selectorTabbable."))}i()};if(this._handleFocusinListener&&(this._handleFocusinListener=this.unmanage(this._handleFocusinListener).release()),n==="shown"){var u="onfocusin"in this.element.ownerDocument.defaultView,m=u?"focusin":"focus";this._handleFocusinListener=this.manage(re(this.element.ownerDocument,m,this._handleFocusin,!u))}n==="hidden"?(this.element.classList.toggle(this.options.classVisible,!1),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!1),(this.options.selectorFocusOnClose||this.previouslyFocusedNode)&&(this.element.ownerDocument.querySelector(this.options.selectorFocusOnClose)||this.previouslyFocusedNode).focus()):n==="shown"&&(this.element.classList.toggle(this.options.classVisible,!0),this.element.ownerDocument.body.classList.toggle(this.options.classBody,!0)),d=this.manage(re(this.element,"transitionend",h))}},{key:"_hookCloseActions",value:function(){var n=this;this.manage(re(this.element,"click",function(a){var i=Re(a,n.options.selectorModalClose);i&&(a.delegateTarget=i),(i||a.target===n.element)&&n.hide(a)})),this._handleKeydownListener&&(this._handleKeydownListener=this.unmanage(this._handleKeydownListener).release()),this._handleKeydownListener=this.manage(re(this.element.ownerDocument.body,"keydown",function(a){a.which===27&&n.shouldStateBeChanged("hidden")&&(a.stopPropagation(),n.hide(a))}))}}],[{key:"options",get:function(){var n=be.prefix;return{selectorInit:"[data-modal]",selectorModalClose:"[data-modal-close]",selectorPrimaryFocus:"[data-modal-primary-focus]",selectorsFloatingMenus:[".".concat(n,"--overflow-menu-options"),".".concat(n,"--tooltip"),".flatpickr-calendar"],selectorModalContainer:".".concat(n,"--modal-container"),classVisible:"is-visible",classBody:"".concat(n,"--body--with-modal-open"),attribInitTarget:"data-modal-target",initEventNames:["click"],eventBeforeShown:"modal-beingshown",eventAfterShown:"modal-shown",eventBeforeHidden:"modal-beinghidden",eventAfterHidden:"modal-hidden"}}}]),t.components=new WeakMap,t}(Ws(Js,Hn,Pn,ln));const Kn=Yn;class Jn extends G{constructor(e,t,s){super(e,t,s),this.type="modal",this.isEventListenerAdded=!1,this.handleShowModal=()=>{this.modal.html(this.getModalHTML()),this.modal.select("div.cds--modal-footer button.cds--btn").on("click",()=>this.model.exportToCSV()),Kn.create(this.modal.node()).show()},this.init()}addEventListeners(){this.services.events.addEventListener(r.Events.Modal.SHOW,this.handleShowModal)}removeEventListeners(){this.services.events.removeEventListener(r.Events.Modal.SHOW,this.handleShowModal)}getModalHTML(){const e=this.model.getOptions(),t=c.getProperty(e,"style","prefix"),s=this.model.getTabularDataArray();return`
|
|
25
25
|
<div class="cds--modal-container cds--modal-container">
|
|
26
26
|
<div class="cds--modal-header cds--modal-header">
|
|
27
27
|
<p class="cds--modal-header__label cds--type-delta cds--modal-header__label cds--type-delta" id="modal-title">Tabular representation</p>
|
|
@@ -57,7 +57,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
57
57
|
<div class="${c.carbonPrefix}--${t}-modal-footer-spacer"></div>
|
|
58
58
|
<button class="cds--btn cds--btn--primary cds--btn cds--btn--primary" type="button" data-modal-primary-focus>Download as CSV</button>
|
|
59
59
|
</div>
|
|
60
|
-
</div>`}render(e=!1){const t=this.model.getOptions();if(!this.isEventListenerAdded){const s=y.select(this.services.domUtils.getHolder()),n=c.getProperty(t,"style","prefix");this.modal=O.DOMUtils.appendOrSelect(s,`div.${c.carbonPrefix}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class Dt extends G{constructor(){super(...arguments),this.type="title",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getComponentContainer(),s=c.getProperty(this.getOptions(),"title"),n=t.selectAll("p.title").data([s]);if(n.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(n).html(a=>a),n.node()&&n.node().offsetWidth<n.node().scrollWidth){const a=this;n.on("mouseover",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:n,content:n.text()})}).on("mousemove",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("mouseout",function(){a.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}n.exit().remove()}truncateTitle(e,t){if(t<=0)return;const s=e.text();if(e.node().getComputedTextLength()>t){e.append("tspan").text("...");const n=O.DOMUtils.appendOrSelect(e,"tspan").node().getComputedTextLength(),a=e.text(),i=this.getSubstringIndex(e.node(),0,a.length-1,t-n);e.html(a.substring(0,i-1)).append("tspan").text("...");const l=this;e.on("mouseover",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:d,hoveredElement:e,content:s})}).on("mousemove",function(d){l.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:d})}).on("mouseout",function(){l.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}getMaxTitleWidth(){return O.DOMUtils.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,t,s,n){const a=Math.floor((s+t)/2);return e.getSubStringLength(0,a)>n?this.getSubstringIndex(e,t,a,n):e.getSubStringLength(0,a)<n?e.getSubStringLength(0,a+1)>n?a:this.getSubstringIndex(e,a,s,n):a}}class wt extends G{constructor(){super(...arguments),this.type="legend",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"legend"),n=c.getProperty(s,"alignment"),a=c.getProperty(t,"legend","orientation");let i=this.model.getDataGroups();const{DISABLED:l}=c.legend.items.status,d=i.some(S=>S.status===l),h=c.getProperty(s,"order"),u=this.getComponentContainer().classed("center-aligned",n===r.Alignments.CENTER).classed("right-aligned",n===r.Alignments.RIGHT).classed(a,!0).classed("has-deactivated-items",d).attr("role",N.Roles.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");h&&(i=this.sortDataGroups(i,h));const m=u.selectAll("div.legend-item").data(i,S=>S.name),p=m.enter().append("div").attr("class","legend-item");p.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});const g=c.getProperty(this.getOptions(),"legend","clickable");u.classed("clickable",g&&i.length>1);const v=c.legend.checkbox.radius,f=p.append("div").classed("checkbox",!0),b=f.merge(m.select("div.checkbox")).attr("role",N.Roles.CHECKBOX).attr("tabindex",g?0:-1).attr("aria-labelledby",(S,T)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${T}-title`)).attr("aria-checked",({status:S})=>S===c.legend.items.status.ACTIVE).attr("width",v*2).attr("height",v*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===c.legend.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});f.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),p.append("p").merge(m.select("p"));const E=c.getProperty(t,"legend","additionalItems");if(E&&i.length){const S=this,T=u.selectAll("div.additional-item").data(E);T.exit().remove();const M=T.enter().append("div").merge(T).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(w,I)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b.size()+I}-title`));M.selectAll("*").remove();let C,x=1;M.append("svg").classed("icon",!0).each(function(w){const I=y.select(this);!C||C!=w.type?(C=w.type,x=1):x++,S.addAdditionalItem(I,w,x)}),M.append("p").merge(M.select("p")),this.truncateLegendText()}m.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),g&&p.size()>1&&this.addEventListeners()}sortDataGroups(e,t){if(e.sort((s,n)=>t.indexOf(s.name)-t.indexOf(n.name)),t.length<e.length){const s=e.length-t.length;return e.slice(s).concat(e.slice(0,s))}return e}addAdditionalItem(e,t,s){const{width:n,height:a}=c.legend.area;if(t.type===r.LegendItemType.RADIUS?e.style("width",`${a}px`).style("height",`${a}px`):e.style("width",`${n}px`).style("height",`${a}px`),t.type===r.LegendItemType.RADIUS){const{iconData:i,fill:l,stroke:d}=c.legend.radius;e.attr("fill","none").selectAll("circle").data(i).enter().append("circle").classed("radius",!0).attr("role",N.Roles.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d)}else if(t.type===r.LegendItemType.LINE){const i=c.legend.line;e.select("line.line").empty()&&e.append("line").classed(`line-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","line").attr("x1",0).attr("y1",i.yPosition).attr("x2",n).attr("y2",i.yPosition).style("stroke",t.stroke?t.stroke:i.stroke).style("stroke-width",i.strokeWidth)}else if(t.type===r.LegendItemType.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${s}`,!0).attr("role",N.Roles.IMG).attr("aria-label","area").attr("width",n).attr("height",a).style("fill",s>3&&!t.fill?c.legend.area.fill:t.fill).style("stroke",t.stroke);else if(t.type===r.LegendItemType.SIZE){const{iconData:i,fill:l,stroke:d}=c.legend.size;e.attr("fill","none").attr("role",N.Roles.IMG).attr("aria-label","size").selectAll("rect").data(i).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",t.fill?t.fill:l).style("stroke",t.stroke?t.stroke:d).style("stroke-width",1)}else if(t.type===r.LegendItemType.QUARTILE){const{iconData:i}=c.legend.quartile;e.selectAll("rect").attr("role",N.Roles.IMG).attr("aria-label","quartile").data(i).enter().append("rect").attr("class",(d,h)=>`quartile-${h===0?"wrapper":"line"}`).attr("x",d=>d.x).attr("y",d=>d.y).attr("width",d=>d.width).attr("height",d=>d.height)}else if(t.type===r.LegendItemType.ZOOM){const{iconData:i,color:l}=c.getProperty(c.legend,"zoom"),d=e.attr("role",N.Roles.IMG).attr("aria-label","zoom").selectAll("g.icon").data(i).enter();d.append("g").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>t.color?t.color:l),d.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>t.color?t.color:l)}}truncateLegendText(){const e=this.getComponentContainer(),t=c.getProperty(this.getOptions(),"legend","truncation"),s=c.getProperty(t,"type"),n=c.getProperty(t,"threshold"),a=c.getProperty(t,"numCharacter"),i=e.selectAll("div.legend-item p");i.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),s!==r.TruncationTypes.NONE?i.html(function(l){return l.name.length>n?c.truncateLabel(l.name,s,a):l.name}):i.html(l=>l.name)}addEventListeners(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=c.getProperty(s,"legend"),a=c.getProperty(n,"truncation");t.selectAll("div.legend-item").on("mouseover",function(i){e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)});const l=y.select(this);l.select("div.checkbox").classed("hovered",!0);const d=l.datum();d.name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})}).on("mousemove",function(i){y.select(this).datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("click",function(){e.services.events.dispatchEvent(r.Events.Legend.ITEM_CLICK,{clickedElement:y.select(this)});const l=y.select(this).datum();e.model.toggleDataLabel(l.name)}).on("mouseout",function(){const i=y.select(this);i.select("div.checkbox").classed("hovered",!1),i.datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.HIDE),e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:i})}),t.selectAll("div.legend-item div.checkbox").on("keyup",function(i){i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)})}),t.selectAll("div.legend-item div.checkbox").on("keydown",function(i,l){i.key&&i.key===" "?(i.preventDefault(),e.model.toggleDataLabel(l.name)):i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:y.select(this)})}),t.selectAll("g.additional-item").on("mouseover",function(i){const l=y.select(this),d=l.datum();d.name.length>a.threshold&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:l,content:d.name})})}}class Pt extends G{constructor(e,t,s){super(e,t,s),this.type="chart-clip",this.renderType=r.RenderTypes.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:t}=this.services;if(!t)throw new Error("Service cartesianScales was undefined");const s=t.getMainXScale(),n=t.getMainYScale(),[a,i]=s.range(),[l,d]=n.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const h=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i-a>0&&h.attr("x",a).attr("y",d).attr("width",i-a).attr("height",l-d),this.chartClipPath.merge(h).lower()}}class Qn extends Pt{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:t,height:s}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const n=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);n.attr("x",0).attr("y",0).attr("width",t).attr("height",s),this.chartClipPath.merge(n).lower()}}var Q,Z;(function(o){o.LEFT="left",o.RIGHT="right",o.TOP="top",o.BOTTOM="bottom"})(Z||(Z={}));var Ke=(Q={},Q[Z.LEFT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left-e.offsetWidth)}},Q[Z.RIGHT]=function(o,e,t){return{top:o.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(o.left+t.width)}},Q[Z.TOP]=function(o,e,t){return{top:Math.round(o.top-e.offsetHeight),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q[Z.BOTTOM]=function(o,e,t){return{top:Math.round(o.top+t.height),left:o.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q),Je=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ge=function(){function o(e){e===void 0&&(e={}),this.positions=Ke,this.positions=Object.assign({},Ke,e)}return o.prototype.getRelativeOffset=function(e){for(var t={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;return t},o.prototype.getAbsoluteOffset=function(e){for(var t=e,s={top:0,left:0};t.offsetParent;){var n=getComputedStyle(t.offsetParent);n.position==="static"&&n.marginLeft&&n.marginTop&&(parseInt(n.marginTop,10)&&(s.top+=parseInt(n.marginTop,10)),parseInt(n.marginLeft,10)&&(s.left+=parseInt(n.marginLeft,10))),t=t.offsetParent}var a=e.getBoundingClientRect(),i=document.body.getBoundingClientRect();return{top:a.top-i.top+s.top,left:a.left-i.left+s.left}},o.prototype.findRelative=function(e,t,s){var n=this.getRelativeOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findAbsolute=function(e,t,s){var n=this.getAbsoluteOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},o.prototype.findPosition=function(e,t,s,n){n===void 0&&(n=this.getAbsoluteOffset.bind(this));var a=n(e),i=e.getBoundingClientRect();return this.calculatePosition(a,i,t,s)},o.prototype.findPositionAt=function(e,t,s){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},t,s)},o.prototype.getPlacementBox=function(e,t){var s=e.offsetHeight+t.top,n=e.offsetWidth+t.left;return{top:t.top,bottom:s,left:t.left,right:n}},o.prototype.addOffset=function(e,t,s){return t===void 0&&(t=0),s===void 0&&(s=0),Object.assign({},e,{top:e.top+t,left:e.left+s})},o.prototype.setElement=function(e,t){e.style.top=t.top+"px",e.style.left=t.left+"px"},o.prototype.findBestPlacement=function(e,t,s,n,a){var i=this;n===void 0&&(n=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var l=s.map(function(d){var h=a(e,t,d),u=i.getPlacementBox(t,h),m=0,p=0,g=n();u.top<g.top?m=g.top-u.top:u.bottom>g.height&&(m=u.bottom-g.height),u.left<g.left?p=g.left-u.left:u.right>g.width&&(p=u.right-g.width),m&&!p?p=1:p&&!m&&(m=1);var v=t.offsetHeight*t.offsetWidth,f=m*p,b=v-f,E=b/v;return{placement:d,weight:E}});return l.sort(function(d,h){return h.weight-d.weight}),l[0].placement},o.prototype.findBestPlacementAt=function(e,t,s,n){var a=this;n===void 0&&(n=this.defaultContainerFunction.bind(this));var i=function(l,d,h){return a.findPositionAt(e,d,h)};return this.findBestPlacement(null,t,s,n,i)},o.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:Je.innerHeight,width:Je.innerWidth}},o.prototype.calculatePosition=function(e,t,s,n){return this.positions[n]?this.positions[n](e,s,t):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},o}();new ge;class Rt extends G{constructor(e,t,s){super(e,t,s),this.type="tooltip",this.renderType=r.RenderTypes.HTML,this.isEventListenerAdded=!1,this.positionService=new ge,this.handleShowTooltip=n=>{const a=n.detail.data||n.detail.items;let i;const l=this.formatItems(this.getItems(n));n.detail.content?i=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`:i=this.getTooltipHTML(l);const d=O.DOMUtils.appendOrSelect(this.tooltip,"div.content-box");if(c.getProperty(this.getOptions(),"tooltip","customHTML"))if(n.detail.content){const h=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`;d.html(h)}else d.html(this.model.getOptions().tooltip.customHTML(a,i));else d.html(i);d.selectAll(".datapoint-tooltip").each(function(h,u){const m=l[u];l[u]&&l[u].color&&y.select(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",m.color)}),this.positionTooltip(n),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(r.Events.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(r.Events.Tooltip.MOVE,null),this.services.events.removeEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const t=this.getOptions(),s=c.getProperty(t,"tooltip","truncation","type"),n=c.getProperty(t,"tooltip","truncation","threshold"),a=c.getProperty(t,"tooltip","truncation","numCharacter");return s!==r.TruncationTypes.NONE?e.map(i=>{const l=i.labelIcon?12:0;return i.value=i.value?this.valueFormatter(i.value,i.label):i.value,i.label&&i.label.length+l>n&&(i.label=c.truncateLabel(i.label,s,a)),i.value&&i.value.length>n&&(i.value=c.truncateLabel(i.value,s,a)),i}):e}getTooltipHTML(e){return'<ul class="multi-tooltip">'+e.map(t=>`<li>
|
|
60
|
+
</div>`}render(e=!1){const t=this.model.getOptions();if(!this.isEventListenerAdded){const s=y.select(this.services.domUtils.getHolder()),n=c.getProperty(t,"style","prefix");this.modal=O.DOMUtils.appendOrSelect(s,`div.${c.carbonPrefix}--${n}--modal`),this.addEventListeners(),this.isEventListenerAdded=!0,this.modal.attr("data-modal",!0).attr("class","cds--modal cds--modal").attr("role","dialog").attr("aria-modal",!0).attr("aria-labelledby","modal-title").attr("aria-describedby","modal-description").attr("tabindex",-1)}}destroy(){this.removeEventListeners(),this.isEventListenerAdded=!1}}class wt extends G{constructor(){super(...arguments),this.type="title",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getComponentContainer(),s=c.getProperty(this.getOptions(),"title"),n=t.selectAll("p.title").data([s]);if(n.enter().append("p").classed("title",!0).attr("role","heading").attr("aria-level",2).merge(n).html(a=>a),n.node()&&n.node().offsetWidth<n.node().scrollWidth){const a=this;n.on("mouseover",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:n,content:n.text()})}).on("mousemove",function(i){a.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("mouseout",function(){a.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}n.exit().remove()}truncateTitle(e,t){if(t<=0)return;const s=e.text();if(e.node().getComputedTextLength()>t){e.append("tspan").text("...");const n=O.DOMUtils.appendOrSelect(e,"tspan").node().getComputedTextLength(),a=e.text(),i=this.getSubstringIndex(e.node(),0,a.length-1,t-n);e.html(a.substring(0,i-1)).append("tspan").text("...");const o=this;e.on("mouseover",function(d){o.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:d,hoveredElement:e,content:s})}).on("mousemove",function(d){o.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:d})}).on("mouseout",function(){o.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}getMaxTitleWidth(){return O.DOMUtils.getSVGElementSize(this.parent.node(),{useAttrs:!0}).width}getSubstringIndex(e,t,s,n){const a=Math.floor((s+t)/2);return e.getSubStringLength(0,a)>n?this.getSubstringIndex(e,t,a,n):e.getSubStringLength(0,a)<n?e.getSubStringLength(0,a+1)>n?a:this.getSubstringIndex(e,a,s,n):a}}class Pt extends G{constructor(){super(...arguments),this.type="legend",this.renderType=r.RenderTypes.HTML}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"legend"),n=c.getProperty(s,"alignment"),a=c.getProperty(t,"legend","orientation");let i=this.model.getDataGroups();const{DISABLED:o}=c.legend.items.status,d=i.some(S=>S.status===o),h=c.getProperty(s,"order"),u=this.getComponentContainer().classed("center-aligned",n===r.Alignments.CENTER).classed("right-aligned",n===r.Alignments.RIGHT).classed(a,!0).classed("has-deactivated-items",d).attr("role",B.Roles.GROUP).attr("aria-label","Data groups").attr("data-name","legend-items");h&&(i=this.sortDataGroups(i,h));const m=u.selectAll("div.legend-item").data(i,S=>S.name),p=m.enter().append("div").attr("class","legend-item");p.merge(u.selectAll("div.legend-item")).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});const g=c.getProperty(this.getOptions(),"legend","clickable");u.classed("clickable",g&&i.length>1);const v=c.legend.checkbox.radius,f=p.append("div").classed("checkbox",!0),b=f.merge(m.select("div.checkbox")).attr("role",B.Roles.CHECKBOX).attr("tabindex",g?0:-1).attr("aria-labelledby",(S,T)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${T}-title`)).attr("aria-checked",({status:S})=>S===c.legend.items.status.ACTIVE).attr("width",v*2).attr("height",v*2).attr("class",S=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.BACKGROUND],dataGroupName:S.name,originalClassName:"checkbox"})).style("background",S=>S.status===c.legend.items.status.ACTIVE?this.model.getFillColor(S.name)||this.model.getStrokeColor(S.name):null).classed("active",function(S){return S.status===c.legend.items.status.ACTIVE});f.append("svg").attr("focusable",!1).attr("preserveAspectRatio","xMidYMid meet").attr("xmlns","http://www.w3.org/2000/svg").attr("width","11").attr("height","11").attr("viewBox","0 0 31 28").attr("aria-hidden",!0).style("will-change","transform").append("path").attr("d","M13 21.2l-7.1-7.1-1.4 1.4 7.1 7.1L13 24 27.1 9.9l-1.4-1.5z"),p.append("p").merge(m.select("p"));const E=c.getProperty(t,"legend","additionalItems");if(E&&i.length){const S=this,T=u.selectAll("div.additional-item").data(E);T.exit().remove();const C=T.enter().append("div").merge(T).classed("legend-item",!0).classed("additional",!0).attr("aria-labelledby",(w,P)=>this.services.domUtils.generateElementIDString(`legend-datagroup-${b.size()+P}-title`));C.selectAll("*").remove();let M,x=1;C.append("svg").classed("icon",!0).each(function(w){const P=y.select(this);!M||M!=w.type?(M=w.type,x=1):x++,S.addAdditionalItem(P,w,x)}),C.append("p").merge(C.select("p")),this.truncateLegendText()}m.exit().on("mouseover",null).on("click",null).on("mouseout",null).remove(),g&&p.size()>1&&this.addEventListeners()}sortDataGroups(e,t){if(e.sort((s,n)=>t.indexOf(s.name)-t.indexOf(n.name)),t.length<e.length){const s=e.length-t.length;return e.slice(s).concat(e.slice(0,s))}return e}addAdditionalItem(e,t,s){const{width:n,height:a}=c.legend.area;if(t.type===r.LegendItemType.RADIUS?e.style("width",`${a}px`).style("height",`${a}px`):e.style("width",`${n}px`).style("height",`${a}px`),t.type===r.LegendItemType.RADIUS){const{iconData:i,fill:o,stroke:d}=c.legend.radius;e.attr("fill","none").selectAll("circle").data(i).enter().append("circle").classed("radius",!0).attr("role",B.Roles.IMG).attr("aria-label","radius").attr("cx",u=>u.cx).attr("cy",u=>u.cy).attr("r",u=>u.r).style("fill",t.fill?t.fill:o).style("stroke",t.stroke?t.stroke:d)}else if(t.type===r.LegendItemType.LINE){const i=c.legend.line;e.select("line.line").empty()&&e.append("line").classed(`line-${s}`,!0).attr("role",B.Roles.IMG).attr("aria-label","line").attr("x1",0).attr("y1",i.yPosition).attr("x2",n).attr("y2",i.yPosition).style("stroke",t.stroke?t.stroke:i.stroke).style("stroke-width",i.strokeWidth)}else if(t.type===r.LegendItemType.AREA)e.select("rect.area").empty()&&e.append("rect").classed(`area-${s}`,!0).attr("role",B.Roles.IMG).attr("aria-label","area").attr("width",n).attr("height",a).style("fill",s>3&&!t.fill?c.legend.area.fill:t.fill).style("stroke",t.stroke);else if(t.type===r.LegendItemType.SIZE){const{iconData:i,fill:o,stroke:d}=c.legend.size;e.attr("fill","none").attr("role",B.Roles.IMG).attr("aria-label","size").selectAll("rect").data(i).enter().append("rect").classed("size",!0).attr("width",u=>u.width).attr("height",u=>u.height).attr("y",()=>0).style("fill",t.fill?t.fill:o).style("stroke",t.stroke?t.stroke:d).style("stroke-width",1)}else if(t.type===r.LegendItemType.QUARTILE){const{iconData:i}=c.legend.quartile;e.selectAll("rect").attr("role",B.Roles.IMG).attr("aria-label","quartile").data(i).enter().append("rect").attr("class",(d,h)=>`quartile-${h===0?"wrapper":"line"}`).attr("x",d=>d.x).attr("y",d=>d.y).attr("width",d=>d.width).attr("height",d=>d.height)}else if(t.type===r.LegendItemType.ZOOM){const{iconData:i,color:o}=c.getProperty(c.legend,"zoom"),d=e.attr("role",B.Roles.IMG).attr("aria-label","zoom").selectAll("g.icon").data(i).enter();d.append("g").attr("x",h=>h.x).attr("y",h=>h.y).attr("width",h=>h.width).attr("height",h=>h.height).append("polygon").attr("points","7.7 4.82 5.78 4.82 5.78 2.89 4.82 2.89 4.82 4.82 2.89 4.82 2.89 5.78 4.82 5.78 4.82 7.7 5.78 7.7 5.78 5.78 7.7 5.78 7.7 4.82").attr("fill",()=>t.color?t.color:o),d.append("path").attr("d","M9.36,8.67A5.22,5.22,0,0,0,10.59,5.3,5.3,5.3,0,1,0,5.3,10.59,5.22,5.22,0,0,0,8.67,9.36L12.32,13l.68-.68Zm-4.06,1A4.34,4.34,0,1,1,9.63,5.3,4.33,4.33,0,0,1,5.3,9.63Z").attr("fill",()=>t.color?t.color:o)}}truncateLegendText(){const e=this.getComponentContainer(),t=c.getProperty(this.getOptions(),"legend","truncation"),s=c.getProperty(t,"type"),n=c.getProperty(t,"threshold"),a=c.getProperty(t,"numCharacter"),i=e.selectAll("div.legend-item p");i.attr("id",function(){return(this.parentNode.querySelector("div.checkbox")||this.parentNode).getAttribute("aria-labelledby")}),s!==r.TruncationTypes.NONE?i.html(function(o){return o.name.length>n?c.truncateLabel(o.name,s,a):o.name}):i.html(o=>o.name)}addEventListeners(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=c.getProperty(s,"legend"),a=c.getProperty(n,"truncation");t.selectAll("div.legend-item").on("mouseover",function(i){e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)});const o=y.select(this);o.select("div.checkbox").classed("hovered",!0);const d=o.datum();d.name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:o,content:d.name})}).on("mousemove",function(i){y.select(this).datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:i})}).on("click",function(){e.services.events.dispatchEvent(r.Events.Legend.ITEM_CLICK,{clickedElement:y.select(this)});const o=y.select(this).datum();e.model.toggleDataLabel(o.name)}).on("mouseout",function(){const i=y.select(this);i.select("div.checkbox").classed("hovered",!1),i.datum().name.length>a.threshold&&a.type!==r.TruncationTypes.NONE&&e.services.events.dispatchEvent(r.Events.Tooltip.HIDE),e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:i})}),t.selectAll("div.legend-item div.checkbox").on("keyup",function(i){i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_HOVER,{hoveredElement:y.select(this)})}),t.selectAll("div.legend-item div.checkbox").on("keydown",function(i,o){i.key&&i.key===" "?(i.preventDefault(),e.model.toggleDataLabel(o.name)):i.key&&i.key==="Tab"&&e.services.events.dispatchEvent(r.Events.Legend.ITEM_MOUSEOUT,{hoveredElement:y.select(this)})}),t.selectAll("g.additional-item").on("mouseover",function(i){const o=y.select(this),d=o.datum();d.name.length>a.threshold&&e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:i,hoveredElement:o,content:d.name})})}}class Rt extends G{constructor(e,t,s){super(e,t,s),this.type="chart-clip",this.renderType=r.RenderTypes.SVG,this.chartClipId="chart-clip-id-"+Math.floor(Math.random()*99999999999),this.init()}init(){this.model.set({chartClipId:this.chartClipId},{skipUpdate:!0})}render(e=!0){this.createClipPath()}createClipPath(){const e=this.parent,{cartesianScales:t}=this.services;if(!t)throw new Error("Service cartesianScales was undefined");const s=t.getMainXScale(),n=t.getMainYScale(),[a,i]=s.range(),[o,d]=n.range();if(!e)throw new Error("svg is undefined");this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const h=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);i-a>0&&h.attr("x",a).attr("y",d).attr("width",i-a).attr("height",o-d),this.chartClipPath.merge(h).lower()}}class Qn extends Rt{constructor(){super(...arguments),this.type="canvas-chart-clip",this.chartClipId="canvas-chart-clip-id-"+Math.floor(Math.random()*99999999999)}createClipPath(){const e=this.parent,{width:t,height:s}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});this.chartClipPath=O.DOMUtils.appendOrSelect(e,`clipPath.${this.type}`).attr("id",this.chartClipId);const n=O.DOMUtils.appendOrSelect(this.chartClipPath,`rect.${this.type}`);n.attr("x",0).attr("y",0).attr("width",t).attr("height",s),this.chartClipPath.merge(n).lower()}}var Q,Z;(function(l){l.LEFT="left",l.RIGHT="right",l.TOP="top",l.BOTTOM="bottom"})(Z||(Z={}));var st=(Q={},Q[Z.LEFT]=function(l,e,t){return{top:l.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(l.left-e.offsetWidth)}},Q[Z.RIGHT]=function(l,e,t){return{top:l.top-Math.round(e.offsetHeight/2)+Math.round(t.height/2),left:Math.round(l.left+t.width)}},Q[Z.TOP]=function(l,e,t){return{top:Math.round(l.top-e.offsetHeight),left:l.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q[Z.BOTTOM]=function(l,e,t){return{top:Math.round(l.top+t.height),left:l.left-Math.round(e.offsetWidth/2)+Math.round(t.width/2)}},Q),nt=typeof window<"u"?window:{innerHeight:0,scrollY:0,innerWidth:0,scrollX:0},ve=function(){function l(e){e===void 0&&(e={}),this.positions=st,this.positions=Object.assign({},st,e)}return l.prototype.getRelativeOffset=function(e){for(var t={left:e.offsetLeft,top:e.offsetTop};e.offsetParent&&getComputedStyle(e.offsetParent).position==="static";)t.left+=e.offsetLeft,t.top+=e.offsetTop,e=e.offsetParent;return t},l.prototype.getAbsoluteOffset=function(e){for(var t=e,s={top:0,left:0};t.offsetParent;){var n=getComputedStyle(t.offsetParent);n.position==="static"&&n.marginLeft&&n.marginTop&&(parseInt(n.marginTop,10)&&(s.top+=parseInt(n.marginTop,10)),parseInt(n.marginLeft,10)&&(s.left+=parseInt(n.marginLeft,10))),t=t.offsetParent}var a=e.getBoundingClientRect(),i=document.body.getBoundingClientRect();return{top:a.top-i.top+s.top,left:a.left-i.left+s.left}},l.prototype.findRelative=function(e,t,s){var n=this.getRelativeOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},l.prototype.findAbsolute=function(e,t,s){var n=this.getAbsoluteOffset(e),a=e.getBoundingClientRect();return this.calculatePosition(n,a,t,s)},l.prototype.findPosition=function(e,t,s,n){n===void 0&&(n=this.getAbsoluteOffset.bind(this));var a=n(e),i=e.getBoundingClientRect();return this.calculatePosition(a,i,t,s)},l.prototype.findPositionAt=function(e,t,s){return this.calculatePosition(e,{top:0,left:0,height:0,width:0},t,s)},l.prototype.getPlacementBox=function(e,t){var s=e.offsetHeight+t.top,n=e.offsetWidth+t.left;return{top:t.top,bottom:s,left:t.left,right:n}},l.prototype.addOffset=function(e,t,s){return t===void 0&&(t=0),s===void 0&&(s=0),Object.assign({},e,{top:e.top+t,left:e.left+s})},l.prototype.setElement=function(e,t){e.style.top=t.top+"px",e.style.left=t.left+"px"},l.prototype.findBestPlacement=function(e,t,s,n,a){var i=this;n===void 0&&(n=this.defaultContainerFunction.bind(this)),a===void 0&&(a=this.findPosition.bind(this));var o=s.map(function(d){var h=a(e,t,d),u=i.getPlacementBox(t,h),m=0,p=0,g=n();u.top<g.top?m=g.top-u.top:u.bottom>g.height&&(m=u.bottom-g.height),u.left<g.left?p=g.left-u.left:u.right>g.width&&(p=u.right-g.width),m&&!p?p=1:p&&!m&&(m=1);var v=t.offsetHeight*t.offsetWidth,f=m*p,b=v-f,E=b/v;return{placement:d,weight:E}});return o.sort(function(d,h){return h.weight-d.weight}),o[0].placement},l.prototype.findBestPlacementAt=function(e,t,s,n){var a=this;n===void 0&&(n=this.defaultContainerFunction.bind(this));var i=function(o,d,h){return a.findPositionAt(e,d,h)};return this.findBestPlacement(null,t,s,n,i)},l.prototype.defaultContainerFunction=function(){return{top:0,left:0,height:nt.innerHeight,width:nt.innerWidth}},l.prototype.calculatePosition=function(e,t,s,n){return this.positions[n]?this.positions[n](e,s,t):(console.error("No function found for placement, defaulting to 0,0"),{left:0,top:0})},l}();new ve;class kt extends G{constructor(e,t,s){super(e,t,s),this.type="tooltip",this.renderType=r.RenderTypes.HTML,this.isEventListenerAdded=!1,this.positionService=new ve,this.handleShowTooltip=n=>{const a=n.detail.data||n.detail.items;let i;const o=this.formatItems(this.getItems(n));n.detail.content?i=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`:i=this.getTooltipHTML(o);const d=O.DOMUtils.appendOrSelect(this.tooltip,"div.content-box");if(c.getProperty(this.getOptions(),"tooltip","customHTML"))if(n.detail.content){const h=`<div class="title-tooltip"><p>${n.detail.content}</p></div>`;d.html(h)}else d.html(this.model.getOptions().tooltip.customHTML(a,i));else d.html(i);d.selectAll(".datapoint-tooltip").each(function(h,u){const m=o[u];o[u]&&o[u].color&&y.select(this).select(".tooltip-color").attr("class","tooltip-color").style("background-color",m.color)}),this.positionTooltip(n),this.tooltip.classed("hidden",!1).attr("aria-hidden",!1)},this.handleHideTooltip=()=>{this.tooltip.classed("hidden",!0).attr("aria-hidden",!0)},this.init()}addTooltipEventListener(){this.services.events.addEventListener(r.Events.Tooltip.MOVE,e=>{this.tooltip.classed("hidden")===!1&&this.positionTooltip(e)}),this.services.events.addEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.addEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.addEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}removeTooltipEventListener(){this.services.events.removeEventListener(r.Events.Tooltip.MOVE,null),this.services.events.removeEventListener(r.Events.Tooltip.SHOW,this.handleShowTooltip),this.services.events.removeEventListener(r.Events.Tooltip.HIDE,this.handleHideTooltip),this.services.events.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleHideTooltip)}getItems(e){return e.detail.items?e.detail.items:[]}formatItems(e){const t=this.getOptions(),s=c.getProperty(t,"tooltip","truncation","type"),n=c.getProperty(t,"tooltip","truncation","threshold"),a=c.getProperty(t,"tooltip","truncation","numCharacter");return s!==r.TruncationTypes.NONE?e.map(i=>{const o=i.labelIcon?12:0;return i.value=i.value?this.valueFormatter(i.value,i.label):i.value,i.label&&i.label.length+o>n&&(i.label=c.truncateLabel(i.label,s,a)),i.value&&i.value.length>n&&(i.value=c.truncateLabel(i.value,s,a)),i}):e}getTooltipHTML(e){return'<ul class="multi-tooltip">'+e.map(t=>`<li>
|
|
61
61
|
<div class="datapoint-tooltip${t.bold?" bold":""}">
|
|
62
62
|
${t.class||t.color?`<div class="tooltip-color ${t.class}"></div>`:""}
|
|
63
63
|
<div class="label">
|
|
@@ -66,17 +66,17 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
66
66
|
</div>
|
|
67
67
|
${t.value===void 0||t.value===null?"":`<p class="value"/>${t.value}</p>`}
|
|
68
68
|
</div>
|
|
69
|
-
</li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const l=t.offsetWidth,d=t.offsetHeight;let h;i[0]/l>.9?h=Z.LEFT:i[0]/l<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:l,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const le=class extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(o=!0){const e=this.parent,t=this.getComponentContainer();if(!e)throw new Error("SVG was not defined");const s=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop"),n=O.DOMUtils.appendOrSelect(s,`g.${this.type}`),a=O.DOMUtils.appendOrSelect(n,this.selectionSelector),{width:i,height:l}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{cartesianScales:d}=this.services,h=d.getMainXScaleType(),u=d.getMainXScale(),[m]=u.range();t.attr("transform",`translate(${m},0)`);const p=O.DOMUtils.appendOrSelect(t,this.frontSelectionSelector);if(u&&h===r.ScaleTypes.TIME){let g=this.model.get("zoomDomain");g===void 0&&(g=this.services.zoom.getDefaultZoomBarDomain(),g&&this.model.set({zoomDomain:g},{animate:!1}));const v=M=>{const C=M[1]-M[0];let x="0,"+C.toString();const w=Math.floor(l/le.DASH_LENGTH),I=w*le.DASH_LENGTH;for(let $=0;$<w;$++)x+=","+le.DASH_LENGTH;x+=","+(l-I),w%2===1&&(x+=",0"),x+=","+C.toString(),x+=","+l.toString(),p.attr("stroke-dasharray",x)},f=M=>{const C=M.selection;C===null||C[0]===C[1]||(p.attr("x",parseFloat(a.attr("x"))+parseFloat(s.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),v(C))},b=(M,C)=>{const x=y.scaleTime().range([0,i]).domain(g);let w=[x.invert(M),x.invert(C)];w[0].valueOf()===w[1].valueOf()&&(w=this.services.zoom.getDefaultZoomBarDomain()),(g[0].valueOf()!==w[0].valueOf()||g[1].valueOf()!==w[1].valueOf())&&this.services.zoom.handleDomainChange(w)};let E;const S=M=>{const C=M.selection;C!==null&&(b(C[0],C[1]),n.call(E.move,null),p.style("display","none"))};l!=0&&i!=0&&(E=y.brushX().extent([[0,0],[i-1,l]]).on("start brush end",f).on("end.brushed",S),n.call(E));const T=this.services.zoom.getZoomRatio();s.on("click",function(M){if(M.shiftKey){const C=this.services.domUtils.getHolder(),x=y.pointer(n.node(),C)[0];let w=x-i*T/2;w<0&&(w=0);let I=x+i*T/2;I>i&&(I=i),b(w,I)}})}}};let kt=le;kt.DASH_LENGTH=4;class ea extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),l=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",l).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",l).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",l/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),T=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");T&&T[0]&&T[1]&&(T[0]=new Date(T[0]),T[1]=new Date(T[1])),T&&!(S&&S[0].valueOf()===T[0].valueOf()&&S[1].valueOf()===T[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],T),zoomDomain:T?c.merge([],T):E},{skipUpdate:!0}):T===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,l-6]).domain(y.extent(b,x=>x.value));const M=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const x=i.highlightStartMapsTo,w=i.highlightEndMapsTo,I=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",l-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[x])).attr("width",this.xScale(_[w])-this.xScale(_[x])).style("fill",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",I&&I.scale[_[$]]?I.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(M,h,d);const C=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(M!==void 0)if(M[0].valueOf()===M[1].valueOf())C.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const x=M.map(w=>this.xScale(w));x[1]-x[0]<this.MIN_SELECTION_DIFF||(C.call(this.brush.move,x),this.updateBrushHandle(this.getComponentContainer(),x))}n&&(this.brush.filter(()=>!1),C.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=l=>{const d=l.selection;d===null?this.handleBrushedEvent(l,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(l,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+l,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+l,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-l+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+l+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),l=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,T)=>M=>a.getValueFromScale(E,S,T,M),m=u(this.xScale,d,i),p=u(this.yScale,h,l),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const l=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(l,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.clone(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],l=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",l).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ta extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ge}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=l.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,T]=f.range(),[M,C]=b.range(),{cartesianScales:x}=m.services,w=x.getOrientation(),I=V=>x.getDomainValue(V),$=V=>x.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(I,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",C).attr("y2",M).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(M-C)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",T).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(T-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),l=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:l,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),l=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,l);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class sa extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ge,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const l=a.enter().append("g").merge(a);l.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=l.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;l.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:T}=m.services,M=T.getOrientation(),C=_=>T.getDomainValue(_),x=_=>T.getRangeValue(_),[w,I]=c.flipDomainAndRangeBasedOnOrientation(C,x,M),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>I(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(I(L[_])-I(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class na extends Rt{getItems(e){if(e.detail.items)return e.detail.items;const t=e.detail.data;if(!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:l}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[l]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[l],color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[l],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[l]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[l]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class aa extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ae.sankeyJustify;h===r.Alignments.LEFT?u=ae.sankeyLeft:h===r.Alignments.RIGHT&&(u=ae.sankeyRight);const m=ae.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});let C=0;return E+C>=M&&(C=-M+4),C});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),l){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",T=>E[T.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",T=>E[T.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ae.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>l?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});return M+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:M}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0}),C=(E.y1-E.y0)/2-9;let x=E.x1-E.x0;return E.x1>=M?x=x-(M+16):x+=4,`translate(${x}, ${C})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(l=>t.services.transitions.setupTransition({transition:l,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const l=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:l,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(l=>l===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const l=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${l.x-2}, ${l.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const l=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${l}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
|
|
69
|
+
</li>`).join("")+"</ul>"}valueFormatter(e,t){const s=this.getOptions(),n=c.getProperty(s,"tooltip","valueFormatter");if(n)return n(e,t);if(typeof e.getTime=="function")return c.format(e,"MMM d, yyyy");try{if(typeof e=="string"&&/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(e))return c.format(Date.parse(e),"MMM d, yyyy")}catch{}return e.toLocaleString()}render(e=!1){const t=this.getOptions(),s=c.getProperty(t,"tooltip","enabled");if(s){const n=y.select(this.services.domUtils.getHolder()),a=c.getProperty(t,"style","prefix");this.tooltip=O.DOMUtils.appendOrSelect(n,`div.${c.carbonPrefix}--${a}--tooltip`),this.tooltip.style("max-width",null).attr("role","tooltip"),this.isEventListenerAdded||(this.addTooltipEventListener(),this.isEventListenerAdded=!0),this.tooltip.classed("hidden",!0)}else!s&&this.isEventListenerAdded&&(this.removeTooltipEventListener(),this.isEventListenerAdded=!1)}positionTooltip(e){const t=this.services.domUtils.getHolder(),s=this.tooltip.node(),n=this.getOptions(),a=c.getProperty(n,"zoomBar","top","enabled");let i=c.getProperty(e,"detail","mousePosition");if(!i)i=y.pointer(c.getProperty(e,"detail","event"),t);else{const p=c.getProperty(n,"zoomBar","top","type"),g=c.zoomBar.height[p];a&&(i[1]+=g+c.zoomBar.spacerHeight)}const o=t.offsetWidth,d=t.offsetHeight;let h;i[0]/o>.9?h=Z.LEFT:i[0]/o<.1?h=Z.RIGHT:h=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},s,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:o,height:d}));let{horizontalOffset:u}=c.tooltips;h===Z.LEFT&&(u*=-1);const m=this.positionService.findPositionAt({left:i[0]+u,top:i[1]},s,h);this.positionService.setElement(s,m)}}const se=class se extends G{constructor(){super(...arguments),this.type="grid-brush",this.renderType=r.RenderTypes.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(e=!0){const t=this.parent,s=this.getComponentContainer();if(!t)throw new Error("SVG was not defined");const n=O.DOMUtils.appendOrSelect(t,"svg.chart-grid-backdrop"),a=O.DOMUtils.appendOrSelect(n,`g.${this.type}`),i=O.DOMUtils.appendOrSelect(a,this.selectionSelector),{width:o,height:d}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),{cartesianScales:h}=this.services,u=h.getMainXScaleType(),m=h.getMainXScale(),[p]=m.range();s.attr("transform",`translate(${p},0)`);const g=O.DOMUtils.appendOrSelect(s,this.frontSelectionSelector);if(m&&u===r.ScaleTypes.TIME){let v=this.model.get("zoomDomain");v===void 0&&(v=this.services.zoom.getDefaultZoomBarDomain(),v&&this.model.set({zoomDomain:v},{animate:!1}));const f=M=>{const x=M[1]-M[0];let w="0,"+x.toString();const P=Math.floor(d/se.DASH_LENGTH),$=P*se.DASH_LENGTH;for(let _=0;_<P;_++)w+=","+se.DASH_LENGTH;w+=","+(d-$),P%2===1&&(w+=",0"),w+=","+x.toString(),w+=","+d.toString(),g.attr("stroke-dasharray",w)},b=M=>{const x=M.selection;x===null||x[0]===x[1]||(g.attr("x",parseFloat(i.attr("x"))+parseFloat(n.attr("x"))).attr("y",i.attr("y")).attr("width",i.attr("width")).attr("height",i.attr("height")).style("cursor","pointer").style("display",null),f(x))},E=(M,x)=>{const w=y.scaleTime().range([0,o]).domain(v);let P=[w.invert(M),w.invert(x)];P[0].valueOf()===P[1].valueOf()&&(P=this.services.zoom.getDefaultZoomBarDomain()),(v[0].valueOf()!==P[0].valueOf()||v[1].valueOf()!==P[1].valueOf())&&this.services.zoom.handleDomainChange(P)};let S;const T=M=>{const x=M.selection;x!==null&&(E(x[0],x[1]),a.call(S.move,null),g.style("display","none"))};d!=0&&o!=0&&(S=y.brushX().extent([[0,0],[o-1,d]]).on("start brush end",b).on("end.brushed",T),a.call(S));const C=this.services.zoom.getZoomRatio();n.on("click",function(M){if(M.shiftKey){const x=this.services.domUtils.getHolder(),w=y.pointer(a.node(),x)[0];let P=w-o*C/2;P<0&&(P=0);let $=w+o*C/2;$>o&&($=o),E(P,$)}})}}};se.DASH_LENGTH=4;let Be=se;class ea extends G{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=r.RenderTypes.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=y.brushX(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this));const e=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"data");this.model.setZoomBarData(e)}render(e=!0){const t=this.getComponentContainer(),s=this.services.zoom.isZoomBarLoading(r.AxisPositions.TOP),n=this.services.zoom.isZoomBarLocked(r.AxisPositions.TOP),a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.getProperty(this.getOptions(),"axes",r.AxisPositions.BOTTOM,"highlights"),o=c.zoomBar.height[a],{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(d===0)return;let h=0;const u=this.model.get("axesMargins");u&&u.left&&(h=u.left);const m=O.DOMUtils.appendOrSelect(t,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(O.DOMUtils.appendOrSelect(t,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",c.zoomBar.spacerHeight).attr("opacity",1).attr("fill","none"),a===r.ZoomBarTypes.GRAPH_VIEW?O.DOMUtils.appendOrSelect(m,"rect.zoom-bg").attr("x",h).attr("y",0).attr("width",d-h).attr("height","100%").classed("zoom-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):a===r.ZoomBarTypes.SLIDER_VIEW&&O.DOMUtils.appendOrSelect(m,"rect.zoom-slider-bg").attr("x",h).attr("y",o/2-1).attr("width",d-h).attr("height",2).classed("zoom-slider-bg-skeleton",s).style("stroke",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),s){this.renderSkeleton(m,h,d);return}const{cartesianScales:p}=this.services,g=p.getMainXScale(),v=p.getMainYScale(),f=p.getMainXScaleType();if(g&&f===r.ScaleTypes.TIME){let b=this.services.zoom.getZoomBarData();if(c.isEmpty(b)||b.length===1)return;this.xScale=g.copy(),this.yScale=v.copy();const E=this.services.zoom.getDefaultZoomBarDomain(b);b=this.compensateDataForDefaultDomain(b,E);const S=this.model.get("initialZoomDomain"),T=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"initialZoomDomain");T&&T[0]&&T[1]&&(T[0]=new Date(T[0]),T[1]=new Date(T[1])),T&&!(S&&S[0].valueOf()===T[0].valueOf()&&S[1].valueOf()===T[1].valueOf())?this.model.set({initialZoomDomain:c.merge([],T),zoomDomain:T?c.merge([],T):E},{skipUpdate:!0}):T===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:c.merge([],E)},{skipUpdate:!0}),this.xScale.range([h,d]).domain(E),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(y.extent(b,x=>x.value));const C=this.model.get("zoomDomain");if(a===r.ZoomBarTypes.GRAPH_VIEW&&(this.renderZoomBarArea(m,"path.zoom-graph-area-unselected",b,null),this.updateClipPath(t,this.clipId,0,0,0,0),this.renderZoomBarArea(m,"path.zoom-graph-area",b,this.clipId),this.renderZoomBarBaseline(m,h,d),i)){const x=i.highlightStartMapsTo,w=i.highlightEndMapsTo,P=i.color,$=i.labelMapsTo;i.data.forEach((_,A)=>{O.DOMUtils.appendOrSelect(m,`rect.highlight-${A}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(_[x])).attr("width",this.xScale(_[w])-this.xScale(_[x])).style("fill",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("fill-opacity",.1).style("stroke",P&&P.scale[_[$]]?P.scale[_[$]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(C,h,d);const M=O.DOMUtils.appendOrSelect(t,this.brushSelector).call(this.brush);if(C!==void 0)if(C[0].valueOf()===C[1].valueOf())M.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const x=C.map(w=>this.xScale(w));x[1]-x[0]<this.MIN_SELECTION_DIFF||(M.call(this.brush.move,x),this.updateBrushHandle(this.getComponentContainer(),x))}n&&(this.brush.filter(()=>!1),M.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(e,t,s){const n=o=>{const d=o.selection;d===null?this.handleBrushedEvent(o,e,this.xScale,this.xScale.range()):d[0]===d[1]||this.handleBrushedEvent(o,e,this.xScale,d)},a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a];this.brush.extent([[t,0],[s,i]]).on("start brush end",null).on("start brush end",n)}handleBrushedEvent(e,t,s,n){const a=[s.invert(n[0]),s.invert(n[1])];if(this.updateBrushHandle(this.getComponentContainer(),n),e.sourceEvent!=null&&(e.sourceEvent.type==="mousemove"||e.sourceEvent.type==="mouseup"||e.sourceEvent.type==="mousedown"||e.sourceEvent.type==="touchstart"||e.sourceEvent.type==="touchmove"||e.sourceEvent.type==="touchend")){(t===void 0||t[0]!==a[0]||t[1]!==a[1])&&this.services.zoom.handleDomainChange(a,{dispatchEvent:!1});let i;e.type==="start"?i=r.Events.ZoomBar.SELECTION_START:e.type==="brush"?i=r.Events.ZoomBar.SELECTION_IN_PROGRESS:e.type==="end"&&(i=r.Events.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(r.Events.ZoomDomain.CHANGE,{newDomain:a})),this.services.events.dispatchEvent(i,{selection:n,newDomain:a})}}updateBrushHandle(e,t){const s=this,n=c.zoomBar.handleWidth,a=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=-n/2,d=c.zoomBar.handleBarWidth,h=a===r.ZoomBarTypes.GRAPH_VIEW?c.zoomBar.handleBarHeight:6,u=-d/2,m=(i-h)/2;e.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(g){if(g.type==="w")return Math.max(t[0]+o,s.maxSelectionRange[0]);if(g.type==="e")return Math.min(t[1]+o,s.maxSelectionRange[1]-n)}).attr("y",0).attr("width",n).attr("height",i).attr("cursor","ew-resize").style("display",null);const p=e.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);p.enter().append("rect").attr("class",function(g){return"handle-bar handle-bar--"+g.type}),p.attr("x",function(g){if(g.type==="w")return Math.max(t[0]+u,s.maxSelectionRange[0]-o+u);if(g.type==="e")return Math.min(t[1]+u,s.maxSelectionRange[1]+o+u)}).attr("y",m).attr("width",d).attr("height",h).attr("cursor","ew-resize"),a===r.ZoomBarTypes.SLIDER_VIEW&&this.updateSliderSelectedArea(t),this.updateClipPath(e,this.clipId,t[0],0,t[1]-t[0],i)}updateSliderSelectedArea(e){const t=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),s=c.zoomBar.height[t],a=this.getComponentContainer().select("svg.zoom-container");O.DOMUtils.appendOrSelect(a,"rect.zoom-slider-selected-area").attr("x",e[0]).attr("y",s/2-1).attr("width",e[1]-e[0]).attr("height",2)}renderZoomBarArea(e,t,s,n){const{cartesianScales:a}=this.services,i=a.getMainXAxisPosition(),o=a.getMainYAxisPosition(),d=a.getMainXScaleType(),h=a.getMainYScaleType(),u=(E,S,T)=>C=>a.getValueFromScale(E,S,T,C),m=u(this.xScale,d,i),p=u(this.yScale,h,o),g=c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),v=c.zoomBar.height[g],f=y.area().x(E=>m(E)).y0(v).y1(E=>v-p(E)),b=O.DOMUtils.appendOrSelect(e,t).datum(s).attr("d",f);n&&b.attr("clip-path",`url(#${n})`)}updateClipPath(e,t,s,n,a,i){const o=O.DOMUtils.appendOrSelect(e,"clipPath").attr("id",t);O.DOMUtils.appendOrSelect(o,"rect").attr("x",s).attr("y",n).attr("width",a).attr("height",i)}compensateDataForDefaultDomain(e,t){if(!e||e.length<2)return;const s=c.clone(e),n=this.services.cartesianScales.getDomainIdentifier(),a=this.services.cartesianScales.getRangeIdentifier();if(Number(t[0])<Number(s[0][n])){const i={};i[n]=t[0],i[a]=0,s.unshift(i)}if(Number(t[1])>Number(s[s.length-1][n])){const i={};i[n]=t[1],i[a]=0,s.push(i)}return s}renderZoomBarBaseline(e,t,s,n=!1){const a=c.getProperty(this.model.getOptions(),"zoomBar",r.AxisPositions.TOP,"type"),i=c.zoomBar.height[a],o=y.line()([[t,i],[s,i]]);O.DOMUtils.appendOrSelect(e,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",n).style("stroke",n?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(e,t,s){this.renderZoomBarArea(e,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(e,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),O.DOMUtils.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),c.getProperty(this.getOptions(),"zoomBar",r.AxisPositions.TOP,"type")===r.ZoomBarTypes.GRAPH_VIEW&&this.renderZoomBarBaseline(e,t,s,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(r.Events.ZoomBar.UPDATE,this.render.bind(this))}}class ta extends G{constructor(e,t){super(e,t),this.type="threshold",this.renderType=r.RenderTypes.SVG,this.positionService=new ve}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.thresholds&&g.thresholds.length>0&&s.push({axisPosition:p,thresholds:g.thresholds,correspondingDatasets:g==null?void 0:g.correspondingDatasets,mapsTo:g==null?void 0:g.mapsTo})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-thresholds").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-thresholds ${p.axisPosition}`);const d=o.selectAll("g.threshold-group").data(p=>p.thresholds.map(g=>(g.axisPosition=p.axisPosition,g.datum=this.constructDatumObj(p,g),g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("line").attr("class","threshold-line"),h.append("rect").attr("class","threshold-hoverable-area"),h.merge(d).attr("class","threshold-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getScaleByPosition(p),v=m.services.cartesianScales.getScaleTypeByPosition(p);let f=null,b=null;p===r.AxisPositions.LEFT||p===r.AxisPositions.RIGHT?(b=g,f=m.services.cartesianScales.getMainXScale()):(f=g,b=m.services.cartesianScales.getMainYScale());const E=v===r.ScaleTypes.LABELS,[S,T]=f.range(),[C,M]=b.range(),{cartesianScales:x}=m.services,w=x.getOrientation(),P=V=>x.getDomainValue(V),$=V=>x.getRangeValue(V),[_,A]=c.flipDomainAndRangeBasedOnOrientation(P,$,w),L=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("y1",M).attr("y2",C).attr("x1",({datum:V})=>_(V)+(E?g.step()/2:0)).attr("x2",({datum:V})=>_(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:V})=>-_(V)).attr("width",Math.abs(C-M)).classed("rotate",!0)):(L.selectAll("line.threshold-line").transition().call(V=>m.services.transitions.setupTransition({transition:V,name:"threshold-line-update",animate:e})).attr("x1",S).attr("x2",T).attr("y1",({datum:V})=>A(V)+(E?g.step()/2:0)).attr("y2",({datum:V})=>A(V)+(E?g.step()/2:0)).style("stroke",({fillColor:V})=>V),L.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:V})=>A(V)).attr("width",Math.abs(T-S)).classed("rotate",!1))}),this.services.events.addEventListener(r.Events.Threshold.SHOW,p=>{this.setThresholdLabelPosition(p.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(r.Events.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(e){const{value:t,axisPosition:s}=e,n=this.getOptions();if(this.services.cartesianScales.getScaleTypeByPosition(s)===r.ScaleTypes.TIME){const i=[r.AxisPositions.LEFT,r.AxisPositions.RIGHT].includes(s),o=this.services.cartesianScales.getMainXScale(),d=this.services.cartesianScales.getMainYScale(),h=i?d:o,u=c.getProperty(n,"timeScale"),m=c.computeTimeIntervalName(h.ticks(),c.getProperty(u,"timeInterval"));return c.formatTick(t,0,h.ticks(),m,u)}return t.toLocaleString("en")}appendThresholdLabel(){const e=y.select(this.services.domUtils.getHolder()),t=c.getProperty(this.getOptions(),"style","prefix");this.label=O.DOMUtils.appendOrSelect(e,`div.${c.carbonPrefix}--${t}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:e,datum:t}){const s=this.services.domUtils.getHolder(),n=y.pointer(e,s),a=t.valueFormatter?t.valueFormatter(t.value):this.getFormattedValue(t);this.label.html(`${t.label||"Threshold"}: ${a}`).style("background-color",t.fillColor);const i=this.label.node(),o=this.positionService.findBestPlacementAt({left:n[0],top:n[1]},i,[Z.RIGHT,Z.LEFT,Z.TOP,Z.BOTTOM],()=>({top:void 0,left:void 0,width:s.offsetWidth,height:s.offsetHeight})),d=this.positionService.findPositionAt({left:n[0],top:n[1]},i,o);this.positionService.setElement(i,d)}constructDatumObj(e,t){const s={};return e.correspondingDatasets&&(s.group=c.getProperty(e,"correspondingDatasets",0)),s[e.mapsTo]=t.value,s}addEventListeners(){const e=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!0),e.services.events.dispatchEvent(r.Events.Threshold.SHOW,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})}).on("mouseout",function(s){y.select(this.parentNode).select("line.threshold-line").classed("active",!1),e.services.events.dispatchEvent(r.Events.Threshold.HIDE,{event:s,hoveredElement:y.select(this),datum:y.select(this).datum()})})}}class sa extends G{constructor(e,t){super(e,t),this.type="highlight",this.renderType=r.RenderTypes.SVG,this.positionService=new ve,this.highlightStrokeWidth=1}render(e=!1){const t=c.getProperty(this.getOptions(),"axes"),s=[];Object.keys(t).forEach(p=>{if(Object.values(r.AxisPositions).includes(p)){const g=t[p];g.highlights&&g.highlights.data.length>0&&s.push({axisPosition:p,highlightStartMapsTo:g.highlights.highlightStartMapsTo,highlightEndMapsTo:g.highlights.highlightEndMapsTo,labelMapsTo:g.highlights.labelMapsTo,highlight:g.highlights.data,color:g.highlights.color})}});const a=this.getComponentContainer({withinChartClip:!0}).selectAll("g.axis-highlight").data(s,p=>p.axisPosition);a.exit().attr("opacity",0).remove();const o=a.enter().append("g").merge(a);o.attr("class",p=>`axis-highlight ${p.axisPosition}`);const d=o.selectAll("g.highlight-group").data(p=>p.highlight.map(g=>(g.axisPosition=p.axisPosition,g.highlightStartMapsTo=p.highlightStartMapsTo,g.labelMapsTo=p.labelMapsTo,g.color=p.color,g.highlightEndMapsTo=p.highlightEndMapsTo,g)));d.exit().attr("opacity",0).remove();const h=d.enter().append("g");h.append("rect").attr("class","highlight-bar"),h.append("line").attr("class","highlight-line"),h.merge(d).attr("class","highlight-group");const m=this;o.each(function({axisPosition:p}){const g=m.services.cartesianScales.getMainXScale(),v=m.services.cartesianScales.getMainYScale(),[f,b]=g.range(),[E,S]=v.range(),{cartesianScales:T}=m.services,C=T.getOrientation(),M=_=>T.getDomainValue(_),x=_=>T.getRangeValue(_),[w,P]=c.flipDomainAndRangeBasedOnOrientation(M,x,C),$=y.select(this);p===r.AxisPositions.TOP||p===r.AxisPositions.BOTTOM?$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("y",Math.max(S+m.highlightStrokeWidth,0)).attr("height",Math.max(E-2*m.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:_,...A})=>w(A[_])).attr("width",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(w(L[A])-w(L[_]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null):$.selectAll("rect.highlight-bar").transition().call(_=>m.services.transitions.setupTransition({transition:_,name:"highlight-bar-update",animate:e})).attr("x",f).attr("width",Math.max(b-f,0)).attr("y",({highlightEndMapsTo:_,...A})=>P(A[_])).attr("height",({highlightStartMapsTo:_,highlightEndMapsTo:A,...L})=>Math.max(P(L[_])-P(L[A]),0)).style("stroke",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",m.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:_,labelMapsTo:A,...L})=>_&&_.scale[L[A]]?_.scale[L[A]]:null)})}}class na extends kt{getItems(e){if(e.detail.items)return e.detail.items;const t=e.detail.data;if(!t.length||!t[0])return[];const s=this.getOptions(),{cartesianScales:n}=this.services,a=n.getDomainIdentifier(),i=n.isDualAxes(),{groupMapsTo:o}=s.data,d=n.getDomainLabel();let h=n.getRangeLabel();const u=t[0][a];let m;if(t.length===1){const p=t[0],g=n.getRangeIdentifier(p);if(i){const f=n.getRangeAxisPosition({datum:p,groups:[p[o]]});h=n.getScaleLabel(f)}const v=p[g];m=[{label:d,value:u},...Array.isArray(v)&&v.length===2?[{label:"Start",value:v[0]},{label:"End",value:v[1]}]:[{label:h,value:p[g]}]],e.detail.additionalItems&&e.detail.additionalItems.forEach(f=>m.push({label:f.label,value:f.value})),m.push({label:s.tooltip.groupLabel,value:p[o],color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})})}else if(t.length>1&&(m=[{label:d,value:u}],m=m.concat(t.map(p=>{const g=p[n.getRangeIdentifier(p)];return{label:p[o],value:Array.isArray(g)&&g.length===2?`${g[0]} - ${g[1]}`:g,color:this.model.getFillColor(p[o]),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:p[o]})}}).sort((p,g)=>g.value-p.value)),!i&&c.getProperty(s,"tooltip","showTotal")===!0)){const p=n.getRangeIdentifier();m.push({label:c.get(s,"tooltip.totalLabel")||"Total",value:t.reduce((g,v)=>g+v[p],0),bold:!0})}return m}}class aa extends G{constructor(){super(...arguments),this.type="alluvial",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),o=c.getProperty(this.getOptions(),"color","gradient","enabled");let d=c.alluvial.minNodePadding;a.alluvial.nodePadding>c.alluvial.minNodePadding&&(d=a.alluvial.nodePadding);const h=c.getProperty(a,"alluvial","nodeAlignment");let u=ie.sankeyJustify;h===r.Alignments.LEFT?u=ie.sankeyLeft:h===r.Alignments.RIGHT&&(u=ie.sankeyRight);const m=ie.sankey().nodeId(E=>E.name).nodeWidth(c.alluvial.nodeWidth).nodePadding(d).nodeAlign(u).extent([[2,30],[s-2,n]]);this.graph=m({nodes:a.alluvial.nodes.map(E=>Object.assign({},E)),links:i.map(E=>Object.assign({},E))}),this.graph.nodes=this.graph.nodes.filter(E=>E.value!==0);const p={};this.graph.nodes.forEach(E=>{const S=E.x0;E.category&&(p[S]=E==null?void 0:E.category)}),t.append("g").classed("header-arrows",!0).selectAll("g").data(Object.keys(p)).join("g").attr("transform",E=>`translate(${E}, 0)`).append("text").attr("id",(E,S)=>this.services.domUtils.generateElementIDString(`alluvial-category-${S}`)).style("font-size","14px").text(E=>p[E]?p[E]:"").attr("y",20).attr("x",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-category-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});let M=0;return E+M>=C&&(M=-C+4),M});const v=t.append("g").attr("fill","none").selectAll("g").data(this.graph.links);if(v.exit().remove(),o){const E=c.getProperty(this.getOptions(),"color","scale");E&&v.enter().append("linearGradient").attr("id",S=>`${this.gradient_id}-link-${S.index}`).attr("gradientUnits","userSpaceOnUse").call(S=>S.append("stop").attr("offset","0%").attr("stop-color",T=>E[T.source.name])).call(S=>S.append("stop").attr("offset","100%").attr("stop-color",T=>E[T.target.name])),v.exit().remove()}v.enter().append("path").classed("link",!0).attr("d",ie.sankeyLinkHorizontal()).attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-line-${E.index}`)).attr("class",E=>a.alluvial.monochrome?this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:0,originalClassName:"link"}):this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E.source.index,originalClassName:"link"})).style("stroke",E=>o?`url(#${this.gradient_id}-link-${E.index})`:this.model.getFillColor(E.source.name)).attr("stroke-width",E=>Math.max(1,E.width)).style("stroke-opacity",c.alluvial.opacity.default).attr("aria-label",E=>`${E.source.name} → ${E.target.name} (${E.value}${a.alluvial.units?" "+a.alluvial.units:""})`);const f=t.append("g").selectAll("g").data(this.graph.nodes).enter().append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-${E.index}`)).classed("node-group",!0).attr("transform",E=>`translate(${E.x0}, ${E.y0})`);f.append("rect").classed("node",!0).attr("height",E=>E.y1-E.y0).attr("width",E=>E.x1-E.x0).attr("fill","black");const b=f.append("g").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-title-${E.index}`));b.append("text").attr("id",E=>this.services.domUtils.generateElementIDString(`alluvial-node-text-${E.index}`)).attr("class","node-text").style("font-size","12px").attr("text-anchor","start").attr("fill","white").attr("x",4).attr("dy",13).text(E=>`${E.name} (${E.value})`).attr("aria-label",E=>`${E.name} (${E.value})`),b.append("rect").classed("node-text-bg",!0).attr("width",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0});return C+8}).attr("height",18).attr("stroke-width",2).lower(),b.attr("transform",(E,S)=>{const T=this.services.domUtils.generateElementIDString(`alluvial-node-text-${S}`),{width:C}=O.DOMUtils.getSVGElementSize(y.select(`text#${T}`),{useBBox:!0}),M=(E.y1-E.y0)/2-9;let x=E.x1-E.x0;return E.x1>=C?x=x-(C+16):x+=4,`translate(${x}, ${M})`}),this.addLineEventListener(),this.addNodeEventListener()}addLineEventListener(){const e=this.getOptions(),t=this,s=O.debounce((n,a="mouseover")=>{const i=t.parent.selectAll("path.link").transition().call(o=>t.services.transitions.setupTransition({transition:o,name:"alluvial-links-mouse-highlight"}));a==="mouseout"?(y.select(n).lower(),i.style("stroke-opacity",c.alluvial.opacity.default)):i.style("stroke-opacity",function(){return n===this?(y.select(this).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},33);this.parent.selectAll("path.link").on("mouseover",function(n,a){const i=y.select(this);s(this,"mouseover"),i.classed("link-hovered",!0);const o=getComputedStyle(this).getPropertyValue("stroke");t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOVER,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:a.target.name,value:a.value+(e.alluvial.units?` ${e.alluvial.units}`:""),color:o,labelIcon:t.getRightArrowIcon()}]})}).on("mousemove",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEMOVE,{event:n,element:y.select(this),datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){t.services.events.dispatchEvent(r.Events.Alluvial.LINE_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);s(this,"mouseout"),i.classed("link-hovered",!1),t.services.events.dispatchEvent(r.Events.Alluvial.LINE_MOUSEOUT,{event:n,element:i,datum:a}),t.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:n,hoveredElement:i})})}addNodeEventListener(){const e=this,t=O.debounce((s=[],n="mouseover")=>{if(n==="mouseout"||s.length===0){e.parent.selectAll("path.link").classed("link-hovered",!1).data(this.graph.links,i=>i.index).order().style("stroke-opacity",c.alluvial.opacity.default);return}e.parent.selectAll("path.link").transition().call(i=>this.services.transitions.setupTransition({transition:i,name:"alluvial-link-mouse-highlight"})).style("stroke-opacity",function(i){return s.some(o=>o===i.index)?(y.select(this).classed("link-hovered",!0).raise(),c.alluvial.opacity.selected):c.alluvial.opacity.unfocus})},66);e.parent.selectAll(".node-group").on("mouseover",function(s,n){const a=y.select(this),i=[];if(e.traverse({link:"sourceLinks",node:"target"},n,i),e.traverse({link:"targetLinks",node:"source"},n,i),i.length){const o=c.getTransformOffsets(a.attr("transform"));if(a.attr("transform",`translate(${o.x-2}, ${o.y})`),a.classed("node-hovered",!0).selectAll("rect.node").attr("width",8),n.x0-2===0){const h=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),u=e.parent.select(`g#${h}`),m=c.getTransformOffsets(u.attr("transform"));u.attr("transform",`translate(${m.x+4},${m.y})`)}const d=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${d}`).style("font-weight","bold"),t(i,"mouseover"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOVER,{event:s,element:a,datum:n})}}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEMOVE,{event:s,element:y.select(this),datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Alluvial.NODE_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=c.getTransformOffsets(a.attr("transform"));if(a.classed("node-hovered",!1).attr("transform",`translate(${i.x+2}, ${i.y})`).select("rect.node").attr("width",c.alluvial.nodeWidth),n.x0-2===0){const d=e.services.domUtils.generateElementIDString(`alluvial-node-title-${n.index}`),h=e.parent.select(`g#${d}`),u=c.getTransformOffsets(h.attr("transform"));h.attr("transform",`translate(${u.x-4},${u.y})`)}const o=e.services.domUtils.generateElementIDString(`alluvial-node-text-${n.index}`);e.parent.select(`text#${o}`).style("font-weight","normal"),t([],"mouseout"),e.services.events.dispatchEvent(r.Events.Alluvial.NODE_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}traverse(e,t,s=[]){t[e.link].map(a=>(s.push(a.index),a[e.node])).forEach(a=>this.traverse(e,a,s))}getRightArrowIcon(){return`
|
|
70
70
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
71
71
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
72
72
|
<rect width="32" height="32"/>
|
|
73
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class ia extends G{constructor(){super(...arguments),this.type="grid",this.renderType=r.RenderTypes.SVG}render(e=!0){const t=c.getProperty(this.getOptions(),"grid","x","enabled"),s=c.getProperty(this.getOptions(),"grid","y","enabled");this.drawBackdrop(t,s),!(!t&&!s)&&(t&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),s&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const t=this.parent,s=this.backdrop.attr("height"),n=this.services.cartesianScales.getMainXScale(),a=y.axisBottom(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","x","alignWithAxisTicks")){const d=this.services.cartesianScales.getDomainAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","x","numberOfTicks");a.ticks(d)}const l=t.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${s})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}drawYGrid(e){const t=this.parent,s=this.backdrop.attr("width"),n=this.services.cartesianScales.getMainYScale(),a=y.axisLeft(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","y","alignWithAxisTicks")){const d=this.services.cartesianScales.getRangeAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","y","numberOfTicks");a.ticks(d)}const l=t.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?l.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):l.call(a),this.cleanGrid(l)}getGridlineThreshold(e){const t=this.parent,s=t.selectAll(".x.grid .tick").nodes().sort((u,m)=>Number(c.getTranslationValues(u).tx)-Number(c.getTranslationValues(m).tx));let n=-1;if(!s.length)return;s.forEach(u=>{e[0]>=+c.getTranslationValues(u).tx&&n++});const a=n+1<s.length?n+1:s.length,i=s[n],l=s[a];let d;if(!i)d=+c.getTranslationValues(l).tx;else if(l)d=+c.getTranslationValues(l).tx-+c.getTranslationValues(i).tx;else{const u=t.select("rect.chart-grid-backdrop").node();d=O.DOMUtils.getSVGElementSize(u).width-+c.getTranslationValues(i).tx}const{threshold:h}=this.getOptions().tooltip.gridline;return d*h}getActiveGridline(e){const t=c.getProperty(this.getOptions,"tooltip","gridline","threshold"),s=t||this.getGridlineThreshold(e);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=c.getTranslationValues(this),l={min:Number(i.tx)-s,max:Number(i.tx)+s};return l.min<=e[0]&&e[0]<=l.max})}drawBackdrop(e,t){const s=this.parent,n=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[i,l]=n.range(),[d,h]=a.range();this.backdrop=O.DOMUtils.appendOrSelect(s,"svg.chart-grid-backdrop");const u=O.DOMUtils.appendOrSelect(this.backdrop,e||t?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",i).attr("y",h).attr("width",Math.abs(l-i)).attr("height",Math.abs(d-h)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(e){e.selectAll("text").remove(),e.select(".domain").remove()}}class ra extends G{constructor(){super(...arguments),this.type="area",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>s.name!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions();let n=[0,0];const{cartesianScales:a}=this.services,i=a.getOrientation(),l=y.area().curve(this.services.curves.getD3Curve()).defined(C=>{const x=a.getRangeIdentifier(),w=C[x];return w!=null}),d=this.model.getGroupedData(this.configs.groups),h=c.getProperty(s,"bounds"),u=h&&d&&d.length===1;!u&&h&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${d.length}`);let m=0;const p=(C,x)=>{c.getProperty(s,"axes",C,"includeZero")===!1&&x[0]>0&&x[1]>0&&(m=x[0])},g=C=>u?a.getBoundedScaledValues(C)[0]:a.getRangeValue(m),v=C=>u?a.getBoundedScaledValues(C)[1]:a.getRangeValue(C);i===r.CartesianOrientations.VERTICAL?(n=a.getMainYScale().domain(),p(a.getMainYAxisPosition(),n),l.x(C=>a.getDomainValue(C)).y0(C=>g(C)).y1(C=>v(C))):(n=a.getMainXScale().domain(),p(a.getMainXAxisPosition(),n),l.x0(C=>g(C)).x1(C=>v(C)).y(C=>a.getDomainValue(C)));const f=c.getProperty(s,"color","gradient","enabled"),b=d&&d.length===1&&f;d.length>1&&f&&console.error("Gradients can only be enabled when having 1 single dataset");const E=t.selectAll("path.area").data(d,C=>C.name),S=y.select(this.services.domUtils.getMainContainer());if(E.exit().attr("opacity",0).remove(),!d.length)return;if(b){const C=S.select(`path.${this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:d[0].name})}`).node();let x;if(C)x=getComputedStyle(C,null).getPropertyValue("stroke");else{const w=c.getProperty(this.model.getOptions(),"color","scale");if(w!==null){const I=Object.keys(w);x=w[I[0]]}}O.GradientUtils.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${d[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:O.GradientUtils.getStops(n,x)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const T=this,M=E.enter().append("path");b?M.merge(E).style("fill",C=>`url(#${this.services.domUtils.generateElementIDString(`${C.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:C.name,originalClassName:"area"})).attr("d",C=>{const{data:x}=C;return l(x)}):(M.attr("opacity",0).merge(E).attr("class","area").attr("class",C=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:C.name,originalClassName:"area"})).style("fill",C=>T.model.getFillColor(C.name)).transition().call(C=>this.services.transitions.setupTransition({transition:C,name:"area-update-enter",animate:e})).attr("opacity",u?1:c.area.opacity.selected).attr("d",C=>{const{data:x}=C;return l(x)}),u&&M.attr("fill-opacity",c.area.opacity.selected).style("stroke",C=>T.model.getStrokeColor(C.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class oa extends G{constructor(){super(...arguments),this.type="line",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s.name!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:s,curves:n}=this.services,a=v=>s.getDomainValue(v),i=v=>s.getRangeValue(v),[l,d]=c.flipDomainAndRangeBasedOnOrientation(a,i,s.getOrientation()),h=this.getOptions(),u=y.line().x(l).y(d).curve(n.getD3Curve()).defined(v=>{const f=s.getRangeIdentifier(v),b=v[f];return b!=null});let m=[];if(this.configs.stacked){const v=Object.keys(h.axes).some(E=>h.axes[E].percentage),{groupMapsTo:f}=h.data;m=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(E=>{const S=this.services.cartesianScales.getDomainIdentifier(E),T=this.services.cartesianScales.getRangeIdentifier(E);return{name:c.getProperty(E,0,f),data:E.map(M=>({[S]:M.data.sharedStackKey,[f]:M[f],[T]:M[1]})),hidden:!_s(E,M=>M[0]!==M[1])}})}else m=this.model.getGroupedData(this.configs.groups);const p=t.selectAll("path.line").data(m,v=>v.name);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(m,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:f}=v;return f.map(b=>{const E=this.services.cartesianScales.getRangeIdentifier(b);return b[E]}).join(",")}).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:e})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:f}=v;return u(f)})}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const Qe=5;function la(o,e){return o>e-Qe&&o<e+Qe}class _e extends G{constructor(){super(...arguments),this.type="ruler",this.renderType=r.RenderTypes.SVG,this.isXGridEnabled=c.getProperty(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=c.getProperty(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(e=!1){const t=c.getProperty(this.getOptions(),"ruler","enabled");this.drawBackdrop(),t&&!this.isEventListenerAdded?this.addBackdropEventListeners():!t&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(e){return e}showRuler(e,[t,s]){const n=this.parent,a=this.services.cartesianScales.getOrientation(),i=this.model.getDisplayData(),l=this.services.cartesianScales.getRangeScale(),[d,h]=l.range(),u=a===r.CartesianOrientations.HORIZONTAL?s:t,m=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),p=O.DOMUtils.appendOrSelect(m,"line.ruler-line"),g=n.selectAll("[role=graphics-symbol]"),v=i.map(b=>({domainValue:this.services.cartesianScales.getDomainValue(b),originalData:b})).filter(b=>la(b.domainValue,u));if(this.pointsWithinLine&&v.length===this.pointsWithinLine.length&&v.map(b=>b.domainValue).join()===this.pointsWithinLine.map(b=>b.domainValue).join())return this.pointsWithinLine=v,this.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{mousePosition:[t,s]});this.pointsWithinLine=v;const f=this.pointsWithinLine.reduce((b,E)=>{if(b.length===0)return b.push(E),b;const S=b[0].domainValue,T=Math.abs(u-E.domainValue),M=Math.abs(u-S);return T>M||(T<M?b=[E]:b.push(E)),b},[]);if(f.length>0){const b=f.map(M=>M.originalData).filter(M=>{const C=this.services.cartesianScales.getRangeIdentifier(M),x=M[C];return x!=null}),E=f.map(M=>M.domainValue),S=g.filter(M=>{const C=this.services.cartesianScales.getDomainValue(M);return E.includes(C)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:p,data:this.formatTooltipData(b)}),m.attr("opacity",1);const T=f[0];a==="horizontal"?p.attr("x1",h).attr("x2",d).attr("y1",T.domainValue).attr("y2",T.domainValue):p.attr("y1",h).attr("y2",d).attr("x1",T.domainValue).attr("x2",T.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,t=O.DOMUtils.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE),t.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,t=this.services.domUtils.getHolder(),s=this.model.getDisplayData();let n=function(a){const i=y.pointer(a,e.parent.node());e.showRuler(a,i)};if(s.length>100){const a=s.length%50*12.5;n=c.debounceWithD3MousePosition(function(i){const{mousePosition:l}=this;e.showRuler(i,l)},a,t)}this.backdrop.on("mousemove mouseover",n).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop")}}class me extends G{constructor(){super(...arguments),this.type="scatter",this.renderType=r.RenderTypes.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(n=>{var a;return(a=this.services.transitions)==null?void 0:a.setupTransition({transition:n,name:"legend-hover-scatter"})}).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:t}=this.configs;t&&(e.addEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");const s=t.getDomainIdentifier(e),n=this.model.get("zoomDomain");return n!==void 0?e.filter(a=>a[s].getTime()>=n[0].getTime()&&a[s].getTime()<=n[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:t}=this.configs;let s;if(t){const n=Object.keys(e.axes).some(a=>e.axes[a].percentage);s=this.model.getStackedData({groups:this.configs.groups,percentage:n})}else{const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");s=this.model.getDisplayData(this.configs.groups).filter(a=>{const i=n.getRangeIdentifier(a);return a[i]!==void 0&&a[i]!==null})}return this.filterBasedOnZoomDomain(s)}render(e){if(!(c.getProperty(this.getOptions(),"points","enabled")||c.getProperty(this.getOptions(),"bubble","enabled")))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");const l=i.getDomainIdentifier(),d=s.selectAll("circle.dot").data(this.getScatterData(),m=>`${m[a]}-${m[l]}`);d.exit().attr("opacity",0).remove();const u=d.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(d);this.styleCircles(u,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:t}=this.configs;if(!t)return!1;const{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const n=s.getOrientation(),[a,i]=c.flipDomainAndRangeBasedOnOrientation(s.getHighestDomainThreshold(),s.getHighestRangeThreshold(),n),[l,d]=c.flipDomainAndRangeBasedOnOrientation(m=>s.getDomainValue(m),m=>s.getRangeValue(m),n),h=l(e),u=d(e);return i&&a?u<=i.scaleValue&&h>=a.scaleValue:i?u<=i.scaleValue:a?h>=a.scaleValue:!1}styleCircles(e,t){const s=this.getOptions(),{filled:n,fillOpacity:a}=s.points,{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:l}=s.data,d=g=>i.getDomainValue(g),h=g=>i.getRangeValue(g),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,i.getOrientation()),{fadeInOnChartHolderMouseover:p}=this.configs;e.raise().classed("dot",!0).attr("class",g=>{const v=i.getDomainIdentifier(g),b=this.model.getIsFilled(g[l],g[v],g,n)?[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE]:[r.ColorClassNameTypes.STROKE];return this.model.getColorClassName({classNameTypes:b,dataGroupName:g[l],originalClassName:"dot"})||""}).classed("threshold-anomaly",g=>this.isDatapointThresholdAnomaly(g)).classed("filled",g=>{const v=i.getDomainIdentifier(g);return this.model.getIsFilled(g[l],g[v],g,n)}).classed("unfilled",g=>{const v=i.getDomainIdentifier(g);return!this.model.getIsFilled(g[l],g[v],g,n)}).transition().call(g=>{var v;return(v=this.services.transitions)==null?void 0:v.setupTransition({transition:g,name:"scatter-update-enter",animate:t})}).attr("cx",u).attr("cy",m).attr("r",s.points.radius).style("fill",g=>{const v=i.getDomainIdentifier(g);if(this.model.getIsFilled(g[l],g[v],g,n))return this.model.getFillColor(g[l],g[v],g)}).style("stroke",g=>{const v=i.getDomainIdentifier(g);return this.model.getStrokeColor(g[l],g[v],g)}).attr("fill-opacity",n?a:1).attr("opacity",p?0:1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",g=>{const v=i.getRangeIdentifier(g);return g[v]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:t}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(s,n){var i,l;const a=y.select(this);a.classed("hovered",!0).attr("class",d=>e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:d[t],originalClassName:a.attr("class")})).style("fill",d=>{var u;const h=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(d);return e.model.getFillColor(d[t],d[h],d)}).classed("unfilled",!1),(i=e.services.events)==null||i.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,data:[n],additionalItems:e.getTooltipAdditionalItems(n)}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOVER,{event:s,element:a,datum:n})}).on("mousemove",function(s,n){var i,l;const a=y.select(this);(i=e.services.events)==null||i.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEMOVE,{event:s,element:a,datum:n}),(l=e.services.events)==null||l.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){var a;(a=e.services.events)==null||a.dispatchEvent(r.Events.Scatter.SCATTER_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){var i,l,d;const a=y.select(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:h}=e.getOptions().points,u=(i=e.services.cartesianScales)==null?void 0:i.getDomainIdentifier(n),m=e.model.getIsFilled(n[t],n[u],n,h);a.classed("unfilled",!m).style("fill",p=>m||h?e.model.getFillColor(p[t],p[u],p):null)}(l=e.services.events)==null||l.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOUT,{event:s,element:a,datum:n}),(d=e.services.events)==null||d.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:e}=this.services;if(!e)throw new Error("Services events undefined");e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class Ue extends G{constructor(e,t,s){super(e,t,s),this.type="axes",this.renderType=r.RenderTypes.SVG,this.truncation={[r.AxisPositions.LEFT]:!1,[r.AxisPositions.RIGHT]:!1,[r.AxisPositions.TOP]:!1,[r.AxisPositions.BOTTOM]:!1},s&&(this.configs=s),this.margins=this.configs.margins}render(e=!0){const{position:t}=this.configs,s=this.getOptions(),n=c.getProperty(s,"axes",t,"visible"),a=this.getComponentContainer(),{width:i,height:l}=O.DOMUtils.getSVGElementSize(a,{useAttrs:!0}),d=O.DOMUtils.appendOrSelect(a,`g.axis.${t}`);let h,u;if(t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP?(h=this.configs.axes[r.AxisPositions.LEFT]?this.margins.left:0,u=this.configs.axes[r.AxisPositions.RIGHT]?i-this.margins.right:i):(h=l-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const m=this.services.cartesianScales.getScaleByPosition(t);this.scaleType===r.ScaleTypes.LABELS||this.scaleType===r.ScaleTypes.LABELS_RATIO?m.rangeRound([h,u]):m.range([h,u]);let p;switch(t){case r.AxisPositions.LEFT:p=y.axisLeft;break;case r.AxisPositions.BOTTOM:p=y.axisBottom;break;case r.AxisPositions.RIGHT:p=y.axisRight;break;case r.AxisPositions.TOP:p=y.axisTop;break}d.attr("aria-label",`${t} axis`);const g=!d.select("g.ticks").empty();let v=O.DOMUtils.appendOrSelect(d,"g.ticks");g||(v.attr("role",`${N.Roles.GRAPHICS_OBJECT} ${N.Roles.GROUP}`),v.attr("aria-label",`${t} ticks`));const f=O.DOMUtils.appendOrSelect(d,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${t} ticks`),b=c.getProperty(s,"axes",t),E=this.scaleType===r.ScaleTypes.TIME||b.scaleType===r.ScaleTypes.TIME,S=t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT,T=this.model.get("zoomDomain");if(T&&E&&!S&&m.domain(T),!n){v.attr("aria-hidden",!0);return}const M=c.getProperty(b,"scaleType"),C=c.getProperty(s,"data","loading"),x=c.getProperty(b,"ticks","number"),w=c.getProperty(b,"ticks","values"),I=c.getProperty(b,"truncation","type"),$=c.getProperty(b,"truncation","threshold"),_=c.getProperty(b,"truncation","numCharacter"),A=x!==null,L=c.getProperty(s,"timeScale"),V=O.DOMUtils.appendOrSelect(f,"g.tick"),R=O.DOMUtils.appendOrSelect(V,"text").text("0"),F=O.DOMUtils.getSVGElementSize(R.node(),{useBBox:!0}).height;V.remove();const q=this.scaleType||b.scaleType||r.ScaleTypes.LINEAR,H=p(m).tickSizeOuter(0);if(m.ticks){let U;if(A?U=x:(U=c.axis.ticks.number,S&&(U=this.getNumberOfFittingTicks(l,F,c.axis.ticks.verticalSpaceRatio))),m.ticks().length===1&&m.ticks()[0]===0&&(U=0),H.ticks(U),E)if(!m.ticks(U).length)H.tickValues([]);else{const z=c.getProperty(s,"timeScale","addSpaceOnEdges"),W=c.getProperty(s,"axes",t,"domain"),j=m.copy();z&&!W&&j.nice(U);const Y=j.ticks(U);z&&Y.length>2&&!W&&(Y.splice(Y.length-1,1),Y.splice(0,1)),H.tickValues(Y)}}let B;const X=c.getProperty(b,"ticks","formatter");if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval"));X===null?B=(z,W)=>c.formatTick(z,W,H.tickValues(),U,L):B=(z,W)=>{const j=c.formatTick(z,W,H.tickValues(),U,L);return X(z,W,j)}}else X===null?q===r.ScaleTypes.LINEAR&&(B=U=>U.toLocaleString()):B=X;H.tickFormat(B);const[fe,ye]=this.services.cartesianScales.getScaleByPosition(t).domain();let ne;if(w){if(E)w.forEach((U,z)=>{U.getTime===void 0&&(w[z]=new Date(U))}),ne=w.filter(U=>{const z=U.getTime();return z>=new Date(fe).getTime()&&z<=new Date(ye).getTime()});else if(M===r.ScaleTypes.LABELS){const U=this.services.cartesianScales.getScaleByPosition(t).domain();ne=w.filter(z=>U.includes(z))}else ne=w.filter(U=>U>=fe&&U<=ye);H.tickValues(ne)}switch(t){case r.AxisPositions.LEFT:v.attr("transform",`translate(${this.margins.left}, 0)`);break;case r.AxisPositions.BOTTOM:v.attr("transform",`translate(0, ${l-this.margins.bottom})`);break;case r.AxisPositions.RIGHT:v.attr("transform",`translate(${i-this.margins.right}, 0)`);break;case r.AxisPositions.TOP:v.attr("transform",`translate(0, ${this.margins.top})`);break}const Be=this.model.isDataEmpty();if(b.title){const U=O.DOMUtils.appendOrSelect(d,"text.axis-title").html(Be||C?"":b.title),z=c.getProperty(b,"titleOrientation");let W;switch(t){case r.AxisPositions.LEFT:z===r.AxisTitleOrientations.RIGHT?U.attr("transform","rotate(90)").attr("y",0).attr("x",m.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):U.attr("transform","rotate(-90)").attr("y",0).attr("x",-(m.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.BOTTOM:U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${l+4})`).style("text-anchor","middle");break;case r.AxisPositions.RIGHT:z===r.AxisTitleOrientations.LEFT?U.attr("transform","rotate(-90)").attr("y",i).attr("x",-(m.range()[0]/2)).style("text-anchor","middle"):U.attr("transform","rotate(90)").attr("y",-i).attr("x",m.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.TOP:W=O.DOMUtils.getSVGElementSize(U,{useBBox:!0}).height,U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${W/2})`).style("text-anchor","middle");break}}if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval")),z=L.showDayName,W=v;e&&(v=v.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:e}))),v=v.call(H),W.selectAll(".tick").data(H.tickValues(),m).order().select("text").style("font-weight",(Y,re)=>c.isTickPrimary(Y,re,H.tickValues(),U,z)?"bold":"normal")}else!e||!g?v=v.call(H):v=v.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"axis-update",animate:e})).call(H);if(f.call(H),t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP){let U=!1;const z=c.getProperty(b,"ticks","rotation");if(z===r.TickRotations.ALWAYS)U=!0;else if(z===r.TickRotations.NEVER)U=!1;else if(!z||z===r.TickRotations.AUTO)if(m.step)U=f.selectAll("g.tick text").nodes().some(j=>O.DOMUtils.getSVGElementSize(j,{useBBox:!0}).width>=m.step());else{U=!1;const W=f.append("text").text("A"),j=O.DOMUtils.getSVGElementSize(W.node(),{useBBox:!0}).width;let Y;f.selectAll("g.tick").each(function(){const re=y.select(this),D=parseFloat(c.getProperty(c.getTranslationValues(this),"tx"));D!==null&&Y+re.text().length*j*.8>=D&&(U=!0),Y=D}),W.remove()}U?(A||(H.ticks(this.getNumberOfFittingTicks(i,F,c.axis.ticks.horizontalSpaceRatio)),f.call(H),v.call(H)),d.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",t===r.AxisPositions.TOP?"start":"end")):d.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(C?d.attr("opacity",0):d.attr("opacity",1),v.selectAll("g.tick").attr("aria-label",U=>U),f.selectAll("g.tick").attr("aria-label",U=>U),I!==r.TruncationTypes.NONE&&M===r.ScaleTypes.LABELS&&!w){const U=this.services.cartesianScales.getScaleDomain(t);if(U.length>0){const z=a.select(`g.axis.${t} g.ticks g.tick`).html();d.selectAll("g.ticks g.tick").html(z);const W=this;d.selectAll("g.tick text").data(U).text(function(j){return j.length>$?(W.truncation[t]=!0,c.truncateLabel(j,I,_)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(U).text(function(j){return j.length>$?c.truncateLabel(j,I,_):j}),d.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),d.selectAll("g.tick text").data(U)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick text").on("mouseover",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,hoveredElement:y.select(this),content:u})}).on("mousemove",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,t,s){const n=Math.floor(e/(t*s));return Ot(n,2,c.axis.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class It extends Ue{constructor(e,t,s){super(e,t,s)}render(e=!0){super.render(e),super.destroy();const t=this.configs.position,s=this.getComponentContainer(),n=O.DOMUtils.appendOrSelect(s,`g.axis.${t}`),a=this;n.selectAll("g.tick").each(function(i,l){const d=y.select(this);d.classed("tick-hover",!0).attr("tabindex",l===0?0:-1);const h=d.select("text"),{width:u,height:m}=O.DOMUtils.getSVGElementSize(h,{useBBox:!0}),p=O.DOMUtils.appendOrSelect(d,"rect.axis-holder");let g=0,v=0;switch(t){case r.AxisPositions.LEFT:g=-u+Number(h.attr("x")),v=-(m/2);break;case r.AxisPositions.RIGHT:g=Math.abs(Number(h.attr("x"))),v=-(m/2);break;case r.AxisPositions.TOP:g=-(u/2),v=-m+Number(h.attr("y"))/2,a.truncation[t]&&(g=0,p.attr("transform","rotate(-45)"));break;case r.AxisPositions.BOTTOM:g=-(u/2),v=m/2-2,a.truncation[t]&&(g=-u,p.attr("transform","rotate(-45)"));break}p.attr("x",g-c.axis.hover.rectanglePadding).attr("y",v).attr("width",u+c.axis.hover.rectanglePadding*2).attr("height",m).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),l=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick.tick-hover").on("mouseover",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:u,datum:m}),i===r.ScaleTypes.LABELS&&m.length>l&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,element:u,datum:m})}).on("mousemove",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:u,datum:m}),d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()})}).on("mouseout",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)}).on("focus",function(h){const u={clientX:0,clientY:0};if(h.target){h.target.focus();const m=h.target.getBoundingClientRect();u.clientX=m.x,u.clientY=m.y}d.services.events.dispatchEvent(r.Events.Axis.LABEL_FOCUS,{event:{...h,...u},element:y.select(this),datum:y.select(this).select("text").datum()})}).on("blur",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})}).on("keydown",function(h){h.key&&h.key==="Escape"&&(d.services.events.dispatchEvent(r.Events.Tooltip.HIDE),d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})),t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT?h.key&&h.key==="ArrowUp"?d.goNext(this,h):h.key&&h.key==="ArrowDown"&&d.goPrevious(this,h):h.key&&h.key==="ArrowLeft"?d.goPrevious(this,h):h.key&&h.key==="ArrowRight"&&d.goNext(this,h)})}goNext(e,t){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}goPrevious(e,t){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ca extends G{constructor(){super(...arguments),this.type="2D-axes",this.renderType=r.RenderTypes.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const t={},s=Object.keys(r.AxisPositions),n=c.getProperty(this.getOptions(),"axes");s.forEach(l=>{n[r.AxisPositions[l]]&&(t[r.AxisPositions[l]]=!0)}),this.configs.axes=t,s.forEach(l=>{const d=r.AxisPositions[l];if(this.configs.axes[d]&&!this.children[d]){const h={position:d,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===r.AxisFlavor.DEFAULT?new Ue(this.model,this.services,h):new It(this.model,this.services,h);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[d]=u}}),Object.keys(this.children).forEach(l=>{this.children[l].render(e)});const a={};Object.keys(this.children).forEach(l=>{const d=this.children[l],h=d.configs.position,u=d.getInvisibleAxisRef(),{width:m,height:p}=O.DOMUtils.getSVGElementSize(u,{useBBox:!0});let g;switch(d.getTitleRef().empty()?g=0:(g=O.DOMUtils.getSVGElementSize(d.getTitleRef(),{useBBox:!0}).height,(h===r.AxisPositions.LEFT||h===r.AxisPositions.RIGHT)&&(g+=5)),h){case r.AxisPositions.TOP:a.top=p+g;break;case r.AxisPositions.BOTTOM:a.bottom=p+g;break;case r.AxisPositions.LEFT:a.left=m+g;break;case r.AxisPositions.RIGHT:a.right=m+g;break}}),this.services.events.dispatchEvent(r.Events.Axis.RENDER_COMPLETE),Object.keys(a).some(l=>this.margins[l]!==a[l])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(r.Events.ZoomBar.UPDATE),Object.keys(this.children).forEach(l=>{const d=this.children[l];d.margins=this.margins}),this.render(!0))}}class _t extends G{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading");t?this.renderSkeleton(t):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===r.Skeletons.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===r.Skeletons.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===r.Skeletons.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===r.Skeletons.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const t=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),t===r.CartesianOrientations.VERTICAL&&this.drawYGrid(e),t===r.CartesianOrientations.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const t=this.computeOuterRadius(),s=0;this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const t=this.computeOuterRadius(),s=this.computeInnerRadius();this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),t=this.services.cartesianScales.getMainYScale().range();this.xScale=y.scaleLinear().domain([0,1]).range(e),this.yScale=y.scaleLinear().domain([0,1]).range(t)}drawBackdrop(e){const t=this.parent,{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});this.backdrop=O.DOMUtils.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("width",s).attr("height",n);const a=O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[i]=this.xScale.range(),[,l]=this.yScale.range();this.backdrop.merge(a).attr("x",i).attr("y",l),a.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const t=+this.backdrop.attr("width"),s=c.getProperty(this.getOptions(),"grid","x","numberOfTicks"),n=this.xScale.ticks(s).map(l=>l*t),a=O.DOMUtils.appendOrSelect(this.backdrop,"g.x.skeleton"),i=a.selectAll("line").data(n);i.enter().append("line").merge(i).attr("x1",l=>l).attr("x2",l=>l).attr("y1",0).attr("y2","100%"),a.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const t=+this.backdrop.attr("height"),s=this.backdrop.attr("width"),n=c.getProperty(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(n).map(d=>d*t),i=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),l=i.selectAll("line").data(a);l.enter().append("line").merge(l).attr("x1",0).attr("x2",s).attr("y1",d=>d).attr("y2",d=>d),i.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,t,s=!0){const n=this.parent,{width:a,height:i}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),l=O.DOMUtils.appendOrSelect(n,"svg.chart-skeleton").attr("width",a).attr("height",i),d=t===0?"pie":"donut",h=c.getProperty(this.getOptions(),d,"alignment");O.DOMUtils.appendOrSelect(l,"rect.chart-skeleton-area-container").attr("width",a).attr("height",i).attr("fill","none");const u=y.arc().innerRadius(t).outerRadius(e).startAngle(0).endAngle(Math.PI*2),m=e+Math.abs(c.pie.radiusOffset),p=e+(Math.min(a,i)-e*2)/2,g=O.DOMUtils.appendOrSelect(l,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${m}, ${p})`).attr("d",u).classed("shimmer-effect-areas",s).classed("empty-state-areas",!s).style("fill",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let v=e+c.pie.xOffset;h===r.Alignments.CENTER?v=a/2:h===r.Alignments.RIGHT&&(v=a-e-c.pie.xOffset);const f=e+c.pie.yOffset;g.attr("transform",`translate(${v}, ${f})`)}computeOuterRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,t)/2+c.pie.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const a="stop-bg-shimmer",i="stop-shimmer",l=this.parent.select(".chart-skeleton"),{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),h=0,u=d,m=O.DOMUtils.appendOrSelect(l,"defs").lower(),p=O.DOMUtils.appendOrSelect(m,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",h-3*.2*d).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),g=`
|
|
73
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class ia extends G{constructor(){super(...arguments),this.type="grid",this.renderType=r.RenderTypes.SVG}render(e=!0){const t=c.getProperty(this.getOptions(),"grid","x","enabled"),s=c.getProperty(this.getOptions(),"grid","y","enabled");this.drawBackdrop(t,s),!(!t&&!s)&&(t&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(e)),s&&(O.DOMUtils.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(e)))}drawXGrid(e){const t=this.parent,s=this.backdrop.attr("height"),n=this.services.cartesianScales.getMainXScale(),a=y.axisBottom(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","x","alignWithAxisTicks")){const d=this.services.cartesianScales.getDomainAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","x","numberOfTicks");a.ticks(d)}const o=t.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${s})`);e?o.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):o.call(a),this.cleanGrid(o)}drawYGrid(e){const t=this.parent,s=this.backdrop.attr("width"),n=this.services.cartesianScales.getMainYScale(),a=y.axisLeft(n).tickSizeInner(-s).tickSizeOuter(0);if(c.getProperty(this.getOptions(),"grid","y","alignWithAxisTicks")){const d=this.services.cartesianScales.getRangeAxisPosition(),h=c.getProperty(this.getOptions(),"axes",d,"ticks","values");h&&a.tickValues(h)}else{const d=c.getProperty(this.getOptions(),"grid","y","numberOfTicks");a.ticks(d)}const o=t.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);e?o.transition().call(d=>this.services.transitions.setupTransition({transition:d,name:"grid-update",animate:e})).call(a):o.call(a),this.cleanGrid(o)}getGridlineThreshold(e){const t=this.parent,s=t.selectAll(".x.grid .tick").nodes().sort((u,m)=>Number(c.getTranslationValues(u).tx)-Number(c.getTranslationValues(m).tx));let n=-1;if(!s.length)return;s.forEach(u=>{e[0]>=+c.getTranslationValues(u).tx&&n++});const a=n+1<s.length?n+1:s.length,i=s[n],o=s[a];let d;if(!i)d=+c.getTranslationValues(o).tx;else if(o)d=+c.getTranslationValues(o).tx-+c.getTranslationValues(i).tx;else{const u=t.select("rect.chart-grid-backdrop").node();d=O.DOMUtils.getSVGElementSize(u).width-+c.getTranslationValues(i).tx}const{threshold:h}=this.getOptions().tooltip.gridline;return d*h}getActiveGridline(e){const t=c.getProperty(this.getOptions,"tooltip","gridline","threshold"),s=t||this.getGridlineThreshold(e);return this.parent.selectAll(".x.grid .tick").filter(function(){const i=c.getTranslationValues(this),o={min:Number(i.tx)-s,max:Number(i.tx)+s};return o.min<=e[0]&&e[0]<=o.max})}drawBackdrop(e,t){const s=this.parent,n=this.services.cartesianScales.getMainXScale(),a=this.services.cartesianScales.getMainYScale(),[i,o]=n.range(),[d,h]=a.range();this.backdrop=O.DOMUtils.appendOrSelect(s,"svg.chart-grid-backdrop");const u=O.DOMUtils.appendOrSelect(this.backdrop,e||t?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",i).attr("y",h).attr("width",Math.abs(o-i)).attr("height",Math.abs(d-h)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(e){e.selectAll("text").remove(),e.select(".domain").remove()}}class ra extends G{constructor(){super(...arguments),this.type="area",this.renderType=r.RenderTypes.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>s.name!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions();let n=[0,0];const{cartesianScales:a}=this.services,i=a.getOrientation(),o=y.area().curve(this.services.curves.getD3Curve()).defined(M=>{const x=a.getRangeIdentifier(),w=M[x];return w!=null}),d=this.model.getGroupedData(this.configs.groups),h=c.getProperty(s,"bounds"),u=h&&d&&d.length===1;!u&&h&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${d.length}`);let m=0;const p=(M,x)=>{c.getProperty(s,"axes",M,"includeZero")===!1&&x[0]>0&&x[1]>0&&(m=x[0])},g=M=>u?a.getBoundedScaledValues(M)[0]:a.getRangeValue(m),v=M=>u?a.getBoundedScaledValues(M)[1]:a.getRangeValue(M);i===r.CartesianOrientations.VERTICAL?(n=a.getMainYScale().domain(),p(a.getMainYAxisPosition(),n),o.x(M=>a.getDomainValue(M)).y0(M=>g(M)).y1(M=>v(M))):(n=a.getMainXScale().domain(),p(a.getMainXAxisPosition(),n),o.x0(M=>g(M)).x1(M=>v(M)).y(M=>a.getDomainValue(M)));const f=c.getProperty(s,"color","gradient","enabled"),b=d&&d.length===1&&f;d.length>1&&f&&console.error("Gradients can only be enabled when having 1 single dataset");const E=t.selectAll("path.area").data(d,M=>M.name),S=y.select(this.services.domUtils.getMainContainer());if(E.exit().attr("opacity",0).remove(),!d.length)return;if(b){const M=S.select(`path.${this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:d[0].name})}`).node();let x;if(M)x=getComputedStyle(M,null).getPropertyValue("stroke");else{const w=c.getProperty(this.model.getOptions(),"color","scale");if(w!==null){const P=Object.keys(w);x=w[P[0]]}}O.GradientUtils.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${d[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:O.GradientUtils.getStops(n,x)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const T=this,C=E.enter().append("path");b?C.merge(E).style("fill",M=>`url(#${this.services.domUtils.generateElementIDString(`${M.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:M.name,originalClassName:"area"})).attr("d",M=>{const{data:x}=M;return o(x)}):(C.attr("opacity",0).merge(E).attr("class","area").attr("class",M=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:M.name,originalClassName:"area"})).style("fill",M=>T.model.getFillColor(M.name)).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"area-update-enter",animate:e})).attr("opacity",u?1:c.area.opacity.selected).attr("d",M=>{const{data:x}=M;return o(x)}),u&&C.attr("fill-opacity",c.area.opacity.selected).style("stroke",M=>T.model.getStrokeColor(M.name)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class oa extends G{constructor(){super(...arguments),this.type="line",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s.name!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{cartesianScales:s,curves:n}=this.services,a=v=>s.getDomainValue(v),i=v=>s.getRangeValue(v),[o,d]=c.flipDomainAndRangeBasedOnOrientation(a,i,s.getOrientation()),h=this.getOptions(),u=y.line().x(o).y(d).curve(n.getD3Curve()).defined(v=>{const f=s.getRangeIdentifier(v),b=v[f];return b!=null});let m=[];if(this.configs.stacked){const v=Object.keys(h.axes).some(E=>h.axes[E].percentage),{groupMapsTo:f}=h.data;m=this.model.getStackedData({groups:this.configs.groups,percentage:v}).map(E=>{const S=this.services.cartesianScales.getDomainIdentifier(E),T=this.services.cartesianScales.getRangeIdentifier(E);return{name:c.getProperty(E,0,f),data:E.map(C=>({[S]:C.data.sharedStackKey,[f]:C[f],[T]:C[1]})),hidden:!_s(E,C=>C[0]!==C[1])}})}else m=this.model.getGroupedData(this.configs.groups);const p=t.selectAll("path.line").data(m,v=>v.name);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("line",!0).attr("opacity",0).merge(p).data(m,v=>v.name).attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:v.name,originalClassName:"line"})).style("stroke",v=>this.model.getStrokeColor(v.name)).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",v=>{const{data:f}=v;return f.map(b=>{const E=this.services.cartesianScales.getRangeIdentifier(b);return b[E]}).join(",")}).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"line-update-enter",animate:e})).attr("opacity",v=>v.hidden?0:1).attr("d",v=>{const{data:f}=v;return u(f)})}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const at=5;function la(l,e){return l>e-at&&l<e+at}class Ge extends G{constructor(){super(...arguments),this.type="ruler",this.renderType=r.RenderTypes.SVG,this.isXGridEnabled=c.getProperty(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=c.getProperty(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(e=!1){const t=c.getProperty(this.getOptions(),"ruler","enabled");this.drawBackdrop(),t&&!this.isEventListenerAdded?this.addBackdropEventListeners():!t&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(e){return e}showRuler(e,[t,s]){const n=this.parent,a=this.services.cartesianScales.getOrientation(),i=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[d,h]=o.range(),u=a===r.CartesianOrientations.HORIZONTAL?s:t,m=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),p=O.DOMUtils.appendOrSelect(m,"line.ruler-line"),g=n.selectAll("[role=graphics-symbol]"),v=i.map(b=>({domainValue:this.services.cartesianScales.getDomainValue(b),originalData:b})).filter(b=>la(b.domainValue,u));if(this.pointsWithinLine&&v.length===this.pointsWithinLine.length&&v.map(b=>b.domainValue).join()===this.pointsWithinLine.map(b=>b.domainValue).join())return this.pointsWithinLine=v,this.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{mousePosition:[t,s]});this.pointsWithinLine=v;const f=this.pointsWithinLine.reduce((b,E)=>{if(b.length===0)return b.push(E),b;const S=b[0].domainValue,T=Math.abs(u-E.domainValue),C=Math.abs(u-S);return T>C||(T<C?b=[E]:b.push(E)),b},[]);if(f.length>0){const b=f.map(C=>C.originalData).filter(C=>{const M=this.services.cartesianScales.getRangeIdentifier(C),x=C[M];return x!=null}),E=f.map(C=>C.domainValue),S=g.filter(C=>{const M=this.services.cartesianScales.getDomainValue(C);return E.includes(M)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ct(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:p,data:this.formatTooltipData(b)}),m.attr("opacity",1);const T=f[0];a==="horizontal"?p.attr("x1",h).attr("x2",d).attr("y1",T.domainValue).attr("y2",T.domainValue):p.attr("y1",h).attr("y2",d).attr("x1",T.domainValue).attr("x2",T.domainValue)}else this.hideRuler()}hideRuler(){const e=this.parent,t=O.DOMUtils.appendOrSelect(e,"g.ruler");e.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE),t.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const e=this,t=this.services.domUtils.getHolder(),s=this.model.getDisplayData();let n=function(a){const i=y.pointer(a,e.parent.node());e.showRuler(a,i)};if(s.length>100){const a=s.length%50*12.5;n=c.debounceWithD3MousePosition(function(i){const{mousePosition:o}=this;e.showRuler(i,o)},a,t)}this.backdrop.on("mousemove mouseover",n).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-grid-backdrop")}}class fe extends G{constructor(){super(...arguments),this.type="scatter",this.renderType=r.RenderTypes.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(n=>{var a;return(a=this.services.transitions)==null?void 0:a.setupTransition({transition:n,name:"legend-hover-scatter"})}).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(e=>{var t;return(t=this.services.transitions)==null?void 0:t.setupTransition({transition:e,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:e}=this.services;if(!e)throw new Error("Services events are undefined.");e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:t}=this.configs;t&&(e.addEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.addEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(e){const{cartesianScales:t}=this.services;if(!t)throw new Error("Services cartesianScales are undefined.");const s=t.getDomainIdentifier(e),n=this.model.get("zoomDomain");return n!==void 0?e.filter(a=>a[s].getTime()>=n[0].getTime()&&a[s].getTime()<=n[1].getTime()):e}getScatterData(){const e=this.getOptions(),{stacked:t}=this.configs;let s;if(t){const n=Object.keys(e.axes).some(a=>e.axes[a].percentage);s=this.model.getStackedData({groups:this.configs.groups,percentage:n})}else{const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");s=this.model.getDisplayData(this.configs.groups).filter(a=>{const i=n.getRangeIdentifier(a);return a[i]!==void 0&&a[i]!==null})}return this.filterBasedOnZoomDomain(s)}render(e){if(!(c.getProperty(this.getOptions(),"points","enabled")||c.getProperty(this.getOptions(),"bubble","enabled")))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");const o=i.getDomainIdentifier(),d=s.selectAll("circle.dot").data(this.getScatterData(),m=>`${m[a]}-${m[o]}`);d.exit().attr("opacity",0).remove();const u=d.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(d);this.styleCircles(u,e),this.addEventListeners()}isDatapointThresholdAnomaly(e){const{handleThresholds:t}=this.configs;if(!t)return!1;const{cartesianScales:s}=this.services;if(!s)throw new Error("Cartesian scales service is undefined");const n=s.getOrientation(),[a,i]=c.flipDomainAndRangeBasedOnOrientation(s.getHighestDomainThreshold(),s.getHighestRangeThreshold(),n),[o,d]=c.flipDomainAndRangeBasedOnOrientation(m=>s.getDomainValue(m),m=>s.getRangeValue(m),n),h=o(e),u=d(e);return i&&a?u<=i.scaleValue&&h>=a.scaleValue:i?u<=i.scaleValue:a?h>=a.scaleValue:!1}styleCircles(e,t){const s=this.getOptions(),{filled:n,fillOpacity:a}=s.points,{cartesianScales:i}=this.services;if(!i)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=s.data,d=g=>i.getDomainValue(g),h=g=>i.getRangeValue(g),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,i.getOrientation()),{fadeInOnChartHolderMouseover:p}=this.configs;e.raise().classed("dot",!0).attr("class",g=>{const v=i.getDomainIdentifier(g),b=this.model.getIsFilled(g[o],g[v],g,n)?[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE]:[r.ColorClassNameTypes.STROKE];return this.model.getColorClassName({classNameTypes:b,dataGroupName:g[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",g=>this.isDatapointThresholdAnomaly(g)).classed("filled",g=>{const v=i.getDomainIdentifier(g);return this.model.getIsFilled(g[o],g[v],g,n)}).classed("unfilled",g=>{const v=i.getDomainIdentifier(g);return!this.model.getIsFilled(g[o],g[v],g,n)}).transition().call(g=>{var v;return(v=this.services.transitions)==null?void 0:v.setupTransition({transition:g,name:"scatter-update-enter",animate:t})}).attr("cx",u).attr("cy",m).attr("r",s.points.radius).style("fill",g=>{const v=i.getDomainIdentifier(g);if(this.model.getIsFilled(g[o],g[v],g,n))return this.model.getFillColor(g[o],g[v],g)}).style("stroke",g=>{const v=i.getDomainIdentifier(g);return this.model.getStrokeColor(g[o],g[v],g)}).attr("fill-opacity",n?a:1).attr("opacity",p?0:1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",g=>{const v=i.getRangeIdentifier(g);return g[v]}),this.addEventListeners()}getTooltipAdditionalItems(e){return null}addEventListeners(){const e=this,{groupMapsTo:t}=e.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(s,n){var i,o;const a=y.select(this);a.classed("hovered",!0).attr("class",d=>e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:d[t],originalClassName:a.attr("class")})).style("fill",d=>{var u;const h=(u=e.services.cartesianScales)==null?void 0:u.getDomainIdentifier(d);return e.model.getFillColor(d[t],d[h],d)}).classed("unfilled",!1),(i=e.services.events)==null||i.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,data:[n],additionalItems:e.getTooltipAdditionalItems(n)}),(o=e.services.events)==null||o.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOVER,{event:s,element:a,datum:n})}).on("mousemove",function(s,n){var i,o;const a=y.select(this);(i=e.services.events)==null||i.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEMOVE,{event:s,element:a,datum:n}),(o=e.services.events)==null||o.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){var a;(a=e.services.events)==null||a.dispatchEvent(r.Events.Scatter.SCATTER_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){var i,o,d;const a=y.select(this);if(a.classed("hovered",!1),!e.configs.filled){const{filled:h}=e.getOptions().points,u=(i=e.services.cartesianScales)==null?void 0:i.getDomainIdentifier(n),m=e.model.getIsFilled(n[t],n[u],n,h);a.classed("unfilled",!m).style("fill",p=>m||h?e.model.getFillColor(p[t],p[u],p):null)}(o=e.services.events)==null||o.dispatchEvent(r.Events.Scatter.SCATTER_MOUSEOUT,{event:s,element:a,datum:n}),(d=e.services.events)==null||d.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:a})})}destroy(){var t;(t=this.parent)==null||t.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:e}=this.services;if(!e)throw new Error("Services events undefined");e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Chart.MOUSEOVER,this.handleChartHolderOnHover),e.removeEventListener(r.Events.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class $e extends G{constructor(e,t,s){super(e,t,s),this.type="axes",this.renderType=r.RenderTypes.SVG,this.truncation={[r.AxisPositions.LEFT]:!1,[r.AxisPositions.RIGHT]:!1,[r.AxisPositions.TOP]:!1,[r.AxisPositions.BOTTOM]:!1},s&&(this.configs=s),this.margins=this.configs.margins}render(e=!0){const{position:t}=this.configs,s=this.getOptions(),n=c.getProperty(s,"axes",t,"visible"),a=this.getComponentContainer(),{width:i,height:o}=O.DOMUtils.getSVGElementSize(a,{useAttrs:!0}),d=O.DOMUtils.appendOrSelect(a,`g.axis.${t}`);let h,u;if(t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP?(h=this.configs.axes[r.AxisPositions.LEFT]?this.margins.left:0,u=this.configs.axes[r.AxisPositions.RIGHT]?i-this.margins.right:i):(h=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const m=this.services.cartesianScales.getScaleByPosition(t);this.scaleType===r.ScaleTypes.LABELS||this.scaleType===r.ScaleTypes.LABELS_RATIO?m.rangeRound([h,u]):m.range([h,u]);let p;switch(t){case r.AxisPositions.LEFT:p=y.axisLeft;break;case r.AxisPositions.BOTTOM:p=y.axisBottom;break;case r.AxisPositions.RIGHT:p=y.axisRight;break;case r.AxisPositions.TOP:p=y.axisTop;break}d.attr("aria-label",`${t} axis`);const g=!d.select("g.ticks").empty();let v=O.DOMUtils.appendOrSelect(d,"g.ticks");g||(v.attr("role",`${B.Roles.GRAPHICS_OBJECT} ${B.Roles.GROUP}`),v.attr("aria-label",`${t} ticks`));const f=O.DOMUtils.appendOrSelect(d,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${t} ticks`),b=c.getProperty(s,"axes",t),E=this.scaleType===r.ScaleTypes.TIME||b.scaleType===r.ScaleTypes.TIME,S=t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT,T=this.model.get("zoomDomain");if(T&&E&&!S&&m.domain(T),!n){v.attr("aria-hidden",!0);return}const C=c.getProperty(b,"scaleType"),M=c.getProperty(s,"data","loading"),x=c.getProperty(b,"ticks","number"),w=c.getProperty(b,"ticks","values"),P=c.getProperty(b,"truncation","type"),$=c.getProperty(b,"truncation","threshold"),_=c.getProperty(b,"truncation","numCharacter"),A=x!==null,L=c.getProperty(s,"timeScale"),V=O.DOMUtils.appendOrSelect(f,"g.tick"),k=O.DOMUtils.appendOrSelect(V,"text").text("0"),F=O.DOMUtils.getSVGElementSize(k.node(),{useBBox:!0}).height;V.remove();const q=this.scaleType||b.scaleType||r.ScaleTypes.LINEAR,H=p(m).tickSizeOuter(0);if(m.ticks){let U;if(A?U=x:(U=c.axis.ticks.number,S&&(U=this.getNumberOfFittingTicks(o,F,c.axis.ticks.verticalSpaceRatio))),m.ticks().length===1&&m.ticks()[0]===0&&(U=0),H.ticks(U),E)if(!m.ticks(U).length)H.tickValues([]);else{const z=c.getProperty(s,"timeScale","addSpaceOnEdges"),W=c.getProperty(s,"axes",t,"domain"),j=m.copy();z&&!W&&j.nice(U);const Y=j.ticks(U);z&&Y.length>2&&!W&&(Y.splice(Y.length-1,1),Y.splice(0,1)),H.tickValues(Y)}}let N;const X=c.getProperty(b,"ticks","formatter");if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval"));X===null?N=(z,W)=>c.formatTick(z,W,H.tickValues(),U,L):N=(z,W)=>{const j=c.formatTick(z,W,H.tickValues(),U,L);return X(z,W,j)}}else X===null?q===r.ScaleTypes.LINEAR&&(N=U=>U.toLocaleString()):N=X;H.tickFormat(N);const[Ee,Oe]=this.services.cartesianScales.getScaleByPosition(t).domain();let ae;if(w){if(E)w.forEach((U,z)=>{U.getTime===void 0&&(w[z]=new Date(U))}),ae=w.filter(U=>{const z=U.getTime();return z>=new Date(Ee).getTime()&&z<=new Date(Oe).getTime()});else if(C===r.ScaleTypes.LABELS){const U=this.services.cartesianScales.getScaleByPosition(t).domain();ae=w.filter(z=>U.includes(z))}else ae=w.filter(U=>U>=Ee&&U<=Oe);H.tickValues(ae)}switch(t){case r.AxisPositions.LEFT:v.attr("transform",`translate(${this.margins.left}, 0)`);break;case r.AxisPositions.BOTTOM:v.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case r.AxisPositions.RIGHT:v.attr("transform",`translate(${i-this.margins.right}, 0)`);break;case r.AxisPositions.TOP:v.attr("transform",`translate(0, ${this.margins.top})`);break}const ze=this.model.isDataEmpty();if(b.title){const U=O.DOMUtils.appendOrSelect(d,"text.axis-title").html(ze||M?"":b.title),z=c.getProperty(b,"titleOrientation");let W;switch(t){case r.AxisPositions.LEFT:z===r.AxisTitleOrientations.RIGHT?U.attr("transform","rotate(90)").attr("y",0).attr("x",m.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):U.attr("transform","rotate(-90)").attr("y",0).attr("x",-(m.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.BOTTOM:U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case r.AxisPositions.RIGHT:z===r.AxisTitleOrientations.LEFT?U.attr("transform","rotate(-90)").attr("y",i).attr("x",-(m.range()[0]/2)).style("text-anchor","middle"):U.attr("transform","rotate(90)").attr("y",-i).attr("x",m.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case r.AxisPositions.TOP:W=O.DOMUtils.getSVGElementSize(U,{useBBox:!0}).height,U.attr("transform",`translate(${this.margins.left/2+m.range()[1]/2}, ${W/2})`).style("text-anchor","middle");break}}if(E){const U=c.computeTimeIntervalName(H.tickValues(),c.getProperty(s,"timeScale","timeInterval")),z=L.showDayName,W=v;e&&(v=v.transition().call(Y=>this.services.transitions.setupTransition({transition:Y,name:"axis-update",animate:e}))),v=v.call(H),W.selectAll(".tick").data(H.tickValues(),m).order().select("text").style("font-weight",(Y,oe)=>c.isTickPrimary(Y,oe,H.tickValues(),U,z)?"bold":"normal")}else!e||!g?v=v.call(H):v=v.transition().call(U=>this.services.transitions.setupTransition({transition:U,name:"axis-update",animate:e})).call(H);if(f.call(H),t===r.AxisPositions.BOTTOM||t===r.AxisPositions.TOP){let U=!1;const z=c.getProperty(b,"ticks","rotation");if(z===r.TickRotations.ALWAYS)U=!0;else if(z===r.TickRotations.NEVER)U=!1;else if(!z||z===r.TickRotations.AUTO)if(m.step)U=f.selectAll("g.tick text").nodes().some(j=>O.DOMUtils.getSVGElementSize(j,{useBBox:!0}).width>=m.step());else{U=!1;const W=f.append("text").text("A"),j=O.DOMUtils.getSVGElementSize(W.node(),{useBBox:!0}).width;let Y;f.selectAll("g.tick").each(function(){const oe=y.select(this),D=parseFloat(c.getProperty(c.getTranslationValues(this),"tx"));D!==null&&Y+oe.text().length*j*.8>=D&&(U=!0),Y=D}),W.remove()}U?(A||(H.ticks(this.getNumberOfFittingTicks(i,F,c.axis.ticks.horizontalSpaceRatio)),f.call(H),v.call(H)),d.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",t===r.AxisPositions.TOP?"start":"end")):d.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(M?d.attr("opacity",0):d.attr("opacity",1),v.selectAll("g.tick").attr("aria-label",U=>U),f.selectAll("g.tick").attr("aria-label",U=>U),P!==r.TruncationTypes.NONE&&C===r.ScaleTypes.LABELS&&!w){const U=this.services.cartesianScales.getScaleDomain(t);if(U.length>0){const z=a.select(`g.axis.${t} g.ticks g.tick`).html();d.selectAll("g.ticks g.tick").html(z);const W=this;d.selectAll("g.tick text").data(U).text(function(j){return j.length>$?(W.truncation[t]=!0,c.truncateLabel(j,P,_)):j}),this.getInvisibleAxisRef().selectAll("g.tick text").data(U).text(function(j){return j.length>$?c.truncateLabel(j,P,_):j}),d.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),d.selectAll("g.tick text").data(U)}}this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),o=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick text").on("mouseover",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>o&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,hoveredElement:y.select(this),content:u})}).on("mousemove",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&u.length>o&&d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this),datum:u}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} g.ticks.invisible`)}getTitleRef(){const{position:e}=this.configs;return this.getComponentContainer().select(`g.axis.${e} text.axis-title`)}getNumberOfFittingTicks(e,t,s){const n=Math.floor(e/(t*s));return Mt(n,2,c.axis.ticks.number)}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class It extends $e{constructor(e,t,s){super(e,t,s)}render(e=!0){super.render(e),super.destroy();const t=this.configs.position,s=this.getComponentContainer(),n=O.DOMUtils.appendOrSelect(s,`g.axis.${t}`),a=this;n.selectAll("g.tick").each(function(i,o){const d=y.select(this);d.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const h=d.select("text"),{width:u,height:m}=O.DOMUtils.getSVGElementSize(h,{useBBox:!0}),p=O.DOMUtils.appendOrSelect(d,"rect.axis-holder");let g=0,v=0;switch(t){case r.AxisPositions.LEFT:g=-u+Number(h.attr("x")),v=-(m/2);break;case r.AxisPositions.RIGHT:g=Math.abs(Number(h.attr("x"))),v=-(m/2);break;case r.AxisPositions.TOP:g=-(u/2),v=-m+Number(h.attr("y"))/2,a.truncation[t]&&(g=0,p.attr("transform","rotate(-45)"));break;case r.AxisPositions.BOTTOM:g=-(u/2),v=m/2-2,a.truncation[t]&&(g=-u,p.attr("transform","rotate(-45)"));break}p.attr("x",g-c.axis.hover.rectanglePadding).attr("y",v).attr("width",u+c.axis.hover.rectanglePadding*2).attr("height",m).lower()}),this.addEventListeners()}addEventListeners(){const e=this.getComponentContainer(),{position:t}=this.configs,s=O.DOMUtils.appendOrSelect(e,`g.axis.${t}`),n=this.getOptions(),a=c.getProperty(n,"axes",t),i=c.getProperty(a,"scaleType"),o=c.getProperty(a,"truncation","threshold"),d=this;s.selectAll("g.tick.tick-hover").on("mouseover",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOVER,{event:h,element:u,datum:m}),i===r.ScaleTypes.LABELS&&m.length>o&&d.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,element:u,datum:m})}).on("mousemove",function(h){const u=y.select(this).select("text"),m=u.datum();d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEMOVE,{event:h,element:u,datum:m}),d.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_CLICK,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()})}).on("mouseout",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_MOUSEOUT,{event:h,element:y.select(this).select("text"),datum:y.select(this).select("text").datum()}),i===r.ScaleTypes.LABELS&&d.services.events.dispatchEvent(r.Events.Tooltip.HIDE)}).on("focus",function(h){const u={clientX:0,clientY:0};if(h.target){h.target.focus();const m=h.target.getBoundingClientRect();u.clientX=m.x,u.clientY=m.y}d.services.events.dispatchEvent(r.Events.Axis.LABEL_FOCUS,{event:{...h,...u},element:y.select(this),datum:y.select(this).select("text").datum()})}).on("blur",function(h){d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})}).on("keydown",function(h){h.key&&h.key==="Escape"&&(d.services.events.dispatchEvent(r.Events.Tooltip.HIDE),d.services.events.dispatchEvent(r.Events.Axis.LABEL_BLUR,{event:h,element:y.select(this),datum:y.select(this).select("text").datum()})),t===r.AxisPositions.LEFT||t===r.AxisPositions.RIGHT?h.key&&h.key==="ArrowUp"?d.goNext(this,h):h.key&&h.key==="ArrowDown"&&d.goPrevious(this,h):h.key&&h.key==="ArrowLeft"?d.goPrevious(this,h):h.key&&h.key==="ArrowRight"&&d.goNext(this,h)})}goNext(e,t){e.nextElementSibling&&e.nextElementSibling.tagName!=="path"&&e.nextElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}goPrevious(e,t){e.previousElementSibling&&e.previousElementSibling.tagName!=="path"&&e.previousElementSibling.dispatchEvent(new Event("focus")),t.preventDefault()}destroy(){const e=this.getComponentContainer(),{position:t}=this.configs;O.DOMUtils.appendOrSelect(e,`g.axis.${t}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class ca extends G{constructor(){super(...arguments),this.type="2D-axes",this.renderType=r.RenderTypes.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(e=!1){const t={},s=Object.keys(r.AxisPositions),n=c.getProperty(this.getOptions(),"axes");s.forEach(o=>{n[r.AxisPositions[o]]&&(t[r.AxisPositions[o]]=!0)}),this.configs.axes=t,s.forEach(o=>{const d=r.AxisPositions[o];if(this.configs.axes[d]&&!this.children[d]){const h={position:d,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===r.AxisFlavor.DEFAULT?new $e(this.model,this.services,h):new It(this.model,this.services,h);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[d]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(e)});const a={};Object.keys(this.children).forEach(o=>{const d=this.children[o],h=d.configs.position,u=d.getInvisibleAxisRef(),{width:m,height:p}=O.DOMUtils.getSVGElementSize(u,{useBBox:!0});let g;switch(d.getTitleRef().empty()?g=0:(g=O.DOMUtils.getSVGElementSize(d.getTitleRef(),{useBBox:!0}).height,(h===r.AxisPositions.LEFT||h===r.AxisPositions.RIGHT)&&(g+=5)),h){case r.AxisPositions.TOP:a.top=p+g;break;case r.AxisPositions.BOTTOM:a.bottom=p+g;break;case r.AxisPositions.LEFT:a.left=m+g;break;case r.AxisPositions.RIGHT:a.right=m+g;break}}),this.services.events.dispatchEvent(r.Events.Axis.RENDER_COMPLETE),Object.keys(a).some(o=>this.margins[o]!==a[o])&&(this.margins=Object.assign(this.margins,a),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(r.Events.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const d=this.children[o];d.margins=this.margins}),this.render(!0))}}class _t extends G{constructor(){super(...arguments),this.type="skeleton"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading");t?this.renderSkeleton(t):this.removeSkeleton()}renderSkeleton(e){if(this.configs.skeleton===r.Skeletons.GRID)this.renderGridSkeleton(e);else if(this.configs.skeleton===r.Skeletons.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(e);else if(this.configs.skeleton===r.Skeletons.PIE)this.renderPieSkeleton(e);else if(this.configs.skeleton===r.Skeletons.DONUT)this.renderDonutSkeleton(e);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawXGrid(e),this.drawYGrid(e),e&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(e){const t=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(e),t===r.CartesianOrientations.VERTICAL&&this.drawYGrid(e),t===r.CartesianOrientations.HORIZONTAL&&this.drawXGrid(e),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(e){const t=this.computeOuterRadius(),s=0;this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(e){const t=this.computeOuterRadius(),s=this.computeInnerRadius();this.drawRing(t,s,e),e&&this.setShimmerEffect("shimmer-areas")}setScales(){const e=this.services.cartesianScales.getMainXScale().range(),t=this.services.cartesianScales.getMainYScale().range();this.xScale=y.scaleLinear().domain([0,1]).range(e),this.yScale=y.scaleLinear().domain([0,1]).range(t)}drawBackdrop(e){const t=this.parent,{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0});this.backdrop=O.DOMUtils.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("width",s).attr("height",n);const a=O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");a.attr("width","100%").attr("height","100%");const[i]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(a).attr("x",i).attr("y",o),a.classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(e){const t=+this.backdrop.attr("width"),s=c.getProperty(this.getOptions(),"grid","x","numberOfTicks"),n=this.xScale.ticks(s).map(o=>o*t),a=O.DOMUtils.appendOrSelect(this.backdrop,"g.x.skeleton"),i=a.selectAll("line").data(n);i.enter().append("line").merge(i).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),a.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(e){const t=+this.backdrop.attr("height"),s=this.backdrop.attr("width"),n=c.getProperty(this.getOptions(),"grid","y","numberOfTicks"),a=this.xScale.ticks(n).map(d=>d*t),i=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),o=i.selectAll("line").data(a);o.enter().append("line").merge(o).attr("x1",0).attr("x2",s).attr("y1",d=>d).attr("y2",d=>d),i.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(e,t,s=!0){const n=this.parent,{width:a,height:i}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),o=O.DOMUtils.appendOrSelect(n,"svg.chart-skeleton").attr("width",a).attr("height",i),d=t===0?"pie":"donut",h=c.getProperty(this.getOptions(),d,"alignment");O.DOMUtils.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",a).attr("height",i).attr("fill","none");const u=y.arc().innerRadius(t).outerRadius(e).startAngle(0).endAngle(Math.PI*2),m=e+Math.abs(c.pie.radiusOffset),p=e+(Math.min(a,i)-e*2)/2,g=O.DOMUtils.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${m}, ${p})`).attr("d",u).classed("shimmer-effect-areas",s).classed("empty-state-areas",!s).style("fill",s?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let v=e+c.pie.xOffset;h===r.Alignments.CENTER?v=a/2:h===r.Alignments.RIGHT&&(v=a-e-c.pie.xOffset);const f=e+c.pie.yOffset;g.attr("transform",`translate(${v}, ${f})`)}computeOuterRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(e,t)/2+c.pie.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(e){const a="stop-bg-shimmer",i="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:d}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),h=0,u=d,m=O.DOMUtils.appendOrSelect(o,"defs").lower(),p=O.DOMUtils.appendOrSelect(m,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(e)).attr("class",e).attr("x1",h-3*.2*d).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),g=`
|
|
74
74
|
<stop class="${a}" offset="${h}"></stop>
|
|
75
75
|
<stop class="${i}" offset="${h+.2}"></stop>
|
|
76
76
|
<stop class="${a}" offset="${h+2*.2}"></stop>
|
|
77
|
-
`;p.html(g),v();function v(){p.attr("gradientTransform",`translate(${h-3*.2*d}, 0)`).transition().duration(2e3).delay(1e3).ease(y.easeLinear).attr("gradientTransform",`translate(${u+3*.2*d}, 0)`).on("end",v)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class da extends G{constructor(){super(...arguments),this.type="boxplot",this.renderType=r.RenderTypes.SVG}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getDataGroupNames(),i=this.services.cartesianScales.getMainXScale(),l=this.services.cartesianScales.getMainYScale(),[d,h]=i.range(),[u,m]=l.range(),p=h-d,g=u-m;if(p===0)return;const{cartesianScales:v}=this.services,f=v.getOrientation(),b=f===r.CartesianOrientations.VERTICAL,[E,S]=c.flipDomainAndRangeBasedOnOrientation(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),f),T=Math.floor((b?p:g)/a.length),M=Math.min(T/2,16),C=this.model.getBoxplotData(),x=t.selectAll(".box-group").data(C);x.exit().remove();const w=x.enter().append("g").attr("class","box-group"),I=x.merge(w);w.append("path").merge(x.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.quartiles.q_25);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.quartiles.q_75);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"box"})).attr("fill-opacity",c.boxplot.box.opacity.default).attr("stroke-width",c.boxplot.strokeWidth.default).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[n]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(Math[b?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),F=R+Math.abs(v.getRangeValue(A.quartiles.q_75)-v.getRangeValue(A.quartiles.q_25));return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker start"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.min);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/2,V=L+M,R=v.getRangeValue(A.quartiles.q_50),F=R;return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)}),w.append("path").merge(x.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker end"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-M/4,V=L+M/2,R=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:R,y1:F},f)});const $=I.selectAll("circle.outlier").data(A=>A.outliers.map(L=>({min:A.whiskers.min,max:A.whiskers.max,[n]:A[n],value:L})));$.exit().remove();const _=$.enter().append("circle");$.merge(_).attr("r",c.boxplot.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"outlier"})).attr("fill-opacity",c.boxplot.circle.opacity.default).attr("cx",E).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:e})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",c.boxplot.box.opacity.hovered),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:t.tooltip.groupLabel,value:a[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOVER,{event:n,element:i,datum:a})}).on("mousemove",function(n,a){const i=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEMOVE,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){e.services.events.dispatchEvent(r.Events.Boxplot.BOX_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",c.boxplot.box.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOUT,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}addCircleEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0).attr("fill-opacity",c.boxplot.circle.opacity.hovered).classed("unfilled",!1),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel,value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Outlier",value:i[n]}]}),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:l,datum:i})}).on("mousemove",function(a,i){const l=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1).attr("fill-opacity",c.boxplot.circle.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class ha extends G{constructor(){super(...arguments),this.type="zero-line",this.renderType=r.RenderTypes.SVG}render(e){const t=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),s=this.services.cartesianScales.getScaleByPosition(t),[n,a]=s.domain(),i=n>0&&a<0||n<0&&a>0,l=this.getComponentContainer();if(!i){l.selectAll("line.domain").remove();return}const[d,h]=this.services.cartesianScales.getDomainScale().range();let u=+s(0)+.5;u||(u=s.range()[0]);const m=c.flipSVGCoordinatesBasedOnOrientation({x0:d,x1:h,y0:u,y1:u},this.services.cartesianScales.getOrientation());O.DOMUtils.appendOrSelect(l,"line.domain").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"zero-line-update",animate:e})).attr("y1",m.y0).attr("y2",m.y1).attr("x1",m.x0).attr("x2",m.x1)}}class ua extends me{constructor(){super(...arguments),this.type="bubble",this.renderType=r.RenderTypes.SVG}getRadiusScale(e){const t=this.getOptions(),{radiusMapsTo:s}=t.bubble,n=e.data(),a=n.map(h=>h[s]).filter(h=>h),i=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),l=a.length>0,d=l?y.extent(a):[1,1];return y.scaleLinear().domain(d).range(l?t.bubble.radiusRange(i,n):[4,4])}styleCircles(e,t){const s=this.getOptions(),{radiusMapsTo:n}=s.bubble,a=this.getRadiusScale(e),{groupMapsTo:i}=s.data,{cartesianScales:l}=this.services,d=p=>l.getDomainValue(p),h=p=>l.getRangeValue(p),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,l.getOrientation());e.raise().classed("dot",!0).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",p=>{const g=l.getRangeIdentifier(p);return p[g]}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bubble-update-enter",animate:t})).attr("cx",u).attr("cy",m).attr("r",p=>a(p[n]||1)).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:p[i],originalClassName:"dot"})).style("fill",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getFillColor(p[i],p[g],p)}).style("stroke",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getStrokeColor(p[i],p[g],p)}).attr("fill-opacity",s.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(e){const t=c.getProperty(this.getOptions(),"bubble");return[{label:c.getProperty(t,"radiusLabel"),value:e[c.getProperty(t,"radiusMapsTo")]}]}}class pa extends G{constructor(){super(...arguments),this.type="bullet",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getRangeScale(),l=this.services.cartesianScales.getRangeIdentifier(),[d,h]=i.range(),[,u]=i.domain(),m=()=>{const f=[];a.forEach(S=>{S.ranges?S.ranges.forEach((T,M)=>{T!=null&&T<u&&f.push({datum:S,value:T,order:M+1})}):f.push({datum:S,order:1})});const b=O.DOMUtils.appendOrSelect(n,"g.range-boxes").selectAll("path.range-box").data(f,S=>`${S[s]}-${S.order}`);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:e})).attr("d",S=>{let M,C,x,w;return S.order===1?(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,x=h-2,w=d+1):(M=this.services.cartesianScales.getDomainValue(S.datum)-16/2,C=M+16,x=this.services.cartesianScales.getRangeValue(S.value),w=h),c.generateSVGPathString({x0:M,x1:C,y0:x,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.bars").selectAll("path.bar").data(a,E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("bar",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-bar-update-enter",animate:e})).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:E[s],originalClassName:"bar"})).style("fill",E=>this.model.getFillColor(E[s])).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-4,M=T+8,C=this.services.cartesianScales.getRangeValue(0)+1,x=this.services.cartesianScales.getRangeValue(E);return c.generateSVGPathString({x0:T,x1:M,y0:C,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",E=>E.value)},g=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.markers").selectAll("path.marker").data(a.filter(E=>c.getProperty(E,"marker")!==null),E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("marker",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-marker-update-enter",animate:e})).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-12,M=T+24,C=this.services.cartesianScales.getRangeValue(E.marker),x=C;return c.generateSVGPathString({x0:T,x1:M,y0:C,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},v=()=>{let f=[];a.filter(S=>c.getProperty(S,"marker")!==null).forEach(S=>{const T=S.marker,M=S[l];f=f.concat([{datum:S,value:T*.25,barValue:M},{datum:S,value:T*.5,barValue:M},{datum:S,value:T*.75,barValue:M}])});const b=O.DOMUtils.appendOrSelect(n,"g.quartiles").selectAll("path.quartile").data(f,S=>S[s]);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:e})).attr("d",({datum:S,value:T})=>{let M=4;S.ranges&&S.ranges.indexOf(T)!==-1&&(M=8);const C=this.services.cartesianScales.getDomainValue(S)-M/2,x=C+M,w=this.services.cartesianScales.getRangeValue(T),I=w;return c.generateSVGPathString({x0:C,x1:x,y0:w,y1:I},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};m(),p(),g(),v(),this.addEventListeners()}addEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(a,i){const l=y.select(this);l.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:a,element:l,datum:i});const d=c.getProperty(t,"bullet","performanceAreaTitles"),h=e.model.getMatchingRangeIndexForDatapoint(i);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:t.tooltip.groupLabel||"Group",value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[s]})},{label:"Value",value:i[n]},{label:"Target",value:i.marker},{label:"Percentage",value:`${Math.floor(i[n]/i.marker*100)}%`},{label:"Performance",value:d[h]}]})}).on("mousemove",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:a,element:y.select(this),datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);l.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:a,element:l,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function ga(o){return o}function ma(o){if(o==null)return ga;var e,t,s=o.scale[0],n=o.scale[1],a=o.translate[0],i=o.translate[1];return function(l,d){d||(e=t=0);var h=2,u=l.length,m=new Array(u);for(m[0]=(e+=l[0])*s+a,m[1]=(t+=l[1])*n+i;h<u;)m[h]=l[h],++h;return m}}function va(o,e){for(var t,s=o.length,n=s-e;n<--s;)t=o[n],o[n++]=o[s],o[s]=t}function fa(o,e){return typeof e=="string"&&(e=o.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return et(o,t)})}:et(o,e)}function et(o,e){var t=e.id,s=e.bbox,n=e.properties==null?{}:e.properties,a=Ve(o,e);return t==null&&s==null?{type:"Feature",properties:n,geometry:a}:s==null?{type:"Feature",id:t,properties:n,geometry:a}:{type:"Feature",id:t,bbox:s,properties:n,geometry:a}}function Ve(o,e){var t=ma(o.transform),s=o.arcs;function n(u,m){m.length&&m.pop();for(var p=s[u<0?~u:u],g=0,v=p.length;g<v;++g)m.push(t(p[g],g));u<0&&va(m,v)}function a(u){return t(u)}function i(u){for(var m=[],p=0,g=u.length;p<g;++p)n(u[p],m);return m.length<2&&m.push(m[0]),m}function l(u){for(var m=i(u);m.length<4;)m.push(m[0]);return m}function d(u){return u.map(l)}function h(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(h)};case"Point":p=a(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(a);break;case"LineString":p=i(u.arcs);break;case"MultiLineString":p=u.arcs.map(i);break;case"Polygon":p=d(u.arcs);break;case"MultiPolygon":p=u.arcs.map(d);break;default:return null}return{type:m,coordinates:p}}return h(e)}function ya(o,e){var t={},s={},n={},a=[],i=-1;e.forEach(function(h,u){var m=o.arcs[h<0?~h:h],p;m.length<3&&!m[1][0]&&!m[1][1]&&(p=e[++i],e[i]=h,e[u]=p)}),e.forEach(function(h){var u=l(h),m=u[0],p=u[1],g,v;if(g=n[m])if(delete n[g.end],g.push(h),g.end=p,v=s[p]){delete s[v.start];var f=v===g?g:g.concat(v);s[f.start=g.start]=n[f.end=v.end]=f}else s[g.start]=n[g.end]=g;else if(g=s[p])if(delete s[g.start],g.unshift(h),g.start=m,v=n[m]){delete n[v.end];var b=v===g?g:v.concat(g);s[b.start=v.start]=n[b.end=g.end]=b}else s[g.start]=n[g.end]=g;else g=[h],s[g.start=m]=n[g.end=p]=g});function l(h){var u=o.arcs[h<0?~h:h],m=u[0],p;return o.transform?(p=[0,0],u.forEach(function(g){p[0]+=g[0],p[1]+=g[1]})):p=u[u.length-1],h<0?[p,m]:[m,p]}function d(h,u){for(var m in h){var p=h[m];delete u[p.start],delete p.start,delete p.end,p.forEach(function(g){t[g<0?~g:g]=1}),a.push(p)}}return d(n,s),d(s,n),e.forEach(function(h){t[h<0?~h:h]||a.push([h])}),a}function Ea(o){for(var e=-1,t=o.length,s,n=o[t-1],a=0;++e<t;)s=n,n=o[e],a+=s[0]*n[1]-s[1]*n[0];return Math.abs(a)}function Oa(o){return Ve(o,ba.apply(this,arguments))}function ba(o,e){var t={},s=[],n=[];e.forEach(a);function a(d){switch(d.type){case"GeometryCollection":d.geometries.forEach(a);break;case"Polygon":i(d.arcs);break;case"MultiPolygon":d.arcs.forEach(i);break}}function i(d){d.forEach(function(h){h.forEach(function(u){(t[u=u<0?~u:u]||(t[u]=[])).push(d)})}),s.push(d)}function l(d){return Ea(Ve(o,{type:"Polygon",arcs:[d]}).coordinates[0])}return s.forEach(function(d){if(!d._){var h=[],u=[d];for(d._=1,n.push(h);d=u.pop();)h.push(d),d.forEach(function(m){m.forEach(function(p){t[p<0?~p:p].forEach(function(g){g._||(g._=1,u.push(g))})})})}}),s.forEach(function(d){delete d._}),{type:"MultiPolygon",arcs:n.map(function(d){var h=[],u;if(d.forEach(function(f){f.forEach(function(b){b.forEach(function(E){t[E<0?~E:E].length<2&&h.push(E)})})}),h=ya(o,h),(u=h.length)>1)for(var m=1,p=l(h[0]),g,v;m<u;++m)(g=l(h[m]))>p&&(v=h[0],h[0]=h[m],h[m]=v,p=g);return h}).filter(function(d){return d.length>0})}}class Sa extends _e{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=r.RenderTypes.SVG}showRuler(e,[t,s]){const n=this.parent,a=this.model.getOptions(),{cartesianScales:i}=this.services,l=i.getOrientation(),d=i.getRangeScale(),[h,u]=d.range(),m=i.getDomainScale(),p=m.invert(l===r.CartesianOrientations.VERTICAL?t:s),g=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),v=O.DOMUtils.appendOrSelect(g,"line.ruler-line"),b=n.selectAll("[role=graphics-symbol]").filter(E=>{if(parseFloat(c.get(E,"data.x0"))<=p&&parseFloat(c.get(E,"data.x1"))>=p)return!0});if(b.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!bt(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b;const E=y.select(b.nodes()[0]).datum(),S=parseFloat(c.get(E,"data.x0")),T=parseFloat(c.get(E,"data.x1")),M=this.model.getActiveDataGroupNames(),C=M.reverse().map(w=>({label:w,value:c.get(E,`data.${w}`),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:w})})).filter(w=>w.value!==0);if(C.length>0){this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:v,items:[{label:c.get(a,"bins.rangeLabel")||"Range",value:`${S} – ${T}`},...C,...c.getProperty(a,"tooltip","showTotal")===!0?[{label:c.get(a,"tooltip.totalLabel")||"Total",value:M.reduce((I,$)=>I+parseFloat(c.get(E,`data.${$}`)),0)}]:[]]}),g.attr("opacity",1);const w=m((S+T)/2);l==="horizontal"?v.attr("x1",u).attr("x2",h).attr("y1",w).attr("y2",w):v.attr("y1",u).attr("y2",h).attr("x1",w).attr("x2",w)}else this.hideRuler()}else this.hideRuler()}}class xa extends _e{formatTooltipData(e){return e.reverse()}}const Ta=(o,e)=>{const t=o.x,s=o.y,n=e.x,a=e.y,i=y.path();return i.moveTo(t,s),i.lineTo(n,a),i.toString()},Ma=(o,e,t=.5)=>{const s=o.x,n=o.y,a=e.x,i=e.y,l=y.path();return l.moveTo(s,n),l.lineTo(s+(a-s)*t,n),l.lineTo(s+(a-s)*t,i),l.lineTo(a,i),l.toString()},Ca=(o,e,t,s,n,a)=>{const i=o.x,l=o.y,d=e.x,h=e.y,u=y.path();return u.moveTo(i,l),u.bezierCurveTo(t,s,n,a,d,h),u.toString()},La={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},Aa={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},Da={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},wa={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},Pa={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},Ra={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class ka extends wt{constructor(e,t,s){super(e,t,s),this.type="color-legend",this.renderType=r.RenderTypes.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const n=this.getComponentContainer(),{width:a}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),i=c.getProperty(this.getOptions(),"data","loading");if(a>c.legend.color.barWidth&&!i){const l=c.getProperty(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:d}=this.services,u=d.getMainXScale().range();if(u[0]>1&&(n.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),l)){const{width:m}=O.DOMUtils.getSVGElementSize(n.select("g.legend-title").select("text"),{useBBox:!0}),p=u[0]-m-9;p>1?n.select("g.legend-title").attr("transform",`translate(${p}, 0)`):(n.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),n.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else n.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=s.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(e=!1){const t=this.getOptions(),s=this.getComponentContainer(),{width:n}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),a=c.getProperty(t,"color","gradient","colors"),i=c.getProperty(t,this.chartType,"colorLegend","type");let l=c.getProperty(t,"color","pairing","option");const d=c.getProperty(t,"heatmap","colorLegend","title");if(c.getProperty(this.getOptions(),"data","loading")){s.html("");return}const u=!c.isEmpty(a),m=c.getDomain(this.model.getDisplayData()),p=!(n<=c.legend.color.barWidth),g=p?c.legend.color.barWidth:n,v=O.DOMUtils.appendOrSelect(s,"g.legend"),f=O.DOMUtils.appendOrSelect(v,"g.legend-axis");if(d){const I=O.DOMUtils.appendOrSelect(s,"g.legend-title");O.DOMUtils.appendOrSelect(I,"text").text(d).attr("dy","0.7em"),v.attr("transform","translate(0, 16)")}const b=m[0]<0&&m[1]>0?"diverge":"mono";(l<1&&l>4&&b==="mono"||l<1&&l>2&&b==="diverge")&&(l=1);let E=[];const S=b==="diverge"?17:11;if(u)E=a;else for(let I=1;I<S+1;I++)E.push(i===r.ColorLegendType.LINEAR?`stop-color-${b}-${l}-${I}`:`fill-${b}-${l}-${I}`);const T=y.interpolateNumber(m[0],m[1]),M=y.quantize(T,3),C=y.scaleLinear().domain(m).range([0,g]),x=y.axisBottom(C).tickSize(0).tickValues(M);let w;switch(i){case r.ColorLegendType.LINEAR:this.drawLinear(E,v,g);break;case r.ColorLegendType.QUANTIZE:w=this.drawQuantize(E,b,u,v,g),C.range([w,g]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${c.legend.color.axisYTranslation})`).call(x),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",p?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",p&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(e,t,s){const n=100/(e.length-1);O.DOMUtils.appendOrSelect(t,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(e).enter().append("stop").attr("offset",(l,d)=>`${d*n}%`).attr("class",(l,d)=>e[d]).attr("stop-color",l=>l),O.DOMUtils.appendOrSelect(t,"rect").attr("width",s).attr("height",c.legend.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(e,t,s,n,a){!s&&t==="diverge"&&e.splice(e.length/2,1);const i=y.scaleBand().domain(e).range([0,a]);return O.DOMUtils.appendOrSelect(n,"g.quantized-rect").selectAll("rect").data(i.domain()).join("rect").attr("x",d=>i(d)).attr("y",0).attr("width",Math.max(0,i.bandwidth()-1)).attr("height",c.legend.color.barHeight).attr("class",d=>d).attr("fill",d=>d),(!s&&t)==="mono"?i.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class Ia extends Dt{constructor(){super(...arguments),this.type="meter-title",this.renderType=r.RenderTypes.SVG}render(e=!1){const t=c.getProperty(this.model.getDisplayData(),0),s=this.getOptions(),n=this.getComponentContainer(),{groupMapsTo:a}=s.data;if(c.getProperty(s,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const h=n.selectAll("text.meter-title").data([t[a]]);h.enter().append("text").classed("meter-title",!0).merge(h).attr("x",0).attr("y","1em").text(u=>u),h.exit().remove(),this.appendPercentage()}this.displayStatus();const l=this.getMaxTitleWidth(),d=O.DOMUtils.appendOrSelect(n,"text.meter-title");l>0&&d.node().getComputedTextLength()>l&&this.truncateTitle(d,l)}displayBreakdownTitle(){const e=this.getComponentContainer(),t=this.getOptions(),s=this.model.getMaximumDomain(this.model.getDisplayData()),n=c.getProperty(t,"meter","proportional","total"),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"";let i;if(s===n)i=null;else{const u=n!==null?n-s:s,m=c.getProperty(t,"meter","proportional","breakdownFormatter");i=m!==null?m({datasetsTotal:s,total:n}):`${s} ${a} used (${u} ${a} available)`}const l=e.selectAll("text.proportional-meter-title").data([i]);l.enter().append("text").classed("proportional-meter-title",!0).merge(l).attr("x",0).attr("y","1em").text(u=>u),l.exit().remove();const d=this.getMaxTitleWidth(),h=O.DOMUtils.appendOrSelect(e,"text.proportional-meter-title");d>0&&h.node().getComputedTextLength()>d&&this.truncateTitle(h,d)}displayTotal(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"meter","proportional","total"),n=s?c.getProperty(t,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"",i=c.getProperty(t,"meter","proportional","totalFormatter"),l=i!==null?i(n):`${s} ${a} total`,d=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),h=d.width?d.width:this.parent.node().getAttribute("width"),u=e.selectAll("text.proportional-meter-total").data([l]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof h!="string"?h-c.meter.total.paddingRight:h).attr("y","1em").attr("text-anchor","end").text(m=>m),u.exit().remove()}displayStatus(){const e=this,t=this.getComponentContainer(),s=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=s.width?s.width:0,a=this.model.getStatus(),i=c.meter.status.indicatorSize/2,l=O.DOMUtils.appendOrSelect(t,"g.status-indicator").attr("class",a!==null?`status-indicator status--${a}`:"").attr("transform",`translate(${n-i}, 0)`),d=a?[a]:[],h=l.selectAll("circle.status").data(d);h.enter().append("circle").merge(h).attr("class","status").attr("r",i).attr("cx",0).attr("cy",8);const u=l.selectAll("path.innerFill").data(d);u.enter().append("path").merge(u).attr("d",e.getStatusIconPathString(a)).attr("transform",`translate(-${i}, 0)`).attr("class","innerFill"),u.exit().remove(),h.exit().remove()}appendPercentage(){const e=c.getProperty(this.model.getDisplayData(),0,"value"),t=this.getComponentContainer(),s=O.DOMUtils.appendOrSelect(t,"text.meter-title"),n=c.getProperty(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[e]:[],a=t.selectAll("text.percent-value").data(n),i=c.meter.statusBar.paddingRight;a.enter().append("text").classed("percent-value",!0).merge(a).text(l=>`${l}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+i).attr("y",s.attr("y")),a.exit().remove()}truncateTitle(e,t){super.truncateTitle(e,t);const s=O.DOMUtils.appendOrSelect(this.parent,"tspan"),n=c.meter.statusBar.paddingRight,a=Math.ceil(s.node().getComputedTextLength());O.DOMUtils.appendOrSelect(this.parent,"text.percent-value").attr("x",+e.attr("x")+e.node().getComputedTextLength()+a+n)}getMaxTitleWidth(){const e=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),t=c.getProperty(this.getOptions(),"meter","proportional"),s=e.width?e.width:this.parent.node().getBoundingClientRect().width;if(t!==null){const n=O.DOMUtils.appendOrSelect(this.parent,"text.proportional-meter-total").node(),a=O.DOMUtils.getSVGElementSize(n,{useBBox:!0}).width;return s-a-c.meter.total.paddingLeft}else{const n=O.DOMUtils.appendOrSelect(this.parent,"text.percent-value"),a=c.meter.statusBar.paddingRight,i=n.node().getComputedTextLength(),l=O.DOMUtils.appendOrSelect(this.parent,"g.status-indicator").node(),d=O.DOMUtils.getSVGElementSize(l,{useBBox:!0}).width+c.meter.status.paddingLeft;return s-i-a-d}}getStatusIconPathString(e){switch(e){case r.Statuses.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case r.Statuses.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case r.Statuses.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class ve extends G{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const t=this.model.getDisplayData().length,s=this.services.cartesianScales.getMainXScale(),n=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!s.step){const a=c.getProperty(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,n*a/t)}return Math.min(e.bars.maxWidth,s.step()/2)}isOutsideZoomedDomain(e,t){if(this.model.getDisplayData().length<=1)return!1;const n=this.model.get("zoomDomain");if(n!==void 0){const a=this.services.cartesianScales.getDomainScale();return e<a(n[0])||t>a(n[1])}return!1}}class _a extends G{constructor(){super(...arguments),this.type="circle-pack",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-circlepack"})).attr("opacity",s=>s.data.dataGroupName===t.datum().name?1:c.circlePack.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;let a=this.model.getDisplayData();const i=this.model.hasParentNode(),l=this.model.getHierarchyLevel(),d=this.getOptions(),h=c.getProperty(d,"canvasZoom","enabled");i&&c.getProperty(a,0,"children")&&(a=c.getProperty(a,0,"children"));const u=y.hierarchy({children:a}).sum(f=>f.value).sort((f,b)=>b.value-f.value),p=y.pack().size([s,n]).padding(f=>f.depth>=1?c.circlePack.padding.children+3:c.circlePack.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=l),g=t.selectAll("circle.node").data(p);g.exit().attr("width",0).attr("height",0).remove();const v=g.enter().append("circle").classed("node",!0);v.merge(g).attr("class",f=>{const b=h&&l===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${b}`:`node node-leaf ${b}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",c.circlePack.circles.fillOpacity),h===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,v,c.canvasZoomSettings),this.setBackgroundListeners()),i||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",s=>this.model.getFillColor(s.data.dataGroupName))}highlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",c.circlePack.circles.hover.stroke)}getZoomClass(e){return this.model.getHierarchyLevel()===3&&this.focal&&(e.data===this.focal.data||this.focal.children.some(t=>t.data===e.data))?"focal":"non-focal"}addLegendListeners(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){y.select(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const e=y.select(this.services.domUtils.getMainContainer()),t=this,s=this.parent.selectAll("circle.node");e.on("click",()=>{t.focal=null,t.model.updateHierarchyLevel(2),e.classed("zoomed-in",!1),t.services.canvasZoom.zoomOut(s,c.canvasZoomSettings)})}getZoomIcon(){return`
|
|
77
|
+
`;p.html(g),v();function v(){p.attr("gradientTransform",`translate(${h-3*.2*d}, 0)`).transition().duration(2e3).delay(1e3).ease(y.easeLinear).attr("gradientTransform",`translate(${u+3*.2*d}, 0)`).on("end",v)}}removeSkeleton(){this.parent.select(".chart-skeleton").remove()}}class da extends G{constructor(){super(...arguments),this.type="boxplot",this.renderType=r.RenderTypes.SVG}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getDataGroupNames(),i=this.services.cartesianScales.getMainXScale(),o=this.services.cartesianScales.getMainYScale(),[d,h]=i.range(),[u,m]=o.range(),p=h-d,g=u-m;if(p===0)return;const{cartesianScales:v}=this.services,f=v.getOrientation(),b=f===r.CartesianOrientations.VERTICAL,[E,S]=c.flipDomainAndRangeBasedOnOrientation(A=>this.services.cartesianScales.getDomainValue(A),A=>this.services.cartesianScales.getRangeValue(A),f),T=Math.floor((b?p:g)/a.length),C=Math.min(T/2,16),M=this.model.getBoxplotData(),x=t.selectAll(".box-group").data(M);x.exit().remove();const w=x.enter().append("g").attr("class","box-group"),P=x.merge(w);w.append("path").merge(x.select("path.vertical-line.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line start"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalstartline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,k=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.quartiles.q_25);return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.vertical-line.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"vertical-line end"})).attr("stroke-width",c.boxplot.strokeWidth.default).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-verticalendline",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n]),V=L,k=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.quartiles.q_75);return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.box")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"box"})).attr("fill-opacity",c.boxplot.box.opacity.default).attr("stroke-width",c.boxplot.strokeWidth.default).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","box").attr("aria-label",A=>A[n]).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-quartiles",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-C/2,V=L+C,k=v.getRangeValue(Math[b?"max":"min"](A.quartiles.q_75,A.quartiles.q_25)),F=k+Math.abs(v.getRangeValue(A.quartiles.q_75)-v.getRangeValue(A.quartiles.q_25));return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.highlight-area")).attr("class","highlight-area").attr("opacity",0).attr("d",A=>{const L=v.getDomainValue(A[n])-C/2,V=L+C,k=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.whisker.start")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker start"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-startingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-C/4,V=L+C/2,k=v.getRangeValue(A.whiskers.min),F=v.getRangeValue(A.whiskers.min);return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.median")).attr("fill","none").attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"median"})).attr("stroke-width",2).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-median",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-C/2,V=L+C,k=v.getRangeValue(A.quartiles.q_50),F=k;return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)}),w.append("path").merge(x.select("path.whisker.end")).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],originalClassName:"whisker end"})).attr("stroke-width",c.boxplot.strokeWidth.thicker).attr("fill","none").transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-endingwhisker",animate:e})).attr("d",A=>{const L=v.getDomainValue(A[n])-C/4,V=L+C/2,k=v.getRangeValue(A.whiskers.max),F=v.getRangeValue(A.whiskers.max);return c.generateSVGPathString({x0:L,x1:V,y0:k,y1:F},f)});const $=P.selectAll("circle.outlier").data(A=>A.outliers.map(L=>({min:A.whiskers.min,max:A.whiskers.max,[n]:A[n],value:L})));$.exit().remove();const _=$.enter().append("circle");$.merge(_).attr("r",c.boxplot.circle.radius).attr("class",()=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],originalClassName:"outlier"})).attr("fill-opacity",c.boxplot.circle.opacity.default).attr("cx",E).transition().call(A=>this.services.transitions.setupTransition({transition:A,name:"boxplot-update-circles",animate:e})).attr("cy",S),this.addBoxEventListeners(),this.addCircleEventListeners()}addBoxEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data;this.parent.selectAll("path.highlight-area").on("mouseover",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!0).attr("fill-opacity",c.boxplot.box.opacity.hovered),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:t.tooltip.groupLabel,value:a[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Minimum",value:a.whiskers.min},{label:"Q1",value:a.quartiles.q_25},{label:"Median",value:a.quartiles.q_50},{label:"Q3",value:a.quartiles.q_75},{label:"Maximum",value:a.whiskers.max},{label:"IQR",value:a.quartiles.q_75-a.quartiles.q_25}]}),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOVER,{event:n,element:i,datum:a})}).on("mousemove",function(n,a){const i=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEMOVE,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){e.services.events.dispatchEvent(r.Events.Boxplot.BOX_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);y.select(this.parentNode).select("path.box").classed("hovered",!1).attr("fill-opacity",c.boxplot.box.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.BOX_MOUSEOUT,{event:n,element:i,datum:a}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}addCircleEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("circle").on("mouseover",function(a,i){const o=y.select(this);o.classed("hovered",!0).attr("fill-opacity",c.boxplot.circle.opacity.hovered).classed("unfilled",!1),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:t.tooltip.groupLabel,value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP]})},{label:"Outlier",value:i[n]}]}),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOVER,{event:a,element:o,datum:i})}).on("mousemove",function(a,i){const o=y.select(this);e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEMOVE,{event:a,element:o,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);o.classed("hovered",!1).attr("fill-opacity",c.boxplot.circle.opacity.default),e.services.events.dispatchEvent(r.Events.Boxplot.OUTLIER_MOUSEOUT,{event:a,element:o,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o})})}}class ha extends G{constructor(){super(...arguments),this.type="zero-line",this.renderType=r.RenderTypes.SVG}render(e){const t=this.services.cartesianScales.getRangeAxisPosition({groups:this.configs.groups}),s=this.services.cartesianScales.getScaleByPosition(t),[n,a]=s.domain(),i=n>0&&a<0||n<0&&a>0,o=this.getComponentContainer();if(!i){o.selectAll("line.domain").remove();return}const[d,h]=this.services.cartesianScales.getDomainScale().range();let u=+s(0)+.5;u||(u=s.range()[0]);const m=c.flipSVGCoordinatesBasedOnOrientation({x0:d,x1:h,y0:u,y1:u},this.services.cartesianScales.getOrientation());O.DOMUtils.appendOrSelect(o,"line.domain").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"zero-line-update",animate:e})).attr("y1",m.y0).attr("y2",m.y1).attr("x1",m.x0).attr("x2",m.x1)}}class ua extends fe{constructor(){super(...arguments),this.type="bubble",this.renderType=r.RenderTypes.SVG}getRadiusScale(e){const t=this.getOptions(),{radiusMapsTo:s}=t.bubble,n=e.data(),a=n.map(h=>h[s]).filter(h=>h),i=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),o=a.length>0,d=o?y.extent(a):[1,1];return y.scaleLinear().domain(d).range(o?t.bubble.radiusRange(i,n):[4,4])}styleCircles(e,t){const s=this.getOptions(),{radiusMapsTo:n}=s.bubble,a=this.getRadiusScale(e),{groupMapsTo:i}=s.data,{cartesianScales:o}=this.services,d=p=>o.getDomainValue(p),h=p=>o.getRangeValue(p),[u,m]=c.flipDomainAndRangeBasedOnOrientation(d,h,o.getOrientation());e.raise().classed("dot",!0).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-label",p=>{const g=o.getRangeIdentifier(p);return p[g]}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bubble-update-enter",animate:t})).attr("cx",u).attr("cy",m).attr("r",p=>a(p[n]||1)).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:p[i],originalClassName:"dot"})).style("fill",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getFillColor(p[i],p[g],p)}).style("stroke",p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return this.model.getStrokeColor(p[i],p[g],p)}).attr("fill-opacity",s.bubble.fillOpacity).attr("opacity",1)}getTooltipAdditionalItems(e){const t=c.getProperty(this.getOptions(),"bubble");return[{label:c.getProperty(t,"radiusLabel"),value:e[c.getProperty(t,"radiusMapsTo")]}]}}class pa extends G{constructor(){super(...arguments),this.type="bullet",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getRangeScale(),o=this.services.cartesianScales.getRangeIdentifier(),[d,h]=i.range(),[,u]=i.domain(),m=()=>{const f=[];a.forEach(S=>{S.ranges?S.ranges.forEach((T,C)=>{T!=null&&T<u&&f.push({datum:S,value:T,order:C+1})}):f.push({datum:S,order:1})});const b=O.DOMUtils.appendOrSelect(n,"g.range-boxes").selectAll("path.range-box").data(f,S=>`${S[s]}-${S.order}`);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`range-box order-${S.order}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-range-box-update-enter",animate:e})).attr("d",S=>{let C,M,x,w;return S.order===1?(C=this.services.cartesianScales.getDomainValue(S.datum)-16/2,M=C+16,x=h-2,w=d+1):(C=this.services.cartesianScales.getDomainValue(S.datum)-16/2,M=C+16,x=this.services.cartesianScales.getRangeValue(S.value),w=h),c.generateSVGPathString({x0:C,x1:M,y0:x,y1:w},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},p=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.bars").selectAll("path.bar").data(a,E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("bar",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-bar-update-enter",animate:e})).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:E[s],originalClassName:"bar"})).style("fill",E=>this.model.getFillColor(E[s])).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-4,C=T+8,M=this.services.cartesianScales.getRangeValue(0)+1,x=this.services.cartesianScales.getRangeValue(E);return c.generateSVGPathString({x0:T,x1:C,y0:M,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",E=>E.value)},g=()=>{const f=O.DOMUtils.appendOrSelect(n,"g.markers").selectAll("path.marker").data(a.filter(E=>c.getProperty(E,"marker")!==null),E=>E[s]);f.exit().attr("opacity",0).remove(),f.enter().append("path").attr("opacity",0).merge(f).classed("marker",!0).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"bullet-marker-update-enter",animate:e})).attr("d",E=>{const T=this.services.cartesianScales.getDomainValue(E)-12,C=T+24,M=this.services.cartesianScales.getRangeValue(E.marker),x=M;return c.generateSVGPathString({x0:T,x1:C,y0:M,y1:x},this.services.cartesianScales.getOrientation())}).attr("opacity",1)},v=()=>{let f=[];a.filter(S=>c.getProperty(S,"marker")!==null).forEach(S=>{const T=S.marker,C=S[o];f=f.concat([{datum:S,value:T*.25,barValue:C},{datum:S,value:T*.5,barValue:C},{datum:S,value:T*.75,barValue:C}])});const b=O.DOMUtils.appendOrSelect(n,"g.quartiles").selectAll("path.quartile").data(f,S=>S[s]);b.exit().attr("opacity",0).remove(),b.enter().append("path").attr("opacity",0).merge(b).attr("class",S=>`quartile ${S.value<=S.barValue?"over-bar":""}`).transition().call(S=>this.services.transitions.setupTransition({transition:S,name:"bullet-quartile-update-enter",animate:e})).attr("d",({datum:S,value:T})=>{let C=4;S.ranges&&S.ranges.indexOf(T)!==-1&&(C=8);const M=this.services.cartesianScales.getDomainValue(S)-C/2,x=M+C,w=this.services.cartesianScales.getRangeValue(T),P=w;return c.generateSVGPathString({x0:M,x1:x,y0:w,y1:P},this.services.cartesianScales.getOrientation())}).attr("opacity",1)};m(),p(),g(),v(),this.addEventListeners()}addEventListeners(){const e=this,t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.services.cartesianScales.getRangeIdentifier();this.parent.selectAll("path.bar").on("mouseover",function(a,i){const o=y.select(this);o.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:a,element:o,datum:i});const d=c.getProperty(t,"bullet","performanceAreaTitles"),h=e.model.getMatchingRangeIndexForDatapoint(i);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:t.tooltip.groupLabel||"Group",value:i[s],class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[s]})},{label:"Value",value:i[n]},{label:"Target",value:i.marker},{label:"Percentage",value:`${Math.floor(i[n]/i.marker*100)}%`},{label:"Performance",value:d[h]}]})}).on("mousemove",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:a,element:y.select(this),datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);o.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:a,element:o,datum:i}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}function ga(l){return l}function ma(l){if(l==null)return ga;var e,t,s=l.scale[0],n=l.scale[1],a=l.translate[0],i=l.translate[1];return function(o,d){d||(e=t=0);var h=2,u=o.length,m=new Array(u);for(m[0]=(e+=o[0])*s+a,m[1]=(t+=o[1])*n+i;h<u;)m[h]=o[h],++h;return m}}function va(l,e){for(var t,s=l.length,n=s-e;n<--s;)t=l[n],l[n++]=l[s],l[s]=t}function fa(l,e){return typeof e=="string"&&(e=l.objects[e]),e.type==="GeometryCollection"?{type:"FeatureCollection",features:e.geometries.map(function(t){return it(l,t)})}:it(l,e)}function it(l,e){var t=e.id,s=e.bbox,n=e.properties==null?{}:e.properties,a=He(l,e);return t==null&&s==null?{type:"Feature",properties:n,geometry:a}:s==null?{type:"Feature",id:t,properties:n,geometry:a}:{type:"Feature",id:t,bbox:s,properties:n,geometry:a}}function He(l,e){var t=ma(l.transform),s=l.arcs;function n(u,m){m.length&&m.pop();for(var p=s[u<0?~u:u],g=0,v=p.length;g<v;++g)m.push(t(p[g],g));u<0&&va(m,v)}function a(u){return t(u)}function i(u){for(var m=[],p=0,g=u.length;p<g;++p)n(u[p],m);return m.length<2&&m.push(m[0]),m}function o(u){for(var m=i(u);m.length<4;)m.push(m[0]);return m}function d(u){return u.map(o)}function h(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(h)};case"Point":p=a(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(a);break;case"LineString":p=i(u.arcs);break;case"MultiLineString":p=u.arcs.map(i);break;case"Polygon":p=d(u.arcs);break;case"MultiPolygon":p=u.arcs.map(d);break;default:return null}return{type:m,coordinates:p}}return h(e)}function ya(l,e){var t={},s={},n={},a=[],i=-1;e.forEach(function(h,u){var m=l.arcs[h<0?~h:h],p;m.length<3&&!m[1][0]&&!m[1][1]&&(p=e[++i],e[i]=h,e[u]=p)}),e.forEach(function(h){var u=o(h),m=u[0],p=u[1],g,v;if(g=n[m])if(delete n[g.end],g.push(h),g.end=p,v=s[p]){delete s[v.start];var f=v===g?g:g.concat(v);s[f.start=g.start]=n[f.end=v.end]=f}else s[g.start]=n[g.end]=g;else if(g=s[p])if(delete s[g.start],g.unshift(h),g.start=m,v=n[m]){delete n[v.end];var b=v===g?g:v.concat(g);s[b.start=v.start]=n[b.end=g.end]=b}else s[g.start]=n[g.end]=g;else g=[h],s[g.start=m]=n[g.end=p]=g});function o(h){var u=l.arcs[h<0?~h:h],m=u[0],p;return l.transform?(p=[0,0],u.forEach(function(g){p[0]+=g[0],p[1]+=g[1]})):p=u[u.length-1],h<0?[p,m]:[m,p]}function d(h,u){for(var m in h){var p=h[m];delete u[p.start],delete p.start,delete p.end,p.forEach(function(g){t[g<0?~g:g]=1}),a.push(p)}}return d(n,s),d(s,n),e.forEach(function(h){t[h<0?~h:h]||a.push([h])}),a}function Ea(l){for(var e=-1,t=l.length,s,n=l[t-1],a=0;++e<t;)s=n,n=l[e],a+=s[0]*n[1]-s[1]*n[0];return Math.abs(a)}function Oa(l){return He(l,ba.apply(this,arguments))}function ba(l,e){var t={},s=[],n=[];e.forEach(a);function a(d){switch(d.type){case"GeometryCollection":d.geometries.forEach(a);break;case"Polygon":i(d.arcs);break;case"MultiPolygon":d.arcs.forEach(i);break}}function i(d){d.forEach(function(h){h.forEach(function(u){(t[u=u<0?~u:u]||(t[u]=[])).push(d)})}),s.push(d)}function o(d){return Ea(He(l,{type:"Polygon",arcs:[d]}).coordinates[0])}return s.forEach(function(d){if(!d._){var h=[],u=[d];for(d._=1,n.push(h);d=u.pop();)h.push(d),d.forEach(function(m){m.forEach(function(p){t[p<0?~p:p].forEach(function(g){g._||(g._=1,u.push(g))})})})}}),s.forEach(function(d){delete d._}),{type:"MultiPolygon",arcs:n.map(function(d){var h=[],u;if(d.forEach(function(f){f.forEach(function(b){b.forEach(function(E){t[E<0?~E:E].length<2&&h.push(E)})})}),h=ya(l,h),(u=h.length)>1)for(var m=1,p=o(h[0]),g,v;m<u;++m)(g=o(h[m]))>p&&(v=h[0],h[0]=h[m],h[m]=v,p=g);return h}).filter(function(d){return d.length>0})}}class Sa extends Ge{constructor(){super(...arguments),this.type="ruler-binned",this.renderType=r.RenderTypes.SVG}showRuler(e,[t,s]){const n=this.parent,a=this.model.getOptions(),{cartesianScales:i}=this.services,o=i.getOrientation(),d=i.getRangeScale(),[h,u]=d.range(),m=i.getDomainScale(),p=m.invert(o===r.CartesianOrientations.VERTICAL?t:s),g=O.DOMUtils.appendOrSelect(n,"g.ruler").attr("aria-label","ruler"),v=O.DOMUtils.appendOrSelect(g,"line.ruler-line"),b=n.selectAll("[role=graphics-symbol]").filter(E=>{if(parseFloat(c.get(E,"data.x0"))<=p&&parseFloat(c.get(E,"data.x1"))>=p)return!0});if(b.size()>0){this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Ct(this.elementsToHighlight,b)&&this.hideRuler(),b.dispatch("mouseover"),this.elementsToHighlight=b;const E=y.select(b.nodes()[0]).datum(),S=parseFloat(c.get(E,"data.x0")),T=parseFloat(c.get(E,"data.x1")),C=this.model.getActiveDataGroupNames(),M=C.reverse().map(w=>({label:w,value:c.get(E,`data.${w}`),class:this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:w})})).filter(w=>w.value!==0);if(M.length>0){this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{mousePosition:[t,s],hoveredElement:v,items:[{label:c.get(a,"bins.rangeLabel")||"Range",value:`${S} – ${T}`},...M,...c.getProperty(a,"tooltip","showTotal")===!0?[{label:c.get(a,"tooltip.totalLabel")||"Total",value:C.reduce((P,$)=>P+parseFloat(c.get(E,`data.${$}`)),0)}]:[]]}),g.attr("opacity",1);const w=m((S+T)/2);o==="horizontal"?v.attr("x1",u).attr("x2",h).attr("y1",w).attr("y2",w):v.attr("y1",u).attr("y2",h).attr("x1",w).attr("x2",w)}else this.hideRuler()}else this.hideRuler()}}class xa extends Ge{formatTooltipData(e){return e.reverse()}}const Ta=(l,e)=>{const t=l.x,s=l.y,n=e.x,a=e.y,i=y.path();return i.moveTo(t,s),i.lineTo(n,a),i.toString()},Ma=(l,e,t=.5)=>{const s=l.x,n=l.y,a=e.x,i=e.y,o=y.path();return o.moveTo(s,n),o.lineTo(s+(a-s)*t,n),o.lineTo(s+(a-s)*t,i),o.lineTo(a,i),o.toString()},Ca=(l,e,t,s,n,a)=>{const i=l.x,o=l.y,d=e.x,h=e.y,u=y.path();return u.moveTo(i,o),u.bezierCurveTo(t,s,n,a,d,h),u.toString()},La={d:"M7 0v8L0 4z",height:8,width:7.5,id:"arrowLeft"},Aa={d:"M0 0v8l7-4z",height:8,width:7.5,id:"arrowRight"},Da={d:"M5.32 9.513a4.75 4.75 0 100-9.5 4.75 4.75 0 000 9.5z",height:10,width:10,id:"circle"},wa={d:"M5.03517654-1e-7l4.99999996 5-4.99999996 5-5-5L2.4517844 2.58339204z",height:10,width:10,id:"diamond"},Pa={d:"M0 .44974747h8v8H0v-3.6830331z",height:9,width:8,id:"square"},Ra={d:"M0 0h1.5v8H0z",height:8,width:2,id:"tee"};class ka extends Pt{constructor(e,t,s){super(e,t,s),this.type="color-legend",this.renderType=r.RenderTypes.SVG,this.gradient_id=`gradient-id-${Math.floor(Math.random()*99999999999)}`,this.handleAxisCompleteEvent=()=>{const n=this.getComponentContainer(),{width:a}=O.DOMUtils.getSVGElementSize(n,{useAttrs:!0}),i=c.getProperty(this.getOptions(),"data","loading");if(a>c.legend.color.barWidth&&!i){const o=c.getProperty(this.getOptions(),"heatmap","colorLegend","title"),{cartesianScales:d}=this.services,u=d.getMainXScale().range();if(u[0]>1&&(n.select("g.legend").attr("transform",`translate(${u[0]}, 0)`),o)){const{width:m}=O.DOMUtils.getSVGElementSize(n.select("g.legend-title").select("text"),{useBBox:!0}),p=u[0]-m-9;p>1?n.select("g.legend-title").attr("transform",`translate(${p}, 0)`):(n.select("g.legend").attr("transform",`translate(${u[0]}, 16)`),n.select("g.legend-title").attr("transform",`translate(${u[0]}, 0)`))}}else n.select("g.legend-title").attr("transform","translate(0, 0)")},this.chartType=s.chartType}init(){this.chartType==="heatmap"&&this.services.events.addEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}render(e=!1){const t=this.getOptions(),s=this.getComponentContainer(),{width:n}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),a=c.getProperty(t,"color","gradient","colors"),i=c.getProperty(t,this.chartType,"colorLegend","type");let o=c.getProperty(t,"color","pairing","option");const d=c.getProperty(t,"heatmap","colorLegend","title");if(c.getProperty(this.getOptions(),"data","loading")){s.html("");return}const u=!c.isEmpty(a),m=c.getDomain(this.model.getDisplayData()),p=!(n<=c.legend.color.barWidth),g=p?c.legend.color.barWidth:n,v=O.DOMUtils.appendOrSelect(s,"g.legend"),f=O.DOMUtils.appendOrSelect(v,"g.legend-axis");if(d){const P=O.DOMUtils.appendOrSelect(s,"g.legend-title");O.DOMUtils.appendOrSelect(P,"text").text(d).attr("dy","0.7em"),v.attr("transform","translate(0, 16)")}const b=m[0]<0&&m[1]>0?"diverge":"mono";(o<1&&o>4&&b==="mono"||o<1&&o>2&&b==="diverge")&&(o=1);let E=[];const S=b==="diverge"?17:11;if(u)E=a;else for(let P=1;P<S+1;P++)E.push(i===r.ColorLegendType.LINEAR?`stop-color-${b}-${o}-${P}`:`fill-${b}-${o}-${P}`);const T=y.interpolateNumber(m[0],m[1]),C=y.quantize(T,3),M=y.scaleLinear().domain(m).range([0,g]),x=y.axisBottom(M).tickSize(0).tickValues(C);let w;switch(i){case r.ColorLegendType.LINEAR:this.drawLinear(E,v,g);break;case r.ColorLegendType.QUANTIZE:w=this.drawQuantize(E,b,u,v,g),M.range([w,g]);break;default:throw Error("Entered color legend type is not supported.")}f.attr("transform",`translate(0,${c.legend.color.axisYTranslation})`).call(x),f.select(".domain").remove(),f.select("g.tick:last-of-type text").style("text-anchor",p?"middle":"end"),f.select("g.tick:first-of-type text").style("text-anchor",p&&this.chartType!=="choropleth"?"middle":"start")}drawLinear(e,t,s){const n=100/(e.length-1);O.DOMUtils.appendOrSelect(t,"linearGradient").attr("id",`${this.gradient_id}-legend`).selectAll("stop").data(e).enter().append("stop").attr("offset",(o,d)=>`${d*n}%`).attr("class",(o,d)=>e[d]).attr("stop-color",o=>o),O.DOMUtils.appendOrSelect(t,"rect").attr("width",s).attr("height",c.legend.color.barHeight).style("fill",`url(#${this.gradient_id}-legend)`)}drawQuantize(e,t,s,n,a){!s&&t==="diverge"&&e.splice(e.length/2,1);const i=y.scaleBand().domain(e).range([0,a]);return O.DOMUtils.appendOrSelect(n,"g.quantized-rect").selectAll("rect").data(i.domain()).join("rect").attr("x",d=>i(d)).attr("y",0).attr("width",Math.max(0,i.bandwidth()-1)).attr("height",c.legend.color.barHeight).attr("class",d=>d).attr("fill",d=>d),(!s&&t)==="mono"?i.bandwidth()-1:0}destroy(){this.chartType==="heatmap"&&this.services.events.removeEventListener(r.Events.Axis.RENDER_COMPLETE,this.handleAxisCompleteEvent)}}class Ia extends wt{constructor(){super(...arguments),this.type="meter-title",this.renderType=r.RenderTypes.SVG}render(e=!1){const t=c.getProperty(this.model.getDisplayData(),0),s=this.getOptions(),n=this.getComponentContainer(),{groupMapsTo:a}=s.data;if(c.getProperty(s,"meter","proportional"))this.displayTotal(),this.displayBreakdownTitle();else{const h=n.selectAll("text.meter-title").data([t[a]]);h.enter().append("text").classed("meter-title",!0).merge(h).attr("x",0).attr("y","1em").text(u=>u),h.exit().remove(),this.appendPercentage()}this.displayStatus();const o=this.getMaxTitleWidth(),d=O.DOMUtils.appendOrSelect(n,"text.meter-title");o>0&&d.node().getComputedTextLength()>o&&this.truncateTitle(d,o)}displayBreakdownTitle(){const e=this.getComponentContainer(),t=this.getOptions(),s=this.model.getMaximumDomain(this.model.getDisplayData()),n=c.getProperty(t,"meter","proportional","total"),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"";let i;if(s===n)i=null;else{const u=n!==null?n-s:s,m=c.getProperty(t,"meter","proportional","breakdownFormatter");i=m!==null?m({datasetsTotal:s,total:n}):`${s} ${a} used (${u} ${a} available)`}const o=e.selectAll("text.proportional-meter-title").data([i]);o.enter().append("text").classed("proportional-meter-title",!0).merge(o).attr("x",0).attr("y","1em").text(u=>u),o.exit().remove();const d=this.getMaxTitleWidth(),h=O.DOMUtils.appendOrSelect(e,"text.proportional-meter-title");d>0&&h.node().getComputedTextLength()>d&&this.truncateTitle(h,d)}displayTotal(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"meter","proportional","total"),n=s?c.getProperty(t,"meter","proportional","total"):this.model.getMaximumDomain(this.model.getDisplayData()),a=c.getProperty(t,"meter","proportional","unit")?c.getProperty(t,"meter","proportional","unit"):"",i=c.getProperty(t,"meter","proportional","totalFormatter"),o=i!==null?i(n):`${s} ${a} total`,d=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),h=d.width?d.width:this.parent.node().getAttribute("width"),u=e.selectAll("text.proportional-meter-total").data([o]);u.enter().append("text").classed("proportional-meter-total",!0).merge(u).attr("x",this.model.getStatus()&&typeof h!="string"?h-c.meter.total.paddingRight:h).attr("y","1em").attr("text-anchor","end").text(m=>m),u.exit().remove()}displayStatus(){const e=this,t=this.getComponentContainer(),s=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),n=s.width?s.width:0,a=this.model.getStatus(),i=c.meter.status.indicatorSize/2,o=O.DOMUtils.appendOrSelect(t,"g.status-indicator").attr("class",a!==null?`status-indicator status--${a}`:"").attr("transform",`translate(${n-i}, 0)`),d=a?[a]:[],h=o.selectAll("circle.status").data(d);h.enter().append("circle").merge(h).attr("class","status").attr("r",i).attr("cx",0).attr("cy",8);const u=o.selectAll("path.innerFill").data(d);u.enter().append("path").merge(u).attr("d",e.getStatusIconPathString(a)).attr("transform",`translate(-${i}, 0)`).attr("class","innerFill"),u.exit().remove(),h.exit().remove()}appendPercentage(){const e=c.getProperty(this.model.getDisplayData(),0,"value"),t=this.getComponentContainer(),s=O.DOMUtils.appendOrSelect(t,"text.meter-title"),n=c.getProperty(this.getOptions(),"meter","statusBar","percentageIndicator","enabled")===!0?[e]:[],a=t.selectAll("text.percent-value").data(n),i=c.meter.statusBar.paddingRight;a.enter().append("text").classed("percent-value",!0).merge(a).text(o=>`${o}%`).attr("x",+s.attr("x")+s.node().getComputedTextLength()+i).attr("y",s.attr("y")),a.exit().remove()}truncateTitle(e,t){super.truncateTitle(e,t);const s=O.DOMUtils.appendOrSelect(this.parent,"tspan"),n=c.meter.statusBar.paddingRight,a=Math.ceil(s.node().getComputedTextLength());O.DOMUtils.appendOrSelect(this.parent,"text.percent-value").attr("x",+e.attr("x")+e.node().getComputedTextLength()+a+n)}getMaxTitleWidth(){const e=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),t=c.getProperty(this.getOptions(),"meter","proportional"),s=e.width?e.width:this.parent.node().getBoundingClientRect().width;if(t!==null){const n=O.DOMUtils.appendOrSelect(this.parent,"text.proportional-meter-total").node(),a=O.DOMUtils.getSVGElementSize(n,{useBBox:!0}).width;return s-a-c.meter.total.paddingLeft}else{const n=O.DOMUtils.appendOrSelect(this.parent,"text.percent-value"),a=c.meter.statusBar.paddingRight,i=n.node().getComputedTextLength(),o=O.DOMUtils.appendOrSelect(this.parent,"g.status-indicator").node(),d=O.DOMUtils.getSVGElementSize(o,{useBBox:!0}).width+c.meter.status.paddingLeft;return s-i-a-d}}getStatusIconPathString(e){switch(e){case r.Statuses.SUCCESS:return"M6.875 11.3125 3.75 8.1875 4.74375 7.25 6.875 9.34375 11.50625 4.75 12.5 5.7375 Z";case r.Statuses.DANGER:return"M10.7 11.5 4.5 5.3 5.3 4.5 11.5 10.7 Z";case r.Statuses.WARNING:return"M7.9375,11.125 C7.41973305,11.125 7,11.544733 7,12.0625 C7,12.580267 7.41973305,13 7.9375,13 C8.45526695,13 8.875,12.580267 8.875,12.0625 C8.875,11.544733 8.45526695,11.125 7.9375,11.125 M7.3125, 3 8.5625, 3 8.5625, 9.875 7.3125, 9.875, 7.3125, 3 Z"}}}class ye extends G{getBarWidth(){const e=this.getOptions();if(e.bars.width)return e.bars.width;const t=this.model.getDisplayData().length,s=this.services.cartesianScales.getMainXScale(),n=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width;if(!s.step){const a=c.getProperty(e,"bars","spacingFactor");return Math.min(e.bars.maxWidth,n*a/t)}return Math.min(e.bars.maxWidth,s.step()/2)}isOutsideZoomedDomain(e,t){if(this.model.getDisplayData().length<=1)return!1;const n=this.model.get("zoomDomain");if(n!==void 0){const a=this.services.cartesianScales.getDomainScale();return e<a(n[0])||t>a(n[1])}return!1}}class _a extends G{constructor(){super(...arguments),this.type="circle-pack",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("circle.node").transition("legend-hover-circlepack").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-circlepack"})).attr("opacity",s=>s.data.dataGroupName===t.datum().name?1:c.circlePack.circles.fillOpacity)},this.handleLegendMouseOut=()=>{this.parent.selectAll("circle.node").transition("legend-mouseout-circlepack").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-circlepack"})).attr("opacity",1)}}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;let a=this.model.getDisplayData();const i=this.model.hasParentNode(),o=this.model.getHierarchyLevel(),d=this.getOptions(),h=c.getProperty(d,"canvasZoom","enabled");i&&c.getProperty(a,0,"children")&&(a=c.getProperty(a,0,"children"));const u=y.hierarchy({children:a}).sum(f=>f.value).sort((f,b)=>b.value-f.value),p=y.pack().size([s,n]).padding(f=>f.depth>=1?c.circlePack.padding.children+3:c.circlePack.padding.mainGroup+3)(u).descendants().splice(1).filter(f=>f.depth<=o),g=t.selectAll("circle.node").data(p);g.exit().attr("width",0).attr("height",0).remove();const v=g.enter().append("circle").classed("node",!0);v.merge(g).attr("class",f=>{const b=h&&o===3?this.getZoomClass(f):"";return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:f.data.dataGroupName,originalClassName:f.children?`node ${b}`:`node node-leaf ${b}`})}).style("fill",f=>this.model.getFillColor(f.data.dataGroupName)).style("stroke",f=>this.model.getFillColor(f.data.dataGroupName)).attr("cx",f=>f.x).attr("cy",f=>f.y).transition("circlepack-leaf-update-enter").call(f=>this.services.transitions.setupTransition({transition:f,name:"circlepack-leaf-update-enter"})).attr("r",f=>f.r).attr("opacity",1).attr("fill-opacity",c.circlePack.circles.fillOpacity),h===!0&&this.focal&&(this.services.canvasZoom.zoomIn(this.focal,v,c.canvasZoomSettings),this.setBackgroundListeners()),i||this.addLegendListeners(),this.addEventListeners()}unhighlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",s=>this.model.getFillColor(s.data.dataGroupName))}highlightChildren(e){const t=e.map(s=>s.data);this.parent.selectAll("circle.node").filter(s=>t.some(n=>n===s.data)&&s.depth>1).style("stroke",c.circlePack.circles.hover.stroke)}getZoomClass(e){return this.model.getHierarchyLevel()===3&&this.focal&&(e.data===this.focal.data||this.focal.children.some(t=>t.data===e.data))?"focal":"non-focal"}addLegendListeners(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}removeBackgroundListeners(){y.select(this.services.domUtils.getMainContainer()).on("click",()=>null)}setBackgroundListeners(){const e=y.select(this.services.domUtils.getMainContainer()),t=this,s=this.parent.selectAll("circle.node");e.on("click",()=>{t.focal=null,t.model.updateHierarchyLevel(2),e.classed("zoomed-in",!1),t.services.canvasZoom.zoomOut(s,c.canvasZoomSettings)})}getZoomIcon(){return`
|
|
78
78
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
79
79
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
80
80
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
81
|
-
</svg>`}addEventListeners(){const e=this;this.parent.selectAll("circle.node").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0);const a=e.model.getHierarchyLevel(),i=a>2&&!n.classed("focal"),l=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");let d=!1;if(!i){let h=[],u=[],m=null;if(s.children){s.depth>1&&l&&(d=!0,n.classed("clickable",!0)),h=s.children.map(v=>{if(v!==null)return typeof v.data.value=="number"?{label:v.data.name,value:v.data.value}:{label:v.data.name,labelIcon:l&&a<=2?e.getZoomIcon():null,value:v.value}});const g=e.model.getOptions();u=[{label:c.get(g,"tooltip.totalLabel")||"Total",value:s.value,bold:!0}],e.highlightChildren(s.children)}else m=s.value;const p=getComputedStyle(this,null).getPropertyValue("fill");e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:p,label:s.data.name,labelIcon:d&&l&&a<=2?e.getZoomIcon():null,value:m},...h,...u]})}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),s.children&&e.unhighlightChildren(s.children),e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})}).on("click",function(t,s){const n=y.select(this),a=n.classed("non-focal"),i=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");if(i&&e.model.getHierarchyLevel()>2){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!1),e.focal=null,e.model.updateHierarchyLevel(2),e.services.canvasZoom.zoomOut(l,c.canvasZoomSettings)}else if(s.depth===2&&s.children&&!a&&i){const l=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!0),e.focal=s,e.model.updateHierarchyLevel(3),e.services.canvasZoom.zoomIn(s,l,c.canvasZoomSettings),t.stopPropagation()}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_CLICK,{event:t,element:n,datum:s})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function Ua(o,e){const t=y.interpolate(this._current,o);return s=>(this._current=t(s),e(this._current))}class Ut extends G{constructor(){super(...arguments),this.type="pie",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n.data[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return c.pie.innerRadius}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),{groupMapsTo:a}=n.data,{valueMapsTo:i}=n.pie,l=this.model.getDisplayData().filter(L=>L[i]>0),d=this.computeRadius();this.arc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d),this.hoverArc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d+c.pie.hoverArc.outerRadiusOffset);const u=y.pie().value(L=>L[i]).sort(c.getProperty(n,"pie","sortFunction")).padAngle(c.pie.padAngle)(l),p=O.DOMUtils.appendOrSelect(s,"g.slices").attr("role",N.Roles.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[a]);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("slice",!0).attr("opacity",0).merge(p).attr("class",L=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>t.model.getFillColor(L.data[a])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:e})).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[i]}, ${c.convertValueToPercentage(L.data[i],l,i)+"%"}`).attrTween("d",function(L){return Ua.bind(this)(L,t.arc)});const f=n.pie.labels.enabled,b=f?u.filter(L=>L.data[i]>0):[],S=O.DOMUtils.appendOrSelect(s,"g.labels").attr("role",N.Roles.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(b,L=>L.data[a]);S.exit().attr("opacity",0).remove();const T=S.enter().append("text").classed("pie-label",!0),M=[];T.merge(S).style("text-anchor","middle").text(L=>n.pie.labels.formatter?n.pie.labels.formatter(L):c.convertValueToPercentage(L.data[i],l,i)+"%").datum(function(L){const V=d+7,R=(L.endAngle-L.startAngle)/2+L.startAngle,F=R/Math.PI*180,q=this.getComputedTextLength();return L.textOffsetX=q/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+V)*Math.sin(R),L.yPosition=(L.textOffsetY+V)*-Math.cos(R),L}).attr("transform",function(L,V){const R=b.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(V>=R-2&&F<c.pie.callout.minSliceDegree){let q,H;return L.index===R-1?(q=L.xPosition+c.pie.callout.offsetX+c.pie.callout.textMargin+L.textOffsetX,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.RIGHT,M.push(L)):(q=L.xPosition-c.pie.callout.offsetX-L.textOffsetX-c.pie.callout.textMargin,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.LEFT,M.push(L)),`translate(${q}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(M);const C=c.getProperty(n,"donut")?"donut":"pie",x=c.getProperty(n,C,"alignment"),{width:w}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0}),I=f?c.pie.xOffset:0,$=f?c.pie.yOffset:0;let _=d+I;x===r.Alignments.CENTER?_=w/2:x===r.Alignments.RIGHT&&(_=w-d-c.pie.xOffset);let A=d+$;M.length>0&&(A+=c.pie.yOffsetCallout),s.attr("x",_+7).attr("y",A),this.addEventListeners()}renderCallouts(e){const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",N.Roles.GROUP).attr("data-name","callouts"),s=t.selectAll("g.callout").data(e);s.exit().remove();const n=s.enter().append("g").classed("callout",!0).attr("role",N.Roles.GROUP).attr("aria-roledescription","label callout");n.merge(s).datum(function(l){const{xPosition:d,yPosition:h,direction:u}=l;return u===r.CalloutDirections.RIGHT?(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d+c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x-c.pie.callout.horizontalLineLength):(l.startPos={x:d,y:h+l.textOffsetY},l.endPos={x:d-c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+l.textOffsetY},l.intersectPointX=l.endPos.x+c.pie.callout.horizontalLineLength),l}),n.append("line").classed("vertical-line",!0).merge(t.selectAll("line.vertical-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.startPos.x).attr("y1",l=>l.startPos.y).attr("x2",l=>l.intersectPointX).attr("y2",l=>l.endPos.y),n.append("line").classed("horizontal-line",!0).merge(t.selectAll("line.horizontal-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",l=>l.intersectPointX).attr("y1",l=>l.endPos.y).attr("x2",l=>l.endPos.x).attr("y2",l=>l.endPos.y)}addEventListeners(){const e=this;this.parent.selectAll("path.slice").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0).transition("pie_slice_mouseover").call(l=>e.services.transitions.setupTransition({transition:l,name:"pie_slice_mouseover"})).attr("d",e.hoverArc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOVER,{event:t,element:y.select(this),datum:s});const{groupMapsTo:a}=e.getOptions().data,{valueMapsTo:i}=e.getOptions().pie;e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{label:s.data[a],value:s.data[i]}]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Pie.SLICE_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>e.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",e.arc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}computeRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),s=this.getOptions(),n=Math.min(e,t)/2;return s.pie.labels.enabled?n+c.pie.radiusOffset:n}}class Va extends Ut{constructor(){super(...arguments),this.type="donut",this.renderType=r.RenderTypes.SVG}render(e=!0){super.render(e);const t=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const s=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.center"),n=this.getOptions(),a=this.computeRadius(),i=c.getProperty(n,"donut","center","label");O.DOMUtils.appendOrSelect(s,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>i===null||i===""?"central":"initial").style("font-size",()=>n.donut.center.numberFontSize(a)).transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"donut-figure-enter-update",animate:e})).tween("text",function(){return t.centerNumberTween(y.select(this))}),i!==null&&i!==""&&O.DOMUtils.appendOrSelect(s,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>n.donut.center.titleFontSize(a)).attr("y",n.donut.center.titleYPosition(a)).text(i)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(e){const t=this.getOptions();let s=c.getProperty(t,"donut","center","number");s===null&&(s=this.model.getDisplayData().reduce((l,d)=>l+d[t.pie.valueMapsTo],0));const n=parseInt(e.text().replace(/[, ]+/g,""),10)||0;let a;n%1===0&&s%1===0?a=y.interpolateRound:a=y.interpolateNumber;const i=a(n,s);return l=>{const{numberFormatter:d}=t.donut.center;e.text(d(i(l)))}}}const tt="4,10 8,6 12,10",st="12,6 8,10 4,6";class Ba extends G{constructor(){super(...arguments),this.type="gauge",this.renderType=r.RenderTypes.SVG}getValue(){var s;return((s=this.model.getData().find(n=>n.group==="value"))==null?void 0:s.value)??null}getValueRatio(){return Ot(this.getValue(),0,100)/100}getDelta(){var s;return((s=this.model.getData().find(n=>n.group==="delta"))==null?void 0:s.value)??null}getArcRatio(){const e=this.getOptions();return c.getProperty(e,"gauge","type")===r.GaugeTypes.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const e=this.getArcSize();return e===2*Math.PI?0:-e/2}getArrow(e){const t=this.getOptions();switch(c.getProperty(t,"gauge","deltaArrow","direction")){case r.ArrowDirections.UP:return tt;case r.ArrowDirections.DOWN:return st;default:return e>0?tt:st}}render(e=!0){const t=this.getComponentContainer().attr("width","100%").attr("height","100%"),s=this.getOptions(),n=this.getValue(),a=this.getValueRatio(),i=this.getArcSize(),l=this.getStartAngle(),d=a*i,h=l+d,u=l+i,m=this.computeRadius(),p=this.getInnerRadius();this.backgroundArc=y.arc().innerRadius(p).outerRadius(m).startAngle(h).endAngle(u),this.arc=y.arc().innerRadius(p).outerRadius(m).startAngle(l).endAngle(h),O.DOMUtils.appendOrSelect(t,"path.arc-background").attr("d",this.backgroundArc);const g=t.selectAll("path.arc-foreground").data([n]);g.enter().append("path").merge(g).attr("class",this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>c.getProperty(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),g.exit().remove();const f=c.getProperty(s,"gauge","alignment"),{width:b}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0});let E=m;f===r.Alignments.CENTER?E=b/2:f===r.Alignments.RIGHT&&(E=b-m),t.attr("x",E).attr("y",m),this.addEventListeners()}drawValueNumber(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"gauge","type"),n=this.getValue(),a=this.getDelta(),i=this.computeRadius(),l=c.getProperty(t,"gauge","valueFontSize"),d=c.getProperty(t,"gauge","deltaFontSize"),h=c.getProperty(t,"gauge","numberSpacing"),u=c.getProperty(t,"gauge","showPercentageSymbol");let m=0;s===r.GaugeTypes.FULL&&!a?m=d(i):s===r.GaugeTypes.SEMI&&a&&(m=-(d(i)+h));const p=O.DOMUtils.appendOrSelect(e,"g.gauge-numbers").attr("transform",`translate(0, ${m})`),g=l(i),v=O.DOMUtils.appendOrSelect(p,"g.gauge-value-number"),f=c.getProperty(t,"gauge","numberFormatter"),b=v.selectAll("text.gauge-value-number").data([n]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${g}px`).attr("text-anchor","middle").text(w=>f(w));const{width:E}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(e,"text.gauge-value-number"),{useBBox:!0}),S=g/2,T=u?"%":"",M=O.DOMUtils.appendOrSelect(v,"text.gauge-value-symbol").style("font-size",`${S}px`).attr("x",E/2).text(T),{width:C,height:x}=O.DOMUtils.getSVGElementSize(M,{useBBox:!0});M.attr("y",`-${x/2}px`),v.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=this.getDelta();if(n){const a=this.computeRadius(),i=n?c.getProperty(s,"gauge","deltaFontSize"):()=>0,l=n?c.getProperty(s,"gauge","numberFormatter"):()=>null,d=c.getProperty(s,"gauge","deltaArrow","size"),h=c.getProperty(s,"gauge","numberSpacing"),u=c.getProperty(s,"gauge","showPercentageSymbol"),m=O.DOMUtils.appendOrSelect(t,"g.gauge-numbers"),p=O.DOMUtils.appendOrSelect(m,"g.gauge-delta").attr("transform",`translate(0, ${i(a)+h})`),g=O.DOMUtils.appendOrSelect(p,"text.gauge-delta-number"),v=u?"%":"";g.data(n===null?[]:[n]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${i(a)}px`).text(S=>`${l(S)}${v}`);const{width:f}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(t,".gauge-delta-number"),{useBBox:!0}),b=c.getProperty(s,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(n!==null&&b?[n]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-d(a)-f/2).attr("y",-d(a)/2-i(a)*.35).attr("width",d(a)).attr("height",d(a)).attr("viewBox","0 0 16 16").each(function(){const S=y.select(this);O.DOMUtils.appendOrSelect(S,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const T=c.getProperty(s,"gauge","status");O.DOMUtils.appendOrSelect(S,"polygon.gauge-delta-arrow").attr("class",T!==null?`gauge-delta-arrow status--${T}`:"").attr("points",e.getArrow(n))}),E.exit().remove(),g.exit().remove()}else{const a=t.select("g.gauge-delta");a.empty()||a.remove()}}getInnerRadius(){const e=this.computeRadius(),t=c.getProperty(this.getOptions(),"gauge","arcWidth");return e-t}addEventListeners(){const e=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOVER,{event:t,element:y.select(this),datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEMOVE,{event:t,element:n,datum:s})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOUT,{event:t,element:n,datum:s})})}computeRadius(){const e=this.getOptions(),t=c.getProperty(e,"gauge","type"),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return t===r.GaugeTypes.SEMI?Math.min(s/2,n):Math.min(s/2,n/2)}}class Na extends ve{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=r.RenderTypes.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.model.getDisplayData(this.configs.groups),s=this.getOptions(),{groupMapsTo:n}=s.data;this.setGroupScale();const a=this.getComponentContainer({withinChartClip:!0}),i=c.removeArrayDuplicates(t.map(p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return p[g]&&typeof p[g].toString=="function"?p[g].toString():p[g]})),l=a.selectAll("g.bars").data(i,p=>p);l.exit().attr("opacity",0).remove();const h=l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars").merge(l);h.transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-group-update-enter",animate:e})).attr("transform",p=>{const v=this.services.cartesianScales.getDomainValue(p)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?`translate(${v}, 0)`:`translate(0, ${v})`});const u=h.selectAll("path.bar").data(p=>this.getDataCorrespondingToLabel(p),p=>p[n]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-update-enter",animate:e})).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:p[n],originalClassName:"bar"})).style("fill",p=>this.model.getFillColor(p[n])).attr("d",p=>{const g=this.groupScale(p[n]),v=this.getBarWidth(),f=g,b=g+v,E=this.services.cartesianScales.getRangeAxisPosition({datum:p}),S=this.services.cartesianScales.getValueThroughAxisPosition(E,0),T=this.services.cartesianScales.getRangeValue(p),M=this.services.cartesianScales.getDomainValue(p)-v/2,C=M+v;if(!this.isOutsideZoomedDomain(M,C))return c.generateSVGPathString({x0:f,x1:b,y0:S,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",p=>p.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(s=>{const n=this.services.cartesianScales.getDomainIdentifier(s);return s[n].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),t=this.getTotalGroupPadding();return this.getBarWidth()*e.length+t}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),t=this.model.getGroupedData(this.configs.groups);let s=this.defaultStepFactor;if(typeof e.step=="function")s=e.step();else if(t.length>0){const n=t.find(a=>{var i;return((i=a.data)==null?void 0:i.length)>1});if(n){const a=this.services.cartesianScales.getDomainIdentifier(n.data[0]);s=Math.abs(e(n.data[1][a])-e(n.data[0][a]))}}return s}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),t=c.getProperty(e,"bars","width"),s=c.getProperty(e,"bars","maxWidth");if(t!==null&&(s===null||t<=s))return t;const a=this.model.getGroupedData(this.configs.groups).length,i=this.getTotalGroupPadding();return Math.min(s,(this.getDomainScaleStep()-i)/a)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=y.scaleBand().domain(e).rangeRound([0,this.getGroupWidth()])}}class Ga extends G{constructor(){super(...arguments),this.type="heatmap",this.renderType=r.RenderTypes.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=e=>{const{detail:t}=e,{datum:s}=t,n=this.model.getUniqueRanges(),a=this.model.getUniqueDomain(),i=this.services.cartesianScales.getDomainLabel(),l=this.services.cartesianScales.getRangeLabel(),d=this.services.cartesianScales.getMainXScale(),h=this.services.cartesianScales.getMainYScale();let u="",m=null,p=null,g=null;this.matrix[s]!==void 0?(u=i,n.forEach(v=>{if(typeof this.matrix[s][v].value=="number"){const f=this.matrix[s][v].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})):(u=l,a.forEach(v=>{if(typeof this.matrix[v][s].value=="number"){const f=this.matrix[v][s].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})),d(s)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${d(s)}, ${y.min(h.range())})`):h(s)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${y.min(d.range())},${h(s)})`),this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t.event,hoveredElement:y.select(e.detail.element),items:[{label:u,value:s,bold:!0},{label:"Min",value:p!==null?p:"-"},{label:"Max",value:g!==null?g:"-"},{label:"Average",value:m!==null?m/a.length:"-"}]})},this.handleAxisMouseOut=e=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:e})}}init(){const e=this.services.events;e.addEventListener(r.Events.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),e.addEventListener(r.Events.Axis.LABEL_FOCUS,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.lower();const{cartesianScales:s}=this.services;if(this.matrix=this.model.getMatrix(),t.html(""),c.getProperty(this.getOptions(),"data","loading"))return;const n=s.getMainXScale(),a=s.getMainYScale(),i=s.getDomainIdentifier(),l=s.getRangeIdentifier(),d=this.model.getUniqueDomain(),h=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),m=n.range(),p=a.range();this.xBandwidth=Math.abs((m[1]-m[0])/d.length),this.yBandwidth=Math.abs((p[1]-p[0])/h.length);const g=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");t.append("defs").append("pattern").attr("id",g).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const v=t.selectAll().data(u).enter().append("g").attr("class",f=>`heat-${f.index}`).classed("cell",!0).attr("transform",f=>`translate(${n(f[i])}, ${a(f[l])})`).append("rect").attr("class",f=>this.model.getColorClassName({value:f.value,originalClassName:`heat-${f.index}`})).classed("heat",!0).classed("null-state",f=>f.index===-1||f.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",f=>f.index===-1||f.value===null?`url(#${g})`:this.model.getFillColor(Number(f.value))).attr("aria-label",f=>f.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(p[1]-p[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(m[1]-m[0]),this.yBandwidth),this.determineDividerStatus()&&(v.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(e,t,s){const n=O.DOMUtils.appendOrSelect(this.parent,e).classed("shadows",!0).classed("highlighter-hidden",!0);O.DOMUtils.appendOrSelect(n,"line.top").attr("x1",-1).attr("x2",t+1),O.DOMUtils.appendOrSelect(n,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",s+1),O.DOMUtils.appendOrSelect(n,"line.down").attr("x1",-1).attr("x2",t+1).attr("y1",s).attr("y2",s),O.DOMUtils.appendOrSelect(n,"line.right").attr("x1",t).attr("x2",t).attr("y1",-1).attr("y2",s+1)}determineDividerStatus(){const e=c.getProperty(this.getOptions(),"heatmap","divider","state");return e!==r.DividerStatus.OFF&&(e===r.DividerStatus.AUTO&&c.heatmap.minCellDividerDimension<=this.xBandwidth&&c.heatmap.minCellDividerDimension<=this.yBandwidth||e===r.DividerStatus.ON)}addEventListener(){const e=this,{cartesianScales:t}=this.services,s=this.getOptions(),n=c.get(s,"tooltip.totalLabel"),a=t.getDomainIdentifier(),i=t.getRangeIdentifier(),l=t.getDomainLabel(),d=t.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(h,u){const m=y.select(this),p=m.select("rect.heat");if(!p.classed("null-state")){const v=c.getTransformOffsets(m.attr("transform"));e.parent.select("g.cell-highlight").attr("transform",`translate(${v.x+e.translationUnits.x}, ${v.y+e.translationUnits.y})`).classed("highlighter-hidden",!1),e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOVER,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,items:[{label:l,value:u[a]},{label:d,value:u[i]},{label:n||"Total",value:u.value,color:p.style("fill")}]})}}).on("mousemove",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){const p=y.select(this).select("rect.heat"),g=p.classed("null-state");e.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),g||(e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOUT,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:h,hoveredElement:p}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleAxisOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class $a extends G{constructor(){super(...arguments),this.type="histogram",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[n]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer(),s=this.model.getOptions(),{groupIdentifier:n}=s,{groupMapsTo:a}=s.data,i=this.model.getBinnedStackedData(),l=this.services.cartesianScales.getMainXScale(),d=t.selectAll("g.bars").data(i,u=>c.get(u,`0.${a}`));d.exit().attr("opacity",0).remove(),d.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP);const h=t.selectAll("g.bars").selectAll("path.bar").data(u=>u);h.exit().remove(),h.enter().append("path").merge(h).classed("bar",!0).attr(n,(u,m)=>m).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a])).attr("d",u=>{const m=c.get(u,"data");if(!m)return;const p=l(m.x1)-l(m.x0)-1,g=this.services.cartesianScales.getDomainValue(m.x0),v=g+p,f=this.services.cartesianScales.getRangeValue(u[0]);let b=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(b-f)>0&&Math.abs(b-f)>s.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?b+=1:b-=1),c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>c.getProperty(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const e=this.model.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0);const l=parseFloat(c.get(a,"data.x0")),d=parseFloat(c.get(a,"data.x1")),h=s.services.cartesianScales.getRangeAxisPosition(),u=s.services.cartesianScales.getScaleLabel(h);s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:c.get(e,"bins.rangeLabel")||"Range",value:`${l} – ${d}`},{label:e.tooltip.groupLabel||"Group",value:a[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:a[t]})},{label:u,value:c.get(a,`data.${a[t]}`)}]})}).on("mousemove",function(n){s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("mouseout",function(){y.select(this).classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ha extends me{constructor(){super(...arguments),this.type="lollipop",this.renderType=r.RenderTypes.SVG,this.handleScatterOnHover=e=>{const t=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[n]!==t.datum[n]?c.lines.weight.unselected:c.lines.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",c.lines.weight.unselected)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[n]!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.model.getOptions(),{groupMapsTo:n}=s.data,{cartesianScales:a}=this.services,i=a.getMainXScale(),l=a.getMainYScale(),d=a.getDomainIdentifier(),h=E=>a.getDomainValue(E),u=E=>a.getRangeValue(E),m=a.getOrientation(),[p,g]=c.flipDomainAndRangeBasedOnOrientation(h,u,m),v=t.selectAll("line.line").data(this.getScatterData(),E=>`${E[n]}-${E[d]}`);v.exit().attr("opacity",0).remove();const b=v.enter().append("line").attr("opacity",0).merge(v).classed("line",!0).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E[n],originalClassName:"line"})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"lollipop-line-update-enter",animate:e})).style("stroke",E=>this.model.getFillColor(E[n],E[d],E)).attr("opacity",1);m===r.CartesianOrientations.HORIZONTAL?b.attr("y1",g).attr("y2",g).attr("x1",i.range()[0]).attr("x2",E=>p(E)-s.points.radius):b.attr("x1",p).attr("x2",p).attr("y1",l.range()[0]).attr("y2",E=>g(E)+s.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class za extends G{constructor(){super(...arguments),this.type="meter",this.renderType=r.RenderTypes.SVG}getStackedBounds(e,t){let s=0;return e.map((a,i)=>i!==0?(s+=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:s-t(a.value)}):(s=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:0}))}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),a=c.getProperty(n,"meter","proportional"),i=this.model.getDisplayData(),l=this.model.getStatus(),{width:d}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{groupMapsTo:h}=n.data;let u;if(c.getProperty(n,"meter","proportional")===null)u=100;else{const T=c.getProperty(n,"meter","proportional","total");u=T||this.model.getMaximumDomain(this.model.getDisplayData())}const m=y.scaleLinear().domain([0,u]).range([0,d]),p=this.getStackedBounds(i,m),g=c.getProperty(n,"meter","height");O.DOMUtils.appendOrSelect(s,"rect.container").attr("x",0).attr("y",0).attr("width",d).attr("height",g||(a?c.meter.height.proportional:c.meter.height.default)),O.DOMUtils.appendOrSelect(s,"line.rangeIndicator").attr("x1",d).attr("x2",d).attr("y1",0).attr("y2",g||(a?c.meter.height.proportional:c.meter.height.default));const v=s.selectAll("rect.value").data(p),f=l!=null&&!t.model.isUserProvidedColorScaleValid()&&!a?`value status--${l}`:"value";v.enter().append("rect").classed("value",!0).merge(v).attr("x",T=>T.x).attr("y",0).attr("height",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).attr("class",T=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:T[h],originalClassName:f})).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"meter-bar-update",animate:e})).attr("width",T=>T.value>u?m(u):T.width).style("fill",T=>t.model.getFillColor(T[h])).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",T=>T.value),v.exit().remove();const b=c.getProperty(n,"meter","peak");let E=b;b!==null&&(b>u?E=u:b<i[0].value&&(E=i[0].value>u?u:i[0].value));const S=s.selectAll("line.peak").data(E==null?[]:[E]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"peak-line-update",animate:e})).attr("x1",T=>m(T)).attr("x2",T=>m(T)).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",T=>T),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=c.getProperty(e,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOVER,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:i[t],value:i.value}]}))}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEMOVE,{event:a,element:l,datum:i}),n&&s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.Meter.METER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOUT,{event:a,element:l,datum:i}),n&&(l.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class Fa extends G{constructor(){super(...arguments),this.type="radar",this.renderType=r.RenderTypes.SVG,this.getLabelDimensions=e=>{const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),s=O.DOMUtils.appendOrSelect(t,"text").text(e),{width:n,height:a}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return t.remove(),{width:n,height:a}},this.normalizeFlatData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo"),i=Rs(this.uniqueKeys.map(l=>this.uniqueGroups.map(d=>({[s]:l,[a]:d,[n]:null}))));return c.merge(i,e)},this.normalizeGroupedData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo");return e.map(({name:i,data:l})=>{const d=this.uniqueKeys.map(h=>({[a]:i,[s]:h,[n]:null}));return{name:i,data:c.merge(d,l)}})},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-blob"})).style("fill-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:c.radar.opacity.selected).style("stroke-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-blob"})).style("fill-opacity",c.radar.opacity.selected).style("stroke-opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer(),{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),a=this.model.getData(),i=this.model.getGroupedData(),l=this.getOptions(),d=c.getProperty(l,"data","groupMapsTo"),h=c.getProperty(l,"radar","axes","value"),{angle:u,value:m}=c.getProperty(l,"radar","axes"),{xLabelPadding:p,yLabelPadding:g,yTicksNumber:v,minRange:f,xAxisRectHeight:b}=c.radar;this.uniqueKeys=Array.from(new Set(a.map(D=>D[u]))),this.uniqueGroups=Array.from(new Set(a.map(D=>D[d]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(i);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+g),C=(Math.min(s,n)-S)/2;if(C<=0)return;const x=y.scaleBand().domain(this.fullDataNormalized.map(D=>D[u])).range([0,2*Math.PI].map(D=>D-Math.PI/2)),w=y.min(this.fullDataNormalized.map(D=>D[m])),I=y.scaleLinear().domain([w>=0?0:w,y.max(this.fullDataNormalized.map(D=>D[m]))]).range([f,C]).nice(v),$=I.ticks(v),_=D=>this.model.getFillColor(D),A=y.lineRadial().angle(D=>x(D[u])+Math.PI/2).radius(D=>I(D[m])).curve(y.curveLinearClosed),L=this.uniqueKeys.map(D=>{const P=this.getLabelDimensions(D).width,k=O.distanceBetweenPointOnCircAndVerticalDiameter(x(D),C);return P+k}),R={x:y.max(L)+p,y:n/2},q=O.DOMUtils.appendOrSelect(t,"g.y-axes").attr("role",N.Roles.GROUP).selectAll("path").data($,D=>D),H=D=>this.uniqueKeys.map(P=>({[u]:P,[m]:D}));q.join(D=>D.append("path").attr("opacity",0).attr("transform",`translate(${R.x}, ${R.y})`).attr("fill","none").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_enter",animate:e})).attr("opacity",1).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(H(k)))),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_axes_exit",animate:e})).attr("d",k=>A(H(k))).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-axes").attr("role",N.Roles.GROUP).selectAll("line").data(this.uniqueKeys,D=>D).join(D=>D.append("line").attr("opacity",0).attr("class",P=>`x-axis-${J(P)}`).attr("stroke-dasharray","0").attr("x1",P=>O.polarToCartesianCoords(x(P),0,R).x).attr("y1",P=>O.polarToCartesianCoords(x(P),0,R).y).attr("x2",P=>O.polarToCartesianCoords(x(P),0,R).x).attr("y2",P=>O.polarToCartesianCoords(x(P),0,R).y).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_enter",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_update",animate:e})).attr("opacity",1).attr("x1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).x).attr("y1",k=>O.polarToCartesianCoords(x(k),I.range()[0],R).y).attr("x2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).x).attr("y2",k=>O.polarToCartesianCoords(x(k),I.range()[1],R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_axes_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-labels").attr("role",N.Roles.GROUP).selectAll("text").data(this.uniqueKeys).join(D=>D.append("text").text(P=>P).attr("opacity",0).attr("x",P=>O.polarToCartesianCoords(x(P),I.range()[1]+p,R).x).attr("y",P=>O.polarToCartesianCoords(x(P),I.range()[1]+p,R).y).style("text-anchor",P=>O.radialLabelPlacement(x(P)).textAnchor).style("dominant-baseline",P=>O.radialLabelPlacement(x(P)).dominantBaseline).call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_update",animate:e})).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(x(k),I.range()[1]+p,R).x).attr("y",k=>O.polarToCartesianCoords(x(k),I.range()[1]+p,R).y).end().finally(()=>{const k=c.getProperty(l,"radar","alignment"),K=this.getAlignmentXOffset(k,t,this.getParent());t.attr("x",K)})),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_x_labels_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.blobs").attr("role",N.Roles.GROUP).selectAll("path").data(this.groupedDataNormalized,D=>D.name).join(D=>D.append("path").attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P.name).attr("opacity",0).attr("transform",e?()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`:`translate(${R.x}, ${R.y})`).style("fill",P=>_(P.name)).style("fill-opacity",c.radar.opacity.selected).style("stroke",P=>_(P.name)).call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_enter",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",`translate(${R.x}, ${R.y})`),k.attr("opacity",1).attr("d",K=>A(K.data))}),D=>(D.attr("class",P=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:P.name,originalClassName:"blob"})).style("fill",P=>_(P.name)).style("stroke",P=>_(P.name)),D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_blobs_update",animate:e})).attr("opacity",1).attr("transform",`translate(${R.x}, ${R.y})`).attr("d",k=>A(k.data))),D),D=>D.call(P=>{const k=P.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_exit",animate:e}));e&&k.delay(()=>Math.random()*30).attr("transform",()=>`translate(${R.x}, ${R.y}) scale(${1+Math.random()*.35})`),k.attr("opacity",0).remove()})),O.DOMUtils.appendOrSelect(t,"g.dots").attr("role",N.Roles.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(D=>c.getProperty(D,m)!==null)).join(D=>D.append("circle").attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-label",P=>P[h]),D=>D,D=>D.remove()).attr("class",D=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:D[d],originalClassName:J(D[u])})).attr("cx",D=>O.polarToCartesianCoords(x(D[u]),I(D[m]),R).x).attr("cy",D=>O.polarToCartesianCoords(x(D[u]),I(D[m]),R).y).attr("r",0).attr("opacity",0).style("fill",D=>_(D[d])),O.DOMUtils.appendOrSelect(t,"g.x-axes-rect").attr("role",N.Roles.GROUP).selectAll("rect").data(this.uniqueKeys).join(D=>D.append("rect"),D=>D,D=>D.remove()).attr("x",R.x).attr("y",R.y-b/2).attr("width",I.range()[1]).attr("height",b).style("fill","red").style("fill-opacity",0).attr("transform",D=>`rotate(${O.radToDeg(x(D))}, ${R.x}, ${R.y})`),O.DOMUtils.appendOrSelect(t,"g.y-labels").attr("role",N.Roles.GROUP).selectAll("text").data(y.extent($)).join(D=>D.append("text").attr("opacity",0).text(P=>P).attr("x",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).x+g).attr("y",P=>O.polarToCartesianCoords(-Math.PI/2,I(P),R).y).style("text-anchor","start").style("dominant-baseline","middle").call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_update",animate:e})).text(k=>k).attr("opacity",1).attr("x",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).x+g).attr("y",k=>O.polarToCartesianCoords(-Math.PI/2,I(k),R).y)),D=>D.call(P=>P.transition().call(k=>this.services.transitions.setupTransition({transition:k,name:"radar_y_labels_exit",animate:e})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(e,t,s){const n=O.DOMUtils.getSVGElementSize(t,{useBBox:!0}),{width:a}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});let i=0;return e===r.Alignments.CENTER?i=Math.floor((a-n.width)/2):e===r.Alignments.RIGHT&&(i=a-n.width),i}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const e=this,{axes:{angle:t}}=c.getProperty(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOVER,{event:s,element:a,datum:n});const i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`),d=e.model.getActiveDataGroupNames(),h=e.getOptions(),{groupMapsTo:u}=h.data,m=c.getProperty(h,"radar","axes","value");i.classed("hovered",!0).attr("stroke-dasharray","4 4"),l.classed("hovered",!0).attr("opacity",g=>d.indexOf(g[u])!==-1?1:0).attr("r",c.radar.dotsRadius);const p=e.fullDataNormalized.filter(g=>g[t]===n&&d.indexOf(g[u])!==-1);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,items:p.filter(g=>typeof g[m]=="number").map(g=>({label:g[u],value:g[m],color:e.model.getFillColor(g[u]),class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:g[u]})}))})}).on("mousemove",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEMOVE,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=e.parent.select(`.x-axes .x-axis-${J(n)}`),l=e.parent.selectAll(`.dots circle.${J(n)}`);i.classed("hovered",!1).attr("stroke-dasharray","0"),l.classed("hovered",!1).attr("opacity",0).attr("r",0),e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}class Wa extends ve{constructor(){super(...arguments),this.type="simple-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getOrientation(),l=n.selectAll("path.bar").data(a,h=>h[s]);l.exit().attr("opacity",0).remove(),l.enter().append("path").attr("opacity",0).merge(l).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[s],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[s])).attr("d",h=>{const u=this.services.cartesianScales.getRangeIdentifier(),m=this.getBarWidth(),p=h[u],g=this.services.cartesianScales.getDomainValue(h)-m/2,v=g+m;let f,b;if(Array.isArray(p)&&p.length===2)f=this.services.cartesianScales.getRangeValue(p[0]),b=this.services.cartesianScales.getRangeValue(p[1]);else{const T=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,T)),b=this.services.cartesianScales.getRangeValue(h)}const E=Math.abs(b-f);if(E!==0&&E<2&&(p>0&&i===r.CartesianOrientations.VERTICAL||p<0&&i===r.CartesianOrientations.HORIZONTAL?b=f-2:b=f+2),!this.isOutsideZoomedDomain(g,v))return c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},i)}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:y.select(this),datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ja extends _t{constructor(){super(...arguments),this.type="skeleton-lines"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading"),s=!c.getProperty(this.getOptions(),"grid","x","enabled")&&!c.getProperty(this.getOptions(),"grid","y","enabled")&&!c.getProperty(this.getOptions(),"axes","bottom","visible")&&!c.getProperty(this.getOptions(),"axes","left","visible");t&&!s?super.renderGridSkeleton(t):t&&s?this.renderSparklineSkeleton(t):this.removeSkeleton()}renderSparklineSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawSparkline(e),this.updateBackdropStyle(),e&&this.setShimmerEffect("shimmer-lines")}drawSparkline(e){const t=this.backdrop.attr("width"),s=[100],n=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),a=n.selectAll("line").data(s);a.enter().append("line").merge(a).attr("x1",0).attr("x2",t).attr("y1",i=>i).attr("y2",i=>i),n.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-skeleton.DAII"),O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Za extends G{constructor(){super(...arguments),this.type="area-stacked",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>c.getProperty(a,0,n)!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this,n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(v=>n.axes[v].percentage),l=this.model.getStackedData({percentage:i,groups:this.configs.groups}),d=c.getProperty(l,0,0),h=this.services.cartesianScales.getDomainAxisPosition({datum:d}),u=this.services.cartesianScales.getRangeAxisPosition({datum:d}),m=this.services.cartesianScales.getScaleByPosition(u),p=t.selectAll("path.area").data(l,v=>c.getProperty(v,0,a));this.areaGenerator=y.area().x(v=>this.services.cartesianScales.getValueThroughAxisPosition(h,v.data.sharedStackKey)).y0(v=>m(v[0])).y1(v=>m(v[1])).curve(this.services.curves.getD3Curve()),p.exit().attr("opacity",0).remove(),p.enter().append("path").attr("opacity",0).merge(p).data(l,v=>c.getProperty(v,0,a)).attr("class","area").attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:c.getProperty(v,0,a),originalClassName:"area"})).style("fill",v=>s.model.getFillColor(c.getProperty(v,0,a))).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",v=>c.getProperty(v,0,a)).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"area-update-enter",animate:e})).attr("opacity",c.area.opacity.selected).attr("d",this.areaGenerator)}}class Xa extends ve{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),i=this.model.getActiveDataGroupNames(),l=t.selectAll("g.bars").data(a,h=>c.getProperty(h,0,n));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",N.Roles.GROUP).attr("data-name","bars");const d=t.selectAll("g.bars").selectAll("path.bar").data(h=>h,h=>h.data.sharedStackKey);d.exit().remove(),d.enter().append("path").merge(d).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[n],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[n])).attr("d",h=>{const u=h.data.sharedStackKey,m=this.getBarWidth(),p=this.services.cartesianScales.getDomainValue(u)-m/2,g=p+m,v=this.services.cartesianScales.getRangeValue(h[0]);let f=this.services.cartesianScales.getRangeValue(h[1]);if(!this.isOutsideZoomedDomain(p,g)){if(Math.abs(f-v)>0&&Math.abs(f-v)>s.bars.dividerSize){const b=h[0]<0&&h[1]<=0;b&&i.length>1?this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=h[1]===0?2:1:f-=1:b||(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=1:f-=1)}return c.generateSVGPathString({x0:p,x1:g,y0:v,y1:f},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",N.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h[1]-h[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:a});let d=s.model.getDisplayData(s.configs.groups).find(h=>{const u=s.services.cartesianScales.getDomainIdentifier(h),m=s.services.cartesianScales.getRangeIdentifier(h);return h[m]===a.data[a[t]]&&h[u].toString()===a.data.sharedStackKey&&h[t]===a[t]});if(d===void 0){const h=s.services.cartesianScales.getDomainIdentifier(),u=s.services.cartesianScales.getRangeIdentifier();d={[h]:a.data.sharedStackKey,[u]:a.data[a[t]],[t]:a[t]}}s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,data:[d]})}).on("mousemove",function(n,a){const i=y.select(this);s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){s.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);i.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}getBarWidth(){const e=this.getOptions();if(c.getProperty(e,"bars","width"))return e.bars.width;const t=this.services.cartesianScales.getMainXScale(),s=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width,n=this.model.getStackKeys().length,a=c.getProperty(e,"bars","spacingFactor");return t.step?Math.min(e.bars.maxWidth,t.step()/2):Math.min(e.bars.maxWidth,s*a/n)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qa extends me{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=r.RenderTypes.SVG}render(e){if(!c.getProperty(this.getOptions(),"points","enabled"))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(g=>n.axes[g].percentage),l=this.model.getStackedData({groups:this.configs.groups,percentage:i}),d=s.selectAll("g.dots").data(l,g=>c.getProperty(g,0,a));d.exit().attr("opacity",0).remove();const u=d.enter().append("g").classed("dots",!0).attr("role",N.Roles.GROUP).merge(d).selectAll("circle.dot").data(g=>g);u.exit().attr("opacity",0).remove();const p=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(g=>{const v=g[a],f=this.services.cartesianScales.getDomainIdentifier(g),b=this.services.cartesianScales.getRangeIdentifier(g);return{[a]:v,[f]:g.data.sharedStackKey,[b]:g[1]}});this.styleCircles(p,e),this.addEventListeners()}getTooltipData(e,t){const s=this.getOptions(),{groupMapsTo:n}=s.data,a=Object.keys(s.axes).some(d=>s.axes[d].percentage),i=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=[];return i.forEach((d,h)=>{d.forEach((u,m)=>{const p=u[n],g=u.data.sharedStackKey;let v=u.data[p];const f=u[1],b=this.services.cartesianScales.getDomainIdentifier(u),E=this.services.cartesianScales.getRangeIdentifier(u);v!=null&&e===this.services.cartesianScales.getDomainValue(g)&&t===this.services.cartesianScales.getRangeValue(f)&&(a&&(v=this.model.getStackedData({groups:this.configs.groups})[h][m].data[p]),v!==null&&l.push({[n]:p,[b]:g,[E]:v}))})}),this.model.getDisplayData(this.configs.groups).filter(d=>{const h=this.services.cartesianScales.getDomainIdentifier(d),u=this.services.cartesianScales.getRangeIdentifier(d);return l.find(m=>m[n]==d[n]&&m[h]==d[h]&&m[u]==d[u])!==void 0})}}const ee=6;class Ya extends G{constructor(){super(...arguments),this.type="tree",this.renderType=r.RenderTypes.SVG}getLongestLabel(e){let t="";return e.forEach(s=>{const n=s.children?this.getLongestLabel(s.children):"";(n.length>t.length||s.name.length>t.length)&&(t=n.length>s.name.length?n:s.name)}),t}getMockLabelWidth(e,t){const s=e.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(t),{width:n}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return s.remove(),n}render(e=!0){const t=this.getComponentContainer();t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),l=c.getProperty(a,"tree","rootTitle")||"Tree",d=this.getMockLabelWidth(t,l),h=this.getLongestLabel(i),u=this.getMockLabelWidth(t,h),m={top:0,right:0,bottom:0,left:d>0?d+ee:30-ee},p=y.hierarchy({name:l,children:i}),g=10,v=s/6,f=x=>{const w=p.descendants().reverse(),I=p.links();let $=p,_=p;p.eachBefore(B=>{B.x<$.x&&($=B),B.x>_.x&&(_=B)});const A=_.x-$.x,L=t.transition().call(B=>this.services.transitions.setupTransition({transition:B,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-m.left,$.x,s,A].join(" ")),V=C.selectAll("g").data(w,B=>B.id),R=this,F=V.enter().append("g").attr("transform",()=>`translate(${x.y0},${x.x0})`).attr("class",B=>B.depth!==0&&B.children&&B.children.length>0?"clickable":null).on("mouseover",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOVER,{event:B,element:y.select(this),datum:X})}).on("click",function(B,X){X.depth!==0&&(X.children=X.children?null:X._children,f(X)),R.services.events.dispatchEvent(r.Events.Tree.NODE_CLICK,{event:B,element:y.select(this),datum:X})}).on("mouseout",function(B,X){R.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOUT,{event:B,element:y.select(this),datum:X})});F.append("circle").attr("r",2.5).attr("class",B=>B._children?"parent":"child").attr("stroke-width",10),F.append("text").attr("dy","0.31em").attr("x",B=>B._children?-ee:ee).attr("text-anchor",B=>B._children?"end":"start").text(B=>B.data.name).clone(!0).attr("class","text-stroke").lower(),V.merge(F).transition(L).attr("transform",B=>`translate(${B.y},${B.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),V.exit().transition(L).remove().attr("transform",()=>`translate(${x.y},${x.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const q=M.selectAll("path").data(I,B=>B.target.id),H=q.enter().append("path").attr("d",()=>{const B={x:x.x0,y:x.y0};return T({source:B,target:B})});q.merge(H).transition(L).attr("d",T),q.exit().transition(L).remove().attr("d",()=>{const B={x:x.x,y:x.y};return T({source:B,target:B})}),p.eachBefore(B=>{B.x0=B.x,B.y0=B.y})},b=p.descendants(),E=b[b.length-1].depth,S=c.getProperty(a,"tree","type")===r.TreeTypes.DENDROGRAM?y.cluster().size([n,s-u-E*ee-d]):y.tree().nodeSize([g,v]).size([n,s-u-E*ee-d]),T=y.linkHorizontal().x(x=>x.y).y(x=>x.x);p.x0=v/2,p.y0=0,p.descendants().forEach((x,w)=>{x.id=w,x._children=x.children}),S(p),t.attr("viewBox",[-m.left,-m.top,s,g]).style("user-select","none");const M=t.append("g").attr("class","links"),C=t.append("g").attr("class","nodes");f(p)}}var Ka="#000000",Ja="#ffffff",Qa="#fcf4d6",ei="#fddc69",ti="#f1c21b",si="#d2a106",ni="#b28600",ai="#8e6a00",ii="#684e00",ri="#483700",oi="#302400",li="#1c1500",ci={10:Qa,20:ei,30:ti,40:si,50:ni,60:ai,70:ii,80:ri,90:oi,100:li},di="#fff2e8",hi="#ffd9be",ui="#ffb784",pi="#ff832b",gi="#eb6200",mi="#ba4e00",vi="#8a3800",fi="#5e2900",yi="#3e1a00",Ei="#231000",Oi={10:di,20:hi,30:ui,40:pi,50:gi,60:mi,70:vi,80:fi,90:yi,100:Ei},bi="#fff1f1",Si="#ffd7d9",xi="#ffb3b8",Ti="#ff8389",Mi="#fa4d56",Ci="#da1e28",Li="#a2191f",Ai="#750e13",Di="#520408",wi="#2d0709",Pi={10:bi,20:Si,30:xi,40:Ti,50:Mi,60:Ci,70:Li,80:Ai,90:Di,100:wi},Ri="#fff0f7",ki="#ffd6e8",Ii="#ffafd2",_i="#ff7eb6",Ui="#ee5396",Vi="#d02670",Bi="#9f1853",Ni="#740937",Gi="#510224",$i="#2a0a18",Hi={10:Ri,20:ki,30:Ii,40:_i,50:Ui,60:Vi,70:Bi,80:Ni,90:Gi,100:$i},zi="#f6f2ff",Fi="#e8daff",Wi="#d4bbff",ji="#be95ff",Zi="#a56eff",Xi="#8a3ffc",qi="#6929c4",Yi="#491d8b",Ki="#31135e",Ji="#1c0f30",Qi={10:zi,20:Fi,30:Wi,40:ji,50:Zi,60:Xi,70:qi,80:Yi,90:Ki,100:Ji},er="#edf5ff",tr="#d0e2ff",sr="#a6c8ff",nr="#78a9ff",ar="#4589ff",ir="#0f62fe",rr="#0043ce",or="#002d9c",lr="#001d6c",cr="#001141",dr={10:er,20:tr,30:sr,40:nr,50:ar,60:ir,70:rr,80:or,90:lr,100:cr},hr="#e5f6ff",ur="#bae6ff",pr="#82cfff",gr="#33b1ff",mr="#1192e8",vr="#0072c3",fr="#00539a",yr="#003a6d",Er="#012749",Or="#061727",br={10:hr,20:ur,30:pr,40:gr,50:mr,60:vr,70:fr,80:yr,90:Er,100:Or},Sr="#d9fbfb",xr="#9ef0f0",Tr="#3ddbd9",Mr="#08bdba",Cr="#009d9a",Lr="#007d79",Ar="#005d5d",Dr="#004144",wr="#022b30",Pr="#081a1c",Rr={10:Sr,20:xr,30:Tr,40:Mr,50:Cr,60:Lr,70:Ar,80:Dr,90:wr,100:Pr},kr="#defbe6",Ir="#a7f0ba",_r="#6fdc8c",Ur="#42be65",Vr="#24a148",Br="#198038",Nr="#0e6027",Gr="#044317",$r="#022d0d",Hr="#071908",zr={10:kr,20:Ir,30:_r,40:Ur,50:Vr,60:Br,70:Nr,80:Gr,90:$r,100:Hr},Fr="#f2f4f8",Wr="#dde1e6",jr="#c1c7cd",Zr="#a2a9b0",Xr="#878d96",qr="#697077",Yr="#4d5358",Kr="#343a3f",Jr="#21272a",Qr="#121619",eo={10:Fr,20:Wr,30:jr,40:Zr,50:Xr,60:qr,70:Yr,80:Kr,90:Jr,100:Qr},to="#f4f4f4",so="#e0e0e0",no="#c6c6c6",ao="#a8a8a8",io="#8d8d8d",ro="#6f6f6f",oo="#525252",lo="#393939",co="#262626",ho="#161616",uo={10:to,20:so,30:no,40:ao,50:io,60:ro,70:oo,80:lo,90:co,100:ho},po="#f7f3f2",go="#e5e0df",mo="#cac5c4",vo="#ada8a8",fo="#8f8b8b",yo="#726e6e",Eo="#565151",Oo="#3c3838",bo="#272525",So="#171414",xo={10:po,20:go,30:mo,40:vo,50:fo,60:yo,70:Eo,80:Oo,90:bo,100:So},nt={black:{100:Ka},blue:dr,coolGray:eo,cyan:br,gray:uo,green:zr,magenta:Hi,orange:Oi,purple:Qi,red:Pi,teal:Rr,warmGray:xo,white:{0:Ja},yellow:ci};const To=o=>{if(!o)return null;for(const e of Object.keys(nt)){const t=nt[e];for(const s of Object.keys(t))if(t[+s]===o)return s}return null},at=function(){const o=y.select(this.parentNode).select("rect.leaf"),e=getComputedStyle(o.node(),null).getPropertyValue("fill"),t=y.color(e);let s;if(t&&(s=To(t?t.hex():null)),s==null){const n=y.hsl(t).l;s=Math.abs(n*100-100)}return s>50?"white":"black"};let Mo=0;class Co extends G{constructor(){super(...arguments),this.type="treemap",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-treemap"})).attr("opacity",s=>s.parent.data.name===t.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer();this.model.getData();const s=this.model.getDisplayData(),n=this.model.getOptions(),a=c.getProperty(window,"location"),{width:i,height:l}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),d=y.hierarchy({name:n.title||"Treemap",children:s}).sum(f=>f.value).sort((f,b)=>b.value-f.value),h=y.treemap().size([i,l]).paddingInner(1).paddingOuter(0).round(!0)(d),u=t.selectAll("g[data-name='leaf']").data(h.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const p=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>Mo++).merge(u);p.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:e})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const g=p.selectAll("rect.leaf").data(f=>[f]);g.exit().attr("width",0).attr("height",0).remove(),g.enter().append("rect").classed("leaf",!0).merge(g).attr("width",0).attr("height",0).attr("id",function(){const f=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:e})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),p.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const b=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-clip-${b}`}).append("use").attr("xlink:href",function(){const b=y.select(this.parentNode.parentNode).attr("data-uid"),E=`${n.style.prefix}-leaf-${b}`;return new URL(`#${E}`,a)+""}),f=>null,f=>f.remove()),p.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let b=f;for(;b.depth>1;)b=b.parent;const E=y.hsl(this.model.getFillColor(b.data.name));return[{text:f.data.name,color:E.l<.5?"white":"black"}]},f=>f).join(f=>{const b=f.append("text").text(E=>E.text).style("fill",at).attr("x",7).attr("y",18);return a&&b.attr("clip-path",function(){const E=y.select(this.parentNode).attr("data-uid"),S=`${n.style.prefix}-clip-${E}`;return`url(${new URL(`#${S}`,a)+""})`}),b},f=>f.text(b=>b.text).style("fill",at),f=>f.remove()),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("rect.leaf").on("mouseover",function(t,s){const n=y.select(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),i=s;for(;i.depth>1;)i=i.parent;n.transition("graph_element_mouseover_fill_update").call(l=>e.services.transitions.setupTransition({transition:l,name:"graph_element_mouseover_fill_update"})).style("fill",l=>{const d=e.model.getFillColor(l.parent.data.name);return d&&(a=d),y.color(a).darker(.7).toString()}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:a,label:i.data.name,bold:!0},{label:s.data.name,value:s.data.value}]}),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Treemap.LEAF_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1);let a=s;for(;a.depth>1;)a=a.parent;n.transition().call(i=>e.services.transitions.setupTransition({transition:i,name:"graph_element_mouseout_fill_update"})).style("fill",i=>e.model.getFillColor(i.parent.data.name)),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}}class Lo extends G{constructor(){super(...arguments),this.type="wordcloud",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-wordcloud"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this,s=this.getComponentContainer().attr("width","100%").attr("height","100%"),n=this.model.getDisplayData(),a=this.getFontSizeScale(n),i=this.getOptions(),{fontSizeMapsTo:l,wordMapsTo:d}=i.wordCloud,{groupMapsTo:h}=i.data,{width:u,height:m}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});if(u===0||m===0)return;const p=Bt().size([u,m]).words(n.map(function(v){const f=v[l];if(typeof v[l]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[h]:v[h],text:v[d],size:f,value:f}})).padding(5).rotate(0).fontSize(v=>a(v.size)).on("end",g);p.start();function g(v){const f=O.DOMUtils.appendOrSelect(s,"g.words");f.attr("transform",`translate(${p.size()[0]/2}, ${p.size()[1]/2})`);const b=f.selectAll("text").data(v,S=>`${S[h]}-${S.text}`);b.exit().attr("opacity",0).remove(),b.enter().append("text").attr("opacity",0).merge(b).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>t.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:S[h],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>t.model.getFillColor(S[h],S.text,S)).attr("text-anchor","middle").transition().call(S=>t.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:e})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(e){const t=this.getOptions(),{fontSizeMapsTo:s}=t.wordCloud,n=e.map(d=>d[s]).filter(d=>d),a=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=n.length>0,l=i?y.extent(n):[1,1];return y.scaleLinear().domain(l).range(i?t.wordCloud.fontSizeRange(a,e):[4,4])}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=O.debounce(a=>{const i=s.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(l=>s.services.transitions.setupTransition({transition:l,name:"wordcloud-word-mouse-highlight"}));a===null?i.attr("opacity",1):i.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,i){const l=this;n(l),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOVER,{event:a,element:y.select(this),datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:e.tooltip.wordLabel,value:i.text},{label:e.tooltip.valueLabel,value:i.value},{label:e.tooltip.groupLabel,value:i[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[t]})}]})}).on("mousemove",function(a,i){const l=y.select(this);s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEMOVE,{element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.WordCloud.WORD_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const l=y.select(this);n(null),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOUT,{event:a,element:l,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:l})})}}class Vt extends G{constructor(){super(...arguments),this.type="geo",this.renderType=r.RenderTypes.SVG}render(){const e=this.getComponentContainer({withinChartClip:!0}),{width:t,height:s}=O.DOMUtils.getSVGElementSize(e,{useAttrs:!0});if(t<1||s<1)return;const n=this.getProjection(),a=c.getProperty(this.getOptions(),"geoData"),i=this.model.getCombinedData(),l={},d={};Object.keys(i).forEach(E=>{typeof i[E].value=="number"?l[E]=i[E]:d[E]=i[E]});const h=Oa(a,Object.values(d)),u=fa(a,{type:"GeometryCollection",geometries:Object.values(l)}),m=n.fitSize([t,s],u),p=y.geoPath().projection(m);O.DOMUtils.appendOrSelect(e,"g.geo").selectAll("path").data(u.features).join("path").attr("d",p);const v=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=O.DOMUtils.appendOrSelect(e,"defs");O.DOMUtils.appendOrSelect(f,"pattern").attr("id",v).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",y.line()([[0,0],[0,10]]));const b=O.DOMUtils.appendOrSelect(e,"g.missing-data");O.DOMUtils.appendOrSelect(b,"path").datum(h).attr("d",p).style("fill",`url(#${v})`)}getProjection(){let e=null;switch(c.getProperty(this.getOptions(),"thematic","projection")){case r.Projection.geoEqualEarth:e=y.geoEqualEarth();break;case r.Projection.geoAlbers:e=y.geoAlbers();break;case r.Projection.geoConicEqualArea:e=y.geoConicEqualArea();break;case r.Projection.geoConicEquidistant:e=y.geoConicEquidistant();break;case r.Projection.geoEquirectangular:e=y.geoEquirectangular();break;case r.Projection.geoMercator:e=y.geoMercator();break;case r.Projection.geoNaturalEarth1:e=y.geoNaturalEarth1();break;default:throw new Error("Projection is not supported.")}return e}}class Ao extends Vt{constructor(){super(...arguments),this.type="choropleth"}render(e=!0){super.render();const t=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:t[a.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const e=this,t=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOVER,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.SHOW,{event:s,hoveredElement:a,items:[{label:n.properties.NAME,value:t[n.properties.NAME].value}]})}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEMOVE,{event:s,element:y.select(this),datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_CLICK,{event:s,element:y.select(this),datum:t[n.properties.NAME]})}).on("mouseout",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOUT,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.HIDE,{event:s,hoveredElement:a})})}}exports.Alluvial=aa;exports.Area=ra;exports.Axis=Ue;exports.AxisChartsTooltip=na;exports.Bar=ve;exports.BinnedRuler=Sa;exports.Boxplot=da;exports.Bubble=ua;exports.Bullet=pa;exports.CanvasChartClip=Qn;exports.ChartBrush=kt;exports.ChartClip=Pt;exports.Choropleth=Ao;exports.CirclePack=_a;exports.ColorScaleLegend=ka;exports.Component=G;exports.Donut=Va;exports.Gauge=Ba;exports.GeoProjection=Vt;exports.Grid=ia;exports.GroupedBar=Na;exports.Heatmap=Ga;exports.Highlight=sa;exports.Histogram=$a;exports.HoverAxis=It;exports.LayoutComponent=Mt;exports.Legend=wt;exports.Line=oa;exports.Lollipop=Ha;exports.Meter=za;exports.MeterTitle=Ia;exports.Modal=Jn;exports.Pie=Ut;exports.Radar=Fa;exports.Ruler=_e;exports.Scatter=me;exports.SimpleBar=Wa;exports.Skeleton=_t;exports.SkeletonLines=ja;exports.Spacer=Us;exports.StackedArea=Za;exports.StackedBar=Xa;exports.StackedRuler=xa;exports.StackedScatter=qa;exports.Threshold=ta;exports.Title=Dt;exports.Toolbar=xt;exports.Tooltip=Rt;exports.Tree=Ya;exports.Treemap=Co;exports.TwoDimensionalAxes=ca;exports.WordCloud=Lo;exports.ZeroLine=ha;exports.ZoomBar=ea;exports.arrowLeft=La;exports.arrowRight=Aa;exports.buildBezierPathString=Ca;exports.buildElbowPathString=Ma;exports.buildStraightPathString=Ta;exports.circle=Da;exports.createCompounder=Et;exports.diamond=wa;exports.square=Pa;exports.tee=Ra;
|
|
82
|
-
//# sourceMappingURL=choropleth-
|
|
81
|
+
</svg>`}addEventListeners(){const e=this;this.parent.selectAll("circle.node").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0);const a=e.model.getHierarchyLevel(),i=a>2&&!n.classed("focal"),o=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");let d=!1;if(!i){let h=[],u=[],m=null;if(s.children){s.depth>1&&o&&(d=!0,n.classed("clickable",!0)),h=s.children.map(v=>{if(v!==null)return typeof v.data.value=="number"?{label:v.data.name,value:v.data.value}:{label:v.data.name,labelIcon:o&&a<=2?e.getZoomIcon():null,value:v.value}});const g=e.model.getOptions();u=[{label:c.get(g,"tooltip.totalLabel")||"Total",value:s.value,bold:!0}],e.highlightChildren(s.children)}else m=s.value;const p=getComputedStyle(this,null).getPropertyValue("fill");e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:p,label:s.data.name,labelIcon:d&&o&&a<=2?e.getZoomIcon():null,value:m},...h,...u]})}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),s.children&&e.unhighlightChildren(s.children),e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})}).on("click",function(t,s){const n=y.select(this),a=n.classed("non-focal"),i=c.getProperty(e.model.getOptions(),"canvasZoom","enabled");if(i&&e.model.getHierarchyLevel()>2){const o=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!1),e.focal=null,e.model.updateHierarchyLevel(2),e.services.canvasZoom.zoomOut(o,c.canvasZoomSettings)}else if(s.depth===2&&s.children&&!a&&i){const o=e.parent.selectAll("circle.node");y.select(e.services.domUtils.getMainContainer()).classed("zoomed-in",!0),e.focal=s,e.model.updateHierarchyLevel(3),e.services.canvasZoom.zoomIn(s,o,c.canvasZoomSettings),t.stopPropagation()}e.services.events.dispatchEvent(r.Events.CirclePack.CIRCLE_CLICK,{event:t,element:n,datum:s})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function Ua(l,e){const t=y.interpolate(this._current,l);return s=>(this._current=t(s),e(this._current))}class Ut extends G{constructor(){super(...arguments),this.type="pie",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n.data[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return c.pie.innerRadius}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),{groupMapsTo:a}=n.data,{valueMapsTo:i}=n.pie,o=this.model.getDisplayData().filter(L=>L[i]>0),d=this.computeRadius();this.arc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d),this.hoverArc=y.arc().innerRadius(this.getInnerRadius()).outerRadius(d+c.pie.hoverArc.outerRadiusOffset);const u=y.pie().value(L=>L[i]).sort(c.getProperty(n,"pie","sortFunction")).padAngle(c.pie.padAngle)(o),p=O.DOMUtils.appendOrSelect(s,"g.slices").attr("role",B.Roles.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,L=>L.data[a]);p.exit().attr("opacity",0).remove(),p.enter().append("path").classed("slice",!0).attr("opacity",0).merge(p).attr("class",L=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:L.data[a],originalClassName:"slice"})).style("fill",L=>t.model.getFillColor(L.data[a])).attr("d",this.arc).transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"pie_slice_enter_update",animate:e})).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",L=>`${L[i]}, ${c.convertValueToPercentage(L.data[i],o,i)+"%"}`).attrTween("d",function(L){return Ua.bind(this)(L,t.arc)});const f=n.pie.labels.enabled,b=f?u.filter(L=>L.data[i]>0):[],S=O.DOMUtils.appendOrSelect(s,"g.labels").attr("role",B.Roles.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(b,L=>L.data[a]);S.exit().attr("opacity",0).remove();const T=S.enter().append("text").classed("pie-label",!0),C=[];T.merge(S).style("text-anchor","middle").text(L=>n.pie.labels.formatter?n.pie.labels.formatter(L):c.convertValueToPercentage(L.data[i],o,i)+"%").datum(function(L){const V=d+7,k=(L.endAngle-L.startAngle)/2+L.startAngle,F=k/Math.PI*180,q=this.getComputedTextLength();return L.textOffsetX=q/2,L.textOffsetY=F>90&&F<270?10:0,L.xPosition=(L.textOffsetX+V)*Math.sin(k),L.yPosition=(L.textOffsetY+V)*-Math.cos(k),L}).attr("transform",function(L,V){const k=b.length,F=(L.endAngle-L.startAngle)*(180/Math.PI);if(V>=k-2&&F<c.pie.callout.minSliceDegree){let q,H;return L.index===k-1?(q=L.xPosition+c.pie.callout.offsetX+c.pie.callout.textMargin+L.textOffsetX,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.RIGHT,C.push(L)):(q=L.xPosition-c.pie.callout.offsetX-L.textOffsetX-c.pie.callout.textMargin,H=L.yPosition-c.pie.callout.offsetY,L.direction=r.CalloutDirections.LEFT,C.push(L)),`translate(${q}, ${H})`}return`translate(${L.xPosition}, ${L.yPosition})`}),this.renderCallouts(C);const M=c.getProperty(n,"donut")?"donut":"pie",x=c.getProperty(n,M,"alignment"),{width:w}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=f?c.pie.xOffset:0,$=f?c.pie.yOffset:0;let _=d+P;x===r.Alignments.CENTER?_=w/2:x===r.Alignments.RIGHT&&(_=w-d-c.pie.xOffset);let A=d+$;C.length>0&&(A+=c.pie.yOffsetCallout),s.attr("x",_+7).attr("y",A),this.addEventListeners()}renderCallouts(e){const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",B.Roles.GROUP).attr("data-name","callouts"),s=t.selectAll("g.callout").data(e);s.exit().remove();const n=s.enter().append("g").classed("callout",!0).attr("role",B.Roles.GROUP).attr("aria-roledescription","label callout");n.merge(s).datum(function(o){const{xPosition:d,yPosition:h,direction:u}=o;return u===r.CalloutDirections.RIGHT?(o.startPos={x:d,y:h+o.textOffsetY},o.endPos={x:d+c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-c.pie.callout.horizontalLineLength):(o.startPos={x:d,y:h+o.textOffsetY},o.endPos={x:d-c.pie.callout.offsetX,y:h-c.pie.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+c.pie.callout.horizontalLineLength),o}),n.append("line").classed("vertical-line",!0).merge(t.selectAll("line.vertical-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),n.append("line").classed("horizontal-line",!0).merge(t.selectAll("line.horizontal-line")).datum(function(){return y.select(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const e=this;this.parent.selectAll("path.slice").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>e.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",e.hoverArc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOVER,{event:t,element:y.select(this),datum:s});const{groupMapsTo:a}=e.getOptions().data,{valueMapsTo:i}=e.getOptions().pie;e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{label:s.data[a],value:s.data[i]}]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Pie.SLICE_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1).transition("pie_slice_mouseout").call(a=>e.services.transitions.setupTransition({transition:a,name:"pie_slice_mouseout"})).attr("d",e.arc),e.services.events.dispatchEvent(r.Events.Pie.SLICE_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}computeRadius(){const{width:e,height:t}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}),s=this.getOptions(),n=Math.min(e,t)/2;return s.pie.labels.enabled?n+c.pie.radiusOffset:n}}class Va extends Ut{constructor(){super(...arguments),this.type="donut",this.renderType=r.RenderTypes.SVG}render(e=!0){super.render(e);const t=this;if(this.model.isDataEmpty()){this.getComponentContainer().select("g.center").remove();return}const s=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.center"),n=this.getOptions(),a=this.computeRadius(),i=c.getProperty(n,"donut","center","label");O.DOMUtils.appendOrSelect(s,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>i===null||i===""?"central":"initial").style("font-size",()=>n.donut.center.numberFontSize(a)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:e})).tween("text",function(){return t.centerNumberTween(y.select(this))}),i!==null&&i!==""&&O.DOMUtils.appendOrSelect(s,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>n.donut.center.titleFontSize(a)).attr("y",n.donut.center.titleYPosition(a)).text(i)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(e){const t=this.getOptions();let s=c.getProperty(t,"donut","center","number");s===null&&(s=this.model.getDisplayData().reduce((o,d)=>o+d[t.pie.valueMapsTo],0));const n=parseInt(e.text().replace(/[, ]+/g,""),10)||0;let a;n%1===0&&s%1===0?a=y.interpolateRound:a=y.interpolateNumber;const i=a(n,s);return o=>{const{numberFormatter:d}=t.donut.center;e.text(d(i(o)))}}}const rt="4,10 8,6 12,10",ot="12,6 8,10 4,6";class Na extends G{constructor(){super(...arguments),this.type="gauge",this.renderType=r.RenderTypes.SVG}getValue(){var s;return((s=this.model.getData().find(n=>n.group==="value"))==null?void 0:s.value)??null}getValueRatio(){return Mt(this.getValue(),0,100)/100}getDelta(){var s;return((s=this.model.getData().find(n=>n.group==="delta"))==null?void 0:s.value)??null}getArcRatio(){const e=this.getOptions();return c.getProperty(e,"gauge","type")===r.GaugeTypes.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const e=this.getArcSize();return e===2*Math.PI?0:-e/2}getArrow(e){const t=this.getOptions();switch(c.getProperty(t,"gauge","deltaArrow","direction")){case r.ArrowDirections.UP:return rt;case r.ArrowDirections.DOWN:return ot;default:return e>0?rt:ot}}render(e=!0){const t=this.getComponentContainer().attr("width","100%").attr("height","100%"),s=this.getOptions(),n=this.getValue(),a=this.getValueRatio(),i=this.getArcSize(),o=this.getStartAngle(),d=a*i,h=o+d,u=o+i,m=this.computeRadius(),p=this.getInnerRadius();this.backgroundArc=y.arc().innerRadius(p).outerRadius(m).startAngle(h).endAngle(u),this.arc=y.arc().innerRadius(p).outerRadius(m).startAngle(o).endAngle(h),O.DOMUtils.appendOrSelect(t,"path.arc-background").attr("d",this.backgroundArc);const g=t.selectAll("path.arc-foreground").data([n]);g.enter().append("path").merge(g).attr("class",this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>c.getProperty(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),g.exit().remove();const f=c.getProperty(s,"gauge","alignment"),{width:b}=O.DOMUtils.getSVGElementSize(this.getParent(),{useAttrs:!0});let E=m;f===r.Alignments.CENTER?E=b/2:f===r.Alignments.RIGHT&&(E=b-m),t.attr("x",E).attr("y",m),this.addEventListeners()}drawValueNumber(){const e=this.getComponentContainer(),t=this.getOptions(),s=c.getProperty(t,"gauge","type"),n=this.getValue(),a=this.getDelta(),i=this.computeRadius(),o=c.getProperty(t,"gauge","valueFontSize"),d=c.getProperty(t,"gauge","deltaFontSize"),h=c.getProperty(t,"gauge","numberSpacing"),u=c.getProperty(t,"gauge","showPercentageSymbol");let m=0;s===r.GaugeTypes.FULL&&!a?m=d(i):s===r.GaugeTypes.SEMI&&a&&(m=-(d(i)+h));const p=O.DOMUtils.appendOrSelect(e,"g.gauge-numbers").attr("transform",`translate(0, ${m})`),g=o(i),v=O.DOMUtils.appendOrSelect(p,"g.gauge-value-number"),f=c.getProperty(t,"gauge","numberFormatter"),b=v.selectAll("text.gauge-value-number").data([n]);b.enter().append("text").attr("class","gauge-value-number").merge(b).style("font-size",`${g}px`).attr("text-anchor","middle").text(w=>f(w));const{width:E}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(e,"text.gauge-value-number"),{useBBox:!0}),S=g/2,T=u?"%":"",C=O.DOMUtils.appendOrSelect(v,"text.gauge-value-symbol").style("font-size",`${S}px`).attr("x",E/2).text(T),{width:M,height:x}=O.DOMUtils.getSVGElementSize(C,{useBBox:!0});C.attr("y",`-${x/2}px`),v.attr("transform",`translate(-${M/2}, 0)`)}drawDelta(){const e=this,t=this.getComponentContainer(),s=this.getOptions(),n=this.getDelta();if(n){const a=this.computeRadius(),i=n?c.getProperty(s,"gauge","deltaFontSize"):()=>0,o=n?c.getProperty(s,"gauge","numberFormatter"):()=>null,d=c.getProperty(s,"gauge","deltaArrow","size"),h=c.getProperty(s,"gauge","numberSpacing"),u=c.getProperty(s,"gauge","showPercentageSymbol"),m=O.DOMUtils.appendOrSelect(t,"g.gauge-numbers"),p=O.DOMUtils.appendOrSelect(m,"g.gauge-delta").attr("transform",`translate(0, ${i(a)+h})`),g=O.DOMUtils.appendOrSelect(p,"text.gauge-delta-number"),v=u?"%":"";g.data(n===null?[]:[n]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${i(a)}px`).text(S=>`${o(S)}${v}`);const{width:f}=O.DOMUtils.getSVGElementSize(O.DOMUtils.appendOrSelect(t,".gauge-delta-number"),{useBBox:!0}),b=c.getProperty(s,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(n!==null&&b?[n]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-d(a)-f/2).attr("y",-d(a)/2-i(a)*.35).attr("width",d(a)).attr("height",d(a)).attr("viewBox","0 0 16 16").each(function(){const S=y.select(this);O.DOMUtils.appendOrSelect(S,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const T=c.getProperty(s,"gauge","status");O.DOMUtils.appendOrSelect(S,"polygon.gauge-delta-arrow").attr("class",T!==null?`gauge-delta-arrow status--${T}`:"").attr("points",e.getArrow(n))}),E.exit().remove(),g.exit().remove()}else{const a=t.select("g.gauge-delta");a.empty()||a.remove()}}getInnerRadius(){const e=this.computeRadius(),t=c.getProperty(this.getOptions(),"gauge","arcWidth");return e-t}addEventListeners(){const e=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOVER,{event:t,element:y.select(this),datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEMOVE,{event:t,element:n,datum:s})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Gauge.ARC_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Gauge.ARC_MOUSEOUT,{event:t,element:n,datum:s})})}computeRadius(){const e=this.getOptions(),t=c.getProperty(e,"gauge","type"),{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});return t===r.GaugeTypes.SEMI?Math.min(s/2,n):Math.min(s/2,n/2)}}class Ba extends ye{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=r.RenderTypes.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.model.getDisplayData(this.configs.groups),s=this.getOptions(),{groupMapsTo:n}=s.data;this.setGroupScale();const a=this.getComponentContainer({withinChartClip:!0}),i=c.removeArrayDuplicates(t.map(p=>{const g=this.services.cartesianScales.getDomainIdentifier(p);return p[g]&&typeof p[g].toString=="function"?p[g].toString():p[g]})),o=a.selectAll("g.bars").data(i,p=>p);o.exit().attr("opacity",0).remove();const h=o.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP).attr("data-name","bars").merge(o);h.transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-group-update-enter",animate:e})).attr("transform",p=>{const v=this.services.cartesianScales.getDomainValue(p)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?`translate(${v}, 0)`:`translate(0, ${v})`});const u=h.selectAll("path.bar").data(p=>this.getDataCorrespondingToLabel(p),p=>p[n]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"bar-update-enter",animate:e})).attr("class",p=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:p[n],originalClassName:"bar"})).style("fill",p=>this.model.getFillColor(p[n])).attr("d",p=>{const g=this.groupScale(p[n]),v=this.getBarWidth(),f=g,b=g+v,E=this.services.cartesianScales.getRangeAxisPosition({datum:p}),S=this.services.cartesianScales.getValueThroughAxisPosition(E,0),T=this.services.cartesianScales.getRangeValue(p),C=this.services.cartesianScales.getDomainValue(p)-v/2,M=C+v;if(!this.isOutsideZoomedDomain(C,M))return c.generateSVGPathString({x0:f,x1:b,y0:S,y1:T},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",p=>p.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(e){return this.model.getDisplayData(this.configs.groups).filter(s=>{const n=this.services.cartesianScales.getDomainIdentifier(s);return s[n].toString()===e})}getGroupWidth(){const e=this.model.getGroupedData(this.configs.groups),t=this.getTotalGroupPadding();return this.getBarWidth()*e.length+t}getDomainScaleStep(){const e=this.services.cartesianScales.getDomainScale(),t=this.model.getGroupedData(this.configs.groups);let s=this.defaultStepFactor;if(typeof e.step=="function")s=e.step();else if(t.length>0){const n=t.find(a=>{var i;return((i=a.data)==null?void 0:i.length)>1});if(n){const a=this.services.cartesianScales.getDomainIdentifier(n.data[0]);s=Math.abs(e(n.data[1][a])-e(n.data[0][a]))}}return s}getTotalGroupPadding(){const e=this.model.getGroupedData(this.configs.groups);return e.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(e.length-1)}getBarWidth(){const e=this.getOptions(),t=c.getProperty(e,"bars","width"),s=c.getProperty(e,"bars","maxWidth");if(t!==null&&(s===null||t<=s))return t;const a=this.model.getGroupedData(this.configs.groups).length,i=this.getTotalGroupPadding();return Math.min(s,(this.getDomainScaleStep()-i)/a)}setGroupScale(){const e=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=y.scaleBand().domain(e).rangeRound([0,this.getGroupWidth()])}}class Ga extends G{constructor(){super(...arguments),this.type="heatmap",this.renderType=r.RenderTypes.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=e=>{const{detail:t}=e,{datum:s}=t,n=this.model.getUniqueRanges(),a=this.model.getUniqueDomain(),i=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),d=this.services.cartesianScales.getMainXScale(),h=this.services.cartesianScales.getMainYScale();let u="",m=null,p=null,g=null;this.matrix[s]!==void 0?(u=i,n.forEach(v=>{if(typeof this.matrix[s][v].value=="number"){const f=this.matrix[s][v].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})):(u=o,a.forEach(v=>{if(typeof this.matrix[v][s].value=="number"){const f=this.matrix[v][s].value;if(m===null){m=f,p=f,g=f;return}m+=f,p=f<p?f:p,g=f>g?f:g}})),d(s)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${d(s)}, ${y.min(h.range())})`):h(s)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${y.min(d.range())},${h(s)})`),this.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t.event,hoveredElement:y.select(e.detail.element),items:[{label:u,value:s,bold:!0},{label:"Min",value:p!==null?p:"-"},{label:"Max",value:g!==null?g:"-"},{label:"Average",value:m!==null?m/a.length:"-"}]})},this.handleAxisMouseOut=e=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:e})}}init(){const e=this.services.events;e.addEventListener(r.Events.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),e.addEventListener(r.Events.Axis.LABEL_FOCUS,this.handleAxisOnHover),e.addEventListener(r.Events.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0});t.lower();const{cartesianScales:s}=this.services;if(this.matrix=this.model.getMatrix(),t.html(""),c.getProperty(this.getOptions(),"data","loading"))return;const n=s.getMainXScale(),a=s.getMainYScale(),i=s.getDomainIdentifier(),o=s.getRangeIdentifier(),d=this.model.getUniqueDomain(),h=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),m=n.range(),p=a.range();this.xBandwidth=Math.abs((m[1]-m[0])/d.length),this.yBandwidth=Math.abs((p[1]-p[0])/h.length);const g=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");t.append("defs").append("pattern").attr("id",g).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const v=t.selectAll().data(u).enter().append("g").attr("class",f=>`heat-${f.index}`).classed("cell",!0).attr("transform",f=>`translate(${n(f[i])}, ${a(f[o])})`).append("rect").attr("class",f=>this.model.getColorClassName({value:f.value,originalClassName:`heat-${f.index}`})).classed("heat",!0).classed("null-state",f=>f.index===-1||f.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",f=>f.index===-1||f.value===null?`url(#${g})`:this.model.getFillColor(Number(f.value))).attr("aria-label",f=>f.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(p[1]-p[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(m[1]-m[0]),this.yBandwidth),this.determineDividerStatus()&&(v.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(e,t,s){const n=O.DOMUtils.appendOrSelect(this.parent,e).classed("shadows",!0).classed("highlighter-hidden",!0);O.DOMUtils.appendOrSelect(n,"line.top").attr("x1",-1).attr("x2",t+1),O.DOMUtils.appendOrSelect(n,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",s+1),O.DOMUtils.appendOrSelect(n,"line.down").attr("x1",-1).attr("x2",t+1).attr("y1",s).attr("y2",s),O.DOMUtils.appendOrSelect(n,"line.right").attr("x1",t).attr("x2",t).attr("y1",-1).attr("y2",s+1)}determineDividerStatus(){const e=c.getProperty(this.getOptions(),"heatmap","divider","state");return e!==r.DividerStatus.OFF&&(e===r.DividerStatus.AUTO&&c.heatmap.minCellDividerDimension<=this.xBandwidth&&c.heatmap.minCellDividerDimension<=this.yBandwidth||e===r.DividerStatus.ON)}addEventListener(){const e=this,{cartesianScales:t}=this.services,s=this.getOptions(),n=c.get(s,"tooltip.totalLabel"),a=t.getDomainIdentifier(),i=t.getRangeIdentifier(),o=t.getDomainLabel(),d=t.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(h,u){const m=y.select(this),p=m.select("rect.heat");if(!p.classed("null-state")){const v=c.getTransformOffsets(m.attr("transform"));e.parent.select("g.cell-highlight").attr("transform",`translate(${v.x+e.translationUnits.x}, ${v.y+e.translationUnits.y})`).classed("highlighter-hidden",!1),e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOVER,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:h,items:[{label:o,value:u[a]},{label:d,value:u[i]},{label:n||"Total",value:u.value,color:p.style("fill")}]})}}).on("mousemove",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEMOVE,{event:h,element:y.select(this),datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:h})}).on("click",function(h,u){e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_CLICK,{event:h,element:y.select(this),datum:u})}).on("mouseout",function(h,u){const p=y.select(this).select("rect.heat"),g=p.classed("null-state");e.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),g||(e.services.events.dispatchEvent(r.Events.Heatmap.HEATMAP_MOUSEOUT,{event:h,element:p,datum:u}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{event:h,hoveredElement:p}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleAxisOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class $a extends G{constructor(){super(...arguments),this.type="histogram",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-bar"})).attr("opacity",a=>a[n]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer(),s=this.model.getOptions(),{groupIdentifier:n}=s,{groupMapsTo:a}=s.data,i=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),d=t.selectAll("g.bars").data(i,u=>c.get(u,`0.${a}`));d.exit().attr("opacity",0).remove(),d.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP);const h=t.selectAll("g.bars").selectAll("path.bar").data(u=>u);h.exit().remove(),h.enter().append("path").merge(h).classed("bar",!0).attr(n,(u,m)=>m).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:e})).attr("class",u=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:u[a],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[a])).attr("d",u=>{const m=c.get(u,"data");if(!m)return;const p=o(m.x1)-o(m.x0)-1,g=this.services.cartesianScales.getDomainValue(m.x0),v=g+p,f=this.services.cartesianScales.getRangeValue(u[0]);let b=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(b-f)>0&&Math.abs(b-f)>s.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?b+=1:b-=1),c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>c.getProperty(u,"data",u[a])),this.addEventListeners()}addEventListeners(){const e=this.model.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0);const o=parseFloat(c.get(a,"data.x0")),d=parseFloat(c.get(a,"data.x1")),h=s.services.cartesianScales.getRangeAxisPosition(),u=s.services.cartesianScales.getScaleLabel(h);s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:c.get(e,"bins.rangeLabel")||"Range",value:`${o} – ${d}`},{label:e.tooltip.groupLabel||"Group",value:a[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:a[t]})},{label:u,value:c.get(a,`data.${a[t]}`)}]})}).on("mousemove",function(n){s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("mouseout",function(){y.select(this).classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class Ha extends fe{constructor(){super(...arguments),this.type="lollipop",this.renderType=r.RenderTypes.SVG,this.handleScatterOnHover=e=>{const t=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").attr("stroke-width",a=>a[n]!==t.datum[n]?c.lines.weight.unselected:c.lines.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",c.lines.weight.unselected)},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-line"})).attr("opacity",a=>a[n]!==t.datum().name?c.lines.opacity.unselected:c.lines.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-line"})).attr("opacity",c.lines.opacity.selected)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.model.getOptions(),{groupMapsTo:n}=s.data,{cartesianScales:a}=this.services,i=a.getMainXScale(),o=a.getMainYScale(),d=a.getDomainIdentifier(),h=E=>a.getDomainValue(E),u=E=>a.getRangeValue(E),m=a.getOrientation(),[p,g]=c.flipDomainAndRangeBasedOnOrientation(h,u,m),v=t.selectAll("line.line").data(this.getScatterData(),E=>`${E[n]}-${E[d]}`);v.exit().attr("opacity",0).remove();const b=v.enter().append("line").attr("opacity",0).merge(v).classed("line",!0).attr("class",E=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.STROKE],dataGroupName:E[n],originalClassName:"line"})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"lollipop-line-update-enter",animate:e})).style("stroke",E=>this.model.getFillColor(E[n],E[d],E)).attr("opacity",1);m===r.CartesianOrientations.HORIZONTAL?b.attr("y1",g).attr("y2",g).attr("x1",i.range()[0]).attr("x2",E=>p(E)-s.points.radius):b.attr("x1",p).attr("x2",p).attr("y1",o.range()[0]).attr("y2",E=>g(E)+s.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),e.removeEventListener(r.Events.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class za extends G{constructor(){super(...arguments),this.type="meter",this.renderType=r.RenderTypes.SVG}getStackedBounds(e,t){let s=0;return e.map((a,i)=>i!==0?(s+=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:s-t(a.value)}):(s=t(a.value),{...a,width:Math.abs(t(a.value)-c.meter.dividerWidth),x:0}))}render(e=!0){const t=this,s=this.getComponentContainer(),n=this.getOptions(),a=c.getProperty(n,"meter","proportional"),i=this.model.getDisplayData(),o=this.model.getStatus(),{width:d}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0}),{groupMapsTo:h}=n.data;let u;if(c.getProperty(n,"meter","proportional")===null)u=100;else{const T=c.getProperty(n,"meter","proportional","total");u=T||this.model.getMaximumDomain(this.model.getDisplayData())}const m=y.scaleLinear().domain([0,u]).range([0,d]),p=this.getStackedBounds(i,m),g=c.getProperty(n,"meter","height");O.DOMUtils.appendOrSelect(s,"rect.container").attr("x",0).attr("y",0).attr("width",d).attr("height",g||(a?c.meter.height.proportional:c.meter.height.default)),O.DOMUtils.appendOrSelect(s,"line.rangeIndicator").attr("x1",d).attr("x2",d).attr("y1",0).attr("y2",g||(a?c.meter.height.proportional:c.meter.height.default));const v=s.selectAll("rect.value").data(p),f=o!=null&&!t.model.isUserProvidedColorScaleValid()&&!a?`value status--${o}`:"value";v.enter().append("rect").classed("value",!0).merge(v).attr("x",T=>T.x).attr("y",0).attr("height",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).attr("class",T=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:T[h],originalClassName:f})).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"meter-bar-update",animate:e})).attr("width",T=>T.value>u?m(u):T.width).style("fill",T=>t.model.getFillColor(T[h])).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",T=>T.value),v.exit().remove();const b=c.getProperty(n,"meter","peak");let E=b;b!==null&&(b>u?E=u:b<i[0].value&&(E=i[0].value>u?u:i[0].value));const S=s.selectAll("line.peak").data(E==null?[]:[E]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>g||(a?c.meter.height.proportional:c.meter.height.default)).transition().call(T=>this.services.transitions.setupTransition({transition:T,name:"peak-line-update",animate:e})).attr("x1",T=>m(T)).attr("x2",T=>m(T)).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",T=>T),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=c.getProperty(e,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOVER,{event:a,element:o,datum:i}),n&&(o.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:i[t],value:i.value}]}))}).on("mousemove",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEMOVE,{event:a,element:o,datum:i}),n&&s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.Meter.METER_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.Meter.METER_MOUSEOUT,{event:a,element:o,datum:i}),n&&(o.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}class Fa extends G{constructor(){super(...arguments),this.type="radar",this.renderType=r.RenderTypes.SVG,this.getLabelDimensions=e=>{const t=O.DOMUtils.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),s=O.DOMUtils.appendOrSelect(t,"text").text(e),{width:n,height:a}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return t.remove(),{width:n,height:a}},this.normalizeFlatData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo"),i=Rs(this.uniqueKeys.map(o=>this.uniqueGroups.map(d=>({[s]:o,[a]:d,[n]:null}))));return c.merge(i,e)},this.normalizeGroupedData=e=>{const t=this.getOptions(),{angle:s,value:n}=c.getProperty(t,"radar","axes"),a=c.getProperty(t,"data","groupMapsTo");return e.map(({name:i,data:o})=>{const d=this.uniqueKeys.map(h=>({[a]:i,[s]:h,[n]:null}));return{name:i,data:c.merge(d,o)}})},this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-blob"})).style("fill-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:c.radar.opacity.selected).style("stroke-opacity",s=>s.name!==t.datum().name?c.radar.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-blob"})).style("fill-opacity",c.radar.opacity.selected).style("stroke-opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer(),{width:s,height:n}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),a=this.model.getData(),i=this.model.getGroupedData(),o=this.getOptions(),d=c.getProperty(o,"data","groupMapsTo"),h=c.getProperty(o,"radar","axes","value"),{angle:u,value:m}=c.getProperty(o,"radar","axes"),{xLabelPadding:p,yLabelPadding:g,yTicksNumber:v,minRange:f,xAxisRectHeight:b}=c.radar;this.uniqueKeys=Array.from(new Set(a.map(D=>D[u]))),this.uniqueGroups=Array.from(new Set(a.map(D=>D[d]))),this.fullDataNormalized=this.normalizeFlatData(a),this.groupedDataNormalized=this.normalizeGroupedData(i);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+g),M=(Math.min(s,n)-S)/2;if(M<=0)return;const x=y.scaleBand().domain(this.fullDataNormalized.map(D=>D[u])).range([0,2*Math.PI].map(D=>D-Math.PI/2)),w=y.min(this.fullDataNormalized.map(D=>D[m])),P=y.scaleLinear().domain([w>=0?0:w,y.max(this.fullDataNormalized.map(D=>D[m]))]).range([f,M]).nice(v),$=P.ticks(v),_=D=>this.model.getFillColor(D),A=y.lineRadial().angle(D=>x(D[u])+Math.PI/2).radius(D=>P(D[m])).curve(y.curveLinearClosed),L=this.uniqueKeys.map(D=>{const R=this.getLabelDimensions(D).width,I=O.distanceBetweenPointOnCircAndVerticalDiameter(x(D),M);return R+I}),k={x:y.max(L)+p,y:n/2},q=O.DOMUtils.appendOrSelect(t,"g.y-axes").attr("role",B.Roles.GROUP).selectAll("path").data($,D=>D),H=D=>this.uniqueKeys.map(R=>({[u]:R,[m]:D}));q.join(D=>D.append("path").attr("opacity",0).attr("transform",`translate(${k.x}, ${k.y})`).attr("fill","none").call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_enter",animate:e})).attr("opacity",1).attr("d",I=>A(H(I)))),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_update",animate:e})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",I=>A(H(I)))),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_axes_exit",animate:e})).attr("d",I=>A(H(I))).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-axes").attr("role",B.Roles.GROUP).selectAll("line").data(this.uniqueKeys,D=>D).join(D=>D.append("line").attr("opacity",0).attr("class",R=>`x-axis-${J(R)}`).attr("stroke-dasharray","0").attr("x1",R=>O.polarToCartesianCoords(x(R),0,k).x).attr("y1",R=>O.polarToCartesianCoords(x(R),0,k).y).attr("x2",R=>O.polarToCartesianCoords(x(R),0,k).x).attr("y2",R=>O.polarToCartesianCoords(x(R),0,k).y).call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_enter",animate:e})).attr("opacity",1).attr("x1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).x).attr("y1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).y).attr("x2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).x).attr("y2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_update",animate:e})).attr("opacity",1).attr("x1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).x).attr("y1",I=>O.polarToCartesianCoords(x(I),P.range()[0],k).y).attr("x2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).x).attr("y2",I=>O.polarToCartesianCoords(x(I),P.range()[1],k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_axes_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.x-labels").attr("role",B.Roles.GROUP).selectAll("text").data(this.uniqueKeys).join(D=>D.append("text").text(R=>R).attr("opacity",0).attr("x",R=>O.polarToCartesianCoords(x(R),P.range()[1]+p,k).x).attr("y",R=>O.polarToCartesianCoords(x(R),P.range()[1]+p,k).y).style("text-anchor",R=>O.radialLabelPlacement(x(R)).textAnchor).style("dominant-baseline",R=>O.radialLabelPlacement(x(R)).dominantBaseline).call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_update",animate:e})).attr("opacity",1).attr("x",I=>O.polarToCartesianCoords(x(I),P.range()[1]+p,k).x).attr("y",I=>O.polarToCartesianCoords(x(I),P.range()[1]+p,k).y).end().finally(()=>{const I=c.getProperty(o,"radar","alignment"),K=this.getAlignmentXOffset(I,t,this.getParent());t.attr("x",K)})),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_x_labels_exit",animate:e})).attr("opacity",0).remove())),O.DOMUtils.appendOrSelect(t,"g.blobs").attr("role",B.Roles.GROUP).selectAll("path").data(this.groupedDataNormalized,D=>D.name).join(D=>D.append("path").attr("class",R=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:R.name,originalClassName:"blob"})).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-label",R=>R.name).attr("opacity",0).attr("transform",e?()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`:`translate(${k.x}, ${k.y})`).style("fill",R=>_(R.name)).style("fill-opacity",c.radar.opacity.selected).style("stroke",R=>_(R.name)).call(R=>{const I=R.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_enter",animate:e}));e&&I.delay(()=>Math.random()*30).attr("transform",`translate(${k.x}, ${k.y})`),I.attr("opacity",1).attr("d",K=>A(K.data))}),D=>(D.attr("class",R=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL,r.ColorClassNameTypes.STROKE],dataGroupName:R.name,originalClassName:"blob"})).style("fill",R=>_(R.name)).style("stroke",R=>_(R.name)),D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_blobs_update",animate:e})).attr("opacity",1).attr("transform",`translate(${k.x}, ${k.y})`).attr("d",I=>A(I.data))),D),D=>D.call(R=>{const I=R.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"radar_blobs_exit",animate:e}));e&&I.delay(()=>Math.random()*30).attr("transform",()=>`translate(${k.x}, ${k.y}) scale(${1+Math.random()*.35})`),I.attr("opacity",0).remove()})),O.DOMUtils.appendOrSelect(t,"g.dots").attr("role",B.Roles.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(D=>c.getProperty(D,m)!==null)).join(D=>D.append("circle").attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-label",R=>R[h]),D=>D,D=>D.remove()).attr("class",D=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:D[d],originalClassName:J(D[u])})).attr("cx",D=>O.polarToCartesianCoords(x(D[u]),P(D[m]),k).x).attr("cy",D=>O.polarToCartesianCoords(x(D[u]),P(D[m]),k).y).attr("r",0).attr("opacity",0).style("fill",D=>_(D[d])),O.DOMUtils.appendOrSelect(t,"g.x-axes-rect").attr("role",B.Roles.GROUP).selectAll("rect").data(this.uniqueKeys).join(D=>D.append("rect"),D=>D,D=>D.remove()).attr("x",k.x).attr("y",k.y-b/2).attr("width",P.range()[1]).attr("height",b).style("fill","red").style("fill-opacity",0).attr("transform",D=>`rotate(${O.radToDeg(x(D))}, ${k.x}, ${k.y})`),O.DOMUtils.appendOrSelect(t,"g.y-labels").attr("role",B.Roles.GROUP).selectAll("text").data(y.extent($)).join(D=>D.append("text").attr("opacity",0).text(R=>R).attr("x",R=>O.polarToCartesianCoords(-Math.PI/2,P(R),k).x+g).attr("y",R=>O.polarToCartesianCoords(-Math.PI/2,P(R),k).y).style("text-anchor","start").style("dominant-baseline","middle").call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_enter",animate:e})).attr("opacity",1)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_update",animate:e})).text(I=>I).attr("opacity",1).attr("x",I=>O.polarToCartesianCoords(-Math.PI/2,P(I),k).x+g).attr("y",I=>O.polarToCartesianCoords(-Math.PI/2,P(I),k).y)),D=>D.call(R=>R.transition().call(I=>this.services.transitions.setupTransition({transition:I,name:"radar_y_labels_exit",animate:e})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(e,t,s){const n=O.DOMUtils.getSVGElementSize(t,{useBBox:!0}),{width:a}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});let i=0;return e===r.Alignments.CENTER?i=Math.floor((a-n.width)/2):e===r.Alignments.RIGHT&&(i=a-n.width),i}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const e=this,{axes:{angle:t}}=c.getProperty(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOVER,{event:s,element:a,datum:n});const i=e.parent.select(`.x-axes .x-axis-${J(n)}`),o=e.parent.selectAll(`.dots circle.${J(n)}`),d=e.model.getActiveDataGroupNames(),h=e.getOptions(),{groupMapsTo:u}=h.data,m=c.getProperty(h,"radar","axes","value");i.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",g=>d.indexOf(g[u])!==-1?1:0).attr("r",c.radar.dotsRadius);const p=e.fullDataNormalized.filter(g=>g[t]===n&&d.indexOf(g[u])!==-1);e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:s,hoveredElement:a,items:p.filter(g=>typeof g[m]=="number").map(g=>({label:g[u],value:g[m],color:e.model.getFillColor(g[u]),class:e.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:g[u]})}))})}).on("mousemove",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEMOVE,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_CLICK,{event:s,element:y.select(this),datum:n})}).on("mouseout",function(s,n){const a=y.select(this),i=e.parent.select(`.x-axes .x-axis-${J(n)}`),o=e.parent.selectAll(`.dots circle.${J(n)}`);i.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),e.services.events.dispatchEvent(r.Events.Radar.X_AXIS_MOUSEOUT,{event:s,element:a,datum:n}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE)})}}class Wa extends ye{constructor(){super(...arguments),this.type="simple-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-simple-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getOptions(),{groupMapsTo:s}=t.data,n=this.getComponentContainer({withinChartClip:!0}),a=this.model.getDisplayData(this.configs.groups),i=this.services.cartesianScales.getOrientation(),o=n.selectAll("path.bar").data(a,h=>h[s]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[s],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[s])).attr("d",h=>{const u=this.services.cartesianScales.getRangeIdentifier(),m=this.getBarWidth(),p=h[u],g=this.services.cartesianScales.getDomainValue(h)-m/2,v=g+m;let f,b;if(Array.isArray(p)&&p.length===2)f=this.services.cartesianScales.getRangeValue(p[0]),b=this.services.cartesianScales.getRangeValue(p[1]);else{const T=this.services.cartesianScales.getRangeScale().domain()[0];f=this.services.cartesianScales.getRangeValue(Math.max(0,T)),b=this.services.cartesianScales.getRangeValue(h)}const E=Math.abs(b-f);if(E!==0&&E<2&&(p>0&&i===r.CartesianOrientations.VERTICAL||p<0&&i===r.CartesianOrientations.HORIZONTAL?b=f-2:b=f+2),!this.isOutsideZoomedDomain(g,v))return c.generateSVGPathString({x0:g,x1:v,y0:f,y1:b},i)}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("path.bar").on("mouseover",function(t,s){const n=y.select(this);n.classed("hovered",!0),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,data:[s]})}).on("mousemove",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:t,element:y.select(this),datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1),e.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ja extends _t{constructor(){super(...arguments),this.type="skeleton-lines"}render(e=!0){const t=c.getProperty(this.getOptions(),"data","loading"),s=!c.getProperty(this.getOptions(),"grid","x","enabled")&&!c.getProperty(this.getOptions(),"grid","y","enabled")&&!c.getProperty(this.getOptions(),"axes","bottom","visible")&&!c.getProperty(this.getOptions(),"axes","left","visible");t&&!s?super.renderGridSkeleton(t):t&&s?this.renderSparklineSkeleton(t):this.removeSkeleton()}renderSparklineSkeleton(e){this.setScales(),this.drawBackdrop(e),this.drawSparkline(e),this.updateBackdropStyle(),e&&this.setShimmerEffect("shimmer-lines")}drawSparkline(e){const t=this.backdrop.attr("width"),s=[100],n=O.DOMUtils.appendOrSelect(this.backdrop,"g.y.skeleton"),a=n.selectAll("line").data(s);a.enter().append("line").merge(a).attr("x1",0).attr("x2",t).attr("y1",i=>i).attr("y2",i=>i),n.selectAll("line").classed("shimmer-effect-lines",e).classed("empty-state-lines",!e).style("stroke",e?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const e=this.parent;this.backdrop=O.DOMUtils.appendOrSelect(e,"svg.chart-skeleton.DAII"),O.DOMUtils.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class Za extends G{constructor(){super(...arguments),this.type="area-stacked",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,s=this.getOptions(),{groupMapsTo:n}=s.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(a=>this.services.transitions.setupTransition({transition:a,name:"legend-hover-area"})).attr("opacity",a=>c.getProperty(a,0,n)!==t.datum().name?c.area.opacity.unselected:c.area.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-area"})).attr("opacity",c.area.opacity.selected)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer({withinChartClip:!0}),s=this,n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(v=>n.axes[v].percentage),o=this.model.getStackedData({percentage:i,groups:this.configs.groups}),d=c.getProperty(o,0,0),h=this.services.cartesianScales.getDomainAxisPosition({datum:d}),u=this.services.cartesianScales.getRangeAxisPosition({datum:d}),m=this.services.cartesianScales.getScaleByPosition(u),p=t.selectAll("path.area").data(o,v=>c.getProperty(v,0,a));this.areaGenerator=y.area().x(v=>this.services.cartesianScales.getValueThroughAxisPosition(h,v.data.sharedStackKey)).y0(v=>m(v[0])).y1(v=>m(v[1])).curve(this.services.curves.getD3Curve()),p.exit().attr("opacity",0).remove(),p.enter().append("path").attr("opacity",0).merge(p).data(o,v=>c.getProperty(v,0,a)).attr("class","area").attr("class",v=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:c.getProperty(v,0,a),originalClassName:"area"})).style("fill",v=>s.model.getFillColor(c.getProperty(v,0,a))).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",v=>c.getProperty(v,0,a)).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"area-update-enter",animate:e})).attr("opacity",c.area.opacity.selected).attr("d",this.areaGenerator)}}class Xa extends ye{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-bar"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e){const t=this.getComponentContainer({withinChartClip:!0}),s=this.getOptions(),{groupMapsTo:n}=s.data,a=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),i=this.model.getActiveDataGroupNames(),o=t.selectAll("g.bars").data(a,h=>c.getProperty(h,0,n));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",B.Roles.GROUP).attr("data-name","bars");const d=t.selectAll("g.bars").selectAll("path.bar").data(h=>h,h=>h.data.sharedStackKey);d.exit().remove(),d.enter().append("path").merge(d).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:e})).attr("class",h=>this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:h[n],originalClassName:"bar"})).style("fill",h=>this.model.getFillColor(h[n])).attr("d",h=>{const u=h.data.sharedStackKey,m=this.getBarWidth(),p=this.services.cartesianScales.getDomainValue(u)-m/2,g=p+m,v=this.services.cartesianScales.getRangeValue(h[0]);let f=this.services.cartesianScales.getRangeValue(h[1]);if(!this.isOutsideZoomedDomain(p,g)){if(Math.abs(f-v)>0&&Math.abs(f-v)>s.bars.dividerSize){const b=h[0]<0&&h[1]<=0;b&&i.length>1?this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=h[1]===0?2:1:f-=1:b||(this.services.cartesianScales.getOrientation()===r.CartesianOrientations.VERTICAL?f+=1:f-=1)}return c.generateSVGPathString({x0:p,x1:g,y0:v,y1:f},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",B.Roles.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h[1]-h[0]),this.addEventListeners()}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this;this.parent.selectAll("path.bar").on("mouseover",function(n,a){const i=y.select(this);i.classed("hovered",!0),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:a});let d=s.model.getDisplayData(s.configs.groups).find(h=>{const u=s.services.cartesianScales.getDomainIdentifier(h),m=s.services.cartesianScales.getRangeIdentifier(h);return h[m]===a.data[a[t]]&&h[u].toString()===a.data.sharedStackKey&&h[t]===a[t]});if(d===void 0){const h=s.services.cartesianScales.getDomainIdentifier(),u=s.services.cartesianScales.getRangeIdentifier();d={[h]:a.data.sharedStackKey,[u]:a.data[a[t]],[t]:a[t]}}s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:n,hoveredElement:i,data:[d]})}).on("mousemove",function(n,a){const i=y.select(this);s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:n})}).on("click",function(n,a){s.services.events.dispatchEvent(r.Events.Bar.BAR_CLICK,{event:n,element:y.select(this),datum:a})}).on("mouseout",function(n,a){const i=y.select(this);i.classed("hovered",!1),s.services.events.dispatchEvent(r.Events.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:a}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:i})})}getBarWidth(){const e=this.getOptions();if(c.getProperty(e,"bars","width"))return e.bars.width;const t=this.services.cartesianScales.getMainXScale(),s=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0}).width,n=this.model.getStackKeys().length,a=c.getProperty(e,"bars","spacingFactor");return t.step?Math.min(e.bars.maxWidth,t.step()/2):Math.min(e.bars.maxWidth,s*a/n)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const e=this.services.events;e.removeEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.removeEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class qa extends fe{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=r.RenderTypes.SVG}render(e){if(!c.getProperty(this.getOptions(),"points","enabled"))return;const s=this.getComponentContainer({withinChartClip:!0}),n=this.getOptions(),{groupMapsTo:a}=n.data,i=Object.keys(n.axes).some(g=>n.axes[g].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:i}),d=s.selectAll("g.dots").data(o,g=>c.getProperty(g,0,a));d.exit().attr("opacity",0).remove();const u=d.enter().append("g").classed("dots",!0).attr("role",B.Roles.GROUP).merge(d).selectAll("circle.dot").data(g=>g);u.exit().attr("opacity",0).remove();const p=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(g=>{const v=g[a],f=this.services.cartesianScales.getDomainIdentifier(g),b=this.services.cartesianScales.getRangeIdentifier(g);return{[a]:v,[f]:g.data.sharedStackKey,[b]:g[1]}});this.styleCircles(p,e),this.addEventListeners()}getTooltipData(e,t){const s=this.getOptions(),{groupMapsTo:n}=s.data,a=Object.keys(s.axes).some(d=>s.axes[d].percentage),i=this.model.getStackedData({groups:this.configs.groups,percentage:a}),o=[];return i.forEach((d,h)=>{d.forEach((u,m)=>{const p=u[n],g=u.data.sharedStackKey;let v=u.data[p];const f=u[1],b=this.services.cartesianScales.getDomainIdentifier(u),E=this.services.cartesianScales.getRangeIdentifier(u);v!=null&&e===this.services.cartesianScales.getDomainValue(g)&&t===this.services.cartesianScales.getRangeValue(f)&&(a&&(v=this.model.getStackedData({groups:this.configs.groups})[h][m].data[p]),v!==null&&o.push({[n]:p,[b]:g,[E]:v}))})}),this.model.getDisplayData(this.configs.groups).filter(d=>{const h=this.services.cartesianScales.getDomainIdentifier(d),u=this.services.cartesianScales.getRangeIdentifier(d);return o.find(m=>m[n]==d[n]&&m[h]==d[h]&&m[u]==d[u])!==void 0})}}const ee=6;class Ya extends G{constructor(){super(...arguments),this.type="tree",this.renderType=r.RenderTypes.SVG}getLongestLabel(e){let t="";return e.forEach(s=>{const n=s.children?this.getLongestLabel(s.children):"";(n.length>t.length||s.name.length>t.length)&&(t=n.length>s.name.length?n:s.name)}),t}getMockLabelWidth(e,t){const s=e.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(t),{width:n}=O.DOMUtils.getSVGElementSize(s.node(),{useBBox:!0});return s.remove(),n}render(e=!0){const t=this.getComponentContainer();t.html("");const{width:s,height:n}=O.DOMUtils.getSVGElementSize(this.parent,{useAttrs:!0});if(s<1||n<1)return;const a=this.model.getOptions(),i=this.model.getDisplayData(),o=c.getProperty(a,"tree","rootTitle")||"Tree",d=this.getMockLabelWidth(t,o),h=this.getLongestLabel(i),u=this.getMockLabelWidth(t,h),m={top:0,right:0,bottom:0,left:d>0?d+ee:30-ee},p=y.hierarchy({name:o,children:i}),g=10,v=s/6,f=x=>{const w=p.descendants().reverse(),P=p.links();let $=p,_=p;p.eachBefore(N=>{N.x<$.x&&($=N),N.x>_.x&&(_=N)});const A=_.x-$.x,L=t.transition().call(N=>this.services.transitions.setupTransition({transition:N,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-m.left,$.x,s,A].join(" ")),V=M.selectAll("g").data(w,N=>N.id),k=this,F=V.enter().append("g").attr("transform",()=>`translate(${x.y0},${x.x0})`).attr("class",N=>N.depth!==0&&N.children&&N.children.length>0?"clickable":null).on("mouseover",function(N,X){k.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOVER,{event:N,element:y.select(this),datum:X})}).on("click",function(N,X){X.depth!==0&&(X.children=X.children?null:X._children,f(X)),k.services.events.dispatchEvent(r.Events.Tree.NODE_CLICK,{event:N,element:y.select(this),datum:X})}).on("mouseout",function(N,X){k.services.events.dispatchEvent(r.Events.Tree.NODE_MOUSEOUT,{event:N,element:y.select(this),datum:X})});F.append("circle").attr("r",2.5).attr("class",N=>N._children?"parent":"child").attr("stroke-width",10),F.append("text").attr("dy","0.31em").attr("x",N=>N._children?-ee:ee).attr("text-anchor",N=>N._children?"end":"start").text(N=>N.data.name).clone(!0).attr("class","text-stroke").lower(),V.merge(F).transition(L).attr("transform",N=>`translate(${N.y},${N.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),V.exit().transition(L).remove().attr("transform",()=>`translate(${x.y},${x.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const q=C.selectAll("path").data(P,N=>N.target.id),H=q.enter().append("path").attr("d",()=>{const N={x:x.x0,y:x.y0};return T({source:N,target:N})});q.merge(H).transition(L).attr("d",T),q.exit().transition(L).remove().attr("d",()=>{const N={x:x.x,y:x.y};return T({source:N,target:N})}),p.eachBefore(N=>{N.x0=N.x,N.y0=N.y})},b=p.descendants(),E=b[b.length-1].depth,S=c.getProperty(a,"tree","type")===r.TreeTypes.DENDROGRAM?y.cluster().size([n,s-u-E*ee-d]):y.tree().nodeSize([g,v]).size([n,s-u-E*ee-d]),T=y.linkHorizontal().x(x=>x.y).y(x=>x.x);p.x0=v/2,p.y0=0,p.descendants().forEach((x,w)=>{x.id=w,x._children=x.children}),S(p),t.attr("viewBox",[-m.left,-m.top,s,g]).style("user-select","none");const C=t.append("g").attr("class","links"),M=t.append("g").attr("class","nodes");f(p)}}var Ka="#000000",Ja="#ffffff",Qa="#fcf4d6",ei="#fddc69",ti="#f1c21b",si="#d2a106",ni="#b28600",ai="#8e6a00",ii="#684e00",ri="#483700",oi="#302400",li="#1c1500",ci={10:Qa,20:ei,30:ti,40:si,50:ni,60:ai,70:ii,80:ri,90:oi,100:li},di="#fff2e8",hi="#ffd9be",ui="#ffb784",pi="#ff832b",gi="#eb6200",mi="#ba4e00",vi="#8a3800",fi="#5e2900",yi="#3e1a00",Ei="#231000",Oi={10:di,20:hi,30:ui,40:pi,50:gi,60:mi,70:vi,80:fi,90:yi,100:Ei},bi="#fff1f1",Si="#ffd7d9",xi="#ffb3b8",Ti="#ff8389",Mi="#fa4d56",Ci="#da1e28",Li="#a2191f",Ai="#750e13",Di="#520408",wi="#2d0709",Pi={10:bi,20:Si,30:xi,40:Ti,50:Mi,60:Ci,70:Li,80:Ai,90:Di,100:wi},Ri="#fff0f7",ki="#ffd6e8",Ii="#ffafd2",_i="#ff7eb6",Ui="#ee5396",Vi="#d02670",Ni="#9f1853",Bi="#740937",Gi="#510224",$i="#2a0a18",Hi={10:Ri,20:ki,30:Ii,40:_i,50:Ui,60:Vi,70:Ni,80:Bi,90:Gi,100:$i},zi="#f6f2ff",Fi="#e8daff",Wi="#d4bbff",ji="#be95ff",Zi="#a56eff",Xi="#8a3ffc",qi="#6929c4",Yi="#491d8b",Ki="#31135e",Ji="#1c0f30",Qi={10:zi,20:Fi,30:Wi,40:ji,50:Zi,60:Xi,70:qi,80:Yi,90:Ki,100:Ji},er="#edf5ff",tr="#d0e2ff",sr="#a6c8ff",nr="#78a9ff",ar="#4589ff",ir="#0f62fe",rr="#0043ce",or="#002d9c",lr="#001d6c",cr="#001141",dr={10:er,20:tr,30:sr,40:nr,50:ar,60:ir,70:rr,80:or,90:lr,100:cr},hr="#e5f6ff",ur="#bae6ff",pr="#82cfff",gr="#33b1ff",mr="#1192e8",vr="#0072c3",fr="#00539a",yr="#003a6d",Er="#012749",Or="#061727",br={10:hr,20:ur,30:pr,40:gr,50:mr,60:vr,70:fr,80:yr,90:Er,100:Or},Sr="#d9fbfb",xr="#9ef0f0",Tr="#3ddbd9",Mr="#08bdba",Cr="#009d9a",Lr="#007d79",Ar="#005d5d",Dr="#004144",wr="#022b30",Pr="#081a1c",Rr={10:Sr,20:xr,30:Tr,40:Mr,50:Cr,60:Lr,70:Ar,80:Dr,90:wr,100:Pr},kr="#defbe6",Ir="#a7f0ba",_r="#6fdc8c",Ur="#42be65",Vr="#24a148",Nr="#198038",Br="#0e6027",Gr="#044317",$r="#022d0d",Hr="#071908",zr={10:kr,20:Ir,30:_r,40:Ur,50:Vr,60:Nr,70:Br,80:Gr,90:$r,100:Hr},Fr="#f2f4f8",Wr="#dde1e6",jr="#c1c7cd",Zr="#a2a9b0",Xr="#878d96",qr="#697077",Yr="#4d5358",Kr="#343a3f",Jr="#21272a",Qr="#121619",eo={10:Fr,20:Wr,30:jr,40:Zr,50:Xr,60:qr,70:Yr,80:Kr,90:Jr,100:Qr},to="#f4f4f4",so="#e0e0e0",no="#c6c6c6",ao="#a8a8a8",io="#8d8d8d",ro="#6f6f6f",oo="#525252",lo="#393939",co="#262626",ho="#161616",uo={10:to,20:so,30:no,40:ao,50:io,60:ro,70:oo,80:lo,90:co,100:ho},po="#f7f3f2",go="#e5e0df",mo="#cac5c4",vo="#ada8a8",fo="#8f8b8b",yo="#726e6e",Eo="#565151",Oo="#3c3838",bo="#272525",So="#171414",xo={10:po,20:go,30:mo,40:vo,50:fo,60:yo,70:Eo,80:Oo,90:bo,100:So},lt={black:{100:Ka},blue:dr,coolGray:eo,cyan:br,gray:uo,green:zr,magenta:Hi,orange:Oi,purple:Qi,red:Pi,teal:Rr,warmGray:xo,white:{0:Ja},yellow:ci};const To=l=>{if(!l)return null;for(const e of Object.keys(lt)){const t=lt[e];for(const s of Object.keys(t))if(t[+s]===l)return s}return null},ct=function(){const l=y.select(this.parentNode).select("rect.leaf"),e=getComputedStyle(l.node(),null).getPropertyValue("fill"),t=y.color(e);let s;if(t&&(s=To(t?t.hex():null)),s==null){const n=y.hsl(t).l;s=Math.abs(n*100-100)}return s>50?"white":"black"};let Mo=0;class Co extends G{constructor(){super(...arguments),this.type="treemap",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-treemap"})).attr("opacity",s=>s.parent.data.name===t.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:e}=this.services;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this.getComponentContainer();this.model.getData();const s=this.model.getDisplayData(),n=this.model.getOptions(),a=c.getProperty(window,"location"),{width:i,height:o}=O.DOMUtils.getSVGElementSize(t,{useAttrs:!0}),d=y.hierarchy({name:n.title||"Treemap",children:s}).sum(f=>f.value).sort((f,b)=>b.value-f.value),h=y.treemap().size([i,o]).paddingInner(1).paddingOuter(0).round(!0)(d),u=t.selectAll("g[data-name='leaf']").data(h.leaves(),f=>f.data.name);u.exit().attr("opacity",0).remove();const p=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>Mo++).merge(u);p.attr("data-name","leaf").transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-group-update",animate:e})).attr("transform",f=>`translate(${f.x0},${f.y0})`);const g=p.selectAll("rect.leaf").data(f=>[f]);g.exit().attr("width",0).attr("height",0).remove(),g.enter().append("rect").classed("leaf",!0).merge(g).attr("width",0).attr("height",0).attr("id",function(){const f=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-leaf-${f}`}).attr("class",f=>{for(;f.depth>1;)f=f.parent;return this.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:f.data.name,originalClassName:"leaf"})}).transition().call(f=>this.services.transitions.setupTransition({transition:f,name:"treemap-leaf-update-enter",animate:e})).attr("width",f=>f.x1-f.x0).attr("height",f=>f.y1-f.y0).style("fill",f=>{for(;f.depth>1;)f=f.parent;return this.model.getFillColor(f.data.name)}),p.selectAll("clipPath").data(f=>f.data.showLabel!==!0?[]:[1],f=>f).join(f=>f.append("clipPath").attr("id",function(){const b=y.select(this.parentNode).attr("data-uid");return`${n.style.prefix}-clip-${b}`}).append("use").attr("xlink:href",function(){const b=y.select(this.parentNode.parentNode).attr("data-uid"),E=`${n.style.prefix}-leaf-${b}`;return new URL(`#${E}`,a)+""}),f=>null,f=>f.remove()),p.selectAll("text").data(f=>{if(f.data.showLabel!==!0)return[];let b=f;for(;b.depth>1;)b=b.parent;const E=y.hsl(this.model.getFillColor(b.data.name));return[{text:f.data.name,color:E.l<.5?"white":"black"}]},f=>f).join(f=>{const b=f.append("text").text(E=>E.text).style("fill",ct).attr("x",7).attr("y",18);return a&&b.attr("clip-path",function(){const E=y.select(this.parentNode).attr("data-uid"),S=`${n.style.prefix}-clip-${E}`;return`url(${new URL(`#${S}`,a)+""})`}),b},f=>f.text(b=>b.text).style("fill",ct),f=>f.remove()),this.addEventListeners()}addEventListeners(){const e=this;this.parent.selectAll("rect.leaf").on("mouseover",function(t,s){const n=y.select(this);let a=getComputedStyle(this,null).getPropertyValue("fill"),i=s;for(;i.depth>1;)i=i.parent;n.transition("graph_element_mouseover_fill_update").call(o=>e.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const d=e.model.getFillColor(o.parent.data.name);return d&&(a=d),y.color(a).darker(.7).toString()}),e.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:t,hoveredElement:n,items:[{color:a,label:i.data.name,bold:!0},{label:s.data.name,value:s.data.value}]}),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOVER,{event:t,element:n,datum:s})}).on("mousemove",function(t,s){const n=y.select(this);e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEMOVE,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:t})}).on("click",function(t,s){e.services.events.dispatchEvent(r.Events.Treemap.LEAF_CLICK,{event:t,element:y.select(this),datum:s})}).on("mouseout",function(t,s){const n=y.select(this);n.classed("hovered",!1);let a=s;for(;a.depth>1;)a=a.parent;n.transition().call(i=>e.services.transitions.setupTransition({transition:i,name:"graph_element_mouseout_fill_update"})).style("fill",i=>e.model.getFillColor(i.parent.data.name)),e.services.events.dispatchEvent(r.Events.Treemap.LEAF_MOUSEOUT,{event:t,element:n,datum:s}),e.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:n})})}}class Lo extends G{constructor(){super(...arguments),this.type="wordcloud",this.renderType=r.RenderTypes.SVG,this.handleLegendOnHover=e=>{const{hoveredElement:t}=e.detail,{groupMapsTo:s}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(n=>this.services.transitions.setupTransition({transition:n,name:"legend-hover-wordcloud"})).attr("opacity",n=>n[s]!==t.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(e=>this.services.transitions.setupTransition({transition:e,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const e=this.services.events;e.addEventListener(r.Events.Legend.ITEM_HOVER,this.handleLegendOnHover),e.addEventListener(r.Events.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(e=!0){const t=this,s=this.getComponentContainer().attr("width","100%").attr("height","100%"),n=this.model.getDisplayData(),a=this.getFontSizeScale(n),i=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:d}=i.wordCloud,{groupMapsTo:h}=i.data,{width:u,height:m}=O.DOMUtils.getSVGElementSize(s,{useAttrs:!0});if(u===0||m===0)return;const p=Nt().size([u,m]).words(n.map(function(v){const f=v[o];if(typeof v[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[h]:v[h],text:v[d],size:f,value:f}})).padding(5).rotate(0).fontSize(v=>a(v.size)).on("end",g);p.start();function g(v){const f=O.DOMUtils.appendOrSelect(s,"g.words");f.attr("transform",`translate(${p.size()[0]/2}, ${p.size()[1]/2})`);const b=f.selectAll("text").data(v,S=>`${S[h]}-${S.text}`);b.exit().attr("opacity",0).remove(),b.enter().append("text").attr("opacity",0).merge(b).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>t.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.FILL],dataGroupName:S[h],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>t.model.getFillColor(S[h],S.text,S)).attr("text-anchor","middle").transition().call(S=>t.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:e})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(e){const t=this.getOptions(),{fontSizeMapsTo:s}=t.wordCloud,n=e.map(d=>d[s]).filter(d=>d),a=O.DOMUtils.getHTMLElementSize(this.services.domUtils.getMainContainer()),i=n.length>0,o=i?y.extent(n):[1,1];return y.scaleLinear().domain(o).range(i?t.wordCloud.fontSizeRange(a,e):[4,4])}addEventListeners(){const e=this.getOptions(),{groupMapsTo:t}=e.data,s=this,n=O.debounce(a=>{const i=s.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>s.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));a===null?i.attr("opacity",1):i.attr("opacity",function(){return a===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(a,i){const o=this;n(o),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOVER,{event:a,element:y.select(this),datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.SHOW,{event:a,hoveredElement:o,items:[{label:e.tooltip.wordLabel,value:i.text},{label:e.tooltip.valueLabel,value:i.value},{label:e.tooltip.groupLabel,value:i[t],class:s.model.getColorClassName({classNameTypes:[r.ColorClassNameTypes.TOOLTIP],dataGroupName:i[t]})}]})}).on("mousemove",function(a,i){const o=y.select(this);s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEMOVE,{element:o,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.MOVE,{event:a})}).on("click",function(a,i){s.services.events.dispatchEvent(r.Events.WordCloud.WORD_CLICK,{event:a,element:y.select(this),datum:i})}).on("mouseout",function(a,i){const o=y.select(this);n(null),s.services.events.dispatchEvent(r.Events.WordCloud.WORD_MOUSEOUT,{event:a,element:o,datum:i}),s.services.events.dispatchEvent(r.Events.Tooltip.HIDE,{hoveredElement:o})})}}class Vt extends G{constructor(){super(...arguments),this.type="geo",this.renderType=r.RenderTypes.SVG}render(){const e=this.getComponentContainer({withinChartClip:!0}),{width:t,height:s}=O.DOMUtils.getSVGElementSize(e,{useAttrs:!0});if(t<1||s<1)return;const n=this.getProjection(),a=c.getProperty(this.getOptions(),"geoData"),i=this.model.getCombinedData(),o={},d={};Object.keys(i).forEach(E=>{typeof i[E].value=="number"?o[E]=i[E]:d[E]=i[E]});const h=Oa(a,Object.values(d)),u=fa(a,{type:"GeometryCollection",geometries:Object.values(o)}),m=n.fitSize([t,s],u),p=y.geoPath().projection(m);O.DOMUtils.appendOrSelect(e,"g.geo").selectAll("path").data(u.features).join("path").attr("d",p);const v=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),f=O.DOMUtils.appendOrSelect(e,"defs");O.DOMUtils.appendOrSelect(f,"pattern").attr("id",v).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",y.line()([[0,0],[0,10]]));const b=O.DOMUtils.appendOrSelect(e,"g.missing-data");O.DOMUtils.appendOrSelect(b,"path").datum(h).attr("d",p).style("fill",`url(#${v})`)}getProjection(){let e=null;switch(c.getProperty(this.getOptions(),"thematic","projection")){case r.Projection.geoEqualEarth:e=y.geoEqualEarth();break;case r.Projection.geoAlbers:e=y.geoAlbers();break;case r.Projection.geoConicEqualArea:e=y.geoConicEqualArea();break;case r.Projection.geoConicEquidistant:e=y.geoConicEquidistant();break;case r.Projection.geoEquirectangular:e=y.geoEquirectangular();break;case r.Projection.geoMercator:e=y.geoMercator();break;case r.Projection.geoNaturalEarth1:e=y.geoNaturalEarth1();break;default:throw new Error("Projection is not supported.")}return e}}class Ao extends Vt{constructor(){super(...arguments),this.type="choropleth"}render(e=!0){super.render();const t=this.model.getCombinedData();this.getComponentContainer({withinChartClip:!0}).select("g.geo").selectAll("path").classed("border",!0).attr("class",a=>this.model.getColorClassName({value:t[a.properties.NAME].value,originalClassName:"border"})),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const e=this,t=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOVER,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.SHOW,{event:s,hoveredElement:a,items:[{label:n.properties.NAME,value:t[n.properties.NAME].value}]})}).on("mousemove",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEMOVE,{event:s,element:y.select(this),datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.MOVE,{event:s})}).on("click",function(s,n){e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_CLICK,{event:s,element:y.select(this),datum:t[n.properties.NAME]})}).on("mouseout",function(s,n){const a=y.select(this);e.services.events.dispatchEvent(r.Choropleth.CHOROPLETH_MOUSEOUT,{event:s,element:a,datum:t[n.properties.NAME]}),e.services.events.dispatchEvent(r.Tooltip.HIDE,{event:s,hoveredElement:a})})}}exports.Alluvial=aa;exports.Area=ra;exports.Axis=$e;exports.AxisChartsTooltip=na;exports.Bar=ye;exports.BinnedRuler=Sa;exports.Boxplot=da;exports.Bubble=ua;exports.Bullet=pa;exports.CanvasChartClip=Qn;exports.ChartBrush=Be;exports.ChartClip=Rt;exports.Choropleth=Ao;exports.CirclePack=_a;exports.ColorScaleLegend=ka;exports.Component=G;exports.Donut=Va;exports.Gauge=Na;exports.GeoProjection=Vt;exports.Grid=ia;exports.GroupedBar=Ba;exports.Heatmap=Ga;exports.Highlight=sa;exports.Histogram=$a;exports.HoverAxis=It;exports.LayoutComponent=xe;exports.Legend=Pt;exports.Line=oa;exports.Lollipop=Ha;exports.Meter=za;exports.MeterTitle=Ia;exports.Modal=Jn;exports.Pie=Ut;exports.Radar=Fa;exports.Ruler=Ge;exports.Scatter=fe;exports.SimpleBar=Wa;exports.Skeleton=_t;exports.SkeletonLines=ja;exports.Spacer=Us;exports.StackedArea=Za;exports.StackedBar=Xa;exports.StackedRuler=xa;exports.StackedScatter=qa;exports.Threshold=ta;exports.Title=wt;exports.Toolbar=Se;exports.Tooltip=kt;exports.Tree=Ya;exports.Treemap=Co;exports.TwoDimensionalAxes=ca;exports.WordCloud=Lo;exports.ZeroLine=ha;exports.ZoomBar=ea;exports.arrowLeft=La;exports.arrowRight=Aa;exports.buildBezierPathString=Ca;exports.buildElbowPathString=Ma;exports.buildStraightPathString=Ta;exports.circle=Da;exports.createCompounder=Tt;exports.diamond=wa;exports.square=Pa;exports.tee=Ra;
|
|
82
|
+
//# sourceMappingURL=choropleth-300f112d.js.map
|