apexcharts 8.2.0 → 8.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/dist/apexcharts.common.js +2 -2
- package/dist/apexcharts.core.js +271 -173
- package/dist/apexcharts.core.min.js +2 -2
- package/dist/apexcharts.css +35 -0
- package/dist/apexcharts.esm.js +1722 -1527
- package/dist/apexcharts.full.js +1459 -1075
- package/dist/apexcharts.full.min.js +2 -2
- package/dist/apexcharts.js +994 -715
- package/dist/apexcharts.min.js +2 -2
- package/dist/apexcharts.ssr.common.js +2 -2
- package/dist/apexcharts.ssr.esm.js +994 -715
- package/dist/area.common.js +2 -2
- package/dist/area.esm.js +91 -40
- package/dist/bar.common.js +2 -2
- package/dist/bar.esm.js +433 -394
- package/dist/bar.js +2 -2
- package/dist/boxPlot.common.js +2 -2
- package/dist/boxPlot.esm.js +364 -322
- package/dist/bubble.common.js +2 -2
- package/dist/bubble.esm.js +91 -40
- package/dist/candlestick.common.js +2 -2
- package/dist/candlestick.esm.js +364 -322
- package/dist/candlestick.js +2 -2
- package/dist/column.common.js +2 -2
- package/dist/column.esm.js +433 -394
- package/dist/core.common.js +2 -2
- package/dist/core.esm.js +271 -173
- package/dist/donut.common.js +1 -1
- package/dist/donut.esm.js +1 -1
- package/dist/dumbbell.common.js +2 -2
- package/dist/dumbbell.esm.js +433 -394
- package/dist/features/all.common.js +2 -2
- package/dist/features/all.esm.js +250 -187
- package/dist/features/annotations.common.js +1 -1
- package/dist/features/annotations.esm.js +1 -1
- package/dist/features/annotations.js +1 -1
- package/dist/features/context-menu.common.js +1 -1
- package/dist/features/context-menu.esm.js +1 -1
- package/dist/features/context-menu.js +1 -1
- package/dist/features/drilldown.common.js +2 -2
- package/dist/features/drilldown.esm.js +4 -2
- package/dist/features/drilldown.js +2 -2
- package/dist/features/dumbbell.common.js +1 -1
- package/dist/features/dumbbell.esm.js +1 -1
- package/dist/features/dumbbell.js +1 -1
- package/dist/features/exports.common.js +1 -1
- package/dist/features/exports.esm.js +1 -1
- package/dist/features/exports.js +1 -1
- package/dist/features/facet.common.js +1 -1
- package/dist/features/facet.esm.js +1 -1
- package/dist/features/facet.js +1 -1
- package/dist/features/highlight-filter.common.js +2 -2
- package/dist/features/highlight-filter.esm.js +14 -9
- package/dist/features/highlight-filter.js +2 -2
- package/dist/features/history.common.js +1 -1
- package/dist/features/history.esm.js +1 -1
- package/dist/features/history.js +1 -1
- package/dist/features/ink.common.js +1 -1
- package/dist/features/ink.esm.js +1 -1
- package/dist/features/ink.js +1 -1
- package/dist/features/keyboard.common.js +2 -2
- package/dist/features/keyboard.esm.js +97 -145
- package/dist/features/keyboard.js +2 -2
- package/dist/features/legend.common.js +2 -2
- package/dist/features/legend.esm.js +63 -43
- package/dist/features/legend.js +2 -2
- package/dist/features/link.common.js +1 -1
- package/dist/features/link.esm.js +1 -1
- package/dist/features/link.js +1 -1
- package/dist/features/marks.common.js +1 -1
- package/dist/features/marks.esm.js +1 -1
- package/dist/features/marks.js +1 -1
- package/dist/features/measure.common.js +1 -1
- package/dist/features/measure.esm.js +1 -1
- package/dist/features/measure.js +1 -1
- package/dist/features/morph.common.js +1 -1
- package/dist/features/morph.esm.js +1 -1
- package/dist/features/morph.js +1 -1
- package/dist/features/perspectives.common.js +1 -1
- package/dist/features/perspectives.esm.js +1 -1
- package/dist/features/perspectives.js +1 -1
- package/dist/features/raincloud.common.js +1 -1
- package/dist/features/raincloud.esm.js +1 -1
- package/dist/features/raincloud.js +1 -1
- package/dist/features/renderer-canvas.common.js +2 -2
- package/dist/features/renderer-canvas.esm.js +2 -1
- package/dist/features/renderer-canvas.js +2 -2
- package/dist/features/stats.common.js +1 -1
- package/dist/features/stats.esm.js +1 -1
- package/dist/features/stats.js +1 -1
- package/dist/features/storyboard.common.js +1 -1
- package/dist/features/storyboard.esm.js +1 -1
- package/dist/features/storyboard.js +1 -1
- package/dist/features/streamgraph.common.js +2 -2
- package/dist/features/streamgraph.esm.js +3 -2
- package/dist/features/streamgraph.js +2 -2
- package/dist/features/toolbar.common.js +2 -2
- package/dist/features/toolbar.esm.js +92 -2
- package/dist/features/toolbar.js +2 -2
- package/dist/features/trellis.common.js +2 -2
- package/dist/features/trellis.esm.js +83 -47
- package/dist/features/trellis.js +2 -2
- package/dist/features/waterfall.common.js +1 -1
- package/dist/features/waterfall.esm.js +1 -1
- package/dist/features/waterfall.js +1 -1
- package/dist/features/weave.common.js +1 -1
- package/dist/features/weave.esm.js +1 -1
- package/dist/features/weave.js +1 -1
- package/dist/full.common.js +2 -2
- package/dist/full.esm.js +950 -795
- package/dist/heatmap.common.js +2 -2
- package/dist/heatmap.esm.js +3 -17
- package/dist/heatmap.js +2 -2
- package/dist/histogram.common.js +2 -2
- package/dist/histogram.esm.js +433 -394
- package/dist/icicle.common.js +2 -2
- package/dist/icicle.esm.js +54 -38
- package/dist/icicle.js +2 -2
- package/dist/line.common.js +2 -2
- package/dist/line.esm.js +91 -40
- package/dist/line.js +2 -2
- package/dist/locales/en.json +2 -1
- package/dist/locales/ro.json +3 -2
- package/dist/pictograms.common.js +1 -1
- package/dist/pictograms.esm.js +1 -1
- package/dist/pictograms.js +1 -1
- package/dist/pie.common.js +1 -1
- package/dist/pie.esm.js +1 -1
- package/dist/pie.js +1 -1
- package/dist/polarArea.common.js +1 -1
- package/dist/polarArea.esm.js +1 -1
- package/dist/radar.common.js +2 -2
- package/dist/radar.esm.js +5 -4
- package/dist/radar.js +2 -2
- package/dist/radialBar.common.js +1 -1
- package/dist/radialBar.esm.js +1 -1
- package/dist/radialBar.js +1 -1
- package/dist/raincloud.common.js +2 -2
- package/dist/raincloud.esm.js +72 -26
- package/dist/rangeArea.common.js +2 -2
- package/dist/rangeArea.esm.js +91 -40
- package/dist/rangeBar.common.js +2 -2
- package/dist/rangeBar.esm.js +433 -394
- package/dist/scatter.common.js +2 -2
- package/dist/scatter.esm.js +91 -40
- package/dist/streamgraph.common.js +2 -2
- package/dist/streamgraph.esm.js +93 -41
- package/dist/sunburst.common.js +2 -2
- package/dist/sunburst.esm.js +103 -93
- package/dist/sunburst.js +2 -2
- package/dist/treemap.common.js +2 -2
- package/dist/treemap.esm.js +105 -86
- package/dist/treemap.js +2 -2
- package/dist/unit-shapes.common.js +1 -1
- package/dist/unit-shapes.esm.js +1 -1
- package/dist/unit-shapes.js +1 -1
- package/dist/unit.common.js +2 -2
- package/dist/unit.esm.js +280 -202
- package/dist/unit.js +2 -2
- package/dist/violin.common.js +2 -2
- package/dist/violin.esm.js +72 -26
- package/dist/violin.js +2 -2
- package/dist/waterfall.common.js +2 -2
- package/dist/waterfall.esm.js +432 -393
- package/package.json +1 -1
- package/src/apexcharts.js +13 -6
- package/src/assets/apexcharts.css +35 -0
- package/src/charts/Bar.js +62 -55
- package/src/charts/BarStacked.js +80 -88
- package/src/charts/BoxCandleStick.js +28 -31
- package/src/charts/Icicle.js +37 -37
- package/src/charts/Line.js +118 -42
- package/src/charts/Radar.js +5 -7
- package/src/charts/RangeBar.js +47 -43
- package/src/charts/Sunburst.js +101 -98
- package/src/charts/Treemap.js +108 -66
- package/src/charts/Unit.js +368 -250
- package/src/charts/Violin.js +48 -30
- package/src/charts/common/Breadcrumb.js +2 -2
- package/src/charts/common/Hierarchy.js +32 -11
- package/src/charts/common/Jitter.js +32 -7
- package/src/charts/common/bar/DataLabels.js +76 -81
- package/src/charts/common/bar/Helpers.js +43 -7
- package/src/charts/common/line/Helpers.js +12 -15
- package/src/charts/common/partition/NodeTooltip.js +8 -1
- package/src/charts/common/partition/Partition.js +33 -1
- package/src/charts/common/treemap/Helpers.js +3 -11
- package/src/locales/en.json +2 -1
- package/src/locales/ro.json +3 -2
- package/src/modules/Core.js +4 -0
- package/src/modules/CoreUtils.js +18 -42
- package/src/modules/Data.js +23 -24
- package/src/modules/DataLabels.js +6 -6
- package/src/modules/Graphics.js +62 -49
- package/src/modules/Markers.js +3 -1
- package/src/modules/Range.js +44 -29
- package/src/modules/RendererController.js +17 -3
- package/src/modules/Scales.js +32 -9
- package/src/modules/Series.js +39 -18
- package/src/modules/Theme.js +1 -1
- package/src/modules/ZoomPanSelection.js +119 -2
- package/src/modules/accessibility/KeyboardNavigation.js +114 -186
- package/src/modules/animations/LengthTransition.js +22 -2
- package/src/modules/drilldown/Breadcrumb.js +5 -2
- package/src/modules/helpers/Destroy.js +1 -1
- package/src/modules/highlightFilter/HighlightFilter.js +8 -9
- package/src/modules/highlightFilter/TreemapPart.js +2 -2
- package/src/modules/legend/HeatmapGradientLegend.js +76 -45
- package/src/modules/legend/Helpers.js +2 -0
- package/src/modules/legend/Legend.js +11 -12
- package/src/modules/settings/Options.js +7 -0
- package/src/modules/streamgraph/StreamLabels.js +1 -0
- package/src/modules/tooltip/Tooltip.js +20 -4
- package/src/modules/tooltip/Utils.js +8 -0
- package/src/modules/trellis/Trellis.js +6 -0
- package/src/modules/trellis/TrellisChrome.js +18 -7
- package/src/modules/trellis/TrellisSync.js +2 -0
- package/src/renderers/canvas/CanvasGraphics.js +1 -0
- package/src/ssr/DOMShim.js +10 -0
- package/src/types/internal.d.ts +9 -3
- package/types/apexcharts.d.ts +31 -12
package/dist/icicle.common.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
"use strict";var t=Object.defineProperty,e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,s=(e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,o=(t,o)=>{for(var n in o||(o={}))i.call(o,n)&&s(t,n,o[n]);if(e)for(var n of e(o))r.call(o,n)&&s(t,n,o[n]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function n(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const l=n(require("apexcharts/core")),a=l.__apex_Graphics,c=l.__apex_BrowserAPIs_BrowserAPIs,h=l.__apex_Environment_Environment;function u(t,e,i,r,s,o=null,n={}){var l,a,c;const h=e&&"object"==typeof e,d=h&&null!=(a=null!=(l=e.x)?l:e.name)?a:"",p=Number(h?null!=(c=e.y)?c:e.value:e),f={name:String(d),value:isNaN(p)?null:p,color:h&&e.color?e.color:void 0,_key:`${s}/${i}:${d}`};if(r&&!f.color&&(f.color=r[i%r.length]),n.keepDatum&&(f._datum=e),h&&Array.isArray(e.children)&&e.children.length)f.children=e.children.map((e,i)=>u(t,e,i,null,f._key,o,n));else if(h&&null!=e.drilldown&&!1!==n.expandDrilldown){const i=o||new Set;if(!i.has(e.drilldown)){const r=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(r&&Array.isArray(r.data)&&r.data.length){const s=new Set(i);s.add(e.drilldown);const o=Array.isArray(r.colors)?r.colors:null;f.children=r.data.map((e,i)=>u(t,e,i,o,f._key,s,n))}}}return f}function d(t){t.children&&t.children.length&&(t.children.forEach(t=>d(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}const p="http://www.w3.org/1999/xhtml";function f(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function _(t,e,i,r){var s;const o=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,n=o?o.getTitleSubtitleCoords("title").height+o.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const o=r.getBoundingClientRect().top,n=e.getBoundingClientRect();let l=i;for(let t=0;t<s.length;t++){const e=s[t].getBoundingClientRect();e.height&&(e.left>=n.right||e.right<=n.left||(l=Math.min(l,e.top-o)))}return l}(t,i);if(c-n>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${n+a}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function g(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function m(t,e,i,r,s,o){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=r,t._parent=s,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=o.cap&&e>=o.cap,e>o.maxDepth&&(o.maxDepth=e),t._leaf||t._clipped)return;const n=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=i;for(let s=0;s<t.children.length;s++){const a=t.children[s],c=(r-i)*Math.max(0,a.value)/n;m(a,e+1,l,l+c,t,o),l+=c}}function y({roots:t,nodesAll:e,focus:i,t0:r,t1:s,cap:o}){for(let t=0;t<e.length;t++)e[t]._show=!1;const n={maxDepth:0,cap:o};if(i)return m(i,0,r,s,i._parent,n),n.maxDepth;const l=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let a=r;for(let e=0;e<t.length;e++){const i=(s-r)*Math.max(0,t[e].value)/l;m(t[e],0,a,a+i,null,n),a+=i}return n.maxDepth}function x(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function b(t,e,i){let r=t===e?t._parent||null:t;return!r||r.children&&r.children.length||(r=r._parent||null),i&&1===i.length&&r===i[0]&&(r=null),r===e?{changed:!1,focus:e}:{changed:!0,focus:r}}function w(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const r=parseInt(i,16);if(isNaN(r))return t;let s=r>>16&255,o=r>>8&255,n=255&r;return s=Math.round(s+(255-s)*e),o=Math.round(o+(255-o)*e),n=Math.round(n+(255-n)*e),"#"+((1<<24)+(s<<16)+(o<<8)+n).toString(16).slice(1)}function v(t,e,i,r){if(t._color=t.color||e,r.push(t),t.children)for(let e=0;e<t.children.length;e++){const s=t.children[e];v(s,s.color||w(t._color,i),i,r)}}class A{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&h.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){const i=this._tip();if(!i)return;const r=this.w,s=(e.value/this.total*100).toFixed(1),o=e._parent?e._parent.value:this.total,n=o>0?(e.value/o*100).toFixed(1):s,l=r.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"";i.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${l}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${e.value} (${n}% of parent, ${s}% of total)</span></div></div></div>`,i.classList.add("apexcharts-active"),i.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight;let o=t.clientX-i.left+12;o+r>i.width&&(o=t.clientX-i.left-r-12),o=Math.max(0,Math.min(o,i.width-r));let n=t.clientY-i.top+12;n+s>i.height&&(n=t.clientY-i.top-s-12),n=Math.max(0,Math.min(n,i.height-s)),e.style.left=o+"px",e.style.top=n+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const S="http://www.w3.org/2000/svg",M=(t,e,i)=>t+(e-t)*i;l.default.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new A(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new a(this.w);this._graphics=i;const r=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return r;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return r;const s=this.cfg.direction;if(this._vertical="right"!==s&&"left"!==s,this._flip="up"===s||"left"===s,this._roots=function(t,e={}){const i=t.config.series,r=i&&i[0],s=r&&Array.isArray(r.data)?r.data:i;return Array.isArray(s)?s.map((i,r)=>u(t,i,r,null,"",null,e)):[]}(this.w),!this._roots.length)return r;this._roots.forEach(t=>d(t)),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),r=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&r(t[e].children)};r(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&function(t,{type:e,remedy:i}){let r=!1;const s=t=>{if(t.children&&t.children.length){const o=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!r&&null!=t.value&&Math.abs(o-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${o}). ${i}`),r=!0),t.children.forEach(s)}};t.forEach(s)}(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this._nodesAll=[],this._colorNodes(),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),r.add(this._cellsG),r.add(this._labelsG),this._focus=null,this._relayout(this._focus);const o=e.config.chart.animations;let n="none";return o.enabled&&(e.globals.dataChanged?o.dynamicAnimation.enabled&&(n="update"):e.globals.resized||(n="intro")),this._applyLayout(n),this._renderBreadcrumb(),r}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const r=[];for(;1===i.length&&i[0].children&&i[0].children.length>1;)r.push(i[0]),i=i[0].children;const s=w(e,.62);r.forEach(t=>{t._color=t.color||s,this._nodesAll.push(t)}),i.forEach((i,r)=>{v(i,i.color||t[r%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){const e=this._valueExtent(),i=this.cfg.maxDepth,r="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=x(t).length-1;this._focusMaxDepth=y({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:r?r-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=y({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:r?r-1:void 0});const s=this._depthExtent(),o=this._focusMaxDepth+1,n="equal"===this.cfg.levelSize?0:function(t,e,i=0){if("number"==typeof t)return t;const r=String(t).trim();if(r.endsWith("%"))return parseFloat(r)/100*e;const s=parseFloat(r);return isNaN(s)?i*e:s}(this.cfg.levelSize,s,0),l=n>0?Math.min(s,n*o):s,a=function({maxDepth:t,near:e,far:i,gap:r=0}){const s=t+1,o=(i-e)/s,n=s>1?r:0;return{near:t=>e+t*o+(t>0?n/2:0),far:t=>e+(t+1)*o-n/2}}({maxDepth:this._focusMaxDepth,near:0,far:l,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=a.near(t._vDepth),t._d1=function(t,e,i,r,s){return t._leaf&&"extend"===r&&t._vDepth<i?s:e.far(t._vDepth)}(t,a,this._focusMaxDepth,this.cfg.leaf,l))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const r=e/i,s=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-s)*r,o=(t._t1-s)*r;o<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,o))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),r=t._d0,s=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-r-s:r,w:i,h:s}:{x:this._flip?this.width-r-s:r,y:e,w:s,h:i}}_applyLayout(t){const e=this.w.config.chart.animations,i=e.enabled?"none"===t?0:"update"===t||"zoom"===t?e.dynamicAnimation.speed||350:e.speed||500:0,r=++this._zoomGen,s="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const o=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),this._setCursor(e),"intro"===t&&i>0)return void this._wipeCell(e,o,i,r);let n,l=!1;e._cur?n=e._cur:s&&s.get(e._key)?n=s.get(e._key):(n={x:o.x+o.w/2,y:o.y+o.h/2,w:0,h:0},l=!0),this._animateCell(e,n,o,i,!1,l,r)}else if(e._el&&e._cur){const t=e._cur,s={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,s,i,!0,!1,r)}});const o=new Map;this._nodesAll.forEach(t=>{t._show&&o.set(t._key,this._box(t))}),this.ctx._iciclePrevGeoms=o,this._renderLabels(i)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const r=i.node;return r.setAttribute("data:name",t.name),r.setAttribute("data:value",String(t.value)),r.setAttribute("data:key",function(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}(t._key)),r.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(r,t),h.isBrowser()&&!1!==this.cfg.zoomOnClick&&r.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,r){const s=t._el,o=this._focusMaxDepth+1,n=o>1?t._vDepth/o*i*.6:0,l=i-n,a=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(s,a),s.attr({opacity:1}),s.node.style.display="",t._cur=a,s.animate(l,n).during(i=>{if(this._zoomGen!==r)return;const o={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(s,o),t._cur=o}).after(()=>{this._zoomGen===r&&(this._setBox(s,e),t._cur=e)})}_animateCell(t,e,i,r,s,o,n){const l=t._el;if(l.attr({fill:t._color}),0===r)return this._setBox(l,i),l.attr({opacity:s?0:1}),l.node.style.display=s?"none":"",void(t._cur=s?null:i);l.node.style.display="";const a=s?Number(l.attr("opacity"))||1:o?0:1,c=s?0:1;l.attr({opacity:a}),l.animate(r).during(r=>{if(this._zoomGen!==n)return;const s={x:M(e.x,i.x,r),y:M(e.y,i.y,r),w:M(e.w,i.w,r),h:M(e.h,i.h,r)};this._setBox(l,s),l.attr({opacity:M(a,c,r)}),t._cur=s}).after(()=>{this._zoomGen===n&&(s?(l.node.style.display="none",t._cur=null):(this._setBox(l,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,r=Math.min(i,Math.max(0,e.w-.5))/2,s=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+r,y:e.y+s,width:Math.max(0,e.w-2*r),height:Math.max(0,e.h-2*s)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderLabel(t){if(!h.isBrowser())return;const e=this.cfg.dataLabels,i=e.style,r=this._box(t),s="always"===e.rotate||"never"!==e.rotate&&r.h>r.w,o=s?r.h:r.w,n=s?r.w:r.h,l=parseFloat(i.fontSize)||12;if(o<e.minSizeToShow)return;if(n<l+2)return;const a=o-8;let u=t.name;if(e.showValue){const e=`${t.name}: ${t.value}`;this._fits(e,a,l)&&(u=e)}const d=this._truncate(u,a,l);if(!d)return;const p=i.colors,f=(Array.isArray(p)?p[0]:p)||"#fff",_=c.createElementNS(S,"text");_.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&_.setAttribute("font-family",i.fontFamily),_.setAttribute("font-weight",String(i.fontWeight||400)),_.setAttribute("fill",f),_.setAttribute("dominant-baseline","central"),_.style.pointerEvents="none",_.textContent=d;const g="center"===e.align?"middle":"right"===e.align?"end":"start",m=r.x+4,y=r.x+r.w-4,x=r.x+r.w/2;if(s){const t=r.x+r.w/2,e=r.y+r.h-4,i=r.y+4,s=r.y+r.h/2,o="middle"===g?s:"end"===g?i:e;_.setAttribute("text-anchor",g),_.setAttribute("x",String(t)),_.setAttribute("y",String(o)),_.setAttribute("transform",`rotate(-90 ${t} ${o})`)}else{const t="middle"===g?x:"end"===g?y:m;_.setAttribute("text-anchor",g),_.setAttribute("x",String(t)),_.setAttribute("y",String(r.y+r.h/2))}this._labelsG.node.appendChild(_)}_renderMoreMark(t){if(!h.isBrowser())return;const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,r=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,s=c.createElementNS(S,"g");s.setAttribute("class","apexcharts-icicle-more"),s.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=c.createElementNS(S,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:r)),e.setAttribute("cy",String(this._vertical?r:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),s.appendChild(e)}this._labelsG.node.appendChild(s)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const r=.58*i,s=Math.floor(e/r);return s>=t.length?t:s<4?"":t.slice(0,s-1)+"\u2026"}_setCursor(t){h.isBrowser()&&!1!==this.cfg.zoomOnClick&&(t._el.node.style.cursor=b(t,this._focus,this._roots).changed?"pointer":"default")}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=b(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!h.isBrowser())return;if(!this._focus)return void g(this.w);const t=f(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(x(this._focus).map(t=>({label:t.name,data:t}))),r=function(t,e){if(!h.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;g(t);const r=e.config||f(t);if(!1===r.show)return null;const s=e.crumbs||[];if(s.length<2)return null;const o=c.createElementNS(p,"nav");o.setAttribute("class","apexcharts-breadcrumb"),o.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(o,r),e.compact&&(o.style.fontSize="11px",o.style.padding="0 2px");const n=null!=r.separator?r.separator:" / ";return s.forEach((t,i)=>{var l;if(i>0){const t=c.createElementNS(p,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=n,o.appendChild(t)}let a=0===i?null!=(l=r.rootLabel)?l:"All":t.label;if("function"==typeof r.formatter&&(a=r.formatter(a,{index:i,depth:s.length-1,data:t.data})),i===s.length-1){const t=c.createElementNS(p,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(a),void o.appendChild(t)}const h=c.createElementNS(p,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=c.createElementNS(p,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const u=c.createElementNS(p,"span");u.setAttribute("class","apexcharts-breadcrumb-label"),u.textContent=String(a),h.appendChild(u),h.addEventListener("click",()=>e.onNavigate(i,t)),o.appendChild(h)}),i.appendChild(o),o}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});r&&_(this.w,this.ctx,r,t)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>l.default});
|
|
5
|
+
"use strict";var t=Object.defineProperty,e=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,s=(e,i,r)=>i in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r,n=(t,n)=>{for(var o in n||(n={}))i.call(n,o)&&s(t,o,n[o]);if(e)for(var o of e(n))r.call(n,o)&&s(t,o,n[o]);return t};Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function o(t){if(t&&t.__esModule)return t;const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t)for(const i in t)if("default"!==i){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(e,i,r.get?r:{enumerable:!0,get:()=>t[i]})}return e.default=t,Object.freeze(e)}const l=o(require("apexcharts/core")),a=l.__apex_Graphics,c=l.__apex_BrowserAPIs_BrowserAPIs,h=l.__apex_Environment_Environment;function u(t,e){var i;const r=String(t).replace(/\//g,"%2F"),s=(null!=(i=e.get(r))?i:-1)+1;return e.set(r,s),`${s}:${r}`}function d(t,e,i,r,s,n=null,o={},l=new Map){var a,c,h;const p=e&&"object"==typeof e,f=p&&null!=(c=null!=(a=e.x)?a:e.name)?c:"",_=p?null!=(h=e.y)?h:e.value:e,g=null==_||""===_?NaN:Number(_),m={name:String(f),value:isNaN(g)?null:g,color:p&&e.color?e.color:void 0,_key:`${s}/${u(f,l)}`};r&&!m.color&&(m.color=r[i%r.length]),o.keepDatum&&(m._datum=e);const y=new Map;if(p&&Array.isArray(e.children)&&e.children.length)m.children=e.children.map((e,i)=>d(t,e,i,null,m._key,n,o,y));else if(p&&null!=e.drilldown&&!1!==o.expandDrilldown){const i=n||new Set;if(!i.has(e.drilldown)){const r=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(r&&Array.isArray(r.data)&&r.data.length){const s=new Set(i);s.add(e.drilldown);const n=Array.isArray(r.colors)?r.colors:null;m.children=r.data.map((e,i)=>d(t,e,i,n,m._key,s,o,y))}}}return m}function p(t){t.children&&t.children.length&&(t.children.forEach(t=>p(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}const f="http://www.w3.org/1999/xhtml";function _(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return n(n({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function g(t,e,i,r){var s;const n=null==(s=null==e?void 0:e.dimensions)?void 0:s.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,l=i.getBoundingClientRect().height||18,a=r&&r.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,r=t.dom.elWrap;if(!r)return i;const s=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!s.length)return i;const n=r.getBoundingClientRect().top,o=e.getBoundingClientRect();let l=i;for(let t=0;t<s.length;t++){const e=s[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(l=Math.min(l,e.top-n)))}return l}(t,i);if(c-o>=l+1)return i.style.top=`${c-l-1+a}px`,!0;i.style.top=`${o+a}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function m(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function y(t,e,i,r,s,n){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=r,t._parent=s,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=n.cap&&e>=n.cap,e>n.maxDepth&&(n.maxDepth=e),t._leaf||t._clipped)return;const o=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=i;for(let s=0;s<t.children.length;s++){const a=t.children[s],c=(r-i)*Math.max(0,a.value)/o;y(a,e+1,l,l+c,t,n),l+=c}}function b({roots:t,nodesAll:e,focus:i,t0:r,t1:s,cap:n}){for(let t=0;t<e.length;t++)e[t]._show=!1;const o={maxDepth:0,cap:n};if(i)return y(i,0,r,s,i._parent,o),o.maxDepth;const l=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let a=r;for(let e=0;e<t.length;e++){const i=(s-r)*Math.max(0,t[e].value)/l;y(t[e],0,a,a+i,null,o),a+=i}return o.maxDepth}function x(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function w(t,e,i){let r=t===e?t._parent||null:t;return!r||r.children&&r.children.length||(r=r._parent||null),i&&1===i.length&&r===i[0]&&(r=null),r===e?{changed:!1,focus:e}:{changed:!0,focus:r}}function v(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const r=parseInt(i,16);if(isNaN(r))return t;let s=r>>16&255,n=r>>8&255,o=255&r;return s=Math.round(s+(255-s)*e),n=Math.round(n+(255-n)*e),o=Math.round(o+(255-o)*e),"#"+((1<<24)+(s<<16)+(n<<8)+o).toString(16).slice(1)}function A(t,e,i,r){if(t._color=t.color||e,r.push(t),t.children)for(let e=0;e<t.children.length;e++){const s=t.children[e];A(s,s.color||v(t._color,i),i,r)}}class M{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&h.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){var i;const r=this._tip();if(!r)return;const s=this.w,n=(e.value/this.total*100).toFixed(1),o=e._parent?e._parent.value:this.total,l=o>0?(e.value/o*100).toFixed(1):n,a=s.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"",c=s.config.tooltip.y,h=null==(i=Array.isArray(c)?c[0]:c)?void 0:i.formatter,u=h?h(e.value,{seriesIndex:0,dataPointIndex:-1,w:s,node:e}):+e.value.toPrecision(12);r.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${a}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${u} (${l}% of parent, ${n}% of total)</span></div></div></div>`,r.classList.add("apexcharts-active"),r.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),r=e.offsetWidth,s=e.offsetHeight;let n=t.clientX-i.left+12;n+r>i.width&&(n=t.clientX-i.left-r-12),n=Math.max(0,Math.min(n,i.width-r));let o=t.clientY-i.top+12;o+s>i.height&&(o=t.clientY-i.top-s-12),o=Math.max(0,Math.min(o,i.height-s)),e.style.left=n+"px",e.style.top=o+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const S="http://www.w3.org/2000/svg",C=(t,e,i)=>t+(e-t)*i;l.default.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new M(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new a(this.w);this._graphics=i;const r=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return r;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return r;const s=this.cfg.direction;if(this._vertical="right"!==s&&"left"!==s,this._flip="up"===s||"left"===s,this._roots=function(t,e={}){const i=t.config.series,r=i&&i[0],s=r&&Array.isArray(r.data)?r.data:i;if(!Array.isArray(s))return[];const n=new Map;return s.map((i,r)=>d(t,i,r,null,"",null,e,n))}(this.w),!this._roots.length)return r;this._roots.forEach(t=>p(t)),this._nodesAll=[],this._colorNodes(),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),r=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&r(t[e].children)};r(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&function(t,{type:e,remedy:i}){let r=!1;const s=t=>{if(t.children&&t.children.length){const n=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!r&&null!=t.value&&Math.abs(n-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${n}). ${i}`),r=!0),t.children.forEach(s)}};t.forEach(s)}(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),r.add(this._cellsG),r.add(this._labelsG),this._focus=function(t,e,i){var r;const s=t&&e.find(e=>e._key===t);return s&&(null==(r=s.children)?void 0:r.length)&&(1!==i.length||s!==i[0])?s:null}(e.globals.icicleFocusKey,this._nodesAll,this._roots),this._relayout(this._focus);const n=e.config.chart.animations;let o="none";return n.enabled&&(e.globals.dataChanged?n.dynamicAnimation.enabled&&(o="update"):e.globals.resized||(o="intro")),this._applyLayout(o),this._renderBreadcrumb(),r}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const r=[];for(;1===i.length&&i[0].children&&i[0].children.length;)r.push(i[0]),i=i[0].children;const s=v(e,.62);r.forEach(t=>{t._color=t.color||s,this._nodesAll.push(t)}),i.forEach((i,r)=>{A(i,i.color||t[r%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){this.w.globals.icicleFocusKey=t&&t._key;const e=this._valueExtent(),i=this.cfg.maxDepth,r="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=x(t).length-1;this._focusMaxDepth=b({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:r?r-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=b({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:r?r-1:void 0});const s=this._depthExtent(),n=this._focusMaxDepth+1,o="equal"===this.cfg.levelSize?0:function(t,e,i=0){if("number"==typeof t)return t;const r=String(t).trim();if(r.endsWith("%"))return parseFloat(r)/100*e;const s=parseFloat(r);return isNaN(s)?i*e:s}(this.cfg.levelSize,s,0),l=o>0?Math.min(s,o*n):s,a=function({maxDepth:t,near:e,far:i,gap:r=0}){const s=t+1,n=(i-e)/s,o=s>1?r:0;return{near:t=>e+t*n+(t>0?o/2:0),far:t=>e+(t+1)*n-o/2}}({maxDepth:this._focusMaxDepth,near:0,far:l,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=a.near(t._vDepth),t._d1=function(t,e,i,r,s){return t._leaf&&"extend"===r&&t._vDepth<i?s:e.far(t._vDepth)}(t,a,this._focusMaxDepth,this.cfg.leaf,l))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const r=e/i,s=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-s)*r,n=(t._t1-s)*r;n<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,n))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),r=t._d0,s=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-r-s:r,w:i,h:s}:{x:this._flip?this.width-r-s:r,y:e,w:s,h:i}}_applyLayout(t){var e,i;const r=this.w.config.chart.animations,s=r.dynamicAnimation,n=r.enabled&&"none"!==t?"intro"===t?null!=(e=r.speed)?e:500:s.enabled?null!=(i=s.speed)?i:350:0:0,o=++this._zoomGen,l="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),function(t,e){h.isBrowser()&&!1!==t.cfg.zoomOnClick&&(e._el.node.style.cursor=w(e,t._focus,t._roots).changed?"pointer":"default")}(this,e),"intro"===t&&n>0)return void this._wipeCell(e,i,n,o);let r,s=!1;e._cur?r=e._cur:l&&l.get(e._key)?r=l.get(e._key)():(r={x:i.x+i.w/2,y:i.y+i.h/2,w:0,h:0},s=!0),this._animateCell(e,r,i,n,!1,s,o)}else if(e._el&&e._cur){const t=e._cur,i={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,i,n,!0,!1,o)}});const a=new Map;this._nodesAll.forEach(t=>{const e=this._box(t);t._show&&a.set(t._key,()=>t._cur||e)}),this.ctx._iciclePrevGeoms=a,this._renderLabels(n)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const r=i.node;return r.setAttribute("data:name",t.name),r.setAttribute("data:value",String(t.value)),r.setAttribute("data:key",function(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}(t._key)),r.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(r,t),h.isBrowser()&&!1!==this.cfg.zoomOnClick&&r.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,r){const s=t._el,n=this._focusMaxDepth+1,o=n>1?t._vDepth/n*i*.6:0,l=i-o,a=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(s,a),s.attr({opacity:1}),s.node.style.display="",t._cur=a,s.animate(l,o).during(i=>{if(this._zoomGen!==r)return;const n={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(s,n),t._cur=n}).after(()=>{this._zoomGen===r&&(this._setBox(s,e),t._cur=e)})}_animateCell(t,e,i,r,s,n,o){const l=t._el;if(l.attr({fill:t._color}),0===r)return this._setBox(l,i),l.attr({opacity:s?0:1}),l.node.style.display=s?"none":"",void(t._cur=s?null:i);l.node.style.display="";const a=s?Number(l.attr("opacity"))||1:n?0:1,c=s?0:1;l.attr({opacity:a}),l.animate(r).during(r=>{if(this._zoomGen!==o)return;const s={x:C(e.x,i.x,r),y:C(e.y,i.y,r),w:C(e.w,i.w,r),h:C(e.h,i.h,r)};this._setBox(l,s),l.attr({opacity:C(a,c,r)}),t._cur=s}).after(()=>{this._zoomGen===o&&(s?(l.node.style.display="none",t._cur=null):(this._setBox(l,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,r=Math.min(i,Math.max(0,e.w-.5))/2,s=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+r,y:e.y+s,width:Math.max(0,e.w-2*r),height:Math.max(0,e.h-2*s)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);if(!this.cfg.dataLabels.show)return;this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))});const i=this._zoomGen;e.attr({opacity:t>0?0:1}),t>0&&e.animate(250,t).during(t=>{this._zoomGen===i&&e.attr({opacity:t})})}_renderLabel(t){const e=this.cfg.dataLabels,i=e.style,r=this._box(t),s="always"===e.rotate||"never"!==e.rotate&&r.h>r.w,n=s?r.h:r.w,o=s?r.w:r.h,l=parseFloat(i.fontSize)||12;if(n<e.minSizeToShow)return;if(o<l+2)return;const a=n-8;let h=t.name;if(e.showValue){const e=`${t.name}: ${+t.value.toPrecision(12)}`;this._fits(e,a,l)&&(h=e)}const u=this._truncate(h,a,l);if(!u)return;const d=i.colors,p=(Array.isArray(d)?d[0]:d)||"#fff",f=c.createElementNS(S,"text");f.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&f.setAttribute("font-family",i.fontFamily),f.setAttribute("font-weight",String(i.fontWeight||400)),f.setAttribute("fill",p),f.setAttribute("dominant-baseline","central"),f.style.pointerEvents="none",f.textContent=u;const _="center"===e.align?"middle":"right"===e.align?"end":"start",g=r.x+4,m=r.x+r.w-4,y=r.x+r.w/2;if(s){const t=r.x+r.w/2,e=r.y+r.h-4,i=r.y+4,s=r.y+r.h/2,n="middle"===_?s:"end"===_?i:e;f.setAttribute("text-anchor",_),f.setAttribute("x",String(t)),f.setAttribute("y",String(n)),f.setAttribute("transform",`rotate(-90 ${t} ${n})`)}else{const t="middle"===_?y:"end"===_?m:g;f.setAttribute("text-anchor",_),f.setAttribute("x",String(t)),f.setAttribute("y",String(r.y+r.h/2))}this._labelsG.node.appendChild(f)}_renderMoreMark(t){const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,r=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,s=c.createElementNS(S,"g");s.setAttribute("class","apexcharts-icicle-more"),s.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=c.createElementNS(S,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:r)),e.setAttribute("cy",String(this._vertical?r:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),s.appendChild(e)}this._labelsG.node.appendChild(s)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const r=.58*i,s=Math.floor(e/r);return s>=t.length?t:s<4?"":t.slice(0,s-1)+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=w(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!h.isBrowser())return;if(!this._focus)return void m(this.w);const t=_(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(x(this._focus).map(t=>({label:t.name,data:t}))),r=function(t,e){if(!h.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;m(t);const r=e.config||_(t);if(!1===r.show)return null;const s=e.crumbs||[];if(s.length<2)return null;const n=c.createElementNS(f,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,r=e.offsetY||0;t.style.position="absolute",t.style.top=r+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(n,r),e.compact&&(n.style.fontSize="11px",n.style.padding="0 2px");const o=null!=r.separator?r.separator:" / ";return s.forEach((t,i)=>{var l;if(i>0){const t=c.createElementNS(f,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}let a=0===i?null!=(l=r.rootLabel)?l:"All":t.label;if("function"==typeof r.formatter&&(a=r.formatter(a,{index:i,depth:s.length-1,data:t.data})),i===s.length-1){const t=c.createElementNS(f,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(a),void n.appendChild(t)}const h=c.createElementNS(f,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=c.createElementNS(f,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const u=c.createElementNS(f,"span");u.setAttribute("class","apexcharts-breadcrumb-label"),u.textContent=String(a),h.appendChild(u),h.addEventListener("click",r=>e.onNavigate(i,t,r)),n.appendChild(h)}),i.appendChild(n),n}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});r&&g(this.w,this.ctx,r,t)}}}),Object.defineProperty(exports,"default",{enumerable:!0,get:()=>l.default});
|
package/dist/icicle.esm.js
CHANGED
|
@@ -15,7 +15,7 @@ var __spreadValues = (a, b) => {
|
|
|
15
15
|
return a;
|
|
16
16
|
};
|
|
17
17
|
/*!
|
|
18
|
-
* ApexCharts v8.
|
|
18
|
+
* ApexCharts v8.3.0
|
|
19
19
|
* (c) 2018-2026 ApexCharts
|
|
20
20
|
*/
|
|
21
21
|
import * as _core from "apexcharts/core";
|
|
@@ -29,26 +29,33 @@ function drilldownById(w, id) {
|
|
|
29
29
|
const list = dd && Array.isArray(dd.series) ? dd.series : [];
|
|
30
30
|
return list.find((s) => s && s.id === id);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function segment(name, seen) {
|
|
33
|
+
var _a;
|
|
34
|
+
const n = String(name).replace(/\//g, "%2F");
|
|
35
|
+
const o = ((_a = seen.get(n)) != null ? _a : -1) + 1;
|
|
36
|
+
seen.set(n, o);
|
|
37
|
+
return `${o}:${n}`;
|
|
38
|
+
}
|
|
39
|
+
function toNode(w, d, i, paletteFromParent, parentKey, seenIds = null, opts = {}, seen = /* @__PURE__ */ new Map()) {
|
|
33
40
|
var _a, _b, _c;
|
|
34
41
|
const isObj = d && typeof d === "object";
|
|
35
42
|
const name = isObj ? (_b = (_a = d.x) != null ? _a : d.name) != null ? _b : "" : "";
|
|
36
|
-
const
|
|
43
|
+
const raw = isObj ? (_c = d.y) != null ? _c : d.value : d;
|
|
44
|
+
const value = raw == null || raw === "" ? NaN : Number(raw);
|
|
37
45
|
const node = {
|
|
38
46
|
name: String(name),
|
|
39
47
|
value: isNaN(value) ? null : value,
|
|
40
48
|
color: isObj && d.color ? d.color : void 0,
|
|
41
|
-
|
|
42
|
-
// siblings stay distinct). Update animations morph matched keys in place.
|
|
43
|
-
_key: `${parentKey}/${i}:${name}`
|
|
49
|
+
_key: `${parentKey}/${segment(name, seen)}`
|
|
44
50
|
};
|
|
45
51
|
if (paletteFromParent && !node.color) {
|
|
46
52
|
node.color = paletteFromParent[i % paletteFromParent.length];
|
|
47
53
|
}
|
|
48
54
|
if (opts.keepDatum) node._datum = d;
|
|
55
|
+
const kids = /* @__PURE__ */ new Map();
|
|
49
56
|
if (isObj && Array.isArray(d.children) && d.children.length) {
|
|
50
57
|
node.children = d.children.map(
|
|
51
|
-
(c, j) => toNode(w, c, j, null, node._key, seenIds, opts)
|
|
58
|
+
(c, j) => toNode(w, c, j, null, node._key, seenIds, opts, kids)
|
|
52
59
|
);
|
|
53
60
|
} else if (isObj && d.drilldown != null && opts.expandDrilldown !== false) {
|
|
54
61
|
const visited = seenIds || /* @__PURE__ */ new Set();
|
|
@@ -59,7 +66,7 @@ function toNode(w, d, i, paletteFromParent, parentKey, seenIds = null, opts = {}
|
|
|
59
66
|
nextSeen.add(d.drilldown);
|
|
60
67
|
const palette = Array.isArray(dd.colors) ? dd.colors : null;
|
|
61
68
|
node.children = dd.data.map(
|
|
62
|
-
(c, j) => toNode(w, c, j, palette, node._key, nextSeen, opts)
|
|
69
|
+
(c, j) => toNode(w, c, j, palette, node._key, nextSeen, opts, kids)
|
|
63
70
|
);
|
|
64
71
|
}
|
|
65
72
|
}
|
|
@@ -74,8 +81,9 @@ function buildHierarchy(w, opts = {}) {
|
|
|
74
81
|
const first = cfgSeries && cfgSeries[0];
|
|
75
82
|
const data = first && Array.isArray(first.data) ? first.data : cfgSeries;
|
|
76
83
|
if (!Array.isArray(data)) return [];
|
|
84
|
+
const seen = /* @__PURE__ */ new Map();
|
|
77
85
|
return data.map(
|
|
78
|
-
(d, i) => toNode(w, d, i, null, "", null, opts)
|
|
86
|
+
(d, i) => toNode(w, d, i, null, "", null, opts, seen)
|
|
79
87
|
);
|
|
80
88
|
}
|
|
81
89
|
function fillValues(node) {
|
|
@@ -212,7 +220,7 @@ function renderBreadcrumb(w, opts) {
|
|
|
212
220
|
text.setAttribute("class", "apexcharts-breadcrumb-label");
|
|
213
221
|
text.textContent = String(label);
|
|
214
222
|
btn.appendChild(text);
|
|
215
|
-
btn.addEventListener("click", () => opts.onNavigate(i, crumb));
|
|
223
|
+
btn.addEventListener("click", (e) => opts.onNavigate(i, crumb, e));
|
|
216
224
|
nav.appendChild(btn);
|
|
217
225
|
});
|
|
218
226
|
elWrap.appendChild(nav);
|
|
@@ -332,6 +340,15 @@ function resolveFocus(node, current, roots) {
|
|
|
332
340
|
if (next === current) return { changed: false, focus: current };
|
|
333
341
|
return { changed: true, focus: next };
|
|
334
342
|
}
|
|
343
|
+
function focusByKey(key, nodesAll, roots) {
|
|
344
|
+
var _a;
|
|
345
|
+
const f = key && nodesAll.find((n) => n._key === key);
|
|
346
|
+
return f && ((_a = f.children) == null ? void 0 : _a.length) && !(roots.length === 1 && f === roots[0]) ? f : null;
|
|
347
|
+
}
|
|
348
|
+
function setZoomCursor(chart, node) {
|
|
349
|
+
if (!Environment.isBrowser() || chart.cfg.zoomOnClick === false) return;
|
|
350
|
+
node._el.node.style.cursor = resolveFocus(node, chart._focus, chart._roots).changed ? "pointer" : "default";
|
|
351
|
+
}
|
|
335
352
|
function parseSize(size, max, fallbackRatio = 0) {
|
|
336
353
|
if (typeof size === "number") return size;
|
|
337
354
|
const s = String(size).trim();
|
|
@@ -403,6 +420,7 @@ class NodeTooltip {
|
|
|
403
420
|
* @param {any} node
|
|
404
421
|
*/
|
|
405
422
|
show(e, node) {
|
|
423
|
+
var _a;
|
|
406
424
|
const t = this._tip();
|
|
407
425
|
if (!t) return;
|
|
408
426
|
const w = this.w;
|
|
@@ -410,7 +428,10 @@ class NodeTooltip {
|
|
|
410
428
|
const parentVal = node._parent ? node._parent.value : this.total;
|
|
411
429
|
const pctParent = parentVal > 0 ? (node.value / parentVal * 100).toFixed(1) : pctTotal;
|
|
412
430
|
const groupBg = w.config.tooltip.fillSeriesColor ? `background-color:${node._color};` : "";
|
|
413
|
-
|
|
431
|
+
const ty = w.config.tooltip.y;
|
|
432
|
+
const fmt = (_a = Array.isArray(ty) ? ty[0] : ty) == null ? void 0 : _a.formatter;
|
|
433
|
+
const val = fmt ? fmt(node.value, { seriesIndex: 0, dataPointIndex: -1, w, node }) : +node.value.toPrecision(12);
|
|
434
|
+
t.innerHTML = `<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${groupBg}"><span class="apexcharts-tooltip-marker" style="background-color:${node._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${node.name}: </span><span class="apexcharts-tooltip-text-y-value">${val} (${pctParent}% of parent, ${pctTotal}% of total)</span></div></div></div>`;
|
|
414
435
|
t.classList.add("apexcharts-active");
|
|
415
436
|
t.style.opacity = "1";
|
|
416
437
|
this.position(e);
|
|
@@ -493,6 +514,8 @@ class IcicleChart {
|
|
|
493
514
|
this._roots = buildHierarchy(this.w);
|
|
494
515
|
if (!this._roots.length) return g;
|
|
495
516
|
this._roots.forEach((r) => fillValues(r));
|
|
517
|
+
this._nodesAll = [];
|
|
518
|
+
this._colorNodes();
|
|
496
519
|
sortTree(this._roots, this.cfg.sort);
|
|
497
520
|
if (this.cfg.partition === "strict") {
|
|
498
521
|
validateStrict(this._roots, {
|
|
@@ -500,15 +523,17 @@ class IcicleChart {
|
|
|
500
523
|
remedy: "Extents are normalized to fill the parent."
|
|
501
524
|
});
|
|
502
525
|
}
|
|
503
|
-
this._nodesAll = [];
|
|
504
|
-
this._colorNodes();
|
|
505
526
|
this.total = this._roots.reduce((s, r) => s + Math.max(0, r.value), 0) || 1;
|
|
506
527
|
this._tooltip.total = this.total;
|
|
507
528
|
this._cellsG = graphics.group({ class: "apexcharts-icicle-cells" });
|
|
508
529
|
this._labelsG = graphics.group({ class: "apexcharts-icicle-labels" });
|
|
509
530
|
g.add(this._cellsG);
|
|
510
531
|
g.add(this._labelsG);
|
|
511
|
-
this._focus =
|
|
532
|
+
this._focus = focusByKey(
|
|
533
|
+
w.globals.icicleFocusKey,
|
|
534
|
+
this._nodesAll,
|
|
535
|
+
this._roots
|
|
536
|
+
);
|
|
512
537
|
this._relayout(this._focus);
|
|
513
538
|
const anims = w.config.chart.animations;
|
|
514
539
|
let mode = "none";
|
|
@@ -539,7 +564,7 @@ class IcicleChart {
|
|
|
539
564
|
const fallback = colors[0] || "#008FFB";
|
|
540
565
|
let level = this._roots;
|
|
541
566
|
const trunk = [];
|
|
542
|
-
while (level.length === 1 && level[0].children && level[0].children.length
|
|
567
|
+
while (level.length === 1 && level[0].children && level[0].children.length) {
|
|
543
568
|
trunk.push(level[0]);
|
|
544
569
|
level = level[0].children;
|
|
545
570
|
}
|
|
@@ -571,6 +596,7 @@ class IcicleChart {
|
|
|
571
596
|
* @param {any} focus
|
|
572
597
|
*/
|
|
573
598
|
_relayout(focus) {
|
|
599
|
+
this.w.globals.icicleFocusKey = focus && focus._key;
|
|
574
600
|
const extent = this._valueExtent();
|
|
575
601
|
const maxDepth = this.cfg.maxDepth;
|
|
576
602
|
const capLevels = typeof maxDepth === "number" && maxDepth > 0 ? maxDepth : 0;
|
|
@@ -686,9 +712,11 @@ class IcicleChart {
|
|
|
686
712
|
* @param {'intro'|'zoom'|'update'|'none'} mode
|
|
687
713
|
*/
|
|
688
714
|
_applyLayout(mode) {
|
|
715
|
+
var _a, _b;
|
|
689
716
|
const w = this.w;
|
|
690
717
|
const anims = w.config.chart.animations;
|
|
691
|
-
const
|
|
718
|
+
const dyn = anims.dynamicAnimation;
|
|
719
|
+
const dur = !anims.enabled || mode === "none" ? 0 : mode === "intro" ? (_a = anims.speed) != null ? _a : 500 : dyn.enabled ? (_b = dyn.speed) != null ? _b : 350 : 0;
|
|
692
720
|
const gen = ++this._zoomGen;
|
|
693
721
|
const prev = mode === "update" ? (
|
|
694
722
|
/** @type {any} */
|
|
@@ -699,7 +727,7 @@ class IcicleChart {
|
|
|
699
727
|
const to = this._box(node);
|
|
700
728
|
if (!node._el) node._el = this._createCellEl(node);
|
|
701
729
|
node._el.node.setAttribute("data:clipped", String(!!node._clipped));
|
|
702
|
-
this
|
|
730
|
+
setZoomCursor(this, node);
|
|
703
731
|
if (mode === "intro" && dur > 0) {
|
|
704
732
|
this._wipeCell(node, to, dur, gen);
|
|
705
733
|
return;
|
|
@@ -709,7 +737,7 @@ class IcicleChart {
|
|
|
709
737
|
if (node._cur) {
|
|
710
738
|
from = node._cur;
|
|
711
739
|
} else if (prev && prev.get(node._key)) {
|
|
712
|
-
from = prev.get(node._key);
|
|
740
|
+
from = prev.get(node._key)();
|
|
713
741
|
} else {
|
|
714
742
|
from = {
|
|
715
743
|
x: to.x + to.w / 2,
|
|
@@ -733,7 +761,8 @@ class IcicleChart {
|
|
|
733
761
|
});
|
|
734
762
|
const geoms = /* @__PURE__ */ new Map();
|
|
735
763
|
this._nodesAll.forEach((n) => {
|
|
736
|
-
|
|
764
|
+
const b = this._box(n);
|
|
765
|
+
if (n._show) geoms.set(n._key, () => n._cur || b);
|
|
737
766
|
});
|
|
738
767
|
this.ctx._iciclePrevGeoms = geoms;
|
|
739
768
|
this._renderLabels(dur);
|
|
@@ -890,11 +919,12 @@ class IcicleChart {
|
|
|
890
919
|
this._renderLabel(node);
|
|
891
920
|
if (node._clipped) this._renderMoreMark(node);
|
|
892
921
|
});
|
|
922
|
+
const gen = this._zoomGen;
|
|
923
|
+
labelsG.attr({ opacity: dur > 0 ? 0 : 1 });
|
|
893
924
|
if (dur > 0) {
|
|
894
|
-
labelsG.
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
labelsG.attr({ opacity: 1 });
|
|
925
|
+
labelsG.animate(250, dur).during((p) => {
|
|
926
|
+
if (this._zoomGen === gen) labelsG.attr({ opacity: p });
|
|
927
|
+
});
|
|
898
928
|
}
|
|
899
929
|
}
|
|
900
930
|
/**
|
|
@@ -907,7 +937,6 @@ class IcicleChart {
|
|
|
907
937
|
* @param {any} node
|
|
908
938
|
*/
|
|
909
939
|
_renderLabel(node) {
|
|
910
|
-
if (!Environment.isBrowser()) return;
|
|
911
940
|
const dl = this.cfg.dataLabels;
|
|
912
941
|
const style = dl.style;
|
|
913
942
|
const box = this._box(node);
|
|
@@ -920,7 +949,7 @@ class IcicleChart {
|
|
|
920
949
|
const room = along - 8;
|
|
921
950
|
let label = node.name;
|
|
922
951
|
if (dl.showValue) {
|
|
923
|
-
const full = `${node.name}: ${node.value}`;
|
|
952
|
+
const full = `${node.name}: ${+node.value.toPrecision(12)}`;
|
|
924
953
|
if (this._fits(full, room, fontPx)) label = full;
|
|
925
954
|
}
|
|
926
955
|
const text = this._truncate(label, room, fontPx);
|
|
@@ -969,7 +998,6 @@ class IcicleChart {
|
|
|
969
998
|
* @param {any} node
|
|
970
999
|
*/
|
|
971
1000
|
_renderMoreMark(node) {
|
|
972
|
-
if (!Environment.isBrowser()) return;
|
|
973
1001
|
const box = this._box(node);
|
|
974
1002
|
const along = this._vertical ? box.w : box.h;
|
|
975
1003
|
if (along < 18) return;
|
|
@@ -1020,18 +1048,6 @@ class IcicleChart {
|
|
|
1020
1048
|
return name.slice(0, maxChars - 1) + "…";
|
|
1021
1049
|
}
|
|
1022
1050
|
// ----------------------------------------------------------------- zoom
|
|
1023
|
-
/**
|
|
1024
|
-
* A cell offers the pointer only while clicking it would change the view.
|
|
1025
|
-
* A leaf under the current focus, or the single root of a one-root tree,
|
|
1026
|
-
* resolves to the focus the reader is already on, and a pointer there
|
|
1027
|
-
* promises a zoom that cannot happen. Asked on every layout, because a zoom
|
|
1028
|
-
* changes the answer for every cell.
|
|
1029
|
-
* @param {any} node
|
|
1030
|
-
*/
|
|
1031
|
-
_setCursor(node) {
|
|
1032
|
-
if (!Environment.isBrowser() || this.cfg.zoomOnClick === false) return;
|
|
1033
|
-
node._el.node.style.cursor = resolveFocus(node, this._focus, this._roots).changed ? "pointer" : "default";
|
|
1034
|
-
}
|
|
1035
1051
|
/**
|
|
1036
1052
|
* Focus a node (zoom in), or zoom out one level when the current focus is
|
|
1037
1053
|
* clicked.
|
package/dist/icicle.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* ApexCharts v8.
|
|
2
|
+
* ApexCharts v8.3.0
|
|
3
3
|
* (c) 2018-2026 ApexCharts
|
|
4
4
|
*/
|
|
5
|
-
!function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/icicle.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/icicle.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/icicle.js",run:t,done:!1},r=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);r.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var n=r.indexOf(s);-1!==n&&r.splice(n,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/icicle.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/icicle.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/icicle.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/icicle.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,o=(t,e)=>{for(var o in e||(e={}))s.call(e,o)&&n(t,o,e[o]);if(i)for(var o of i(e))r.call(e,o)&&n(t,o,e[o]);return t};const a=globalThis.ApexCharts,l=globalThis.ApexCharts.__internals.__apex_Graphics,h=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,c=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function d(t,e,i,s,r,n=null,o={}){var a,l,h;const c=e&&"object"==typeof e,u=c&&null!=(l=null!=(a=e.x)?a:e.name)?l:"",p=Number(c?null!=(h=e.y)?h:e.value:e),f={name:String(u),value:isNaN(p)?null:p,color:c&&e.color?e.color:void 0,_key:`${r}/${i}:${u}`};if(s&&!f.color&&(f.color=s[i%s.length]),o.keepDatum&&(f._datum=e),c&&Array.isArray(e.children)&&e.children.length)f.children=e.children.map((e,i)=>d(t,e,i,null,f._key,n,o));else if(c&&null!=e.drilldown&&!1!==o.expandDrilldown){const i=n||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const r=new Set(i);r.add(e.drilldown);const n=Array.isArray(s.colors)?s.colors:null;f.children=s.data.map((e,i)=>d(t,e,i,n,f._key,r,o))}}}return f}function u(t){t.children&&t.children.length&&(t.children.forEach(t=>u(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}const p="http://www.w3.org/1999/xhtml";function f(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function _(t,e,i,s){var r;const n=null==(r=null==e?void 0:e.dimensions)?void 0:r.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,a=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,h=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const r=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!r.length)return i;const n=s.getBoundingClientRect().top,o=e.getBoundingClientRect();let a=i;for(let t=0;t<r.length;t++){const e=r[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(a=Math.min(a,e.top-n)))}return a}(t,i);if(h-o>=a+1)return i.style.top=`${h-a-1+l}px`,!0;i.style.top=`${o+l}px`;const c="dark"===t.config.theme.mode;return i.style.background=c?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function g(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function x(t,e,i,s,r,n){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=s,t._parent=r,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=n.cap&&e>=n.cap,e>n.maxDepth&&(n.maxDepth=e),t._leaf||t._clipped)return;const o=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let a=i;for(let r=0;r<t.children.length;r++){const l=t.children[r],h=(s-i)*Math.max(0,l.value)/o;x(l,e+1,a,a+h,t,n),a+=h}}function m({roots:t,nodesAll:e,focus:i,t0:s,t1:r,cap:n}){for(let t=0;t<e.length;t++)e[t]._show=!1;const o={maxDepth:0,cap:n};if(i)return x(i,0,s,r,i._parent,o),o.maxDepth;const a=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=s;for(let e=0;e<t.length;e++){const i=(r-s)*Math.max(0,t[e].value)/a;x(t[e],0,l,l+i,null,o),l+=i}return o.maxDepth}function y(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function b(t,e,i){let s=t===e?t._parent||null:t;return!s||s.children&&s.children.length||(s=s._parent||null),i&&1===i.length&&s===i[0]&&(s=null),s===e?{changed:!1,focus:e}:{changed:!0,focus:s}}function w(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const s=parseInt(i,16);if(isNaN(s))return t;let r=s>>16&255,n=s>>8&255,o=255&s;return r=Math.round(r+(255-r)*e),n=Math.round(n+(255-n)*e),o=Math.round(o+(255-o)*e),"#"+((1<<24)+(r<<16)+(n<<8)+o).toString(16).slice(1)}function v(t,e,i,s){if(t._color=t.color||e,s.push(t),t.children)for(let e=0;e<t.children.length;e++){const r=t.children[e];v(r,r.color||w(t._color,i),i,s)}}class A{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&c.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){const i=this._tip();if(!i)return;const s=this.w,r=(e.value/this.total*100).toFixed(1),n=e._parent?e._parent.value:this.total,o=n>0?(e.value/n*100).toFixed(1):r,a=s.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"";i.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${a}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${e.value} (${o}% of parent, ${r}% of total)</span></div></div></div>`,i.classList.add("apexcharts-active"),i.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,r=e.offsetHeight;let n=t.clientX-i.left+12;n+s>i.width&&(n=t.clientX-i.left-s-12),n=Math.max(0,Math.min(n,i.width-s));let o=t.clientY-i.top+12;o+r>i.height&&(o=t.clientY-i.top-r-12),o=Math.max(0,Math.min(o,i.height-r)),e.style.left=n+"px",e.style.top=o+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const C="http://www.w3.org/2000/svg",S=(t,e,i)=>t+(e-t)*i;a.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new A(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new l(this.w);this._graphics=i;const s=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return s;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return s;const r=this.cfg.direction;if(this._vertical="right"!==r&&"left"!==r,this._flip="up"===r||"left"===r,this._roots=function(t,e={}){const i=t.config.series,s=i&&i[0],r=s&&Array.isArray(s.data)?s.data:i;return Array.isArray(r)?r.map((i,s)=>d(t,i,s,null,"",null,e)):[]}(this.w),!this._roots.length)return s;this._roots.forEach(t=>u(t)),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),s=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&s(t[e].children)};s(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&function(t,{type:e,remedy:i}){let s=!1;const r=t=>{if(t.children&&t.children.length){const n=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!s&&null!=t.value&&Math.abs(n-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${n}). ${i}`),s=!0),t.children.forEach(r)}};t.forEach(r)}(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this._nodesAll=[],this._colorNodes(),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),s.add(this._cellsG),s.add(this._labelsG),this._focus=null,this._relayout(this._focus);const n=e.config.chart.animations;let o="none";return n.enabled&&(e.globals.dataChanged?n.dynamicAnimation.enabled&&(o="update"):e.globals.resized||(o="intro")),this._applyLayout(o),this._renderBreadcrumb(),s}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const s=[];for(;1===i.length&&i[0].children&&i[0].children.length>1;)s.push(i[0]),i=i[0].children;const r=w(e,.62);s.forEach(t=>{t._color=t.color||r,this._nodesAll.push(t)}),i.forEach((i,s)=>{v(i,i.color||t[s%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){const e=this._valueExtent(),i=this.cfg.maxDepth,s="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=y(t).length-1;this._focusMaxDepth=m({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:s?s-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=m({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:s?s-1:void 0});const r=this._depthExtent(),n=this._focusMaxDepth+1,o="equal"===this.cfg.levelSize?0:function(t,e,i=0){if("number"==typeof t)return t;const s=String(t).trim();if(s.endsWith("%"))return parseFloat(s)/100*e;const r=parseFloat(s);return isNaN(r)?i*e:r}(this.cfg.levelSize,r,0),a=o>0?Math.min(r,o*n):r,l=function({maxDepth:t,near:e,far:i,gap:s=0}){const r=t+1,n=(i-e)/r,o=r>1?s:0;return{near:t=>e+t*n+(t>0?o/2:0),far:t=>e+(t+1)*n-o/2}}({maxDepth:this._focusMaxDepth,near:0,far:a,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=l.near(t._vDepth),t._d1=function(t,e,i,s,r){return t._leaf&&"extend"===s&&t._vDepth<i?r:e.far(t._vDepth)}(t,l,this._focusMaxDepth,this.cfg.leaf,a))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const s=e/i,r=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-r)*s,n=(t._t1-r)*s;n<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,n))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),s=t._d0,r=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-s-r:s,w:i,h:r}:{x:this._flip?this.width-s-r:s,y:e,w:r,h:i}}_applyLayout(t){const e=this.w.config.chart.animations,i=e.enabled?"none"===t?0:"update"===t||"zoom"===t?e.dynamicAnimation.speed||350:e.speed||500:0,s=++this._zoomGen,r="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const n=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),this._setCursor(e),"intro"===t&&i>0)return void this._wipeCell(e,n,i,s);let o,a=!1;e._cur?o=e._cur:r&&r.get(e._key)?o=r.get(e._key):(o={x:n.x+n.w/2,y:n.y+n.h/2,w:0,h:0},a=!0),this._animateCell(e,o,n,i,!1,a,s)}else if(e._el&&e._cur){const t=e._cur,r={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,r,i,!0,!1,s)}});const n=new Map;this._nodesAll.forEach(t=>{t._show&&n.set(t._key,this._box(t))}),this.ctx._iciclePrevGeoms=n,this._renderLabels(i)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const s=i.node;return s.setAttribute("data:name",t.name),s.setAttribute("data:value",String(t.value)),s.setAttribute("data:key",function(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}(t._key)),s.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(s,t),c.isBrowser()&&!1!==this.cfg.zoomOnClick&&s.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,s){const r=t._el,n=this._focusMaxDepth+1,o=n>1?t._vDepth/n*i*.6:0,a=i-o,l=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(r,l),r.attr({opacity:1}),r.node.style.display="",t._cur=l,r.animate(a,o).during(i=>{if(this._zoomGen!==s)return;const n={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(r,n),t._cur=n}).after(()=>{this._zoomGen===s&&(this._setBox(r,e),t._cur=e)})}_animateCell(t,e,i,s,r,n,o){const a=t._el;if(a.attr({fill:t._color}),0===s)return this._setBox(a,i),a.attr({opacity:r?0:1}),a.node.style.display=r?"none":"",void(t._cur=r?null:i);a.node.style.display="";const l=r?Number(a.attr("opacity"))||1:n?0:1,h=r?0:1;a.attr({opacity:l}),a.animate(s).during(s=>{if(this._zoomGen!==o)return;const r={x:S(e.x,i.x,s),y:S(e.y,i.y,s),w:S(e.w,i.w,s),h:S(e.h,i.h,s)};this._setBox(a,r),a.attr({opacity:S(l,h,s)}),t._cur=r}).after(()=>{this._zoomGen===o&&(r?(a.node.style.display="none",t._cur=null):(this._setBox(a,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,s=Math.min(i,Math.max(0,e.w-.5))/2,r=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+s,y:e.y+r,width:Math.max(0,e.w-2*s),height:Math.max(0,e.h-2*r)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);this.cfg.dataLabels.show&&(this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))}),t>0?(e.attr({opacity:0}),e.animate(250,t).attr({opacity:1})):e.attr({opacity:1}))}_renderLabel(t){if(!c.isBrowser())return;const e=this.cfg.dataLabels,i=e.style,s=this._box(t),r="always"===e.rotate||"never"!==e.rotate&&s.h>s.w,n=r?s.h:s.w,o=r?s.w:s.h,a=parseFloat(i.fontSize)||12;if(n<e.minSizeToShow)return;if(o<a+2)return;const l=n-8;let d=t.name;if(e.showValue){const e=`${t.name}: ${t.value}`;this._fits(e,l,a)&&(d=e)}const u=this._truncate(d,l,a);if(!u)return;const p=i.colors,f=(Array.isArray(p)?p[0]:p)||"#fff",_=h.createElementNS(C,"text");_.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&_.setAttribute("font-family",i.fontFamily),_.setAttribute("font-weight",String(i.fontWeight||400)),_.setAttribute("fill",f),_.setAttribute("dominant-baseline","central"),_.style.pointerEvents="none",_.textContent=u;const g="center"===e.align?"middle":"right"===e.align?"end":"start",x=s.x+4,m=s.x+s.w-4,y=s.x+s.w/2;if(r){const t=s.x+s.w/2,e=s.y+s.h-4,i=s.y+4,r=s.y+s.h/2,n="middle"===g?r:"end"===g?i:e;_.setAttribute("text-anchor",g),_.setAttribute("x",String(t)),_.setAttribute("y",String(n)),_.setAttribute("transform",`rotate(-90 ${t} ${n})`)}else{const t="middle"===g?y:"end"===g?m:x;_.setAttribute("text-anchor",g),_.setAttribute("x",String(t)),_.setAttribute("y",String(s.y+s.h/2))}this._labelsG.node.appendChild(_)}_renderMoreMark(t){if(!c.isBrowser())return;const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,s=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,r=h.createElementNS(C,"g");r.setAttribute("class","apexcharts-icicle-more"),r.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=h.createElementNS(C,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:s)),e.setAttribute("cy",String(this._vertical?s:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),r.appendChild(e)}this._labelsG.node.appendChild(r)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const s=.58*i,r=Math.floor(e/s);return r>=t.length?t:r<4?"":t.slice(0,r-1)+"\u2026"}_setCursor(t){c.isBrowser()&&!1!==this.cfg.zoomOnClick&&(t._el.node.style.cursor=b(t,this._focus,this._roots).changed?"pointer":"default")}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=b(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!c.isBrowser())return;if(!this._focus)return void g(this.w);const t=f(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(y(this._focus).map(t=>({label:t.name,data:t}))),s=function(t,e){if(!c.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;g(t);const s=e.config||f(t);if(!1===s.show)return null;const r=e.crumbs||[];if(r.length<2)return null;const n=h.createElementNS(p,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(n,s),e.compact&&(n.style.fontSize="11px",n.style.padding="0 2px");const o=null!=s.separator?s.separator:" / ";return r.forEach((t,i)=>{var a;if(i>0){const t=h.createElementNS(p,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}let l=0===i?null!=(a=s.rootLabel)?a:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:r.length-1,data:t.data})),i===r.length-1){const t=h.createElementNS(p,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void n.appendChild(t)}const c=h.createElementNS(p,"button");if(c.setAttribute("type","button"),c.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=h.createElementNS(p,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",c.appendChild(t)}const d=h.createElementNS(p,"span");d.setAttribute("class","apexcharts-breadcrumb-label"),d.textContent=String(l),c.appendChild(d),c.addEventListener("click",()=>e.onNavigate(i,t)),n.appendChild(c)}),i.appendChild(n),n}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});s&&_(this.w,this.ctx,s,t)}}}),t.default=a,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexIcicle={})});
|
|
5
|
+
!function(t){var e="undefined"!=typeof globalThis?globalThis:self,i=e.ApexCharts;if(i&&i.__internals)return t.call(e);if(i)throw new Error("ApexCharts: dist/icicle.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");if("function"==typeof define&&define.amd)return t.call(e);if("object"==typeof exports&&"undefined"!=typeof module||"undefined"==typeof window||"undefined"==typeof document)throw new Error("ApexCharts: dist/icicle.js is a script-tag add-on and needs the ApexCharts script on the page. A bundler imports the matching apexcharts/ sub-path instead.");var s={file:"dist/icicle.js",run:t,done:!1},r=e.__apexcharts_pending_addons__||(e.__apexcharts_pending_addons__=[]);r.push(s),"complete"!==document.readyState&&window.addEventListener("load",function(){if(!s.done){var i=e.ApexCharts;if(i)if(i.__internals){s.done=!0;var n=r.indexOf(s);-1!==n&&r.splice(n,1);try{t.call(e),i.__drainsAddons||e.console.warn("ApexCharts: dist/icicle.js loaded before the ApexCharts script, which is older than 8.0 and does not pick up add-ons loaded first, so it registered only when the page finished loading. Put its tag after the ApexCharts script.")}catch(t){e.console.error("ApexCharts: dist/icicle.js could not register with the ApexCharts script on this page: "+(t&&t.message))}}else e.console.error("ApexCharts: dist/icicle.js cannot register: the ApexCharts on this page has no add-on surface (a script before 7.0, or a bundled apexcharts/core class). Load apexcharts.min.js, apexcharts.core.min.js or apexcharts.full.min.js.");else e.console.warn("ApexCharts: dist/icicle.js is waiting for the ApexCharts script, which had not loaded when the page finished loading. It registers when an ApexCharts 8.0 or later script loads; if the page has none, add apexcharts.min.js (or apexcharts.core.min.js, or apexcharts.full.min.js).")}})}(function(){var t,e;t=this,e=function(t){"use strict";var e=Object.defineProperty,i=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,n=(t,i,s)=>i in t?e(t,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[i]=s,o=(t,e)=>{for(var o in e||(e={}))s.call(e,o)&&n(t,o,e[o]);if(i)for(var o of i(e))r.call(e,o)&&n(t,o,e[o]);return t};const a=globalThis.ApexCharts,l=globalThis.ApexCharts.__internals.__apex_Graphics,c=globalThis.ApexCharts.__internals.__apex_BrowserAPIs_BrowserAPIs,h=globalThis.ApexCharts.__internals.__apex_Environment_Environment;function d(t,e){var i;const s=String(t).replace(/\//g,"%2F"),r=(null!=(i=e.get(s))?i:-1)+1;return e.set(s,r),`${r}:${s}`}function u(t,e,i,s,r,n=null,o={},a=new Map){var l,c,h;const p=e&&"object"==typeof e,f=p&&null!=(c=null!=(l=e.x)?l:e.name)?c:"",_=p?null!=(h=e.y)?h:e.value:e,g=null==_||""===_?NaN:Number(_),x={name:String(f),value:isNaN(g)?null:g,color:p&&e.color?e.color:void 0,_key:`${r}/${d(f,a)}`};s&&!x.color&&(x.color=s[i%s.length]),o.keepDatum&&(x._datum=e);const m=new Map;if(p&&Array.isArray(e.children)&&e.children.length)x.children=e.children.map((e,i)=>u(t,e,i,null,x._key,n,o,m));else if(p&&null!=e.drilldown&&!1!==o.expandDrilldown){const i=n||new Set;if(!i.has(e.drilldown)){const s=function(t,e){const i=t.config.drilldown;return(i&&Array.isArray(i.series)?i.series:[]).find(t=>t&&t.id===e)}(t,e.drilldown);if(s&&Array.isArray(s.data)&&s.data.length){const r=new Set(i);r.add(e.drilldown);const n=Array.isArray(s.colors)?s.colors:null;x.children=s.data.map((e,i)=>u(t,e,i,n,x._key,r,o,m))}}}return x}function p(t){t.children&&t.children.length&&(t.children.forEach(t=>p(t)),(null==t.value||isNaN(t.value))&&(t.value=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0))),(null==t.value||isNaN(t.value))&&(t.value=0)}const f="http://www.w3.org/1999/xhtml";function _(t,e){const i=t.config.drilldown&&t.config.drilldown.breadcrumb||{};return o(o({show:!0,position:"top-left",separator:" / ",rootLabel:"All",offsetX:0,offsetY:0,formatter:void 0},i),{})}function g(t,e,i,s){var r;const n=null==(r=null==e?void 0:e.dimensions)?void 0:r.dimHelpers,o=n?n.getTitleSubtitleCoords("title").height+n.getTitleSubtitleCoords("subtitle").height:0,a=i.getBoundingClientRect().height||18,l=s&&s.offsetY||0,c=function(t,e){const i=t.layout.translateY||0,s=t.dom.elWrap;if(!s)return i;const r=t.dom.baseEl.querySelectorAll(".apexcharts-yaxis-label");if(!r.length)return i;const n=s.getBoundingClientRect().top,o=e.getBoundingClientRect();let a=i;for(let t=0;t<r.length;t++){const e=r[t].getBoundingClientRect();e.height&&(e.left>=o.right||e.right<=o.left||(a=Math.min(a,e.top-n)))}return a}(t,i);if(c-o>=a+1)return i.style.top=`${c-a-1+l}px`,!0;i.style.top=`${o+l}px`;const h="dark"===t.config.theme.mode;return i.style.background=h?"rgba(20,24,30,0.82)":"rgba(255,255,255,0.86)",i.style.borderRadius="4px",!1}function x(t){const e=t.dom.elWrap;if(!e)return;const i=e.querySelector(".apexcharts-breadcrumb");i&&i.parentNode&&i.parentNode.removeChild(i)}function m(t,e,i,s,r,n){if(t._show=!0,t._vDepth=e,t._t0=i,t._t1=s,t._parent=r,t._leaf=!(t.children&&t.children.length),t._clipped=!t._leaf&&null!=n.cap&&e>=n.cap,e>n.maxDepth&&(n.maxDepth=e),t._leaf||t._clipped)return;const o=t.children.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let a=i;for(let r=0;r<t.children.length;r++){const l=t.children[r],c=(s-i)*Math.max(0,l.value)/o;m(l,e+1,a,a+c,t,n),a+=c}}function y({roots:t,nodesAll:e,focus:i,t0:s,t1:r,cap:n}){for(let t=0;t<e.length;t++)e[t]._show=!1;const o={maxDepth:0,cap:n};if(i)return m(i,0,s,r,i._parent,o),o.maxDepth;const a=t.reduce((t,e)=>t+Math.max(0,e.value),0)||1;let l=s;for(let e=0;e<t.length;e++){const i=(r-s)*Math.max(0,t[e].value)/a;m(t[e],0,l,l+i,null,o),l+=i}return o.maxDepth}function b(t){const e=[];let i=t;for(;i;)e.unshift(i),i=i._parent;return e}function w(t,e,i){let s=t===e?t._parent||null:t;return!s||s.children&&s.children.length||(s=s._parent||null),i&&1===i.length&&s===i[0]&&(s=null),s===e?{changed:!1,focus:e}:{changed:!0,focus:s}}function v(t,e){if("string"!=typeof t||"#"!==t[0])return t;let i=t.slice(1);if(3===i.length&&(i=i.split("").map(t=>t+t).join("")),6!==i.length)return t;const s=parseInt(i,16);if(isNaN(s))return t;let r=s>>16&255,n=s>>8&255,o=255&s;return r=Math.round(r+(255-r)*e),n=Math.round(n+(255-n)*e),o=Math.round(o+(255-o)*e),"#"+((1<<24)+(r<<16)+(n<<8)+o).toString(16).slice(1)}function A(t,e,i,s){if(t._color=t.color||e,s.push(t),t.children)for(let e=0;e<t.children.length;e++){const r=t.children[e];A(r,r.color||v(t._color,i),i,s)}}class C{constructor(t){this.w=t,this.total=1,this._el=null}_tip(){return this._el||(this._el=this.w.dom.baseEl.querySelector(".apexcharts-tooltip")),this._el}attach(t,e){this.w.config.tooltip.enabled&&h.isBrowser()&&(t.addEventListener("mouseenter",t=>this.show(t,e)),t.addEventListener("mousemove",t=>this.position(t)),t.addEventListener("mouseleave",()=>this.hide()))}show(t,e){var i;const s=this._tip();if(!s)return;const r=this.w,n=(e.value/this.total*100).toFixed(1),o=e._parent?e._parent.value:this.total,a=o>0?(e.value/o*100).toFixed(1):n,l=r.config.tooltip.fillSeriesColor?`background-color:${e._color};`:"",c=r.config.tooltip.y,h=null==(i=Array.isArray(c)?c[0]:c)?void 0:i.formatter,d=h?h(e.value,{seriesIndex:0,dataPointIndex:-1,w:r,node:e}):+e.value.toPrecision(12);s.innerHTML=`<div class="apexcharts-tooltip-series-group apexcharts-active" style="display:flex;${l}"><span class="apexcharts-tooltip-marker" style="background-color:${e._color}"></span><div class="apexcharts-tooltip-text"><div class="apexcharts-tooltip-y-group"><span class="apexcharts-tooltip-text-y-label">${e.name}: </span><span class="apexcharts-tooltip-text-y-value">${d} (${a}% of parent, ${n}% of total)</span></div></div></div>`,s.classList.add("apexcharts-active"),s.style.opacity="1",this.position(t)}position(t){const e=this._tip();if(!e)return;const i=this.w.dom.elWrap.getBoundingClientRect(),s=e.offsetWidth,r=e.offsetHeight;let n=t.clientX-i.left+12;n+s>i.width&&(n=t.clientX-i.left-s-12),n=Math.max(0,Math.min(n,i.width-s));let o=t.clientY-i.top+12;o+r>i.height&&(o=t.clientY-i.top-r-12),o=Math.max(0,Math.min(o,i.height-r)),e.style.left=n+"px",e.style.top=o+"px"}hide(){const t=this._tip();t&&(t.classList.remove("apexcharts-active"),t.style.opacity="0")}}const M="http://www.w3.org/2000/svg",S=(t,e,i)=>t+(e-t)*i;a.use({icicle:class{constructor(t,e){this.ctx=e,this.w=t;const i=t.config;this.cfg=i.plotOptions.icicle,this.strokeWidth=i.stroke.show?i.stroke.width:0,this.strokeColor=Array.isArray(i.stroke.colors)?i.stroke.colors[0]:i.stroke.colors||"#fff",this.width=0,this.height=0,this._vertical=!0,this._flip=!1,this.total=1,this._focusMaxDepth=0,this._focus=null,this._zoomGen=0,this._roots=[],this._nodesAll=[],this._tooltip=new C(t),this._graphics=null,this._cellsG=null,this._labelsG=null}draw(t){const e=this.w,i=new l(this.w);this._graphics=i;const s=i.group({class:"apexcharts-icicle"});if(e.globals.noData||!t||!t.length)return s;if(this.width=e.layout.gridWidth,this.height=e.layout.gridHeight,this.width<5||this.height<5)return s;const r=this.cfg.direction;if(this._vertical="right"!==r&&"left"!==r,this._flip="up"===r||"left"===r,this._roots=function(t,e={}){const i=t.config.series,s=i&&i[0],r=s&&Array.isArray(s.data)?s.data:i;if(!Array.isArray(r))return[];const n=new Map;return r.map((i,s)=>u(t,i,s,null,"",null,e,n))}(this.w),!this._roots.length)return s;this._roots.forEach(t=>p(t)),this._nodesAll=[],this._colorNodes(),function(t,e){if("value"!==e&&"name"!==e)return;const i="value"===e?(t,e)=>(e.value||0)-(t.value||0):(t,e)=>String(t.name).localeCompare(String(e.name)),s=t=>{t.sort(i);for(let e=0;e<t.length;e++)t[e].children&&t[e].children.length&&s(t[e].children)};s(t)}(this._roots,this.cfg.sort),"strict"===this.cfg.partition&&function(t,{type:e,remedy:i}){let s=!1;const r=t=>{if(t.children&&t.children.length){const n=t.children.reduce((t,e)=>t+Math.max(0,e.value||0),0);!s&&null!=t.value&&Math.abs(n-t.value)>.5&&(console.warn(`ApexCharts ${e}: partition 'strict' but "${t.name}" (${t.value}) != sum of its children (${n}). ${i}`),s=!0),t.children.forEach(r)}};t.forEach(r)}(this._roots,{type:"icicle",remedy:"Extents are normalized to fill the parent."}),this.total=this._roots.reduce((t,e)=>t+Math.max(0,e.value),0)||1,this._tooltip.total=this.total,this._cellsG=i.group({class:"apexcharts-icicle-cells"}),this._labelsG=i.group({class:"apexcharts-icicle-labels"}),s.add(this._cellsG),s.add(this._labelsG),this._focus=function(t,e,i){var s;const r=t&&e.find(e=>e._key===t);return r&&(null==(s=r.children)?void 0:s.length)&&(1!==i.length||r!==i[0])?r:null}(e.globals.icicleFocusKey,this._nodesAll,this._roots),this._relayout(this._focus);const n=e.config.chart.animations;let o="none";return n.enabled&&(e.globals.dataChanged?n.dynamicAnimation.enabled&&(o="update"):e.globals.resized||(o="intro")),this._applyLayout(o),this._renderBreadcrumb(),s}_colorNodes(){const t=this.w.globals.colors||[],e=t[0]||"#008FFB";let i=this._roots;const s=[];for(;1===i.length&&i[0].children&&i[0].children.length;)s.push(i[0]),i=i[0].children;const r=v(e,.62);s.forEach(t=>{t._color=t.color||r,this._nodesAll.push(t)}),i.forEach((i,s)=>{A(i,i.color||t[s%t.length]||e,this.cfg.tint,this._nodesAll)})}_valueExtent(){return this._vertical?this.width:this.height}_depthExtent(){return this._vertical?this.height:this.width}_relayout(t){this.w.globals.icicleFocusKey=t&&t._key;const e=this._valueExtent(),i=this.cfg.maxDepth,s="number"==typeof i&&i>0?i:0;if(t&&"both"!==this.cfg.zoomType){const i=b(t).length-1;this._focusMaxDepth=y({roots:this._roots,nodesAll:this._nodesAll,focus:null,t0:0,t1:e,cap:s?s-1+i:void 0}),this._stretchTo(t,e)}else this._focusMaxDepth=y({roots:this._roots,nodesAll:this._nodesAll,focus:t,t0:0,t1:e,cap:s?s-1:void 0});const r=this._depthExtent(),n=this._focusMaxDepth+1,o="equal"===this.cfg.levelSize?0:function(t,e,i=0){if("number"==typeof t)return t;const s=String(t).trim();if(s.endsWith("%"))return parseFloat(s)/100*e;const r=parseFloat(s);return isNaN(r)?i*e:r}(this.cfg.levelSize,r,0),a=o>0?Math.min(r,o*n):r,l=function({maxDepth:t,near:e,far:i,gap:s=0}){const r=t+1,n=(i-e)/r,o=r>1?s:0;return{near:t=>e+t*n+(t>0?o/2:0),far:t=>e+(t+1)*n-o/2}}({maxDepth:this._focusMaxDepth,near:0,far:a,gap:1});this._nodesAll.forEach(t=>{t._show&&(t._d0=l.near(t._vDepth),t._d1=function(t,e,i,s,r){return t._leaf&&"extend"===s&&t._vDepth<i?r:e.far(t._vDepth)}(t,l,this._focusMaxDepth,this.cfg.leaf,a))})}_stretchTo(t,e){const i=t._t1-t._t0;if(!(i>0))return;const s=e/i,r=t._t0;this._nodesAll.forEach(t=>{if(!t._show)return;const i=(t._t0-r)*s,n=(t._t1-r)*s;n<=.01||i>=e-.01?t._show=!1:(t._t0=Math.max(0,i),t._t1=Math.min(e,n))})}_box(t){const e=t._t0,i=Math.max(0,t._t1-t._t0),s=t._d0,r=Math.max(0,t._d1-t._d0);return this._vertical?{x:e,y:this._flip?this.height-s-r:s,w:i,h:r}:{x:this._flip?this.width-s-r:s,y:e,w:r,h:i}}_applyLayout(t){var e,i;const s=this.w.config.chart.animations,r=s.dynamicAnimation,n=s.enabled&&"none"!==t?"intro"===t?null!=(e=s.speed)?e:500:r.enabled?null!=(i=r.speed)?i:350:0:0,o=++this._zoomGen,a="update"===t?this.ctx._iciclePrevGeoms:null;this._nodesAll.forEach(e=>{if(e._show){const i=this._box(e);if(e._el||(e._el=this._createCellEl(e)),e._el.node.setAttribute("data:clipped",String(!!e._clipped)),function(t,e){h.isBrowser()&&!1!==t.cfg.zoomOnClick&&(e._el.node.style.cursor=w(e,t._focus,t._roots).changed?"pointer":"default")}(this,e),"intro"===t&&n>0)return void this._wipeCell(e,i,n,o);let s,r=!1;e._cur?s=e._cur:a&&a.get(e._key)?s=a.get(e._key)():(s={x:i.x+i.w/2,y:i.y+i.h/2,w:0,h:0},r=!0),this._animateCell(e,s,i,n,!1,r,o)}else if(e._el&&e._cur){const t=e._cur,i={x:t.x+t.w/2,y:t.y+t.h/2,w:0,h:0};this._animateCell(e,t,i,n,!0,!1,o)}});const l=new Map;this._nodesAll.forEach(t=>{const e=this._box(t);t._show&&l.set(t._key,()=>t._cur||e)}),this.ctx._iciclePrevGeoms=l,this._renderLabels(n)}_createCellEl(t){const e=this._box(t),i=this._graphics.drawRect(e.x,e.y,0,0,this.cfg.borderRadius,t._color,1,this.strokeWidth,this.strokeColor);i.node.setAttribute("class","apexcharts-icicle-cell");const s=i.node;return s.setAttribute("data:name",t.name),s.setAttribute("data:value",String(t.value)),s.setAttribute("data:key",function(t){if("string"!=typeof t)return"";const e=t.indexOf("/");return-1===e?"":t.slice(e)}(t._key)),s.setAttribute("data:leaf",String(!(t.children&&t.children.length))),this._tooltip.attach(s,t),h.isBrowser()&&!1!==this.cfg.zoomOnClick&&s.addEventListener("click",()=>this._zoomTo(t)),this._cellsG.add(i),i}_wipeCell(t,e,i,s){const r=t._el,n=this._focusMaxDepth+1,o=n>1?t._vDepth/n*i*.6:0,a=i-o,l=this._vertical?{x:e.x,y:e.y,w:0,h:e.h}:{x:e.x,y:e.y,w:e.w,h:0};this._setBox(r,l),r.attr({opacity:1}),r.node.style.display="",t._cur=l,r.animate(a,o).during(i=>{if(this._zoomGen!==s)return;const n={x:e.x,y:e.y,w:this._vertical?e.w*i:e.w,h:this._vertical?e.h:e.h*i};this._setBox(r,n),t._cur=n}).after(()=>{this._zoomGen===s&&(this._setBox(r,e),t._cur=e)})}_animateCell(t,e,i,s,r,n,o){const a=t._el;if(a.attr({fill:t._color}),0===s)return this._setBox(a,i),a.attr({opacity:r?0:1}),a.node.style.display=r?"none":"",void(t._cur=r?null:i);a.node.style.display="";const l=r?Number(a.attr("opacity"))||1:n?0:1,c=r?0:1;a.attr({opacity:l}),a.animate(s).during(s=>{if(this._zoomGen!==o)return;const r={x:S(e.x,i.x,s),y:S(e.y,i.y,s),w:S(e.w,i.w,s),h:S(e.h,i.h,s)};this._setBox(a,r),a.attr({opacity:S(l,c,s)}),t._cur=r}).after(()=>{this._zoomGen===o&&(r?(a.node.style.display="none",t._cur=null):(this._setBox(a,i),t._cur=i))})}_setBox(t,e){const i=this.cfg.spacing||0,s=Math.min(i,Math.max(0,e.w-.5))/2,r=Math.min(i,Math.max(0,e.h-.5))/2;t.attr({x:e.x+s,y:e.y+r,width:Math.max(0,e.w-2*s),height:Math.max(0,e.h-2*r)})}_renderLabels(t){const e=this._labelsG;for(;e.node.firstChild;)e.node.removeChild(e.node.firstChild);if(!this.cfg.dataLabels.show)return;this._nodesAll.forEach(t=>{t._show&&(this._renderLabel(t),t._clipped&&this._renderMoreMark(t))});const i=this._zoomGen;e.attr({opacity:t>0?0:1}),t>0&&e.animate(250,t).during(t=>{this._zoomGen===i&&e.attr({opacity:t})})}_renderLabel(t){const e=this.cfg.dataLabels,i=e.style,s=this._box(t),r="always"===e.rotate||"never"!==e.rotate&&s.h>s.w,n=r?s.h:s.w,o=r?s.w:s.h,a=parseFloat(i.fontSize)||12;if(n<e.minSizeToShow)return;if(o<a+2)return;const l=n-8;let h=t.name;if(e.showValue){const e=`${t.name}: ${+t.value.toPrecision(12)}`;this._fits(e,l,a)&&(h=e)}const d=this._truncate(h,l,a);if(!d)return;const u=i.colors,p=(Array.isArray(u)?u[0]:u)||"#fff",f=c.createElementNS(M,"text");f.setAttribute("font-size",i.fontSize||"12px"),i.fontFamily&&f.setAttribute("font-family",i.fontFamily),f.setAttribute("font-weight",String(i.fontWeight||400)),f.setAttribute("fill",p),f.setAttribute("dominant-baseline","central"),f.style.pointerEvents="none",f.textContent=d;const _="center"===e.align?"middle":"right"===e.align?"end":"start",g=s.x+4,x=s.x+s.w-4,m=s.x+s.w/2;if(r){const t=s.x+s.w/2,e=s.y+s.h-4,i=s.y+4,r=s.y+s.h/2,n="middle"===_?r:"end"===_?i:e;f.setAttribute("text-anchor",_),f.setAttribute("x",String(t)),f.setAttribute("y",String(n)),f.setAttribute("transform",`rotate(-90 ${t} ${n})`)}else{const t="middle"===_?m:"end"===_?x:g;f.setAttribute("text-anchor",_),f.setAttribute("x",String(t)),f.setAttribute("y",String(s.y+s.h/2))}this._labelsG.node.appendChild(f)}_renderMoreMark(t){const e=this._box(t);if((this._vertical?e.w:e.h)<18)return;const i=this._vertical?e.x+e.w/2:e.y+e.h/2,s=this._vertical?this._flip?e.y+2.5:e.y+e.h-2.5:this._flip?e.x+2.5:e.x+e.w-2.5,r=c.createElementNS(M,"g");r.setAttribute("class","apexcharts-icicle-more"),r.style.pointerEvents="none";for(let t=-1;t<=1;t++){const e=c.createElementNS(M,"circle");e.setAttribute("cx",String(this._vertical?i+5*t:s)),e.setAttribute("cy",String(this._vertical?s:i+5*t)),e.setAttribute("r","1.1"),e.setAttribute("fill","#fff"),e.setAttribute("fill-opacity","0.85"),r.appendChild(e)}this._labelsG.node.appendChild(r)}_fits(t,e,i){return t.length*i*.58<=e}_truncate(t,e,i){const s=.58*i,r=Math.floor(e/s);return r>=t.length?t:r<4?"":t.slice(0,r-1)+"\u2026"}_zoomTo(t){if(!1===this.cfg.zoomOnClick)return;const e=w(t,this._focus,this._roots);e.changed&&(this._focus=e.focus,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb())}_renderBreadcrumb(){if(!h.isBrowser())return;if(!this._focus)return void x(this.w);const t=_(this.w),e=1===this._roots.length?this._roots[0]:null,i=(e?[]:[{label:"All",data:null}]).concat(b(this._focus).map(t=>({label:t.name,data:t}))),s=function(t,e){if(!h.isBrowser())return null;const i=t.dom.elWrap;if(!i)return null;x(t);const s=e.config||_(t);if(!1===s.show)return null;const r=e.crumbs||[];if(r.length<2)return null;const n=c.createElementNS(f,"nav");n.setAttribute("class","apexcharts-breadcrumb"),n.setAttribute("aria-label",e.ariaLabel||"Breadcrumb"),function(t,e){const i=e.offsetX||0,s=e.offsetY||0;t.style.position="absolute",t.style.top=s+"px","top-right"===e.position?t.style.right=3-i+"px":t.style.left=i+"px"}(n,s),e.compact&&(n.style.fontSize="11px",n.style.padding="0 2px");const o=null!=s.separator?s.separator:" / ";return r.forEach((t,i)=>{var a;if(i>0){const t=c.createElementNS(f,"span");t.setAttribute("class","apexcharts-breadcrumb-separator"),t.setAttribute("aria-hidden","true"),t.textContent=o,n.appendChild(t)}let l=0===i?null!=(a=s.rootLabel)?a:"All":t.label;if("function"==typeof s.formatter&&(l=s.formatter(l,{index:i,depth:r.length-1,data:t.data})),i===r.length-1){const t=c.createElementNS(f,"span");return t.setAttribute("class","apexcharts-breadcrumb-item apexcharts-breadcrumb-current"),t.setAttribute("aria-current","page"),t.textContent=String(l),void n.appendChild(t)}const h=c.createElementNS(f,"button");if(h.setAttribute("type","button"),h.setAttribute("class","apexcharts-breadcrumb-item"),0===i){const t=c.createElementNS(f,"span");t.setAttribute("class","apexcharts-breadcrumb-arrow"),t.setAttribute("aria-hidden","true"),t.textContent="\u2190",h.appendChild(t)}const d=c.createElementNS(f,"span");d.setAttribute("class","apexcharts-breadcrumb-label"),d.textContent=String(l),h.appendChild(d),h.addEventListener("click",s=>e.onNavigate(i,t,s)),n.appendChild(h)}),i.appendChild(n),n}(this.w,{crumbs:i,ariaLabel:"Icicle breadcrumb",config:t,compact:!0,onNavigate:(t,i)=>{this._focus=i.data===e?null:i.data,this._relayout(this._focus),this._applyLayout("zoom"),this._renderBreadcrumb()}});s&&g(this.w,this.ctx,s,t)}}}),t.default=a,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ApexIcicle={})});
|