@visactor/vchart-extension 2.1.0-alpha.2 → 2.1.0-alpha.20
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/build/index.js +2393 -0
- package/build/index.min.js +2 -2
- package/cjs/charts/axis-3d/index.js +1 -2
- package/cjs/charts/axis-3d/linear-axis.js +2 -1
- package/cjs/charts/bar-3d/chart-spec-transformer.js +1 -1
- package/cjs/charts/bar-3d/chart.js +1 -1
- package/cjs/charts/bar-3d/constant.js +1 -1
- package/cjs/charts/bar-3d/index.js +1 -1
- package/cjs/charts/bar-3d/interface.js +1 -1
- package/cjs/charts/bar-3d/series-spec-transformer.js +1 -1
- package/cjs/charts/bar-3d/series.js +1 -1
- package/cjs/charts/bar-3d/theme.js +1 -1
- package/cjs/charts/candlestick/candlestick-transformer.js +1 -1
- package/cjs/charts/candlestick/candlestick.js +2 -1
- package/cjs/charts/candlestick/index.js +1 -1
- package/cjs/charts/candlestick/interface.js +1 -1
- package/cjs/charts/candlestick/util.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/cjs/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/cjs/charts/combination-candlestick/constant.js +1 -1
- package/cjs/charts/combination-candlestick/index.js +1 -1
- package/cjs/charts/combination-candlestick/interface.js +1 -1
- package/cjs/charts/conversion-funnel/arrow-data-transform.js +1 -1
- package/cjs/charts/conversion-funnel/constants.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/cjs/charts/conversion-funnel/conversion-funnel.js +1 -1
- package/cjs/charts/conversion-funnel/index.js +1 -1
- package/cjs/charts/conversion-funnel/interface.js +1 -1
- package/cjs/charts/conversion-funnel/util.js +1 -1
- package/cjs/charts/funnel-3d/chart.js +2 -1
- package/cjs/charts/funnel-3d/constant.js +1 -1
- package/cjs/charts/funnel-3d/index.js +1 -1
- package/cjs/charts/funnel-3d/interface.js +1 -1
- package/cjs/charts/funnel-3d/series-spec-transformer.js +1 -1
- package/cjs/charts/funnel-3d/series.js +1 -1
- package/cjs/charts/funnel-3d/theme.js +1 -1
- package/cjs/charts/histogram-3d/chart.js +1 -1
- package/cjs/charts/storyline/index.d.ts +4 -0
- package/cjs/charts/storyline/index.js +22 -0
- package/cjs/charts/storyline/index.js.map +1 -0
- package/cjs/charts/storyline/interface.d.ts +69 -0
- package/cjs/charts/storyline/interface.js +6 -0
- package/cjs/charts/storyline/interface.js.map +1 -0
- package/cjs/charts/storyline/layout.d.ts +58 -0
- package/cjs/charts/storyline/layout.js +214 -0
- package/cjs/charts/storyline/layout.js.map +1 -0
- package/cjs/charts/storyline/layouts/arc.d.ts +5 -0
- package/cjs/charts/storyline/layouts/arc.js +327 -0
- package/cjs/charts/storyline/layouts/arc.js.map +1 -0
- package/cjs/charts/storyline/layouts/clock.d.ts +5 -0
- package/cjs/charts/storyline/layouts/clock.js +248 -0
- package/cjs/charts/storyline/layouts/clock.js.map +1 -0
- package/cjs/charts/storyline/layouts/common.d.ts +98 -0
- package/cjs/charts/storyline/layouts/common.js +293 -0
- package/cjs/charts/storyline/layouts/common.js.map +1 -0
- package/cjs/charts/storyline/layouts/default.d.ts +4 -0
- package/cjs/charts/storyline/layouts/default.js +183 -0
- package/cjs/charts/storyline/layouts/default.js.map +1 -0
- package/cjs/charts/storyline/layouts/ladder.d.ts +5 -0
- package/cjs/charts/storyline/layouts/ladder.js +207 -0
- package/cjs/charts/storyline/layouts/ladder.js.map +1 -0
- package/cjs/charts/storyline/layouts/landscape.d.ts +4 -0
- package/cjs/charts/storyline/layouts/landscape.js +258 -0
- package/cjs/charts/storyline/layouts/landscape.js.map +1 -0
- package/cjs/charts/storyline/layouts/portrait.d.ts +11 -0
- package/cjs/charts/storyline/layouts/portrait.js +270 -0
- package/cjs/charts/storyline/layouts/portrait.js.map +1 -0
- package/cjs/charts/storyline/layouts/wing.d.ts +4 -0
- package/cjs/charts/storyline/layouts/wing.js +272 -0
- package/cjs/charts/storyline/layouts/wing.js.map +1 -0
- package/cjs/charts/storyline/storyline-transformer.d.ts +4 -0
- package/cjs/charts/storyline/storyline-transformer.js +91 -0
- package/cjs/charts/storyline/storyline-transformer.js.map +1 -0
- package/cjs/charts/storyline/storyline.d.ts +16 -0
- package/cjs/charts/storyline/storyline.js +36 -0
- package/cjs/charts/storyline/storyline.js.map +1 -0
- package/cjs/components/bar-link/bar-link.js +1 -1
- package/cjs/components/bar-link/constant.js +1 -1
- package/cjs/components/bar-link/index.js +1 -1
- package/cjs/components/bar-link/type.js +1 -1
- package/cjs/components/bar-link/util.js +1 -1
- package/cjs/components/bar-regression-line/index.js +1 -1
- package/cjs/components/bar-regression-line/type.js +1 -1
- package/cjs/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/cjs/components/extension-mark-sync-state/index.js +1 -1
- package/cjs/components/extension-mark-sync-state/type.js +1 -1
- package/cjs/components/histogram-regression-line/index.js +1 -1
- package/cjs/components/histogram-regression-line/type.js +1 -2
- package/cjs/components/map-label/index.js +1 -1
- package/cjs/components/map-label/layout.js +1 -1
- package/cjs/components/map-label/map-label-transformer.js +1 -1
- package/cjs/components/map-label/map-label.js +1 -1
- package/cjs/components/map-label/theme.js +1 -1
- package/cjs/components/map-label/type.js +1 -1
- package/cjs/components/regression-line/index.js +1 -1
- package/cjs/components/regression-line/regression-line.js +1 -1
- package/cjs/components/regression-line/type.js +1 -1
- package/cjs/components/scatter-regression-line/index.js +1 -1
- package/cjs/components/scatter-regression-line/type.js +1 -1
- package/cjs/components/series-break/constant.js +1 -1
- package/cjs/components/series-break/index.js +1 -1
- package/cjs/components/series-break/series-break.js +1 -1
- package/cjs/components/series-break/type.js +1 -1
- package/cjs/components/series-break/util.js +1 -2
- package/cjs/components/series-label/constant.js +1 -1
- package/cjs/components/series-label/index.js +1 -1
- package/cjs/components/series-label/series-label.js +1 -1
- package/cjs/components/series-label/type.js +1 -1
- package/cjs/components/series-label/util.js +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +5 -5
- package/cjs/index.js.map +1 -1
- package/esm/charts/axis-3d/index.js +1 -2
- package/esm/charts/axis-3d/linear-axis.js +2 -1
- package/esm/charts/bar-3d/chart-spec-transformer.js +1 -1
- package/esm/charts/bar-3d/chart.js +1 -1
- package/esm/charts/bar-3d/constant.js +1 -1
- package/esm/charts/bar-3d/index.js +1 -1
- package/esm/charts/bar-3d/interface.js +1 -1
- package/esm/charts/bar-3d/series-spec-transformer.js +1 -1
- package/esm/charts/bar-3d/series.js +1 -1
- package/esm/charts/bar-3d/theme.js +1 -1
- package/esm/charts/candlestick/candlestick-transformer.js +1 -1
- package/esm/charts/candlestick/candlestick.js +2 -1
- package/esm/charts/candlestick/index.js +1 -1
- package/esm/charts/candlestick/interface.js +1 -1
- package/esm/charts/candlestick/util.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick-transformer.js +1 -1
- package/esm/charts/combination-candlestick/combination-candlestick.js +1 -1
- package/esm/charts/combination-candlestick/constant.js +1 -1
- package/esm/charts/combination-candlestick/index.js +1 -1
- package/esm/charts/combination-candlestick/interface.js +1 -1
- package/esm/charts/conversion-funnel/arrow-data-transform.js +1 -1
- package/esm/charts/conversion-funnel/constants.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel-transformer.js +1 -1
- package/esm/charts/conversion-funnel/conversion-funnel.js +1 -1
- package/esm/charts/conversion-funnel/index.js +1 -1
- package/esm/charts/conversion-funnel/interface.js +1 -1
- package/esm/charts/conversion-funnel/util.js +1 -1
- package/esm/charts/funnel-3d/chart.js +2 -1
- package/esm/charts/funnel-3d/constant.js +1 -1
- package/esm/charts/funnel-3d/index.js +1 -1
- package/esm/charts/funnel-3d/interface.js +1 -1
- package/esm/charts/funnel-3d/series-spec-transformer.js +1 -1
- package/esm/charts/funnel-3d/series.js +1 -1
- package/esm/charts/funnel-3d/theme.js +1 -1
- package/esm/charts/histogram-3d/chart.js +1 -1
- package/esm/charts/storyline/index.d.ts +4 -0
- package/esm/charts/storyline/index.js +8 -0
- package/esm/charts/storyline/index.js.map +1 -0
- package/esm/charts/storyline/interface.d.ts +69 -0
- package/esm/charts/storyline/interface.js +2 -0
- package/esm/charts/storyline/interface.js.map +1 -0
- package/esm/charts/storyline/layout.d.ts +58 -0
- package/esm/charts/storyline/layout.js +204 -0
- package/esm/charts/storyline/layout.js.map +1 -0
- package/esm/charts/storyline/layouts/arc.d.ts +5 -0
- package/esm/charts/storyline/layouts/arc.js +320 -0
- package/esm/charts/storyline/layouts/arc.js.map +1 -0
- package/esm/charts/storyline/layouts/clock.d.ts +5 -0
- package/esm/charts/storyline/layouts/clock.js +242 -0
- package/esm/charts/storyline/layouts/clock.js.map +1 -0
- package/esm/charts/storyline/layouts/common.d.ts +98 -0
- package/esm/charts/storyline/layouts/common.js +258 -0
- package/esm/charts/storyline/layouts/common.js.map +1 -0
- package/esm/charts/storyline/layouts/default.d.ts +4 -0
- package/esm/charts/storyline/layouts/default.js +176 -0
- package/esm/charts/storyline/layouts/default.js.map +1 -0
- package/esm/charts/storyline/layouts/ladder.d.ts +5 -0
- package/esm/charts/storyline/layouts/ladder.js +198 -0
- package/esm/charts/storyline/layouts/ladder.js.map +1 -0
- package/esm/charts/storyline/layouts/landscape.d.ts +4 -0
- package/esm/charts/storyline/layouts/landscape.js +254 -0
- package/esm/charts/storyline/layouts/landscape.js.map +1 -0
- package/esm/charts/storyline/layouts/portrait.d.ts +11 -0
- package/esm/charts/storyline/layouts/portrait.js +274 -0
- package/esm/charts/storyline/layouts/portrait.js.map +1 -0
- package/esm/charts/storyline/layouts/wing.d.ts +4 -0
- package/esm/charts/storyline/layouts/wing.js +268 -0
- package/esm/charts/storyline/layouts/wing.js.map +1 -0
- package/esm/charts/storyline/storyline-transformer.d.ts +4 -0
- package/esm/charts/storyline/storyline-transformer.js +88 -0
- package/esm/charts/storyline/storyline-transformer.js.map +1 -0
- package/esm/charts/storyline/storyline.d.ts +16 -0
- package/esm/charts/storyline/storyline.js +29 -0
- package/esm/charts/storyline/storyline.js.map +1 -0
- package/esm/components/bar-link/bar-link.js +1 -1
- package/esm/components/bar-link/constant.js +1 -1
- package/esm/components/bar-link/index.js +1 -1
- package/esm/components/bar-link/type.js +1 -1
- package/esm/components/bar-link/util.js +1 -1
- package/esm/components/bar-regression-line/index.js +1 -1
- package/esm/components/bar-regression-line/type.js +1 -1
- package/esm/components/extension-mark-sync-state/extension-mark-sync-state.js +1 -1
- package/esm/components/extension-mark-sync-state/index.js +1 -1
- package/esm/components/extension-mark-sync-state/type.js +1 -1
- package/esm/components/histogram-regression-line/index.js +1 -1
- package/esm/components/histogram-regression-line/type.js +1 -2
- package/esm/components/map-label/index.js +1 -1
- package/esm/components/map-label/layout.js +1 -1
- package/esm/components/map-label/map-label-transformer.js +1 -1
- package/esm/components/map-label/map-label.js +1 -1
- package/esm/components/map-label/theme.js +1 -1
- package/esm/components/map-label/type.js +1 -1
- package/esm/components/regression-line/index.js +1 -1
- package/esm/components/regression-line/regression-line.js +1 -1
- package/esm/components/regression-line/type.js +1 -1
- package/esm/components/scatter-regression-line/index.js +1 -1
- package/esm/components/scatter-regression-line/type.js +1 -1
- package/esm/components/series-break/constant.js +1 -1
- package/esm/components/series-break/index.js +1 -1
- package/esm/components/series-break/series-break.js +1 -1
- package/esm/components/series-break/type.js +1 -1
- package/esm/components/series-break/util.js +1 -2
- package/esm/components/series-label/constant.js +1 -1
- package/esm/components/series-label/index.js +1 -1
- package/esm/components/series-label/series-label.js +1 -1
- package/esm/components/series-label/type.js +1 -1
- package/esm/components/series-label/util.js +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -1
- package/package.json +8 -8
package/build/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VChartExtension={},e.VChart,e.VUtils)}(this,(function(e,t,i){"use strict";class r extends t.BaseChartSpecTransformer{transformSpec(e){const{timeData:i,timeNodes:r}=function(e){const{xField:i,yField:r,timeField:a,data:s,topN:n=10,icon:o}=e,l=new Set,d=new Map;return s.sort(((e,t)=>Number(t[i])-Number(e[i]))),s.forEach((e=>{const i=e[a];t.isValid(i)&&l.add(i),d.has(i)||d.set(i,[]);const s=d.get(i);if(s.length<n){const t=Object.assign({},e);o&&o[t[r]]&&(t.icon=o[t[r]]),s.push(t)}})),{timeData:d,timeNodes:Array.from(l).sort()}}(e),{interval:n,xField:o,yField:l,color:d,icon:c,iconPosition:u,iconShape:h,timeLabel:p,label:g,nameLabel:m,xAxis:y,yAxis:v}=e,f=n||1e3,b=Math.min(f,500);if(e.type="common",e.data=[{id:"timeData",values:i.get(r[0])},{id:"time",values:[{time:r[0]}]}],e.color={specified:Object.assign({},d)},e.region=[{clip:!0}],e.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:o,seriesField:l,extensionMark:[],label:a(g,Object.assign(Object.assign({},m),{yField:l}))}],e.axes=function(e={},t={}){const i={orient:"left",type:"band",inverse:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid}},r={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid},innerOffset:{right:"10%"}};e.label&&(r.label=e.label);return[i,r]}(y,v),e.player={type:"continuous",auto:!0,loop:!1,interval:f,specs:r.map((e=>({data:[{id:"timeData",values:i.get(e)},{id:"time",values:[{time:e}]}]})))},e.tooltip={visible:!1},e.customMark=[],function(e,{interval:t,exchangeDuration:i}){e.animationAppear=!1,e.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:t},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:t,easing:"linear"}},e.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(e,t,i)=>({y:i.groupHeight+t.getBounds().height()})}}]},e.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(e,{interval:f,exchangeDuration:b}),p&&!1===p.visible||e.customMark.push(function(e={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:e=>e.time,x:(e,t)=>{var i;return(null===(i=t.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(e,t)=>{var i;return(null===(i=t.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},e)}}(p.style)),c){const t=function(e="bar-end",t="circle",{interval:i,exchangeDuration:r}){return{type:"symbol",dataId:"timeData",style:{symbolType:t,stroke:"white",lineWidth:1,size:(e,t)=>{var i,r;const a=t.vchart,s=null===(i=a.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(a&&s){const e=null!==(r=s.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return Math.max(e-4,0)}return 10},background:e=>e.icon,x:(t,i)=>{var r,a;const s=i.vchart,n=null===(r=s.getChart())||void 0===r?void 0:r.getSeriesInIndex(0)[0];if(s&&n){const i=null!==(a=n.getYAxisHelper().getBandwidth(0))&&void 0!==a?a:0;return"bar-start"===e?i/2:"axis"===e?-i/2:n.dataToPositionX(t)-i/2}},y:(e,t)=>{var i,r;const a=t.vchart,s=null===(i=a.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(a&&s){const t=null!==(r=s.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return s.dataToPositionY(e)+t/2}},scaleY:"rect"===t?1.2:1},animationUpdate:s(i,r),animationEnter:[{type:"moveIn",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(e,t,i)=>({y:i.groupHeight+t.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:r,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(u,h,{interval:f,exchangeDuration:b});e.series[0].extensionMark.push(t)}super.transformSpec(e)}}function a(e={},t){var i,r,a,s;const n=[];return!1!==e.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},e.style),smartInvert:{fillStrategy:(null===(i=e.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0}}),t.visible&&n.push({visible:!0,overlap:!1,style:Object.assign({},t.style),smartInvert:{fillStrategy:(null===(a=t.style)||void 0===a?void 0:a.fill)?"null":void 0,strokeStrategy:(null===(s=t.style)||void 0===s?void 0:s.stroke)?"null":void 0},position:"bar-end"===t.position?"inside-right":"inside-left",formatter:`{${t.yField}}`}),n}function s(e,t){return[{duration:t,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:e}]}class n extends t.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=r}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,timeField:n,data:o}=this._spec;return a&&s&&n?!!o||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}n.type="rankingBar",n.view="singleDefault",n.transformerConstructor=r;const o=1e3,l="#21252c",d={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:l,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:o,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:o,easing:"linear"},animationNormal:{interval:o}},c="dataKey",u="VCHART_ORDER",h="SUPPLY_DATA_KEY";class p extends t.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=e=>{const{scrollSize:t=1,pageSize:i=5}=e,r=this.originalData,a={};let s=0;for(let n=0;n<r.length;n+=t)if(s++,a[`page${s}`]=r.slice(n,n+i),n+i-1>=r.length-1){r.push(...Array.from({length:n+i-r.length},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[h]:!0}))));break}return{orderCount:s,result:a}},this.processRankingData=e=>{const t=[];e.data.forEach(((e,t)=>e[u]=t+1<10?`0${t+1}`:t+1));const i=this.paginateDataArr(e).result,r=this.paginateDataArr(e).orderCount;this.orderCount=r;const a=e.pageSize-i[`page${r}`].length;return i[`page${r}`].push(...Array.from({length:a},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[h]:!0})))),Object.keys(i).forEach((r=>{t.push({data:[{id:"datas",values:i[r].map((t=>Object.assign(Object.assign({},t),{[c]:t[e.yField]})))},{id:"order",values:[{order:r}]}]})})),t}}isSpecValid(e){const{xField:t,yField:i,data:r}=e;return!!(t&&i&&r&&0!==r.length)}transformSpec(e){var t;super.transformSpec(e),this.isSpecValid(e)?(this.normalizeSpec(e),this.upgradeTextMeasure(e),this.upgradeFormatMap(e),this.processData(e),this.transformBaseSpec(e),this.transformAnimationSpec(e),this.transformAxesSpec(e),e.extensionMark=[this.generateBarBackground(e),...this.generateDecorateHaloIcons(e),this.generateRankingIcon(e),this.generateNameLabel(e),this.generateOrderLabel(e),this.generateValueLabel(e)],this.transformPaddingSpec(e),null===(t=e.customTransformSpec)||void 0===t||t.call(e,e),super.transformSpec(e)):e.series=[]}normalizeSpec(e){(function e(t,i){for(const r in i)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&"object"==typeof i[r]&&null!==i[r]?(t.hasOwnProperty(r)||(t[r]=Array.isArray(i[r])?[]:{}),e(t[r],i[r])):t.hasOwnProperty(r)||"object"!=typeof t||(t[r]=i[r]);return t})(e,d),((e,i)=>{i.forEach((i=>{var r,a,s,n,o,l,d;t.isArray(e[i])?null===(r=e[i])||void 0===r||r.forEach(((t,r)=>{var a,s,n;e[i][r]=Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},null==t?void 0:t.style),{visible:null===(n=null!==(s=null===(a=null==t?void 0:t.style)||void 0===a?void 0:a.visible)&&void 0!==s?s:null==t?void 0:t.visible)||void 0===n||n})})})):e[i]=Object.assign(Object.assign({},e[i]),{style:Object.assign(Object.assign({},null===(a=e[i])||void 0===a?void 0:a.style),{visible:null===(d=null!==(o=null===(n=null===(s=e[i])||void 0===s?void 0:s.style)||void 0===n?void 0:n.visible)&&void 0!==o?o:null===(l=e[i])||void 0===l?void 0:l.visible)||void 0===d||d})})}))})(e,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(e){var i,r,a,s,n,o,l,d,c;null===(i=this.nameLabelTextMeasure)||void 0===i||i.release(),null===(r=this.valueLabelTextMeasure)||void 0===r||r.release(),null===(a=this.orderLabelTextMeasure)||void 0===a||a.release(),this.nameLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(n=null===(s=e.nameLabel)||void 0===s?void 0:s.style)&&void 0!==n?n:{}}),this.valueLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(l=null===(o=e.valueLabel)||void 0===o?void 0:o.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(c=null===(d=e.orderLabel)||void 0===d?void 0:d.style)&&void 0!==c?c:{}})}upgradeFormatMap(e){this.formatMap[e.yField]=e.nameLabel.formatMethod,this.formatMap[e.xField]=e.valueLabel.formatMethod,this.formatMap[u]=e.orderLabel.formatMethod}processData(e){var i;(null===(i=e.data[0])||void 0===i?void 0:i.values)||(this.originalData=e.data,this.originalSpec=t.cloneDeep(e),this.dataSpecs=this.processRankingData(e),e.data=this.dataSpecs[0].data)}transformBaseSpec(e){var t,i,r;e.type="common",e.dataKey=c,e.series=[{type:"bar",direction:"horizontal",xField:e.xField,yField:e.yField,barWidth:null!==(i=null===(t=e.bar)||void 0===t?void 0:t.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},e.bar),{style:Object.assign(Object.assign({},null===(r=e.bar)||void 0===r?void 0:r.style),{x1:0,visible:t=>{var i,r;return!t[h]&&(null===(r=null===(i=e.bar)||void 0===i?void 0:i.style)||void 0===r||r)}})})}]}transformAnimationSpec(e){var t,i,r;e.animationUpdate.enable&&this.orderCount>1&&(e.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(t=e.animationNormal)||void 0===t?void 0:t.interval)&&void 0!==i?i:1e3)+(null!==(r=e.animationUpdate.duration)&&void 0!==r?r:1e3)/2,loop:!0},e.player),e.animationExit=this.getAnimationExit(this.originalSpec),e.animationEnter=this.getAnimationEnter(this.originalSpec),e.animationUpdate=this.getAnimationUpdate(this.originalSpec)),e.animationNormal=this.originalSpec.animationNormal,e.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(e){const{min:t,max:i}=((e,t)=>{let i,r;const a=e.map((e=>e[t])).filter((e=>null!=e));if(0===a.length)i=0,r=1;else{i=Math.min(...a)-(Math.max(...a)-Math.min(...a))/3,r=(Math.max(...a)-i)/.8+i;const e=10,t=i;i===r&&(i=t-e,r=(4*t+e)/4)}return{min:i,max:r}})(this.originalData,e.xField);e.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:t,max:i}]}generateBarBackground(e){var t;return{type:e.barBackground.type,dataId:"data",visible:!0,dataKey:c,zIndex:-99,state:null===(t=e.barBackground)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({x:(t,i)=>"symbol"===e.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(t,i)=>i.valueToY([t[e.yField]])+i.yBandwidth()/2-("symbol"===e.barBackground.type?0:e.bar.height/2),size:(t,i)=>[i.getRegion().getLayoutRect().width,e.bar.height],width:(e,t)=>t.getRegion().getLayoutRect().width,height:e.bar.height},e.barBackground.style),{visible:t=>!t[h]&&e.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(e){var t;return null===(t=e.decorateHaloIcons)||void 0===t?void 0:t.map((t=>({type:"symbol",dataId:"data",visible:!0,dataKey:c,state:null==t?void 0:t.state,style:Object.assign(Object.assign({x:(t,i)=>{if(void 0!==t[e.xField]&&null!==t[e.xField])return i.valueToX([t[e.xField]])},y:(t,i)=>i.valueToY([t[e.yField]])+i.yBandwidth()/2},t.style),{visible:e=>!e[h]&&t.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(e){return{type:"symbol",dataId:"data",visible:!0,dataKey:c,state:e.rankingIcon.state,style:Object.assign(Object.assign({x:t=>"bothEnd"===e.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).width+(e.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,t)).width:0)+8):5,y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(u,t)).height)/2},e.rankingIcon.style),{lineWidth:0,stroke:null,visible:t=>!t[h]&&e.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(e){var t;return{type:"text",dataId:"data",dataKey:c,state:null===(t=e.nameLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(e.yField,t),x:()=>{var t;return"bothEnd"===e.labelLayout?-10:(e.rankingIcon.style.visible?8+(null!==(t=e.rankingIcon.style.size)&&void 0!==t?t:10):0)+(e.orderLabel.style.visible?5+this.getMaxDataLabelLens(e,u,this.orderLabelTextMeasure):0)},y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.nameLabel.style),{textAlign:"bothEnd"===e.labelLayout?"right":"left",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(e){var t;return{type:"text",dataId:"data",dataKey:c,state:null===(t=e.orderLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(u,e),x:t=>{var i;return"bothEnd"===e.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(e.yField,t)).width+5):e.rankingIcon.style.visible?8+(null!==(i=e.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.orderLabel.style),{textAlign:"bothEnd"===e.labelLayout?"right":"left",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(e){var t;return{type:"text",dataId:"data",visible:!0,dataKey:c,state:null===(t=e.valueLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(e.xField,t),x:(t,i)=>"bothEnd"===e.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(t,i)=>"bothEnd"===e.labelLayout?i.valueToY([t[e.yField]])+i.yBandwidth()/2:i.valueToY([t[e.yField]])+i.yBandwidth()/2-e.bar.height/2-5},e.valueLabel.style),{textAlign:"bothEnd"===e.labelLayout?"left":"right",textBaseline:"bothEnd"===e.labelLayout?"middle":"bottom",visible:t=>!t[h]&&e.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(e){var t;const i=e.decorateHaloIcons.length>0?Math.max(...e.decorateHaloIcons.map((e=>{var t,i;return null!==(i=null===(t=e.style)||void 0===t?void 0:t.size)&&void 0!==i?i:18}))):0;e.padding=Object.assign({left:"bothEnd"===e.labelLayout?10+this.getMaxDataLabelLens(e,e.yField,this.nameLabelTextMeasure)+(e.orderLabel.style.visible?5+this.getMaxDataLabelLens(e,u,this.orderLabelTextMeasure):0)+(e.rankingIcon.style.visible?8+(null!==(t=e.rankingIcon.style.size)&&void 0!==t?t:10):0)+5:5+i/2,right:"bothEnd"===e.labelLayout?5+this.getMaxDataLabelLens(e,e.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},e.padding)}getMaxDataLabelLens(e,t,i){const r=this.originalData.map((e=>e[h]?0:i.fullMeasure(this.formatDatum(t,e)).width));return Math.max(...r)}formatDatum(e,t){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[e])?this.formatMap[e](t[e],t):t[e]}getLabelWidth(e,t){return t+e}getAnimationExit(e){var t,i,r,a,s;return!1!==(null===(t=e.animationUpdate)||void 0===t?void 0:t.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(t,i)=>({y:i.getGraphicAttribute("y")-e.height/(e.pageSize+1)*Math.min(e.scrollSize,e.pageSize)})},duration:null!==(r=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==r?r:1e3,easing:null!==(s=null===(a=e.animationUpdate)||void 0===a?void 0:a.easing)&&void 0!==s?s:"linear"}}getAnimationEnter(e){var t,i,r,a,s;return!1!==(null===(t=e.animationUpdate)||void 0===t?void 0:t.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(t,i)=>({y:i.getGraphicAttribute("y")+e.height/(e.pageSize+1)*Math.min(e.scrollSize,e.pageSize)})},duration:null!==(r=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==r?r:1e3,easing:null!==(s=null===(a=e.animationUpdate)||void 0===a?void 0:a.easing)&&void 0!==s?s:"linear"}}getAnimationAppear(e,t){var i,r,a,s,n,o,l,d,c,u,h,p,g;return!1!==(null===(i=e.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===t?{type:"growWidthIn",oneByOne:!1,duration:null!==(a=null===(r=e.animationAppear)||void 0===r?void 0:r.duration)&&void 0!==a?a:1e3,easing:null!==(n=null===(s=e.animationAppear)||void 0===s?void 0:s.easing)&&void 0!==n?n:"linear",options:{}}:"symbol"===t?{channel:{x:{from:0,to:(e,t)=>t.getGraphicAttribute("x")}},duration:null!==(l=null===(o=e.animationAppear)||void 0===o?void 0:o.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(d=e.animationAppear)||void 0===d?void 0:d.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(h=null===(u=e.animationAppear)||void 0===u?void 0:u.duration)&&void 0!==h?h:1e3,easing:null!==(g=null===(p=e.animationAppear)||void 0===p?void 0:p.easing)&&void 0!==g?g:"linear"})}getAnimationUpdate(e){var t,i,r,a;return!1!==e.animationUpdate.enable&&{duration:null!==(i=null===(t=e.animationUpdate)||void 0===t?void 0:t.duration)&&void 0!==i?i:1e3,easing:null!==(a=null===(r=e.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear"}}}class g extends t.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=p}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}g.type="rankingList",g.view="singleDefault",g.transformerConstructor=p;
|
|
1
|
+
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@visactor/vchart"),require("@visactor/vutils")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart","@visactor/vutils"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).VChartExtension={},t.VChart,t.VUtils)}(this,(function(t,e,i){"use strict";class n extends e.BaseChartSpecTransformer{transformSpec(t){const{timeData:i,timeNodes:n}=function(t){const{xField:i,yField:n,timeField:o,data:r,topN:a=10,icon:s}=t,l=new Set,d=new Map;return r.sort(((t,e)=>Number(e[i])-Number(t[i]))),r.forEach((t=>{const i=t[o];e.isValid(i)&&l.add(i),d.has(i)||d.set(i,[]);const r=d.get(i);if(r.length<a){const e=Object.assign({},t);s&&s[e[n]]&&(e.icon=s[e[n]]),r.push(e)}})),{timeData:d,timeNodes:Array.from(l).sort()}}(t),{interval:a,xField:s,yField:l,color:d,icon:c,iconPosition:h,iconShape:u,timeLabel:g,label:p,nameLabel:y,xAxis:v,yAxis:m}=t,x=a||1e3,f=Math.min(x,500);if(t.type="common",t.data=[{id:"timeData",values:i.get(n[0])},{id:"time",values:[{time:n[0]}]}],t.color={specified:Object.assign({},d)},t.region=[{clip:!0}],t.series=[{type:"bar",id:"ranking-bar",dataId:"timeData",direction:"horizontal",yField:l,xField:s,seriesField:l,extensionMark:[],label:o(p,Object.assign(Object.assign({},y),{yField:l}))}],t.axes=function(t={},e={}){const i={orient:"left",type:"band",inverse:!0,label:{style:e.label},domainLine:{style:e.domainLine},grid:{style:e.grid}},n={orient:"bottom",type:"linear",nice:!1,animation:!0,label:{style:t.label},domainLine:{style:t.domainLine},grid:{style:t.grid},innerOffset:{right:"10%"}};t.label&&(n.label=t.label);return[i,n]}(v,m),t.player={type:"continuous",auto:!0,loop:!1,interval:x,specs:n.map((t=>({data:[{id:"timeData",values:i.get(t)},{id:"time",values:[{time:t}]}]})))},t.tooltip={visible:!1},t.customMark=[],function(t,{interval:e,exchangeDuration:i}){t.animationAppear=!1,t.animationUpdate={bar:[{type:"update",options:{excludeChannels:["y"]},easing:"linear",duration:e},{channel:["y"],easing:"circInOut",duration:i}],axis:{duration:e,easing:"linear"}},t.animationEnter={bar:[{type:"moveIn",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}]},t.animationExit={bar:[{type:"moveOut",duration:i,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(t,{interval:x,exchangeDuration:f}),g&&!1===g.visible||t.customMark.push(function(t={}){return{type:"text",dataId:"time",style:Object.assign({textBaseline:"bottom",fontSize:200,textAlign:"end",fontWeight:600,text:t=>t.time,x:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.width)-50},y:(t,e)=>{var i;return(null===(i=e.vchart.getChart().getCanvasRect())||void 0===i?void 0:i.height)-80},fill:"grey",fillOpacity:.5},t)}}(g.style)),c){const e=function(t="bar-end",e="circle",{interval:i,exchangeDuration:n}){return{type:"symbol",dataId:"timeData",style:{symbolType:e,stroke:"white",lineWidth:1,size:(t,e)=>{var i,n;const o=e.vchart,r=null===(i=o.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(o&&r){const t=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return Math.max(t-4,0)}return 10},background:t=>t.icon,x:(e,i)=>{var n,o;const r=i.vchart,a=null===(n=r.getChart())||void 0===n?void 0:n.getSeriesInIndex(0)[0];if(r&&a){const i=null!==(o=a.getYAxisHelper().getBandwidth(0))&&void 0!==o?o:0;return"bar-start"===t?i/2:"axis"===t?-i/2:a.dataToPositionX(e)-i/2}},y:(t,e)=>{var i,n;const o=e.vchart,r=null===(i=o.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(o&&r){const e=null!==(n=r.getYAxisHelper().getBandwidth(0))&&void 0!==n?n:0;return r.dataToPositionY(t)+e/2}},scaleY:"rect"===e?1.2:1},animationUpdate:r(i,n),animationEnter:[{type:"moveIn",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(t,e,i)=>({y:i.groupHeight+e.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:n,easing:"cubicInOut",options:{direction:"y",orient:"negative"}}]}}(h,u,{interval:x,exchangeDuration:f});t.series[0].extensionMark.push(e)}super.transformSpec(t)}}function o(t={},e){var i,n,o,r;const a=[];return!1!==t.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({fill:"rgb(64, 64, 64)"},t.style),smartInvert:{fillStrategy:(null===(i=t.style)||void 0===i?void 0:i.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0}}),e.visible&&a.push({visible:!0,overlap:!1,style:Object.assign({},e.style),smartInvert:{fillStrategy:(null===(o=e.style)||void 0===o?void 0:o.fill)?"null":void 0,strokeStrategy:(null===(r=e.style)||void 0===r?void 0:r.stroke)?"null":void 0},position:"bar-end"===e.position?"inside-right":"inside-left",formatter:`{${e.yField}}`}),a}function r(t,e){return[{duration:e,easing:"cubicInOut",channel:["y"]},{options:{excludeChannels:["y"]},channel:["x","x2","x1"],easing:"linear",duration:t}]}class a extends e.BaseChart{constructor(){super(...arguments),this.type="rankingBar",this.transformerConstructor=n}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:o,yField:r,timeField:a,data:s}=this._spec;return o&&r&&a?!!s||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField`, `timeField` "),!1)}}a.type="rankingBar",a.view="singleDefault",a.transformerConstructor=n;const s=1e3,l="#21252c",d={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:l,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:l,textBaseline:"middle"}},pageSize:5,scrollSize:1,animationAppear:{enable:!0,type:"grow",duration:s,easing:"linear"},animationUpdate:{enable:!0,type:"grow",duration:s,easing:"linear"},animationNormal:{interval:s}},c="dataKey",h="VCHART_ORDER",u="SUPPLY_DATA_KEY";class g extends e.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=t=>{const{scrollSize:e=1,pageSize:i=5}=t,n=this.originalData,o={};let r=0;for(let a=0;a<n.length;a+=e)if(r++,o[`page${r}`]=n.slice(a,a+i),a+i-1>=n.length-1){n.push(...Array.from({length:a+i-n.length},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[u]:!0}))));break}return{orderCount:r,result:o}},this.processRankingData=t=>{const e=[];t.data.forEach(((t,e)=>t[h]=e+1<10?`0${e+1}`:e+1));const i=this.paginateDataArr(t).result,n=this.paginateDataArr(t).orderCount;this.orderCount=n;const o=t.pageSize-i[`page${n}`].length;return i[`page${n}`].push(...Array.from({length:o},(e=>({[t.yField]:100*Math.random(),[t.xField]:null,[u]:!0})))),Object.keys(i).forEach((n=>{e.push({data:[{id:"datas",values:i[n].map((e=>Object.assign(Object.assign({},e),{[c]:e[t.yField]})))},{id:"order",values:[{order:n}]}]})})),e}}isSpecValid(t){const{xField:e,yField:i,data:n}=t;return!!(e&&i&&n&&0!==n.length)}transformSpec(t){var e;super.transformSpec(t),this.isSpecValid(t)?(this.normalizeSpec(t),this.upgradeTextMeasure(t),this.upgradeFormatMap(t),this.processData(t),this.transformBaseSpec(t),this.transformAnimationSpec(t),this.transformAxesSpec(t),t.extensionMark=[this.generateBarBackground(t),...this.generateDecorateHaloIcons(t),this.generateRankingIcon(t),this.generateNameLabel(t),this.generateOrderLabel(t),this.generateValueLabel(t)],this.transformPaddingSpec(t),null===(e=t.customTransformSpec)||void 0===e||e.call(t,t),super.transformSpec(t)):t.series=[]}normalizeSpec(t){(function t(e,i){for(const n in i)"__proto__"!==n&&"constructor"!==n&&"prototype"!==n&&"object"==typeof i[n]&&null!==i[n]?(e.hasOwnProperty(n)||(e[n]=Array.isArray(i[n])?[]:{}),t(e[n],i[n])):e.hasOwnProperty(n)||"object"!=typeof e||(e[n]=i[n]);return e})(t,d),((t,i)=>{i.forEach((i=>{var n,o,r,a,s,l,d;e.isArray(t[i])?null===(n=t[i])||void 0===n||n.forEach(((e,n)=>{var o,r,a;t[i][n]=Object.assign(Object.assign({},e),{style:Object.assign(Object.assign({},null==e?void 0:e.style),{visible:null===(a=null!==(r=null===(o=null==e?void 0:e.style)||void 0===o?void 0:o.visible)&&void 0!==r?r:null==e?void 0:e.visible)||void 0===a||a})})})):t[i]=Object.assign(Object.assign({},t[i]),{style:Object.assign(Object.assign({},null===(o=t[i])||void 0===o?void 0:o.style),{visible:null===(d=null!==(s=null===(a=null===(r=t[i])||void 0===r?void 0:r.style)||void 0===a?void 0:a.visible)&&void 0!==s?s:null===(l=t[i])||void 0===l?void 0:l.visible)||void 0===d||d})})}))})(t,["barBackground","rankingIcon","decorateHaloIcons","orderLabel","nameLabel","valueLabel"])}upgradeTextMeasure(t){var i,n,o,r,a,s,l,d,c;null===(i=this.nameLabelTextMeasure)||void 0===i||i.release(),null===(n=this.valueLabelTextMeasure)||void 0===n||n.release(),null===(o=this.orderLabelTextMeasure)||void 0===o||o.release(),this.nameLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(a=null===(r=t.nameLabel)||void 0===r?void 0:r.style)&&void 0!==a?a:{}}),this.valueLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(l=null===(s=t.valueLabel)||void 0===s?void 0:s.style)&&void 0!==l?l:{}}),this.orderLabelTextMeasure=new e.TextMeasure({defaultFontParams:null!==(c=null===(d=t.orderLabel)||void 0===d?void 0:d.style)&&void 0!==c?c:{}})}upgradeFormatMap(t){this.formatMap[t.yField]=t.nameLabel.formatMethod,this.formatMap[t.xField]=t.valueLabel.formatMethod,this.formatMap[h]=t.orderLabel.formatMethod}processData(t){var i;(null===(i=t.data[0])||void 0===i?void 0:i.values)||(this.originalData=t.data,this.originalSpec=e.cloneDeep(t),this.dataSpecs=this.processRankingData(t),t.data=this.dataSpecs[0].data)}transformBaseSpec(t){var e,i,n;t.type="common",t.dataKey=c,t.series=[{type:"bar",direction:"horizontal",xField:t.xField,yField:t.yField,barWidth:null!==(i=null===(e=t.bar)||void 0===e?void 0:e.height)&&void 0!==i?i:10,bar:Object.assign(Object.assign({},t.bar),{style:Object.assign(Object.assign({},null===(n=t.bar)||void 0===n?void 0:n.style),{x1:0,visible:e=>{var i,n;return!e[u]&&(null===(n=null===(i=t.bar)||void 0===i?void 0:i.style)||void 0===n||n)}})})}]}transformAnimationSpec(t){var e,i,n;t.animationUpdate.enable&&this.orderCount>1&&(t.player=Object.assign({specs:this.dataSpecs,auto:!0,visible:!1,interval:(null!==(i=null===(e=t.animationNormal)||void 0===e?void 0:e.interval)&&void 0!==i?i:1e3)+(null!==(n=t.animationUpdate.duration)&&void 0!==n?n:1e3)/2,loop:!0},t.player),t.animationExit=this.getAnimationExit(this.originalSpec),t.animationEnter=this.getAnimationEnter(this.originalSpec),t.animationUpdate=this.getAnimationUpdate(this.originalSpec)),t.animationNormal=this.originalSpec.animationNormal,t.animationAppear=this.getAnimationAppear(this.originalSpec,"rect")}transformAxesSpec(t){const{min:e,max:i}=((t,e)=>{let i,n;const o=t.map((t=>t[e])).filter((t=>null!=t));if(0===o.length)i=0,n=1;else{i=Math.min(...o)-(Math.max(...o)-Math.min(...o))/3,n=(Math.max(...o)-i)/.8+i;const t=10,e=i;i===n&&(i=e-t,n=(4*e+t)/4)}return{min:i,max:n}})(this.originalData,t.xField);t.axes=[{orient:"left",type:"band",visible:!1,inverse:!0,paddingOuter:.5},{orient:"bottom",label:{visible:!0},type:"linear",visible:!1,min:e,max:i}]}generateBarBackground(t){var e;return{type:t.barBackground.type,dataId:"data",visible:!0,dataKey:c,zIndex:-99,state:null===(e=t.barBackground)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>"symbol"===t.barBackground.type?i.getRegion().getLayoutRect().width/2:0,y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2-("symbol"===t.barBackground.type?0:t.bar.height/2),size:(e,i)=>[i.getRegion().getLayoutRect().width,t.bar.height],width:(t,e)=>e.getRegion().getLayoutRect().width,height:t.bar.height},t.barBackground.style),{visible:e=>!e[u]&&t.barBackground.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"barBack"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateDecorateHaloIcons(t){var e;return null===(e=t.decorateHaloIcons)||void 0===e?void 0:e.map((e=>({type:"symbol",dataId:"data",visible:!0,dataKey:c,state:null==e?void 0:e.state,style:Object.assign(Object.assign({x:(e,i)=>{if(void 0!==e[t.xField]&&null!==e[t.xField])return i.valueToX([e[t.xField]])},y:(e,i)=>i.valueToY([e[t.yField]])+i.yBandwidth()/2},e.style),{visible:t=>!t[u]&&e.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"symbol"),animationUpdate:this.getAnimationUpdate(this.originalSpec)})))}generateRankingIcon(t){return{type:"symbol",dataId:"data",visible:!0,dataKey:c,state:t.rankingIcon.state,style:Object.assign(Object.assign({x:e=>"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+(t.orderLabel.style.visible?5+this.orderLabelTextMeasure.fullMeasure(this.formatDatum(h,e)).width:0)+8):5,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5-Math.max(this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).height,this.orderLabelTextMeasure.fullMeasure(this.formatDatum(h,e)).height)/2},t.rankingIcon.style),{lineWidth:0,stroke:null,visible:e=>!e[u]&&t.rankingIcon.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateNameLabel(t){var e;return{type:"text",dataId:"data",dataKey:c,state:null===(e=t.nameLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.yField,e),x:()=>{var e;return"bothEnd"===t.labelLayout?-10:(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,h,this.orderLabelTextMeasure):0)},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.nameLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[u]&&t.nameLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateOrderLabel(t){var e;return{type:"text",dataId:"data",dataKey:c,state:null===(e=t.orderLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:t=>this.formatDatum(h,t),x:e=>{var i;return"bothEnd"===t.labelLayout?-(10+this.nameLabelTextMeasure.fullMeasure(this.formatDatum(t.yField,e)).width+5):t.rankingIcon.style.visible?8+(null!==(i=t.rankingIcon.style.size)&&void 0!==i?i:10):0},y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.orderLabel.style),{textAlign:"bothEnd"===t.labelLayout?"right":"left",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[u]&&t.orderLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}generateValueLabel(t){var e;return{type:"text",dataId:"data",visible:!0,dataKey:c,state:null===(e=t.valueLabel)||void 0===e?void 0:e.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(t.xField,e),x:(e,i)=>"bothEnd"===t.labelLayout?i.getRegion().getLayoutRect().width+5:i.getRegion().getLayoutRect().width,y:(e,i)=>"bothEnd"===t.labelLayout?i.valueToY([e[t.yField]])+i.yBandwidth()/2:i.valueToY([e[t.yField]])+i.yBandwidth()/2-t.bar.height/2-5},t.valueLabel.style),{textAlign:"bothEnd"===t.labelLayout?"left":"right",textBaseline:"bothEnd"===t.labelLayout?"middle":"bottom",visible:e=>!e[u]&&t.valueLabel.style.visible}),animation:!0,animationEnter:this.getAnimationEnter(this.originalSpec),animationExit:this.getAnimationExit(this.originalSpec),animationAppear:this.getAnimationAppear(this.originalSpec,"text"),animationUpdate:this.getAnimationUpdate(this.originalSpec)}}transformPaddingSpec(t){var e;const i=t.decorateHaloIcons.length>0?Math.max(...t.decorateHaloIcons.map((t=>{var e,i;return null!==(i=null===(e=t.style)||void 0===e?void 0:e.size)&&void 0!==i?i:18}))):0;t.padding=Object.assign({left:"bothEnd"===t.labelLayout?10+this.getMaxDataLabelLens(t,t.yField,this.nameLabelTextMeasure)+(t.orderLabel.style.visible?5+this.getMaxDataLabelLens(t,h,this.orderLabelTextMeasure):0)+(t.rankingIcon.style.visible?8+(null!==(e=t.rankingIcon.style.size)&&void 0!==e?e:10):0)+5:5+i/2,right:"bothEnd"===t.labelLayout?5+this.getMaxDataLabelLens(t,t.xField,this.valueLabelTextMeasure)+5:15,top:0,bottom:0},t.padding)}getMaxDataLabelLens(t,e,i){const n=this.originalData.map((t=>t[u]?0:i.fullMeasure(this.formatDatum(e,t)).width));return Math.max(...n)}formatDatum(t,e){var i;return(null===(i=this.formatMap)||void 0===i?void 0:i[t])?this.formatMap[t](e[t],e):e[t]}getLabelWidth(t,e){return e+t}getAnimationExit(t){var e,i,n,o,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveOut",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")-t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(o=t.animationUpdate)||void 0===o?void 0:o.easing)&&void 0!==r?r:"linear"}}getAnimationEnter(t){var e,i,n,o,r;return!1!==(null===(e=t.animationUpdate)||void 0===e?void 0:e.enable)&&{type:"moveIn",options:{direction:"y",orient:"negative",excludeChannels:["x"],point:(e,i)=>({y:i.getGraphicAttribute("y")+t.height/(t.pageSize+1)*Math.min(t.scrollSize,t.pageSize)})},duration:null!==(n=null===(i=t.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==n?n:1e3,easing:null!==(r=null===(o=t.animationUpdate)||void 0===o?void 0:o.easing)&&void 0!==r?r:"linear"}}getAnimationAppear(t,e){var i,n,o,r,a,s,l,d,c,h,u,g,p;return!1!==(null===(i=t.animationAppear)||void 0===i?void 0:i.enable)&&("rect"===e?{type:"growWidthIn",oneByOne:!1,duration:null!==(o=null===(n=t.animationAppear)||void 0===n?void 0:n.duration)&&void 0!==o?o:1e3,easing:null!==(a=null===(r=t.animationAppear)||void 0===r?void 0:r.easing)&&void 0!==a?a:"linear",options:{}}:"symbol"===e?{channel:{x:{from:0,to:(t,e)=>e.getGraphicAttribute("x")}},duration:null!==(l=null===(s=t.animationAppear)||void 0===s?void 0:s.duration)&&void 0!==l?l:1e3,easing:null!==(c=null===(d=t.animationAppear)||void 0===d?void 0:d.easing)&&void 0!==c?c:"linear"}:{channel:{opacity:{from:0,to:1}},duration:null!==(u=null===(h=t.animationAppear)||void 0===h?void 0:h.duration)&&void 0!==u?u:1e3,easing:null!==(p=null===(g=t.animationAppear)||void 0===g?void 0:g.easing)&&void 0!==p?p:"linear"})}getAnimationUpdate(t){var e,i,n,o;return!1!==t.animationUpdate.enable&&{duration:null!==(i=null===(e=t.animationUpdate)||void 0===e?void 0:e.duration)&&void 0!==i?i:1e3,easing:null!==(o=null===(n=t.animationUpdate)||void 0===n?void 0:n.easing)&&void 0!==o?o:"linear"}}}class p extends e.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=g}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:o,yField:r,data:a}=this._spec;return o&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}p.type="rankingList",p.view="singleDefault",p.transformerConstructor=g;
|
|
2
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -13,4 +13,4 @@
|
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
15
|
***************************************************************************** */
|
|
16
|
-
function m(e,t){var i={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(i[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(i[r[a]]=e[r[a]])}return i}const y={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},v={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},f={fill:"#606773",fontSize:12},b={fill:"#eff1f9"};class x extends t.FunnelChartSpecTransformer{transformSpec(e){const{conversionArrow:t,extensionMark:i=[],funnelBackground:r}=e;if(t&&t.arrows&&t.arrows.length){const e=function(e){const{arrows:t}=e,i=m(e,["arrows"]),r=t.filter((e=>"left"===e.position)),a=_(t.filter((e=>"right"===e.position)),i),s=_(r,i),n=[];a&&(a.name="arrowRight",n.push(a));s&&(s.name="arrowLeft",n.push(s));return n}(t);e&&e.length&&i.push(...e)}if(r&&r.visible){const e=function(e){const{style:t={}}=e,i=m(e,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},b),t),{x:0,y:(e,t)=>t.getPoints(e)[0].y,width:(e,t)=>{const i=t.getRegion(),{width:r}=i.getLayoutRect();return r},height:(e,t)=>{const i=t.getPoints(e),r=i[0];return i[3].y-r.y}})})}(r);e&&i.push(e)}e.extensionMark=i,super.transformSpec(e)}_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.conversionArrow=e.conversionArrow,t.funnelBackground=e.funnelBackground,t}}function _(e,i){if(0===(null==e?void 0:e.length))return null;const{line:r,symbol:a,text:s,margin:n}=i,o=[],l={type:"group",zIndex:t.LayoutZIndex.Mark+1,children:[]},d=function(e={},t){const{style:i={}}=e,r=m(e,["style"]),a=(e,t)=>{var i,r;const{from:a,to:s}=e,{vchart:n}=t,o=null===(r=null===(i=null==n?void 0:n.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===r?void 0:r.latestData;return!(s>o.length-1||a>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},r),{dataKey:e=>`${e.id}`,style:Object.assign(Object.assign(Object.assign({},y),i),{renderable:a,points:(e,i)=>{if(!a(e,i))return[];let r=e.layout.points;return r=S(e,i,t),r}})})}(r,n);d&&o.push(d);const c=function(e={},t){const{style:i={}}=e,r=m(e,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:e=>`${e.id}`},r),{style:Object.assign(Object.assign(Object.assign({},v),i),{x:(e,i)=>{var r,a;let s=e.layout.points;return s=S(e,i,t),null!==(a=null===(r=s[(null==s?void 0:s.length)-1])||void 0===r?void 0:r.x)&&void 0!==a?a:NaN},y:(e,i)=>{var r,a;let s=e.layout.points;return s=S(e,i,t),null!==(a=null===(r=s[(null==s?void 0:s.length)-1])||void 0===r?void 0:r.y)&&void 0!==a?a:NaN},angle:e=>"left"===e.position?90:-90})})}(a,n);c&&o.push(c);const u=function(e={},i){const{style:r={},formatMethod:a,textMargin:s=4}=e,n=m(e,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:e=>`${e.id}`,interactive:!1,animation:!1},n),{style:Object.assign(Object.assign(Object.assign({},f),{text:(e,i)=>{var r,s,n,o,l,d,c;const{text:u}=e;let h=u;if(t.isFunction(a)){const{vchart:t}=i,{from:p,to:g}=e,{field:m}=e.context,y=null!==(n=null===(s=null===(r=null==t?void 0:t.getChart())||void 0===r?void 0:r.getSeriesData())||void 0===s?void 0:s.latestData)&&void 0!==n?n:[],v=null!==(c=null===(d=null===(l=null===(o=null==t?void 0:t.getChart())||void 0===o?void 0:o.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===d?void 0:d.latestData)&&void 0!==c?c:[],f=v.find((e=>e[m]===y[p][m])),b=v.find((e=>e[m]===y[g][m]));h=a(u,{arrow:e,from:f,to:b})}return h},x:(e,t)=>{var r,a;let n=e.layout.points;return n=S(e,t,i),null!==(a=(null===(r=n[1])||void 0===r?void 0:r.x)+("left"===e.position?-s:s))&&void 0!==a?a:NaN},y:(e,t)=>{var r,a,s;let n=e.layout.points;return n=S(e,t,i),null!==(s=((null===(r=n[1])||void 0===r?void 0:r.y)+(null===(a=n[2])||void 0===a?void 0:a.y))/2)&&void 0!==s?s:NaN},textAlign:e=>"left"===e.position?"right":"left",textBaseline:"middle"}),r)})}(s,n);return u&&o.push(u),l.children=o,l}function S(e,t,i){var r,a,s,n,o;const{vchart:l}=t,{from:d,to:c}=e,{field:u}=e.context,h=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getSeriesData())||void 0===a?void 0:a.latestData,p=null===(o=null===(n=null===(s=null==l?void 0:l.getChart())||void 0===s?void 0:s.getAllSeries()[0])||void 0===n?void 0:n.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(h&&h.length){const r=p.find((e=>e[u]===h[d][u])),a=p.find((e=>e[u]===h[c][u])),s=p[0];if(r&&a&&s){g=function(e,t,i,r,a=12){const{layout:s,distance:n,position:o}=e,{level:l,fromIndex:d,toIndex:c,fromTotal:u,toTotal:h}=s,p="right"===o,g=p?t[1]:t[0],m=p?t[2]:t[3],y=Math.abs(g.y-m.y),v=p?i[1]:i[0],f=p?i[2]:i[3],b=Math.abs(v.y-f.y),x=p?r[1]:r[0],_=y/(u+1),S=b/(h+1),k=g.y+_*(d+1),C=v.y+S*(c+1),M=p?-1:1,A=[{x:g.x-a*M,y:k},{x:x.x-(a+(l+1)*n)*M,y:k},{x:x.x-(a+(l+1)*n)*M,y:C},{x:v.x-a*M,y:C}];return A}(e,t.getPoints(r),t.getPoints(a),t.getPoints(s),i),e.layout.points=g}}return g}function k(e,t){const{from:i,to:r}=e,{from:a,to:s}=t;return r>a&&s>i}function C(e,t){const{from:i,to:r}=e,{from:a,to:s}=t;return i===a&&r===s}const M=(e,i)=>{var r,a,s;if(!e||!(null===(r=e.arrows)||void 0===r?void 0:r.length))return[];const{arrows:n}=e,o=function(e,i){return e.filter((e=>t.isValidNumber(e.from*e.to))).map(((e,t)=>{const{from:r,to:a,position:s="right"}=e;return Object.assign(Object.assign({},e),{position:s,distance:e.distance||40,from:Math.min(r,a),to:Math.max(r,a),span:Math.abs(r-a),isLayout:!1,context:{field:i},layout:{level:0},id:`${r}-${a}-${s}-${t}`})}))}(n,i.categoryField),l=o.filter((e=>"left"===e.position)),d=o.filter((e=>"right"===e.position));return[...null!==(a=A(l))&&void 0!==a?a:[],...null!==(s=A(d))&&void 0!==s?s:[]]};function A(e){if(0===(null==e?void 0:e.length))return null;const i=new Map;return e.forEach((e=>{const r=i.get(e.from);if(t.isValid(r)){const t=r.fromArrows.find((t=>C(t,e)));t?e.layout.duplicateNode=t:r.degree+=1,r.fromArrows.push(e)}else i.set(e.from,{fromArrows:[e],toArrows:[],totalArrows:[],degree:1});const a=i.get(e.to);if(t.isValid(a)){const t=a.toArrows.find((t=>C(t,e)));t?e.layout.duplicateNode=t:a.degree+=1,a.toArrows.push(e)}else i.set(e.to,{toArrows:[e],fromArrows:[],totalArrows:[],degree:1})})),i.forEach((e=>{e.fromArrows.sort(((e,t)=>t.span-e.span)),e.toArrows.sort(((e,t)=>e.span-t.span)),e.totalArrows=[...e.toArrows,...e.fromArrows]})),e.sort(((e,t)=>e.span-t.span)).forEach((r=>{var a;const s=e.filter((e=>e.layout.isLayout)),n=t.maxInArray(s,((e,t)=>e.layout.level-t.layout.level));let o=null!==(a=null==n?void 0:n.layout.level)&&void 0!==a?a:0;for(;o>=0;){if(s.some((e=>e.layout.level===o&&k(e,r)))){o+=1;break}--o}r.layout.level=Math.max(0,o),r.layout.fromTotal=i.get(r.from).degree,r.layout.toTotal=i.get(r.to).degree;const l=r.layout.duplicateNode;l?(r.layout.fromIndex=l.layout.fromIndex,r.layout.toIndex=l.layout.toIndex):(r.layout.fromIndex=F(r,i.get(r.from).totalArrows),r.layout.toIndex=F(r,i.get(r.to).totalArrows)),r.layout.isLayout=!0})),e}function F(e,t){let i=0,r=0;for(let a=0;a<t.length;a++){const s=t[a];if(s===e){i=a-r;break}s.layout.duplicateNode&&r++}return i}class T extends t.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=x}}T.type="conversionFunnel",T.transformerConstructor=x;class L extends t.FunnelSeries{initData(){var e;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(e=i.arrows)||void 0===e?void 0:e.length)&&(this._arrowData=new t.DataView(this._dataSet,{name:`${t.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",M),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var e;null===(e=super.afterCompile)||void 0===e||e.call(this);const t=this.getMarkInName("arrowRight");t&&t.getMarks().forEach((e=>{e.setDataView(this._arrowData),e.compileData(),e.setTransform([{type:"filter",callback:e=>"right"===e.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((e=>{e.setDataView(this._arrowData),e.compileData(),e.setTransform([{type:"filter",callback:e=>"left"===e.position}])}))}}const w="dataKey";class O extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s;super.transformSpec(e);const n=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const r=e.data[i].nodes;t.push({data:[{id:"nodes",values:r.map(((e,t)=>Object.assign(Object.assign({},e),{[w]:t})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:e.scope[0],y:e.scope[1]},{iter:i,x:e.scope[0],y:e.scope[3]},{iter:i,x:e.scope[2],y:e.scope[3]},{iter:i,x:e.scope[2],y:e.scope[1]},{iter:i,x:e.scope[0],y:e.scope[1]}]}]})})),t}(e),o="neighborhood"!==e.taskType;e.type="common",e.dataKey=w,e.data=n[0].data,e.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:t=>"neighborhood"===e.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${t.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:e=>e.color,lineDash:e=>"same_type"===e.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:e.xField,yField:e.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===e.taskType?6:4,fill:t=>{var i;return null!==(i=e.labelColor[t.label])&&void 0!==i?i:"gray"},fillOpacity:e=>e.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"===e.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:e=>e.id}}}],e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:n}),e.animationAppear={duration:null!==(i=null===(t=e.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:2e3,easing:"linear"},e.animationUpdate={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear",inverse:!0,min:e.scope[1],max:e.scope[3]},{orient:"bottom",type:"linear",min:e.scope[0],max:e.scope[2]}],e.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(s=e.infoLabel)||void 0===s?void 0:s.style)}],e.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:e=>e.map((e=>(e.shape.outerBorder={stroke:e.shape.fill,distance:2,lineWidth:1},e))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],e.tooltip={visible:o,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:e=>e.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:e=>e.prediction,shapeType:"circle",shapeSize:8,shapeFill:t=>{var i;return null!==(i=e.labelColor[t.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:e=>e.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:e=>e.label===e.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},e.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(e)}}class I extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=O}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}I.type="sequenceScatterLink",I.view="singleDefault",I.transformerConstructor=O;const E=.2;function D(e){const t=Math.sqrt((2*Math.PI)**2);return Math.exp(-(e**2)/2)/t}const B="dataKey";class P extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s,n;super.transformSpec(e);const o=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const r=e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[B]:t}))),a=function(e,t=100,i){const r=e.reduce(((e,t)=>{const i=t.label;return e[i]=e[i]||[],e[i].push(t),e}),{}),a=[];return Object.entries(r).forEach((([e,r])=>{const s=i||function(e){return e.length**(-1/6)}(r),n=r.map((e=>e.x)),o=r.map((e=>e.y)),l=Math.min(...n),d=Math.max(...n),c=Math.min(...o),u=Math.max(...o),h=l-(d-l)*E,p=c-(u-c)*E;for(let i=0;i<t;i++)for(let n=0;n<t;n++){const t=h+.1*i,o=p+.1*n;let l=0;for(const e of r)l+=D(Math.sqrt((t-e.x)**2+(o-e.y)**2)/s);l/=r.length*s*s,a.push({x:t,y:o,kde:l,label:e})}})),a}(r,150);t.push({data:[{id:"nodes",values:r},{id:"iter",values:[{iter:i}]},{id:"kde",values:a}]})})),t}(e);e.type="common",e.dataKey=B,e.data=o[0].data,e.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(t=e.scales)&&void 0!==t?t:[]],e.series=[{type:"scatter",dataIndex:0,xField:e.xField,yField:e.yField,seriesField:e.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:e.seriesField}}}}];e.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:e=>e.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=e.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(e,t)=>54+(0,t.chart.getAllSeries()[0]._markAttributeContext.valueToX)([e.x]),y:(e,t)=>(0,t.chart.getAllSeries()[0]._markAttributeContext.valueToY)([e.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:e=>10*e.kde}}],e.tooltip={visible:!0,fields:["x","y","label"]},e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:o}),e.animationAppear={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"},e.animationUpdate={duration:null!==(n=null===(s=e.player)||void 0===s?void 0:s.duration)&&void 0!==n?n:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(e)}}class j extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=P}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}j.type="sequenceScatterKDE",j.view="singleDefault",j.transformerConstructor=P;const R="dataKey";function V(e){const t=[];return Object.keys(e.data).forEach((i=>{let r=null;if(e.backgroundColors&&e.backgroundColors[i]){const t=function(e,t){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const r=document.createElement("canvas");r.width=t.width,r.height=t.height;const a=r.getContext("2d");if(!a)throw new Error("Failed to get 2D rendering context from canvas");const s=a.createImageData(t.width,t.height);for(let t=0;t<300;t++)for(let r=0;r<300;r++){const a=(null===(i=e[t])||void 0===i?void 0:i[r])||[0,0,0],n=4*(300*t+r);s.data[n]=Math.round(255*a[0]),s.data[n+1]=Math.round(255*a[1]),s.data[n+2]=Math.round(255*a[2]),s.data[n+3]=255}return a.putImageData(s,0,0),r.toDataURL("image/png")}(e.backgroundColors[i],e);r={imageData:t}}t.push({data:[{id:"nodes",values:e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[R]:t})))},{id:"inter",values:[{inter:i}]},{id:"background",values:r?[r]:[]}]})})),t}class N extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,r,a,s;super.transformSpec(e);const n=V(e);e.type="common",e.dataKey=R,e.data=n[0].data,e.width=300,e.height=300,e.autoFit=!1,e.series=[{type:"scatter",xField:e.xField,yField:e.yField}],e.player&&(e.player=Object.assign(Object.assign({},e.player),{specs:n}),e.animationAppear={duration:null!==(i=null===(t=e.player)||void 0===t?void 0:t.duration)&&void 0!==i?i:2e3,easing:"linear"},e.animationUpdate={duration:null!==(a=null===(r=e.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),e.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],e.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:e=>e.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:e=>e.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(s=e.infoLabel)||void 0===s?void 0:s.style)}],e.tooltip={visible:!1},super.transformSpec(e)}}class z extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=N}init(){this.isValid()&&super.init()}isValid(){var e,t,i,r;const{xField:a,yField:s,data:n}=this._spec;return a&&s?!!n||(null===(r=(i=this._option).onError)||void 0===r||r.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}z.type="sequenceScatterPixel",z.view="singleDefault",z.transformerConstructor=N;class H extends t.BarChartSpecTransformer{_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.barWidth=e.barWidth,t.barMaxWidth=e.barMaxWidth,t.barMinWidth=e.barMinWidth,t.barGapInGroup=e.barGapInGroup,t}}var G,W,$,U,K;!function(e){e.bar3d="bar3d",e.histogram3d="histogram3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}(G||(G={})),function(e){e.rect3d="rect3d",e.arc3d="arc3d",e.pyramid3d="pyramid3d"}(W||(W={})),function(e){e.bar3d="bar3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}($||($={})),function(e){e.bar3d="bar3d",e.funnel3d="funnel3d",e.transform3d="transform3d",e.pie3d="pie3d"}(U||(U={})),function(e){e.bar3d_horizontal="bar3d_horizontal",e.bar3d_vertical="bar3d_vertical",e.bar3d_stack="bar3d_stack",e.rangeColumn3d_horizontal="rangeColumn3d_horizontal",e.rangeColumn3d_vertical="rangeColumn3d_vertical"}(K||(K={}));const X=e=>e.zField||e.series&&e.series.some((e=>e.zField));class Y extends t.BasePlugin{constructor(){super(Y.type),this.type="VChart3dPlugin"}onInit(e,t){var i,r;if(this._is3d=!!(r=t)&&((e=>"bar3d"===e||"funnel3d"===e||"histogram3d"===e||"pie3d"===e||"rangeColumn3d"===e||"wordCloud3d"===e)(r.type)||X(r),!0),this._is3d){const{globalInstance:t}=e;t.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=t._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(e,t,i){this._is3d&&X(t)&&(t.layout={type:"layout3d"})}}Y.pluginType="chart",Y.type="VChart3dPlugin";const q=()=>{t.registerChartPlugin(Y),t.registerDirectionalLight(),t.registerOrthoCamera(),t.registerViewTransform3dPlugin()},Z={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class J extends t.BarSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"bar3d")}}class Q extends t.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(e,t){super(e,t),this.type=Q.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}Q.type="rect3d";const ee=()=>{t.Factory.registerMark(Q.type,Q),t.registerShadowRoot(),t.registerRect3d(),t.registerRectAnimation(),t.Factory.registerGraphicComponent("rect3d",t.createRect3d)};class te extends t.BarSeries{constructor(){super(...arguments),this.type=$.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=J}}te.type=$.bar3d,te.mark=Z,te.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},te.transformerConstructor=J;const ie=()=>{t.Factory.registerAnimation("bar3d",((e,i)=>({appear:t.barPresetAnimation(e,i),enter:t.barGrowIn(e,!1),exit:t.barGrowOut(e,!1),disappear:t.barGrowOut(e)}))),ee(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries(te.type,te)};class re extends t.Layout{layoutItems(e,i,r,a){this._layoutInit(e,i,r,a);const s={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,s);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},o=i.filter((e=>"absolute"===e.layoutType)),l=o.filter((e=>"z"===e.layoutOrient));let d={width:0,height:0};if(l.length){d=l[0].getLayoutRect()}this.leftCurrent+=d.width/8,this.rightCurrent-=d.width/8,this.topCurrent+=d.height/8,this.bottomCurrent-=d.height/8;const{regionItems:c,relativeItems:u,relativeOverlapItems:h,allRelatives:p,overlapItems:g}=this._groupItems(i);this.layoutRegionItems(c,u,h,g,s),this._processAutoIndent(c,u,h,g,p,n,s);const m=o.filter((e=>"z"!==e.layoutOrient));this.layoutAbsoluteItems(m);const y=u.filter((e=>"axes"===e.model.specKey&&t.isXAxis(e.layoutOrient)))[0],v=u.filter((e=>"axes"===e.model.specKey&&t.isYAxis(e.layoutOrient)))[0];if(y&&l.length){const e=y.getLayoutStartPoint(),t=y.getLayoutRect(),i={x:"left"===v.layoutOrient?e.x+t.width:e.x,y:e.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===v.layoutOrient?"r2l":"l2r";const r=y.getLayoutRect(),a=v.getLayoutRect(),s={length:l[0].getLayoutRect().width,width:r.width,height:a.height};y.model.setLayout3dBox&&y.model.setLayout3dBox(s),v.model.setLayout3dBox&&v.model.setLayout3dBox(s),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(s),this.layoutZAxisItems(l,i)}}layoutZAxisItems(e,t){e.forEach((e=>{e.absoluteLayoutInRect(t)}))}getItemComputeLayoutRect(e,t){t||(t={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-e.layoutPaddingLeft-e.layoutPaddingRight-(t.offsetLeft+t.offsetRight),height:this.bottomCurrent-this.topCurrent-e.layoutPaddingTop-e.layoutPaddingBottom-(t.offsetTop+t.offsetBottom)}}_checkAutoIndent(e){const t={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,r=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return e.forEach((e=>{if(!e.getModelVisible()||!e.autoIndent)return;const a="left"===e.layoutOrient||"right"===e.layoutOrient,s=e.getLastComputeOutBounds();a?(t.top=Math.max(t.top,s.y1-this.topCurrent),t.bottom=Math.max(t.bottom,s.y2-r)):(t.left=Math.max(t.left,s.x1-this.leftCurrent),t.right=Math.max(t.right,s.x2-i))})),t}}re.type="layout3d";const ae=()=>{t.Factory.registerLayout(re.type,re)};class se extends t.BarChart{constructor(){super(...arguments),this.transformerConstructor=H,this.type="bar3d",this.seriesType=$.bar3d}}se.type="bar3d",se.seriesType=$.bar3d,se.transformerConstructor=H;const ne=Object.assign(Object.assign({},t.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class oe extends t.FunnelSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"funnel3d"),e.isTransform&&this._addMarkLabelSpec(e,"transform3d","transformLabel")}}class le extends t.BasePolygonMark{_getDefaultStyle(){const e=super._getDefaultStyle();return e.stroke=!1,e}constructor(e,t){super(e,t),this.type=le.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}le.type="pyramid3d";const de=t.getFunnelTheme(!0);class ce extends t.FunnelSeries{constructor(){super(...arguments),this.type=$.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=oe}initMark(){var e,t,i,r,a,s,n,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},ce.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},ce.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(r=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===r?void 0:r.visible){const{line:e}=null!==(a=this._spec.outerLabel)&&void 0!==a?a:{},{line:t}=null!==(n=null===(s=this._theme)||void 0===s?void 0:s.outerLabel)&&void 0!==n?n:{};this._funnelOuterLabelMark.label=this._createMark(ce.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(ce.mark.outerLabelLine,{themeSpec:t,key:this._seriesField,markSpec:e})}}initMarkStyle(){super.initMarkStyle();const e=this._funnelMark;e&&this.setMarkStyle(e,{z:e=>{if(this._isHorizontal())return 0;const t=this.getPoints(e),i=Math.max(Math.abs(t[0].x-t[1].x),Math.abs(t[2].x-t[3].x));return(this._computeMaxSize()-i)/2}},"normal",t.AttributeLevel.Series)}initLabelMarkStyle(e){var i,r;super.initLabelMarkStyle(e),this.setMarkStyle(e,{z:e=>{if(this._isHorizontal())return 0;const t=this.getPoints(e),i=Math.max(Math.abs(t[0].x-t[1].x),Math.abs(t[2].x-t[3].x));return(this._computeMaxSize()-i)/2}},"normal",t.AttributeLevel.Series),this._labelMark=e,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(r=this._funnelOuterLabelMark)||void 0===r||r.line}}ce.type=$.funnel3d,ce.mark=ne,ce.builtInTheme={funnel3d:de},ce.transformerConstructor=oe;const ue=()=>{t.Factory.registerMark(le.type,le),t.registerShadowRoot(),t.registerPyramid3d(),t.registerPolygonAnimation(),t.Factory.registerGraphicComponent("pyramid3d",t.createPyramid3d),t.registerTextMark(),t.registerRuleMark(),t.Factory.registerSeries(ce.type,ce)};class he extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=t.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=$.funnel3d}}he.type="funnel3d",he.seriesType=$.funnel3d,he.transformerConstructor=t.FunnelChartSpecTransformer;class pe extends t.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=t.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=$.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}pe.type="histogram3d",pe.seriesType=$.bar3d,pe.transformerConstructor=t.HistogramChartSpecTransformer;class ge extends t.BasePieChartSpecTransformer{transformSpec(e){super.transformSpec(e),e.series.forEach((t=>{"pie3d"===t.type&&(t.angle3d=e.angle3d)}))}}class me extends t.BaseArcMark{setDataLabelType(){return"arc"}constructor(e,t){super(e,t),this.type=me.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}me.type="arc3d";const ye=Object.assign(Object.assign({},t.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class ve extends t.PieSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"pie3d")}}class fe extends t.BasePieSeries{constructor(){super(...arguments),this.type=$.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=ve}setAttrFromSpec(){var e,t;super.setAttrFromSpec(),this._angle3d=null!==(t=null===(e=this._spec)||void 0===e?void 0:e.angle3d)&&void 0!==t?t:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const e=this._pieMark;e&&this.setMarkStyle(e,{beta:()=>this._angle3d},"normal",t.AttributeLevel.Series)}initLabelMarkStyle(e,i={}){e&&(super.initLabelMarkStyle(e),this.setMarkStyle(e,{support3d:!0},void 0,t.AttributeLevel.Mark))}}fe.type=$.pie3d,fe.mark=ye,fe.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},fe.transformerConstructor=ve;const be=()=>{t.Factory.registerAnimation("pie3d",((e,i)=>({appear:t.piePresetAnimation(e,i),enter:t.pieEnter(e),exit:t.pieExit(e),disappear:t.pieDisappear(e)}))),t.registerArcAnimation(),t.registerShadowRoot(),t.registerArc3d(),t.Factory.registerGraphicComponent("arc3d",t.createArc3d),t.Factory.registerMark("arc3d",me),t.Factory.registerSeries(fe.type,fe)};class xe extends t.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=ge,this.type="pie3d",this.seriesType=$.pie3d}}xe.type="pie3d",xe.seriesType=$.pie3d,xe.transformerConstructor=ge;const _e="combinationCandlestick";class Se extends t.CartesianChartSpecTransformer{_getDefaultSeriesSpec(e){const t=[e.openField,e.highField,e.lowField,e.closeField],i=super._getDefaultSeriesSpec(e,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=t,i}transformSpec(e){super.transformSpec(e),e.axes||(e.axes=[{orient:"bottom"},{orient:"left"}]),t.setDefaultCrosshairForCartesianChart(e)}}class ke extends t.GlyphMark{constructor(){super(...arguments),this.type=ke.type}setGlyphConfig(e){super.setGlyphConfig(e),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(e,t,i)=>{const{x:r=i.attribute.x,boxWidth:a=i.attribute.boxWidth,open:s=i.attribute.open,close:n=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=e,d={};return d.line={points:[{x:r,y:o},{x:r,y:l}]},d.box={x:r-a/2,x1:r+a/2,y:Math.min(s,n),y1:Math.max(s,n),drawStrokeWhenZeroWH:!0},d}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}ke.type="candlestick";class Ce extends t.ACustomAnimate{constructor(e,t,i,r,a){super(e,t,i,r,a)}onBind(){super.onBind();const e=this.target.getFinalAttribute();e&&this.target.setAttributes(e);const{from:t,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((e=>null!=i[e])),this.animate.reSyncProps(),this.from=t,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(e=>{const i=e.getFinalAttribute(),{x:r,y:a,open:s,high:n,low:o,close:l}=i,d={from:{x:r,y:a},to:{x:r,y:a}};return t.isValidNumber(s)&&t.isValidNumber(l)&&(s>l?(d.from.open=o,d.to.open=s,d.from.close=o,d.to.close=l,t.isValidNumber(n)&&(d.from.high=o,d.to.high=n)):(d.from.open=n,d.to.open=s,d.from.close=n,d.to.close=l,t.isValidNumber(o)&&(d.from.low=n,d.to.low=o))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const r=this.target.attribute;this.propKeys.forEach((e=>{r[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(r)}}class Me extends t.ACustomAnimate{constructor(e,t,i,r,a){super(e,t,i,r,a)}onBind(){var e;(null===(e=this.params)||void 0===e?void 0:e.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:t,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((e=>null!=i[e])),this.animate.reSyncProps(),this.from=t,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(e=>{const i=e.getFinalAttribute(),{x:r,y:a,open:s,high:n,low:o,close:l}=i,d={from:{x:r,y:a},to:{x:r,y:a}};return t.isValidNumber(s)&&t.isValidNumber(l)&&(s>l?(d.from.open=s,d.to.open=o,d.from.close=l,d.to.close=o,t.isValidNumber(n)&&(d.from.high=n,d.to.high=o)):(d.from.open=s,d.to.open=n,d.from.close=l,d.to.close=n,t.isValidNumber(o)&&(d.from.low=o,d.to.low=n))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const r=this.target.attribute;this.propKeys.forEach((e=>{r[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(r)}}const Ae="candlestick";var Fe,Te;!function(e){e.OPEN="open",e.HIGH="high",e.LOW="low",e.CLOSE="close",e.SERIES_FIELD="seriesField"}(Fe||(Fe={})),function(e){e.candlestick="candlestick"}(Te||(Te={}));const Le=Object.assign(Object.assign({},t.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class we extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=e=>t=>{switch(e){case Fe.OPEN:return this.series.getOpenField();case Fe.HIGH:return this.series.getHighField();case Fe.LOW:return this.series.getLowField();case Fe.CLOSE:return this.series.getCloseField();case Fe.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=e=>t=>{switch(e){case Fe.OPEN:return t[this.series.getOpenField()];case Fe.HIGH:return t[this.series.getHighField()];case Fe.LOW:return t[this.series.getLowField()];case Fe.CLOSE:return t[this.series.getCloseField()];case Fe.SERIES_FIELD:return t[this.series.getSeriesField()]}return null},this.shapeColorCallback=e=>this.series.getMarkInName("candlestick").getAttribute("stroke",e)}getDefaultContentList(e){return[{key:this.getContentKey(Fe.OPEN),value:this.getContentValue(Fe.OPEN)},{key:this.getContentKey(Fe.HIGH),value:this.getContentValue(Fe.HIGH)},{key:this.getContentKey(Fe.LOW),value:this.getContentValue(Fe.LOW)},{key:this.getContentKey(Fe.CLOSE),value:this.getContentValue(Fe.CLOSE)},{key:this.getContentKey(Fe.SERIES_FIELD),value:this.getContentValue(Fe.SERIES_FIELD)}]}}const Oe={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class Ie extends t.CartesianSeries{constructor(){super(...arguments),this.type=Ae,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var e,t,i,r,a,s,n,o;super.setAttrFromSpec();const l=this._spec,d=null!==(t=null===(e=l.candlestick)||void 0===e?void 0:e.style)&&void 0!==t?t:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=d.boxWidth,this._boxFill=d.boxFill,this._strokeColor=d.strokeColor,this._buildMergedStyles(d,null!==(r=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==r?r:{},null!==(s=null===(a=l.falling)||void 0===a?void 0:a.style)&&void 0!==s?s:{},null!==(o=null===(n=l.doji)||void 0===n?void 0:n.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(Ie.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var e;const i=this._candlestickMark;if(i){const r={fill:e=>this.mergeStyle(e).boxFill,stroke:e=>this.mergeStyle(e).stroke,lineWidth:e=>this.mergeStyle(e).lineWidth,boxWidth:null!==(e=this._boxWidth)&&void 0!==e?e:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,r,t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}initCandlestickMarkStyle(){var e;const i=this._candlestickMark,r=this._yAxisHelper;if(i&&r){const{dataToPosition:a}=r,s=null===(e=null==r?void 0:r.getScale)||void 0===e?void 0:e.call(r,0);this.setMarkStyle(i,{open:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._openField),{bandPosition:this._bandPosition}),s),high:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._highField),{bandPosition:this._bandPosition}),s),low:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._lowField),{bandPosition:this._bandPosition}),s),close:e=>t.valueInScaleRange(a(this.getDatumPositionValues(e,this._closeField),{bandPosition:this._bandPosition}),s)},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}init(e){super.init(e),this.initCandlestickMarkStyle()}_initAnimationSpec(e={}){const i=t.merge({},e);return["appear","enter","update","exit","disappear"].forEach((e=>{i[e]&&"scaleIn"===i[e].type?i[e].type="candlestickScaleIn":i[e]&&"scaleOut"===i[e].type&&(i[e].type="candlestickScaleOut")})),i}initAnimation(){var e;const i=t.getGroupAnimationParams(this);if(this._candlestickMark){const r=this._initAnimationSpec(null===(e=t.Factory.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e()),a=this._initAnimationSpec(t.userAnimationConfig(Ae,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(t.animationConfig(r,a,i))}}initTooltip(){this._tooltipHelper=new we(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(e,i,r,a){this._mergedStyles.rising=t.merge({},e,i),this._mergedStyles.falling=t.merge({},e,r),this._mergedStyles.doji=t.merge({},e,a)}mergeStyle(e){const t=this.getDatumPositionValues(e,this._openField)[0],i=this.getDatumPositionValues(e,this._closeField)[0];return t<i?this._mergedStyles.rising:t>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const e=this._xAxisHelper,t=this._fieldX,i=e.getBandwidth(t.length-1)/t.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}Ie.type=Ae,Ie.builtInTheme={candlestick:Oe},Ie.mark=Le;const Ee=()=>{t.registerGlyphMark(),t.registerLine(),t.registerRect(),t.Factory.registerGraphicComponent("line",(e=>t.createLine(e))),t.Factory.registerGraphicComponent("rect",(e=>t.createRect(e))),t.Factory.registerMark(ke.type,ke),t.registerSymbolMark(),t.registerScaleInOutAnimation(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleIn",Ce),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleOut",Me),t.Factory.registerSeries(Ie.type,Ie)};class De extends t.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}De.type="candlestick",De.seriesType=Ae,De.transformerConstructor=Se;function Be(e){e.yField=[e.openField,e.highField,e.lowField,e.closeField]}class Pe extends t.CartesianChartSpecTransformer{needAxes(){return!0}transformSpec(e){this.transformRegion(e),void 0===e.tooltip&&(e.tooltip={}),this.transformSeriesSpec(e),this._transformAxisSpec(e),this._transformLayout(e)}transformRegion(e){var t,i;const r=e;r.region=[null!==(t=e.candlestickRegion)&&void 0!==t?t:{}],e.previewSeries&&r.region.push(null!==(i=e.previewRegion)&&void 0!==i?i:{})}transformSeriesSpec(e){var i;e.series=null!==(i=e.series)&&void 0!==i?i:[],e.series.forEach((t=>{this._transformSeriesData(e,t),t.regionIndex=0}));const r=e.series.find((t=>t.id===e.candlestickSeries.id));let a;r?(t.merge(r,e.candlestickSeries),a=r):(e.series.push(e.candlestickSeries),a=e.candlestickSeries),Be(a),this._transformSeriesData(e,a),a.regionIndex=0,e.previewSeries&&t.array(e.previewSeries).forEach((i=>{const r=e.series.find((e=>e.id===i.id));let a;r?(t.merge(r,i),a=r):(e.series.push(i),a=i),a.regionIndex=1,this._transformSeriesData(e,a)}))}_transformSeriesData(e,i){var r;i.data&&(e.data=t.array(null!==(r=e.data)&&void 0!==r?r:[]),t.array(i.data).forEach(((t,r)=>{e.data.push(t),0===r&&(i.dataIndex=e.data.length-1,"id"in t?i.dataId=t.id:"name"in t&&(i.dataId=t.name))})),delete i.data)}_transformAxisSpec(e){super._transformAxisSpec(e),e.previewSeries&&(e.previewAxes||(e.previewAxes={type:"linear",orient:"left",visible:!1}),e.previewAxes.regionIndex=[1],e.axes.push(e.previewAxes),e.axes.forEach((t=>{t!==e.previewAxes&&("left"!==t.orient&&"right"!==t.orient||(t.regionIndex=[0]))})))}_transformDataZoomSpec(e){e.dataZoom&&t.array(e.dataZoom).forEach((e=>{"left"!==e.orient&&"right"!==e.orient||(e.regionIndex=[0])}))}_transformLayout(e){var i,r;const a={type:"grid",col:2,row:6,elements:[],colWidth:[],rowHeight:[]};let s=0,n=0;if(e.title&&!1!==(null===(i=e.title)||void 0===i?void 0:i.visible)&&s++,e.legends){const i=t.array(e.legends)[0];!1!==(null==i?void 0:i.visible)&&("top"===i.orient||"bottom"===i.orient?s++:n++)}if(e.dataZoom&&t.array(e.dataZoom).forEach((e=>{!1!==(null==e?void 0:e.visible)&&("top"===e.orient||"bottom"===e.orient?s++:n++)})),e.axes){const i={top:!1,bottom:!1,left:!1,right:!1,z:!1};t.array(e.axes).forEach((e=>{i[e.orient]||(i[e.orient]=!0,"top"===e.orient||"bottom"===e.orient?s++:n++)}))}s++,n++,e.previewSeries&&s++,a.row=s,a.col=n;const o={top:0,bottom:0,left:0,right:0};if(e.title&&!1!==(null===(r=e.title)||void 0===r?void 0:r.visible)&&this._layoutOrientItem(a,e.title,o,{specKey:"title",index:0},"total"),e.legends){const i=t.array(e.legends)[0];!1!==(null==i?void 0:i.visible)&&this._layoutOrientItem(a,i,o,{specKey:"legends",index:0},"less")}if(e.dataZoom&&t.array(e.dataZoom).forEach(((e,t)=>{!1!==(null==e?void 0:e.visible)&&this._layoutOrientItem(a,e,o,{specKey:"dataZoom",index:t},"one")})),e.axes){const t={left:!1,right:!1};e.axes.forEach(((e,i)=>{"left"!==e.orient&&"right"!==e.orient||t[e.orient]||(t[e.orient]=!0,this._layoutOrientItem(a,e,o,{specKey:"axes",index:i},"one"))}))}const l=this._layoutOrientItem(a,{orient:"top"},o,{specKey:"region",index:0},"one");if(e.previewSeries){const i=this._layoutOrientItem(a,{orient:"bottom"},o,{specKey:"region",index:1},"one"),r=e.axes.findIndex((t=>t===e.previewAxes));if(-1!==r){const e={col:i.col-1,row:i.row,modelKey:"axes",modelIndex:r};a.elements.push(e)}if(e.previewHeight)if("string"==typeof e.previewHeight){if(t.isPercent(e.previewHeight)){const t=e.previewHeight;a.rowHeight.push({index:i.row,size:e=>Number(t.substring(0,t.length-1))*e/100})}}else a.rowHeight.push({index:i.row,size:e.previewHeight})}const d=e.axes.findIndex((e=>"bottom"===e.orient));this._layoutOrientItem(a,e.axes[d],o,{specKey:"axes",index:d},"one"),e.axes.forEach(((t,i)=>{if(t===e.previewAxes)return;const r=a.elements.find((e=>"modelKey"in e&&"axes"===e.modelKey&&e.modelIndex===i));r&&("top"===t.orient||"bottom"===t.orient?r.col=l.col:r.row=l.row)})),t.array(e.dataZoom).forEach(((e,t)=>{const i=a.elements.find((e=>"modelKey"in e&&"dataZoom"===e.modelKey&&e.modelIndex===t));i&&("top"===e.orient||"bottom"===e.orient?i.col=l.col:i.row=l.row)})),e.layout=a}_layoutOrientItem(e,t,i,r,a){var s;const n={modelKey:r.specKey,modelIndex:r.index,col:0,row:0},o=null!==(s=t.orient)&&void 0!==s?s:"top",{span:l,index:d}=this._getLayoutElementCommon(e,i,a,o);return e.elements.push(n),"top"===o?(n.row=i.top,n.rowSpan=1,n.colSpan=l,n.col=d,i.top++):"bottom"===o?(n.row=e.row-i.bottom-1,n.rowSpan=1,n.colSpan=l,n.col=d,i.bottom++):"left"===o?(n.col=i.left,n.colSpan=1,n.rowSpan=l,n.row=d,i.left++):"right"===o&&(n.col=e.col-i.right-1,n.colSpan=1,n.rowSpan=l,n.row=d,i.right++),n}_getLayoutElementCommon(e,t,i,r){return"top"===r||"bottom"===r?{span:"total"===i?e.col:"one"===i?1:e.col-t.left-t.right,index:"total"===i?0:t.left}:{span:"total"===i?e.row:"one"===i?1:e.row-t.top-t.bottom,index:"total"===i?0:t.top}}}class je extends t.BaseChart{constructor(){super(...arguments),this.type=_e,this.transformerConstructor=Pe}_setModelOption(){this._modelOption.getDimensionInfo=(e,i,r)=>{var a;return[...null!==(a=t.getCartesianDimensionInfo(e,i,r))&&void 0!==a?a:[]]},this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}je.type=_e,je.transformerConstructor=Pe,t.mixin(je,t.StackChartMixin);const Re=e=>({custom:t.RotateBySphereAnimate,customParameters:()=>e,easing:"linear",loop:1/0,duration:6e3});class Ve extends t.BaseWordCloudSeries{constructor(){super(...arguments),this.type=$.wordCloud3d}_wordCloudTransformOption(){var e;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(e=this._spec.postProjection)&&void 0!==e?e:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var e;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(e=this._spec.postProjection)&&void 0!==e?e:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(t.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const e=this._wordMark;e&&this.setMarkStyle(e,{z:e=>{var t;return null!==(t=e.z)&&void 0!==t?t:0}},"normal",t.AttributeLevel.Series)}initAnimation(){var e,i;const r=null!==(e=this._padding)&&void 0!==e?e:{};this._wordMark&&this._wordMark.setAnimationConfig(t.animationConfig(null===(i=t.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var e;const t=this.getCompiler().getStage(),i=t.width-r.left||0-r.right||0,a=t.height-r.top||0-r.bottom||0,s=Math.max(i,a)/2;return{center:{x:s,y:s,z:null!==(e=this._spec.depth_3d)&&void 0!==e?e:s},r:s}})),t.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Ve.type=$.wordCloud3d,Ve.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Ne=()=>{t.registerTextMark(),t.Factory.registerAnimation("wordCloud3d",(e=>({appear:Re(e)}))),t.Factory.registerSeries(Ve.type,Ve)},ze=()=>{Ne()};class He extends t.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(e){const t=super._getDefaultSeriesSpec(e);return t.depth_3d=e.depth_3d,t}}class Ge extends t.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=He,this.type="wordCloud3d",this.seriesType=$.wordCloud3d}}Ge.type="wordCloud3d",Ge.seriesType=$.wordCloud3d,Ge.transformerConstructor=He;const We=()=>{q(),Ne(),t.Factory.registerChart(Ge.type,Ge)},$e={label:{space:0}};class Ue{setLayout3dBox(e){this.layout3dBox=e}_afterUpdateAttribute(e,i){const r=t.isZAxis(this._orient),a=t.isXAxis(this._orient),s=t.isYAxis(this._orient);let n=0,o=0;if(!i){const e=this.getRegions();let{x:t,y:i}=e[0].getLayoutStartPoint(),r=t+e[0].getLayoutRect().width,a=i+e[0].getLayoutRect().height;for(let s=1;s<e.length;s++){const n=e[s],{x:o,y:l}=n.getLayoutStartPoint(),{width:d,height:c}=n.getLayoutRect();t=Math.min(t,o),r=Math.max(r,d+o),i=Math.min(i,l),a=Math.max(a,c+l)}n=Math.abs(a-i),o=Math.abs(r-t)}let l=0,d=0;const{width:c,height:u}=this.getLayoutRect();let h={x:0,y:0};a?(h={x:c,y:0},l=n,d=c):s&&(h={x:0,y:u},l=o,d=u);const p=this.layout3dBox?this.layout3dBox.length:0;if(!r){const t=this.getLabelItems(d);return e.grid={length:l},e.start={x:0,y:0},e.text=this._spec.title.text||this._dataFieldText,e.maxWidth=this._getTitleLimit(a),e.items=t,e.grid={type:"line",start:{x:0,y:0},end:h,items:t[0],depth:p,length:l},e}return((e,i)=>{var r;const a=t.getCombinedSizeOfRegions(e.getRegions()),{width:s}=e.getLayoutRect(),n=s,o=e.layout3dBox?e.layout3dBox.length:0,l=e.layout3dBox?e.layout3dBox.width:0,d={x:o,y:0},c=e.getLabelItems(n),u={start:{x:0,y:0},end:d,title:{text:e._spec.title.text||e._dataFieldText,maxWidth:e._getTitleLimit(!1)},items:c,scale:e._scale.clone()},h=null!==(r=e.directionStr)&&void 0!==r?r:"r2l";let p=[0,0],g=-Math.PI/2,m=0;return"l2r"===h&&(m=e.layout3dBox.length,p=[0,0,0],g=Math.PI/2),u.z=m,u.alpha=g,u.anchor3d=p,i||(u.grid={type:"line",start:{x:0,y:0},end:d,items:c[0],verticalFactor:e._axisStyle.verticalFactor,depth:l,length:i?0:a.height,alpha:g,z:m,anchor3d:p}),u})(this,i)}}const Ke=Object.assign(Object.assign({},Z),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Xe extends t.RangeColumnSeries{constructor(){super(...arguments),this.type=$.rangeColumn3d,this._barMarkType="rect3d",this._barName=$.bar3d}}Xe.type=$.rangeColumn3d,Xe.mark=Ke;const Ye=()=>{ee(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries(Xe.type,Xe)};class qe extends t.RangeColumnSeriesSpecTransformer{_transformLabelSpec(e){var t;"bothEnd"!==(null===(t=e.label)||void 0===t?void 0:t.position)&&this._addMarkLabelSpec(e,"bar3d")}}class Ze extends t.CartesianChartSpecTransformer{_getDefaultSeriesSpec(e){var t,i;const r=super._getDefaultSeriesSpec(e,["bar3d","barGapInGroup"]);return"horizontal"===e.direction?r.xField=null!==(t=e.xField)&&void 0!==t?t:[e.minField,e.maxField]:r.yField=null!==(i=e.yField)&&void 0!==i?i:[e.minField,e.maxField],r}}class Je extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Ze,this.type="rangeColumn3d",this.seriesType=$.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}Je.type="rangeColumn3d",Je.seriesType=$.rangeColumn3d,Je.transformerConstructor=Ze;const Qe="pictogram",et="pictogram";var tt;!function(e){e.pictogram="pictogram"}(tt||(tt={}));const it=Object.assign(Object.assign({},t.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class rt extends t.BaseChartSpecTransformer{_isValidSeries(e){return e===et}_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(e){super.transformSpec(e),e.region.forEach((e=>{e.coordinate="geo"})),super.transformSeriesSpec(e)}}const at=new Map;let st;function nt(e,i){at.has(e)&&t.warn(`svg source key of '${e}' already exists, will be overwritten.`),st||(st=new t.DataSet,t.registerDataSetInstanceParser(st,"svg",t.svgParser));const r=new t.DataView(st);r.parse(i,{type:"svg"}),at.set(e,r)}function ot(e){at.has(e)?at.delete(e):t.warn(`map type of '${e}' does not exists.`)}function lt(e){return at.get(e)}class dt extends t.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(e){var i,r,a;const s=null!==(i=super._getDefaultSpecFromChart(e))&&void 0!==i?i:{},n=e.svg,o=null===(a=null===(r=at.get(n))||void 0===r?void 0:r.latestData)||void 0===a?void 0:a.elements;if(o&&o.length){o.map((e=>e.name)).filter((e=>t.isValid(e))).forEach((t=>{e[t]&&(s[t]=e[t])}))}return s}}class ct extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=e=>{var t;const i=this.series;return null!==(t=this._getDimensionData(e))&&void 0!==t?t:i.getDatumName(e)},this.markTooltipValueCallback=(e,t)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&e.data)return e.data[i[0]]},this.markTooltipKeyCallback=e=>{var t;return null===(t=e.data)||void 0===t?void 0:t[this.series.getDimensionField()[0]]}}}const ut="element-highlight-by-graphic-name";class ht extends t.ElementHighlight{constructor(){super(...arguments),this.type=ut,this.handleStart=e=>{if(e&&e.item&&this.isGraphicInMark(e.item)){if(this.options.shouldStart?this.options.shouldStart(e):this._filterByName(e)){const t=this._parseTargetKey(e);this.start(t)}}},this.handleReset=e=>{e&&e.item&&this.isGraphicInMark(e.item)&&this.reset()}}_filterByName(e){var t;return!!(null===(t=null==e?void 0:e.node)||void 0===t?void 0:t.name)}_parseTargetKey(e){return e.node.name}start(e){if(t.isNil(e))return;const{interaction:i,highlightState:r,blurState:a}=this.options,s=i.getStatedGraphics(this),n=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&n.push(t)}))})),i.updateStates(this,n,s,r,a),i.setStatedGraphics(this,n)}reset(){const{highlightState:e,blurState:t,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,e,t),i.setStatedGraphics(this,[])}}ht.type=ut;const pt="element-select-by-graphic-name";class gt extends t.ElementSelect{constructor(){super(...arguments),this.type=pt}start(e){const t=null==e?void 0:e.name;t&&this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&super.start(e)}))}))}}gt.type=pt;function mt(e){var i;return t.isValid(e)&&"none"!==e&&!(null===(i=e.includes)||void 0===i?void 0:i.call(e,"url"))}const yt=e=>{const t=parseFloat(e.strokeWidth);if(!isNaN(t))return t;const i=e.stroke;return i&&mt(i)?1:0},vt=(e,t)=>{var i;const r=null!==(i=e.fill)&&void 0!==i?i:t;return r&&mt(r)?r:void 0},ft=(e,t)=>{var i;const r=null!==(i=e.stroke)&&void 0!==i?i:t;return!(!r||!mt(r))&&r},bt=e=>Object.assign(Object.assign({},e),{x:parseFloat(e.x)||void 0,y:parseFloat(e.y)||void 0,fillStrokeOrder:!1,fill:vt(e),lineWidth:yt(e),stroke:ft(e)}),xt={group:e=>{const t=bt(e);return Object.assign(Object.assign({},t),{visibleAll:!1!==t.visible})},rule:e=>Object.assign(Object.assign({},bt(e)),{x:parseFloat(e.x1),y:parseFloat(e.y1),x1:parseFloat(e.x2),y1:parseFloat(e.y2)}),rect:e=>Object.assign(Object.assign({},bt(e)),{fill:vt(e,"#000"),width:parseFloat(e.width),height:parseFloat(e.height)}),polygon:e=>Object.assign(Object.assign({},bt(e)),{fill:vt(e,"#000"),points:e.points.trim().split(/\s+/).map((e=>{const[t,i]=e.split(",").map(Number);return{x:t,y:i}}))}),line:e=>Object.assign(Object.assign({},bt(e)),{points:e.points.trim().split(/\s+/).map((e=>{const[t,i]=e.split(",").map(Number);return{x:t,y:i}}))}),path:e=>Object.assign(Object.assign({},bt(e)),{path:e.d,fillStrokeOrder:!1,fill:vt(e,"#000")}),arc:e=>{var t;return Object.assign(Object.assign({},bt(e)),{outerRadius:null!==(t=e.r)&&void 0!==t?t:e.ry,x:parseFloat(e.cx),y:parseFloat(e.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(e.rx)/parseFloat(e.ry)||1,fill:vt(e,"#000")})},text:(e,t)=>{var i,r;return Object.assign(Object.assign({},bt(e)),{text:t,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(r=e.textAnchor)&&void 0!==r?r:"middle",anchor:[0,0],fill:vt(e,"#000")})}},_t=e=>{var i,r;if(!e||!e[0])return{};const{elements:a}=e[0].latestData;if(a&&a.length){a.forEach(((e,i)=>{var r;e[t.DEFAULT_DATA_INDEX]=i,e._uniqueId=`${e.id}-${i}`,e.data=void 0;const{graphicType:a,transform:s}=e,n={visible:"hidden"!==e.attributes.visibility&&"collapse"!==e.attributes.visibility};"text"===e.graphicType?t.merge(n,e._inheritStyle,null===(r=e.parent)||void 0===r?void 0:r._textGroupStyle,e.attributes):"group"!==e.graphicType&&t.merge(n,e._inheritStyle,e.attributes),xt[a]?e._finalAttributes=xt[a](n,e.value):e._finalAttributes=n,s&&(e._finalAttributes.postMatrix=Object.assign({},s))}));const e=a.filter((e=>"text"===e.tagName));for(let s=0;s<e.length;s++){const n=e[s]._uniqueId,o=a.filter((e=>{let t=!1,i=e.parent;for(;i;){if(i._uniqueId===n){t=!0;break}i=i.parent}return t}));if(o&&o.length){const a=null!==(r=null===(i=e[s]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==r?r:0;let n=a;for(let e=0;e<o.length;e++){const i=o[e];if("group"===i.graphicType)n=a;else if(i.value&&void 0===i.parent._textGroupStyle.x){const r=o.slice(0,e).reverse().find((e=>"text"===e.graphicType&&e.value));if(r){n+=t.measureText(r.value,r._finalAttributes).width}i._finalAttributes.x=n}}}}}return a};class St extends t.GeoSeries{constructor(){super(...arguments),this.type=et,this._idToMark=new Map}setAttrFromSpec(){var e,t,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(e=this._option)||void 0===e||e.onError("svg source is not specified !"),this._parsedSvgResult=null===(t=lt(this.svg))||void 0===t?void 0:t.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(e){return[Number.NaN,Number.NaN]}getDatumName(e){return e.name||e._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((e=>e.name&&!e.name.includes("seriesGroup")&&!e.name.includes("root")&&e!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(e){return{type:"element-highlight-by-graphic-name",trigger:e.trigger,triggerOff:"pointerout",blurState:t.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:t.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(e){const i="multiple"===e.mode,r=t.isValid(e.triggerOff)?e.triggerOff:i?["empty","self"]:["empty",e.trigger];return{type:"element-select-by-graphic-name",trigger:e.trigger,triggerOff:r,reverseState:t.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:t.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var e;if(this._pictogramMark=this._createMark(St.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:t.shouldMarkDoMorph(this._spec,St.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(St.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:r,name:a,parent:s,id:n,_nameFromParent:o,_uniqueId:l}=i,d=this._createMark({type:r,name:null!=a?a:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(e=this._idToMark.get(null==s?void 0:s._uniqueId))&&void 0!==e?e:this._pictogramMark},{morph:t.shouldMarkDoMorph(this._spec,St.mark.pictogram.name)});d&&(d.setData(this._mapViewData),d.setUserId(l),this._idToMark.set(l,d),"group"!==d.type&&d.setMarkConfig({graphicName:d.name}),d.setTransform([{type:"filter",callback:e=>e._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const e=this._createMark(St.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});e&&(this._labelMark=e,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:e=>!!this._validElement(e),x:e=>{var t;return null===(t=this.dataToPosition(e,!0))||void 0===t?void 0:t.x},y:e=>{var t;return null===(t=this.dataToPosition(e,!0))||void 0===t?void 0:t.y},text:e=>e[this.nameField],textAlign:"center",textBaseline:"middle"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}initMarkStyle(){const{root:e,viewBoxRect:i}=this._parsedSvgResult,r=this._mapViewData.getDataView().latestData;e&&(this.setMarkStyle(this._pictogramMark,xt.group(e.attributes),"normal",t.AttributeLevel.Built_In),e.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>e.transform},"normal",t.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[t.createRect(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const e of r){const{_uniqueId:i,_finalAttributes:r}=e,a=this._idToMark.get(i),s=this._validElement(e);a&&(this.setMarkStyle(a,{keepStrokeScale:!0},"normal",t.AttributeLevel.Built_In),s?(this.initMarkStyleWithSpec(a,t.merge({},this._spec.pictogram,this._spec[a.name])),this.setMarkStyle(a,r,"normal",t.AttributeLevel.Series),a.setPostProcess("fill",((e,i)=>t.isValid(e)?e:this._spec.defaultFillColor))):(a.setMarkConfig({interactive:!1}),this.setMarkStyle(a,r,"normal",t.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(e){return e.name||e._nameFromParent}initTooltip(){this._tooltipHelper=new ct(this),this.getMarksWithoutRoot().forEach((e=>{e&&e.name&&this._tooltipHelper.activeTriggerSet.mark.add(e)}))}dataToPosition(e,i=!1){if(!e)return null;const r=e[this.nameField];if(!r)return null;const a=this.getMarksWithoutRoot().filter((e=>e.name===r));if(!a||0===a.length)return null;let s=new t.Bounds;i?a.forEach((e=>{s=s.union(e.getGraphics()[0].globalAABBBounds)})):a.forEach((e=>{s=s.union(e.getProduct().AABBBounds)}));const n={x:(s.x1+s.x2)/2,y:(s.y1+s.y2)/2};if(i){const{x:e,y:t}=this.getLayoutStartPoint();n.x-=e,n.y-=t}return n}coordToPosition(e){if(!e)return null;const{x:t,y:i}=e,r=this.getRootMatrix();if(!r)return null;const a={};return r.getInverse().transformPoint({x:t,y:i},a),a}getRootMatrix(){var e;return null===(e=this.getPictogramRootGraphic())||void 0===e?void 0:e.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var e,i;super.initData();const r=at.get(this.svg);r||null===(e=this._option)||void 0===e||e.onError("no valid svg found!");const a=new t.DataView(this._dataSet,{name:`pictogram_${this.id}_data`});t.registerDataSetInstanceTransform(this._dataSet,"pictogram",_t),t.registerDataSetInstanceTransform(this._dataSet,"lookup",t.lookup),a.parse([r],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(e,t)=>{t&&(e.data=t)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(e,t)=>{t&&(e.data=t)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",a.reRunAllTransform),this._mapViewData=new t.CompilableData(this._option,a)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var e;super.onLayoutEnd(),null===(e=this._mapViewData)||void 0===e||e.getDataView().reRunAllTransform()}updateSVGSize(){const{width:e,height:t}=this.getLayoutRect(),i=e/2,r=t/2,a=this.getPictogramRootGraphic();if(a){const s=a.AABBBounds,{x1:n,x2:o,y1:l,y2:d}=a.AABBBounds,c=(n+o)/2,u=(l+d)/2,h=e/s.width(),p=t/s.height(),g=Math.min(h,p);a.scale(g,g,{x:c,y:u}),a.translate(i-c,r-u)}}initEvent(){var e;super.initEvent(),null===(e=this._mapViewData.getDataView())||void 0===e||e.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(t.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(e){const{scale:i,scaleCenter:r}=e;if(1===i)return;const a=this.getPictogramRootGraphic();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new t.Matrix}),a.scale(i,i,r))}handlePan(e){const{delta:i}=e;if(0===i[0]&&0===i[1])return;const r=this.getPictogramRootGraphic();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new t.Matrix}),r.translate(i[0],i[1]))}getMarkData(e){var t;return null!==(t=e.data)&&void 0!==t?t:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(e,t){const i=this.getDefaultShapeType();return t.map((t=>({key:t,originalKey:t,style:this.getSeriesStyle({data:{[e]:t}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}St.type=et,St.mark=it,St.transformerConstructor=dt;const kt=()=>{t.Factory.registerSeries(St.type,St),t.Factory.registerImplement("registerSVG",nt),t.Factory.registerImplement("unregisterSVG",ot),t.Factory.registerInteractionTrigger(ht.type,ht),t.Factory.registerInteractionTrigger(gt.type,gt)};class Ct extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=rt,this.type=Qe,this.seriesType=et}}Ct.type=et,Ct.seriesType=Qe,Ct.transformerConstructor=rt;class Mt extends t.BaseChartSpecTransformer{transformSpec(e){super.transformSpec(e),this.transformSeriesSpec(e)}_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const At="imageCloud",Ft="imageCloud";var Tt;!function(e){e.image="image",e.imageMask="imageMask"}(Tt||(Tt={}));const Lt=Object.assign(Object.assign({},t.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}});class wt extends t.ACustomAnimate{constructor(e,t,i,r,a){var s;super(e,t,i,r,a),this._rotations=null!==(s=null==a?void 0:a.rotation)&&void 0!==s?s:1}onBind(){this._scaleX=this.target.attribute.scaleX,t.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(e,t,i){var r;if(!1===this.valid)return;if(e)return void(i.scaleX=this._scaleX);const a=360*this._rotations*t*Math.PI/180,s=Math.abs(Math.cos(a))*(null!==(r=this._scaleX)&&void 0!==r?r:1);this.target.attribute.scaleX=s,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Ot(e,i){switch(i){case"axialRotate":return[{custom:wt,customParameters:{rotation:1},duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(t,i)=>e.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>e.center().x},y:{from:()=>e.center().y}},duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:t.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class It extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=e=>{var t,i;return null===(i=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=e=>{var t,i;const{measureFields:r}=this._seriesCacheInfo,a=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(r[0]&&a)return null!==(i=a[r[0]])&&void 0!==i?i:e.value},this.dimensionTooltipTitleCallback=e=>{var t;const{dimensionFields:i}=this._seriesCacheInfo,r=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(i[0]&&r)return r[i[0]]}}get defaultShapeType(){return"square"}}class Et extends t.BaseSeries{constructor(){super(...arguments),this.type=Ft}setValueField(e){t.isValid(e)&&(this._valueField=e)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var e;(null===(e=this._spec.imageMask)||void 0===e?void 0:e.visible)&&(this._maskMark=this._createMark(Lt.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Lt.image,{key:e=>`${e[t.DEFAULT_DATA_KEY]}-${e.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var e,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:e=>e.x,y:e=>e.y,width:e=>e.width,height:e=>e.height,visible:e=>e.visible,angle:e=>e.angle,clipConfig:e=>e.clipConfig,image:e=>e[this._urlField],scaleCenter:["50%","50%"]},"normal",t.AttributeLevel.Series);"masked"===(null===(e=this._spec.layoutConfig)||void 0===e?void 0:e.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",t.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",t.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",t.AttributeLevel.Series)}isFillingImage(e){return e._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",t.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new It(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var e;return{size:()=>{const{width:e,height:t}=this._region.getLayoutRect();return[e,t]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(e=this._spec.image)||void 0===e?void 0:e.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:t.vglobal.createCanvas.bind(t.vglobal),createImage:t.createImage,onUpdateMaskCanvas:((e,t)=>{var i;e&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((t=>{t.setAttribute("background",e)})),t&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",t)}).bind(this),onLayoutFinished:()=>{var e,t;return null===(t=null===(e=this._option.globalInstance.getChart().getOption().performanceHook)||void 0===e?void 0:e.afterWordcloudShapeDraw)||void 0===t?void 0:t.call(e,this._option.globalInstance)}}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((e=>{var i,r;if(e){const a=null===(r=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===r?void 0:r.preset,s={center:()=>{const{width:e,height:t}=this._region.getLayoutRect();return{x:e/2,y:t/2}},height:()=>{const{height:e}=this._region.getLayoutRect();return e}};e.setAnimationConfig(t.animationConfig(t.Factory.getAnimationInKey("imageCloud")(s,a),t.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var e;return[null!==(e=this._nameField)&&void 0!==e?e:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const e=[];return e.push({key:this._nameField,operations:["values"]}),e.push({key:this._valueField,operations:["max","min"]}),e}getActiveMarks(){return[this._imageMark]}getMarkData(e){var t;return null!==(t=null==e?void 0:e.datum)&&void 0!==t?t:e}getGroupFields(){return[]}dataToPosition(e){return null}dataToPositionX(e){var t;return null===(t=this.dataToPosition(e))||void 0===t?void 0:t.x}dataToPositionY(e){var t;return null===(t=this.dataToPosition(e))||void 0===t?void 0:t.y}valueToPosition(e,t){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Et.type=Ft,Et.mark=Lt;const Dt=()=>{t.registerImageMark(),t.Factory.registerAnimation("imageCloud",((e,t)=>({appear:Ot(e,t),enter:Ot(e,t),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),t.Factory.registerSeries(Et.type,Et),t.Factory.registerGrammarTransform("imagecloud",{transform:t.imagecloudTransform})};class Bt extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Bt.transformerConstructor,this.type=At,this.seriesType=Ft}}Bt.type=At,Bt.seriesType=Ft,Bt.transformerConstructor=Mt;class Pt extends t.BaseChartSpecTransformer{_getDefaultSeriesSpec(e){return super._getDefaultSeriesSpec(e,["timeField","eventField","seriesField","titleField","subTitleField","iconField","dot","title","subTitle","icon","line","arrow","labelPosition","sortDataByAxis"])}_setDefaultXAxisSpec(e){return{type:"band",orient:"bottom",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_setDefaultYAxisSpec(e){return{type:"band",inverse:!0,orient:"left",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_transformAxisSpec(e){e.axes||(e.axes=[]);const t={x:!1,y:!1};e.axes.forEach((r=>{const{orient:a}=r;let s=null;"top"!==a&&"bottom"!==a||(t.x=!0,s=this._setDefaultXAxisSpec(e)),"left"!==a&&"right"!==a||(t.y=!0,s=this._setDefaultYAxisSpec(e)),s&&Object.keys(s).forEach((e=>{r[e]=i.isObject(r[e])?i.merge(s[e],r[e]):i.isNil(r[e])?s[e]:r[e]}))})),t.x||e.axes.push(this._setDefaultXAxisSpec(e)),t.y||e.axes.push(this._setDefaultYAxisSpec(e))}transformSpec(e){var t,i;super.transformSpec(e),this.transformSeriesSpec(e),this._transformAxisSpec(e);const r=null!==(t=e.direction)&&void 0!==t?t:"horizontal";null===(i=e.series)||void 0===i||i.forEach((e=>{"vertical"===r?(e.timeField&&!e.yField&&(e.yField=e.timeField),e.xField||(e.xField=e.seriesField||"__vchart_timeline_dummy__")):(e.timeField&&!e.xField&&(e.xField=e.timeField),e.yField||(e.yField=e.seriesField||"__vchart_timeline_dummy__"))}))}}const jt="event",Rt=Object.assign(Object.assign({},t.baseSeriesMark),{line:{name:"line",type:"line"},dot:{name:"dot",type:"symbol"},icon:{name:"icon",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},arrow:{name:"arrow",type:"path"}});class Vt extends t.CartesianSeries{constructor(){super(...arguments),this.type=jt,this.transformerConstructor=t.BaseSeriesSpecTransformer,this.coordinate="cartesian"}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),this._timeField=this._spec.timeField,this._eventField=this._spec.eventField,this._subTitleField=this._spec.subTitleField,this._iconField=this._spec.iconField,this._labelPosition=this._spec.labelPosition}getDimensionField(){return this._timeField?[this._timeField]:[]}getMeasureField(){const e=[];return this._eventField&&e.push(this._eventField),this._subTitleField&&e.push(this._subTitleField),e}initMark(){this._axisLineMark=this._createMark(Vt.mark.line,{isSeriesMark:!0,groupKey:this._seriesField}),this._arrowMark=this._createMark(Vt.mark.arrow,{isSeriesMark:!0}),this._dotMark=this._createMark(Vt.mark.dot,{isSeriesMark:!0}),this._iconMark=this._createMark(Vt.mark.icon,{isSeriesMark:!0}),this._titleMark=this._createMark(Vt.mark.title),this._subTitleMark=this._createMark(Vt.mark.subTitle)}initTooltip(){super.initTooltip(),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark),this._titleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._titleMark),this._subTitleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._subTitleMark),this._iconMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._iconMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}initMarkStyle(){var e,r,a,s,n,o,l,d,c,u,h;this._axisLineMark&&this.setMarkStyle(this._axisLineMark,{points:this._getAxisPoints.bind(this),visible:this._isFirstDataInGroup.bind(this),stroke:"#c0c3c7",lineWidth:1},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series);const p=this._spec.dot,g="number"==typeof(null===(e=null==p?void 0:p.style)||void 0===e?void 0:e.size)?p.style.size:8,m=this._spec.title,y=null!==(r=null==m?void 0:m.style)&&void 0!==r?r:{},v=this._spec.subTitle,f=null!==(a=null==v?void 0:v.style)&&void 0!==a?a:{},b="number"==typeof y.fontSize?y.fontSize:14,x=g/2+(null!==(s=null==m?void 0:m.offset)&&void 0!==s?s:6);this._dotMark&&this.setMarkStyle(this._dotMark,{x:e=>this._getPoint(e).x,y:e=>this._getPoint(e).y,size:g,fill:null!==(o=null===(n=null==p?void 0:p.style)||void 0===n?void 0:n.fill)&&void 0!==o?o:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._arrowMark&&this.setMarkStyle(this._arrowMark,{path:e=>this._getArrowPath(e),fill:null!==(d=null===(l=null==p?void 0:p.style)||void 0===l?void 0:l.fill)&&void 0!==d?d:this.getColorAttribute()},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._titleMark&&this.setMarkStyle(this._titleMark,Object.assign(Object.assign({fontSize:14},y),{x:e=>this._getTitlePosition(e,x).x,y:e=>this._getTitlePosition(e,x).y,textAlign:e=>this._getLabelTextAlign(e),textBaseline:e=>this._getLabelTextBaseline(e,!0),text:e=>this._getDatumString(e,this._eventField)}),t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series),this._subTitleMark&&this.setMarkStyle(this._subTitleMark,Object.assign(Object.assign({},f),{x:e=>this._getSubTitlePosition(e,x,b).x,y:e=>this._getSubTitlePosition(e,x,b).y,textAlign:e=>this._getLabelTextAlign(e),textBaseline:e=>this._getLabelTextBaseline(e,!1),text:e=>this._getDatumString(e,this._subTitleField)}),t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series);const _=this._spec.icon,S="number"==typeof(null===(c=null==_?void 0:_.style)||void 0===c?void 0:c.size)?_.style.size:20,k=(i.isValid(null==_?void 0:_.offset)?_.offset+g/2:x)+S/2;this._iconMark&&this.setMarkStyle(this._iconMark,{x:e=>this._getIconPosition(e,k).x,y:e=>this._getIconPosition(e,k).y,size:S,fill:null!==(h=null===(u=null==_?void 0:_.style)||void 0===u?void 0:u.fill)&&void 0!==h?h:this.getColorAttribute(),shape:e=>this._getDatumString(e,this._iconField)||"circle"},t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}_getLabelSide(e){const t=this._getViewDataList().indexOf(e),i=this._labelPosition;if("vertical"===this.direction)switch(i){case"left":default:return"primary";case"right":return"secondary";case"left-right":return t%2==0?"primary":"secondary";case"right-left":return t%2==0?"secondary":"primary"}else switch(i){case"top":default:return"primary";case"bottom":return"secondary";case"top-bottom":return t%2==0?"primary":"secondary";case"bottom-top":return t%2==0?"secondary":"primary"}}_getLabelTextAlign(e){if("vertical"===this.direction){return"primary"===this._getLabelSide(e)?"right":"left"}return"center"}_getLabelTextBaseline(e,t){if("vertical"===this.direction)return"middle";return"primary"===this._getLabelSide(e)?"bottom":"top"}_getTitlePosition(e,t){const i=this._getPoint(e),r=this._getLabelSide(e);return"vertical"===this.direction?{x:"primary"===r?i.x-t:i.x+t,y:i.y}:{x:i.x,y:"primary"===r?i.y-t:i.y+t}}_getSubTitlePosition(e,t,i){var r,a,s,n;const o=this._getPoint(e),l=this._getLabelSide(e),d=null!==(a=null===(r=this._spec.title)||void 0===r?void 0:r.subTitleGap)&&void 0!==a?a:4;if("vertical"===this.direction){const e=null!==(n=null===(s=this._spec.title)||void 0===s?void 0:s.style)&&void 0!==n?n:{},r="number"==typeof e.lineHeight?e.lineHeight:1.2*i;return{x:"primary"===l?o.x-t:o.x+t,y:o.y+r+d}}return{x:o.x,y:"primary"===l?o.y-(t+i+d):o.y+(t+i+d)}}_getIconPosition(e,t){const i=this._getPoint(e),r=this._getLabelSide(e);return"vertical"===this.direction?{x:"primary"===r?i.x+t:i.x-t,y:i.y}:{x:i.x,y:"primary"===r?i.y+t:i.y-t}}_getViewDataList(){var e,t;return null!==(t=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)&&void 0!==t?t:[]}_getPoint(e){if("vertical"===this.direction){return{x:this._getPositionFromAxis(e,this.getXAxisHelper(),this._seriesField),y:this._getPositionFromAxis(e,this.getYAxisHelper(),this._timeField)}}return{x:this._getPositionFromAxis(e,this.getXAxisHelper(),this._timeField),y:this._getPositionFromAxis(e,this.getYAxisHelper(),this._seriesField)}}_getPositionFromAxis(e,t,i){var r,a,s,n,o,l;if(!t)return this._getDefaultPosition(i);if(!i||!(i in e))return this._getDefaultPosition(i);const d=e[i];return"band"!==(null===(a=null===(r=t.getSpec)||void 0===r?void 0:r.call(t))||void 0===a?void 0:a.type)&&t.isContinuous?null!==(l=null===(o=t.valueToPosition)||void 0===o?void 0:o.call(t,d))&&void 0!==l?l:this._getDefaultPosition(i):null!==(n=null===(s=t.dataToPosition)||void 0===s?void 0:s.call(t,[d],{bandPosition:.5}))&&void 0!==n?n:this._getDefaultPosition(i)}onXAxisHelperUpdate(){var e;null===(e=super.onXAxisHelperUpdate)||void 0===e||e.call(this),this.onMarkPositionUpdate()}onYAxisHelperUpdate(){var e;null===(e=super.onYAxisHelperUpdate)||void 0===e||e.call(this),this.onMarkPositionUpdate()}_getDefaultPosition(e){const t=this._region.getLayoutRect();if(!this._seriesField||e===this._seriesField){return"vertical"!==this.direction?.5*t.height:.5*t.width}return 0}_getAxisPoints(e){const t=this._region.getLayoutRect();if("vertical"===this.direction){const i=this._getPositionFromAxis(e,this.getXAxisHelper(),this._seriesField);return[{x:i,y:0},{x:i,y:t.height}]}const i=this._getPositionFromAxis(e,this.getYAxisHelper(),this._seriesField);return[{x:0,y:i},{x:t.width,y:i}]}_isFirstDataInGroup(e){if(!this._seriesField){return 0===this._getViewDataList().indexOf(e)}const t=this._getViewDataList(),i=e[this._seriesField];return e===t.find((e=>this._seriesField&&e[this._seriesField]===i))}_getNextDatum(e){const t=this._getViewDataList(),i=t.indexOf(e);if(-1===i||i===t.length-1)return null;if(!this._seriesField)return t[i+1];const r=e[this._seriesField];for(let e=i+1;e<t.length;e++){const i=t[e];if(i[this._seriesField]===r)return i}return null}_getPreviousDatum(e){const t=this._getViewDataList(),i=t.indexOf(e);if(-1===i||0===i)return null;if(!this._seriesField)return t[i-1];const r=e[this._seriesField];for(let e=i-1;e>=0;e--){const i=t[e];if(i[this._seriesField]===r)return i}return null}_getArrowPath(e){var t,i;const r=this._getPoint(e),a=this._getNextDatum(e),s=this._getPreviousDatum(e),n=null!==(i=null===(t=this._spec.arrow)||void 0===t?void 0:t.thickness)&&void 0!==i?i:16,o=this._region.getLayoutRect();if("vertical"===this.direction){const e=this.getYAxisHelper().isInverse(),t=s?{x:r.x,y:(this._getPoint(s).y+r.y)/2}:{x:r.x,y:e?0:o.height},i=a?{x:r.x,y:(this._getPoint(a).y+r.y)/2}:{x:r.x,y:e?o.height:0},l=e?1:-1,d=n/3,c=n/2;return`M ${t.x-c} ${t.y} L ${t.x} ${t.y+l*d} L ${t.x+c} ${t.y} \n L ${i.x+c} ${i.y-l*d} \n L ${i.x} ${i.y}\n L ${i.x-c} ${i.y-l*d} Z`}const l=this.getXAxisHelper().isInverse(),d=s?{x:(this._getPoint(s).x+r.x)/2,y:r.y}:{x:l?o.width:0,y:r.y},c=a?{x:(this._getPoint(a).x+r.x)/2,y:r.y}:{x:l?0:o.width,y:r.y},u=l?-1:1,h=n/2,p=n/3;return`M ${d.x} ${d.y-h} L ${d.x+u*p} ${d.y} L ${d.x} ${d.y+h} \n L ${c.x-u*p} ${c.y+h} \n L ${c.x} ${c.y} \n L ${c.x-u*p} ${c.y-h} Z`}_getDatumString(e,t){if(!e||!t)return"";const i=e[t];return"string"==typeof i?i:null==i?"":String(i)}valueToPosition(e,t){if(e&&"object"==typeof e)return this.dataToPosition(e);const i={};return this._timeField&&(i[this._timeField]=e),this._eventField&&void 0!==t&&(i[this._eventField]=t),this._getPoint(i)}getActiveMarks(){return[this._axisLineMark,this._dotMark,this._iconMark,this._arrowMark,this._titleMark,this._subTitleMark].filter(Boolean)}}Vt.type=jt,Vt.mark=Rt,Vt.builtInTheme={event:{dot:{style:{size:8}},icon:{visible:!1,style:{size:20}},line:{visible:!0,style:{stroke:"#c0c3c7",lineWidth:1}},title:{visible:!0,offset:6,subTitleGap:4,style:{fontSize:14}},subTitle:{visible:!0,style:{fontSize:12}},arrow:{visible:!1,thickness:16}}},Vt.transformerConstructor=t.BaseSeriesSpecTransformer;const Nt=()=>{t.registerSymbolMark(),t.registerTextMark(),t.registerLineMark(),t.registerPathMark(),t.Factory.registerSeries(Vt.type,Vt)};class zt extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Pt,this.type="timeline",this.seriesType="event"}}zt.type="timeline",zt.seriesType="event",zt.transformerConstructor=Pt;const Ht="seriesBreak";function Gt(e,t,i,r,a=!1){const s=[],{x:n,y:o}=e,{x:l,y:d}=t,c=a?Math.floor((d-o)/(2*i)):Math.floor((l-n)/(2*i)),u=Math.PI/180*r,h=i*Math.cos(u),p=i*Math.sin(u);s.push(`M ${n} ${o}`);for(let e=0;e<=c;e++){const t=a?n+(e%2==0?h:-h):n+e*i*2,r=a?o+e*i*2:e%2==0?o-p:o+p;s.push(`L ${t} ${r}`)}return s.push(`L ${a?n:l} ${a?d:o}`),s.join(" ")}class Wt extends t.AbstractComponent{constructor(){super(...arguments),this.name=Ht}render(){this.removeAllChild();const{data:e=[]}=this.attribute;if(t.isEmpty(e))return;const i=[],r=[];e.forEach((e=>{const{start:a,end:s}=e;((e,i)=>{const{start:r,end:a}=i,s=r.x===a.x,n=s?"x":"y",o=s?"y":"x";let l=!0;const d=1e-6;e.length&&e.forEach((e=>{if(t.isNumberClose(e.start[n],r[n])){const t=Math.min(r[o],a[o]),i=Math.max(r[o],a[o]),s=Math.min(e.start[o],e.end[o]),n=Math.max(e.start[o],e.end[o]);if(!(i<s-d||t>n+d))return e.start[o]=Math.min(s,t),e.end[o]=Math.max(n,i),void(l=!1)}})),l&&e.push(i)})(a.x===s.x?i:r,e)})),[...i,...r].forEach(((e,i)=>{var r;const{start:a,end:s,size:n=4,gap:o=5,style:l={}}=e,d=m(e,["start","end","size","gap","style"]),c=t.createGroup({}),u=a.x===s.x;let h,p,g,y;u?(h={x:a.x-o/2,y:a.y},p={x:s.x-o/2,y:s.y},g={x:a.x+o/2,y:a.y},y={x:s.x+o/2,y:s.y}):(h={x:a.x,y:a.y-o/2},p={x:s.x,y:s.y-o/2},g={x:a.x,y:a.y+o/2},y={x:s.x,y:s.y+o/2});const v=Gt(h,p,n,u?75:15,u),f=Gt(a,s,n,u?75:15,u),b=Gt(g,y,n,u?75:15,u);c.add(t.createPath(Object.assign(Object.assign({path:v,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(t.createPath(Object.assign(Object.assign({path:b,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(t.createPath({path:f,stroke:"#fff",lineWidth:o,pickable:!1,zIndex:0})),c.name="series-break",c.data=d,t.isValid(d.axisId)&&(c.id=`${null!==(r=d.axisId)&&void 0!==r?r:""}_${i}`),this.add(c)}))}}function $t(e,t,i=1){return Math.abs(e-t)<i}function Ut(e,i){return{type:"component",componentType:Ht,interactive:!0,zIndex:500,style:{data:(r,a)=>{const s=[],n=a.vchart.getChart(),o="horizontal"===n.getAllSeries()[0].direction;return e.forEach(((e,r)=>{var a,l;const d=e.id,c=t.isValid(d)?n.getComponentByUserId(d):i&&t.isValid(i[r])?n.getComponentByIndex("axes",i[r]):null===(a=n.getComponentsByKey("axes").filter((t=>t.getSpec().breaks===e.breaks)))||void 0===a?void 0:a[0];if(!c)return;const u=null!=d?d:`${c.type}-${c.id}`,h=function(e){let{x:t,y:i}=e[0].getLayoutStartPoint(),r=t+e[0].getLayoutRect().width,a=i+e[0].getLayoutRect().height;for(let s=1;s<e.length;s++){const n=e[s],{x:o,y:l}=n.getLayoutStartPoint(),{width:d,height:c}=n.getLayoutRect();t=Math.min(t,o),r=Math.max(r,d+o),i=Math.min(i,l),a=Math.max(a,c+l)}return{x1:t,y1:i,x2:r,y2:a}}(c.getRegions());t.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((e=>{const{range:t,breakSymbol:i,gap:r=5}=e,a=c.valueToPosition(t[0]),l=c.valueToPosition(t[1]),d=(a+l)/2+(o?h.x1:h.y1);n.getAllSeries().forEach((e=>{if("bar"===e.type||"waterfall"===e.type){e.getMarkInName("bar").getGraphics().forEach((e=>{const n=e.AABBBounds;let c,p,g,m,y=!1;o?(y=n.x1<(a+l-r)/2&&n.x2>(a+l+r)/2,c=d,p=Math.max(n.y1+h.y1-2,h.y1),g=d,m=Math.min(n.y2+h.y1+2,h.y2)):(y=n.y1<(a+l-r)/2&&n.y2>(a+l+r)/2,c=Math.max(n.x1+h.x1-2,h.x1),p=d,g=Math.min(n.x2+h.x1+2,h.x2),m=d),y&&s.push({start:{x:c,y:p},end:{x:g,y:m},gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}))}else if("line"===e.type){e.getMarkInName(e.type).getGraphics().forEach((e=>{Xt(e,"line").forEach((e=>{Kt(o?{start:{x:(a+l)/2,y:0},end:{x:(a+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(a+l)/2},end:{x:h.x2-h.x1,y:(a+l)/2}},e).forEach((e=>{let a,n;o?(a={x:d,y:Math.max(e[1]+h.y1-10,h.y1)},n={x:d,y:Math.min(e[1]+h.y1+10,h.y2)}):(a={x:Math.max(e[0]+h.x1-10,h.x1),y:d},n={x:Math.min(e[0]+h.x1+10,h.x2),y:d}),s.push({start:a,end:n,gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}))}))}))}else if("area"===e.type){e.getMarkInName("area").getGraphics().forEach((e=>{Xt(e,"area").forEach((e=>{const n=Kt(o?{start:{x:(a+l)/2,y:0},end:{x:(a+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(a+l)/2},end:{x:h.x2-h.x1,y:(a+l)/2}},e);n.sort(((e,t)=>e[0]-t[0]));for(let a=0;a<n.length-1;a++){const l={x:n[a][0],y:n[a][1]},d={x:n[a+1][0],y:n[a+1][1]};if(Yt(o?{x:l.x,y:(l.y+d.y)/2}:{x:(l.x+d.x)/2,y:l.y},e)){let e,a;o?(e={x:l.x+h.x1,y:Math.max(l.y+h.y1-0,h.y1)},a={x:d.x+h.x1,y:Math.min(d.y+h.y1+0,h.y2)}):(e={x:Math.max(l.x+h.x1-0,h.x1),y:l.y+h.y1},a={x:Math.min(d.x+h.x1+0,h.x2),y:d.y+h.y1}),s.push({start:e,end:a,gap:r,style:null==i?void 0:i.style,axisId:u,data:t})}}}))}))}}))}))})),s}}}}function Kt(e,i){const r=[];for(let a=1;a<i.length;a++){const s=t.getIntersectPoint([e.start.x,e.start.y],[e.end.x,e.end.y],[i[a].x,i[a].y],[i[a-1].x,i[a-1].y]);s&&!r.find((e=>$t(t.PointService.distancePP({x:e[0],y:e[1]},{x:s[0],y:s[1]}),0)))&&r.push(s)}return r}function Xt(e,t){const{points:i,segments:r}=e.attribute,a=[];let s=[];const n=e=>{if(e&&e.length){let i=[];if(e.forEach((e=>{var r,n;if(!1===e.defined){if(a.push(s),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)s.push({x:i[e].x,y:i[e].y});s.push(s[0])}s=[],i=[]}else s.push({x:e.x,y:e.y}),"area"===t&&i.push({x:null!==(r=e.x1)&&void 0!==r?r:e.x,y:null!==(n=e.y1)&&void 0!==n?n:e.y})})),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)s.push({x:i[e].x,y:i[e].y});s.push(s[0])}a.push(s)}};return i&&i.length?n(i):r&&r.length&&r.forEach((e=>{n(e.points)})),a}function Yt(e,t){const{x:i,y:r}=e;let a=!1;for(let e=0,s=t.length-1;e<t.length;s=e++){const{x:n,y:o}=t[e],{x:l,y:d}=t[s];o>r!=d>r&&i<(l-n)*(r-o)/(d-o)+n&&(a=!a)}return a}const qt="barLink";class Zt extends t.AbstractComponent{constructor(){super(...arguments),this.name=qt}render(){const{data:e,linkStyle:i,areaStyle:r,styleMap:a,label:s,linkType:n="total"}=this.attribute;t.isEmpty(e)||(this.removeAllChild(),e.forEach(((e,o)=>{var l,d,c,u,h;const{linePoints:p,areaPoints:g,id:m=o,color:y,data:v}=e;if(g&&!1!==(null===(l=null==a?void 0:a[`area-${m}`])||void 0===l?void 0:l.visible)){const e=t.createArea(Object.assign(Object.assign({points:g,fillOpacity:.3,fill:y,zIndex:0},r),null==a?void 0:a[`area-${m}`]));e.name="bar-link-area",e.id=`area-${m}`,this.add(e)}if(p&&!1!==(null===(d=null==a?void 0:a[`line-${m}`])||void 0===d?void 0:d.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(u=null==a?void 0:a[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:e={},endSymbol:r={},lineStyle:s}=i||{},n=t.cloneDeep(e),o=t.cloneDeep(r);(null==a?void 0:a[`line-${m}`])&&a[`line-${m}`].stroke&&(n.style=Object.assign(Object.assign({},n.style),{color:a[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:a[`line-${m}`].stroke})),n.symbolType||n.originSymbolType||(n.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new t.Segment({points:p,startSymbol:Object.assign({size:8},n),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},s),null==a?void 0:a[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==s?void 0:s.visible)&&!1!==(null===(h=null==a?void 0:a[`label-${m}`])||void 0===h?void 0:h.visible)){const{style:e,formatMethod:i}=s,[r,o]=v;let l=r[t.STACK_FIELD_END],d=o[t.STACK_FIELD_END];"value"===n&&(l=r[t.STACK_FIELD_END]-r[t.STACK_FIELD_START],d=o[t.STACK_FIELD_END]-o[t.STACK_FIELD_START]);const c=d-l,u=(d-l)/l*100,h=t.createText(Object.assign(Object.assign({x:.5*(p[0].x+p[1].x),y:.5*(p[0].y+p[1].y),text:i?i(c,u,v):`${c} ${u}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},e),null==a?void 0:a[`label-${m}`]));h.name="bar-link-label",h.id=`label-${m}`,this.add(h)}})))}}function Jt(e,i,r){const{isHorizontal:a,isXAxisInverse:s,isYAxisInverse:n,linkType:o,doFill:l,regionStartX:d,regionStartY:c}=r,u=e.AABBBounds,h=i.AABBBounds;let p,g;return a?(p=[{x:(u.x1+u.x2)/2+d,y:u.y1+c},{x:(h.x1+h.x2)/2+d,y:h.y2+c}],s?("total"===o&&(p=[{x:u.x1+d,y:u.y1+c},{x:h.x1+d,y:h.y2+c}]),l&&(g=[{x:u.x1+d,x1:u.x2+d,y:u.y1+c},{x:h.x1+d,x1:h.x2+d,y:h.y2+c}])):("total"===o&&(p=[{x:u.x2+d,y:u.y1+c},{x:h.x2+d,y:h.y2+c}]),l&&(g=[{x:u.x2+d,x1:u.x1+d,y:u.y1+c},{x:h.x2+d,x1:h.x1+d,y:h.y2+c}]))):(p=[{x:u.x2+d,y:(u.y1+u.y2)/2+c},{x:h.x1+d,y:(h.y1+h.y2)/2+c}],n?("total"===o&&(p=[{x:u.x2+d,y:u.y2+c},{x:h.x1+d,y:h.y2+c}]),l&&(g=[{x:u.x2+d,y:u.y2+c,y1:u.y1+c},{x:h.x1+d,y:h.y2+c,y1:h.y1+c}])):("total"===o&&(p=[{x:u.x2+d,y:u.y1+c},{x:h.x1+d,y:h.y1+c}]),l&&(g=[{x:u.x2+d,y:u.y1+c,y1:u.y2+c},{x:h.x1+d,y:h.y1+c,y1:h.y2+c}]))),{areaPoints:g,linePoints:p,data:[t.getDatumOfGraphic(e),t.getDatumOfGraphic(i)],color:e.attribute.fill}}function Qt(e={},i){const{linkType:r="total",doFill:a}=e,s=m(e,["linkType","doFill"]);return{type:"component",componentType:qt,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(e,i)=>{const{vchart:s}=i,n=s.getChart().getAllRegions(),o=[];return n.forEach((e=>{const i=e.getSeries().filter((e=>"bar"===e.type)),{x:s,y:n}=e.getLayoutStartPoint();if(i.length){const e=i[0].getGroupFields(),l=[];i.forEach((e=>{var t;(null===(t=e.getMarkInName("bar"))||void 0===t?void 0:t.getGraphics()).forEach((e=>{l.push(e)}))}));const d=function(e,i){const r={};for(let a=0;a<e.length;a++){const s=e[a],n=t.getDatumOfGraphic(s),o=i.map((e=>n[e])).join("-");r[o]||(r[o]=[]),r[o].push(s)}return r}(l,e);Object.values(d).forEach((e=>{e.sort(((e,i)=>t.getDatumOfGraphic(e)[t.STACK_FIELD_END]-t.getDatumOfGraphic(i)[t.STACK_FIELD_END]))}));const c=i[0],u="horizontal"===c.direction,h=c.getYAxisHelper().isInverse(),p=c.getXAxisHelper().isInverse(),g=Object.values(d);if(g.length)if(u){g[0][0].AABBBounds.y1<g[g.length-1][0].AABBBounds.y1&&g.reverse()}else{g[0][0].AABBBounds.x1>g[g.length-1][0].AABBBounds.x1&&g.reverse()}for(let e=0;e<g.length-1;e++){const t=g[e],i=g[e+1];if(t.forEach(((e,t)=>{var l;const d=Jt(e,null!==(l=i[t])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:h,doFill:a,linkType:r,regionStartX:s,regionStartY:n});o.push(d)})),t.length<i.length){const e=t[t.length-1];for(let l=t.length;l<i.length;l++){const t=Jt(e,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:h,doFill:a,linkType:r,regionStartX:s,regionStartY:n});o.push(t)}}}}})),o},linkType:r},s),i)}}const ei="seriesLabel";function ti(e,t=10,i=10,r=.1){const a=e.length;if(!e.every(isFinite))return e;if(!(a>1))return e;const s=function(e,t,i){e=+e,t=+t;let r=arguments.length;i=r<2?(t=e,e=0,1):r<3?1:+i;let a=-1;r=0|Math.max(0,Math.ceil((t-e)/i));const s=new Array(r);for(;++a<r;)s[a]=e+a*i;return s}(e.length);for(let n=0;n<i;++n){s.sort(((t,i)=>{return r=e[t],a=e[i],null==r||null==a?NaN:r<a?-1:r>a?1:r>=a?0:NaN;var r,a}));let i=0;for(let r=1;r<a;++r){let a=e[s[r]]-e[s[r-1]];a<t&&(a=(t-a)/2,i=Math.max(i,a),e[s[r-1]]-=a,e[s[r]]+=a)}if(i<r)break}return e}function ii(e,t){return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1)}function ri(e,t=10,i=10){const r=e.length;let a,s=0;do{a=!1;for(let i=0;i<r;++i)for(let s=i+1;s<r;++s){const r=e[i].AABBBounds,n=e[s].AABBBounds;if(ii(r,n)){const i=t-(n.x1-r.x2);i>0&&(e[s].attribute.x+=i,n.x1+=i,n.x2+=i,a=!0)}}s++}while(a&&s<i)}function ai(e,i){const{label:r,line:a}=i;return{type:"component",componentType:ei,interactive:!1,style:{position:e,layout:(e,t)=>{var i;return null!==(i=t.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(i,r)=>{var a;const s=r.vchart.getChart(),n=s.getAllSeries()[0],o="horizontal"===n.direction,l=o?n.getYAxisHelper():n.getXAxisHelper(),d=null===(a=l.getScale)||void 0===a?void 0:a.call(l,0),c=l.isInverse(),u=n.getDimensionField()[0],h=n.getSeriesField(),p=s.getAllSeries().map((e=>e.type)).filter(((e,t,i)=>i.indexOf(e)===t)),g=[];if(1===p.length&&["bar","area","line","waterfall"].includes(p[0])){("both-ends"===e?["start","end"]:[e]).forEach((e=>{const i="end"===e?t.last(d.domain()):d.domain()[0],r=n.getRegion(),{x:a,y:l}=r.getLayoutStartPoint();let m=0;s.getAllSeries().forEach((t=>{t.getMarkInName("waterfall"===p[0]?"bar":p[0]).getGraphics().forEach((r=>{var s;const n=r.context.data.find((e=>e[u]===i));if(n){const i=r.AABBBounds;let d,y,v,f;"bar"===p[0]||"waterfall"===p[0]?(d="end"===e?{x:o?(i.x1+i.x2)/2:c?i.x1:i.x2,y:o?c?i.y2:i.y1:(i.y1+i.y2)/2}:{x:o?(i.x1+i.x2)/2:c?i.x2:i.x1,y:o?c?i.y1:i.y2:(i.y1+i.y2)/2},y=r.attribute.fill):(d=t.dataToPosition(n),y=r.attribute.stroke||r.attribute.fill),"end"===e?(v=o?"center":c?"end":"start",f=o?c?"top":"bottom":"middle"):(v=o?"center":c?"start":"end",f=o?c?"bottom":"top":"middle");const b=null!==(s=n[h])&&void 0!==s?s:n[u];g.push({point:{x:d.x+a,y:d.y+l},label:b,color:y,textAlign:v,textBaseline:f,series:t,datum:n,id:`${e}-${m}`,position:e}),m++}}))}))}))}return g},line:a,label:Object.assign({space:12},r)}}}class si extends t.AbstractComponent{constructor(){super(...arguments),this.name=ei}render(){var e,i,r,a;this.removeAllChild();const{data:s,layout:n,label:o,line:l={}}=this.attribute;if(t.isEmpty(s))return;const d=null!==(e=null==o?void 0:o.styleMap)&&void 0!==e?e:{},c={},u=s.filter((e=>{var t;return!1!==(null===(t=d[e.id])||void 0===t?void 0:t.visible)}));if("vertical"===n){const e=1.5*(null!==(r=null===(i=null==o?void 0:o.style)||void 0===i?void 0:i.fontSize)&&void 0!==r?r:12),a=(e,i,r)=>{var a,s,n,o,l,d,c,u;const{label:h,color:p,textAlign:g,textBaseline:m,id:y}=e,v=null!==(s=null===(a=r[y])||void 0===a?void 0:a.formatMethod)&&void 0!==s?s:null===(n=this.attribute.label)||void 0===n?void 0:n.formatMethod,f=t.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:v?v(h,e.datum,{series:e.series}):h},null===(o=this.attribute.label)||void 0===o?void 0:o.style),i),{textAlign:g,textBaseline:m,fill:null!==(c=null===(d=null===(l=this.attribute.label)||void 0===l?void 0:l.style)||void 0===d?void 0:d.fill)&&void 0!==c?c:p}),null===(u=r[y])||void 0===u?void 0:u.style));return f.name="series-label-text",f.id=y,this.add(f),f};["start","end"].forEach((t=>{const i=u.filter((e=>e.position===t)),r=ti(i.map((e=>e.point.y)),e);i.forEach(((e,t)=>{var i;const s={x:e.point.x+(null!==(i=null==o?void 0:o.space)&&void 0!==i?i:8)*("start"===e.textAlign?1:-1),y:r[t]};a(e,s,d),c[e.id]=s}))}))}else{const e=[],i=[];u.forEach((r=>{var a,s,n,l,c;const{point:u,label:h,color:p,textAlign:g,textBaseline:m,id:y,position:v}=r,f={x:u.x,y:u.y},b=null!==(s=null===(a=d[y])||void 0===a?void 0:a.formatMethod)&&void 0!==s?s:null==o?void 0:o.formatMethod,x=t.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(h,r.datum,{series:r.series}):h},null==o?void 0:o.style),f),{textAlign:g,textBaseline:m,fill:null!==(l=null===(n=null==o?void 0:o.style)||void 0===n?void 0:n.fill)&&void 0!==l?l:p}),null===(c=d[y])||void 0===c?void 0:c.style));x.id=y,x.name="series-label-text",this.add(x),"start"===v?e.push(x):"end"===v&&i.push(x)})),e.length&&ri(e,4,10),i.length&&ri(i,4,10);const r=null!==(a=null==o?void 0:o.space)&&void 0!==a?a:8;[...e,...i].forEach((e=>{const t="top"===e.attribute.textBaseline?1:-1;e.setAttribute("y",e.attribute.y+r*t),c[e.id]={x:e.attribute.x,y:e.attribute.y}}))}!1!==l.visible&&u.forEach((e=>{var i,r,a,s,o,u;const{point:h,color:p,id:g}=e,m={x:c[g].x+(null!==(a=null===(r=null===(i=d[g])||void 0===i?void 0:i.style)||void 0===r?void 0:r.dx)&&void 0!==a?a:0),y:c[g].y+(null!==(u=null===(o=null===(s=d[g])||void 0===s?void 0:s.style)||void 0===o?void 0:o.dy)&&void 0!==u?u:0)};if(!1!==l.autoVisible){if("vertical"===n&&h.y!==m.y||"horizontal"===n&&h.x!==m.x){const e=t.createLine(Object.assign({points:[h,m],lineWidth:1,stroke:p},l.style));e.name="series-label-line",this.add(e)}}else{const e=t.createLine(Object.assign({points:[h,m],lineWidth:1,stroke:p},l.style));e.name="series-label-line",this.add(e)}}))}}function ni(e,t,i=0){return i>Math.max(t.x1-e.x2,e.x1-t.x2,t.y1-e.y2,e.y1-t.y2)}function oi(e){var t;if(!e||0===e.length)return[];if(1===e.length)return[e[0].rect];const i=e.map((e=>{var t,i;return Object.assign(Object.assign({},e),{bound:(i=e.rect,{x1:i.x,x2:i.x+i.width,y1:i.y,y2:i.y+i.height}),anchorCandidates:pi(null!==(t=e.anchors)&&void 0!==t?t:[],e.point,e.rect,e.offset)})})),r=[];r.push(i[0].bound);for(let e=1;e<=i.length-1;e++){const a=i[e],s=a.bound;let n=r.some((e=>ni(e,s)));if(a.anchorCandidates)if(n&&(null===(t=a.anchorCandidates)||void 0===t?void 0:t.length)>0){for(let e=0;e<a.anchorCandidates.length;e++){const t=a.anchorCandidates[e],i={x1:t.x,y1:t.y,x2:t.x+s.x2-s.x1,y2:t.y+s.y2-s.y1,anchor:t};if(!r.some((e=>ni(e,i)))){r.push(i),n=!1;break}}n&&r.push(a.bound)}else r.push(a.bound)}return r.map((e=>function(e){return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}}(e)))}function li(e,i,r){const a=e.map((e=>e.pointCoord)),{x1:s,x2:n,y1:o,y2:l}=t.getAABBFromPoints(a),d=r([(s+n)/2,(o+l)/2]);if(!d)return[];const c=e.map((e=>{const a=e.rect,s=ui(i,e.pointCoord)?r(function(e,i,r,a=200){const s=5621/a;let n=i;for(let i=1;i<=s;i++){const i=t.destination(n,a,r);if(!ui(e,i))return[i.x,i.y];n=[i.x,i.y]}return i}(i,[e.pointCoord.x,e.pointCoord.y],di(ci(e.point,d)))):e.point;s&&(a.x=s.x,a.y=s.y);const n=di(ci(e.point,d));let o;const l=[];return n>=-45&&n<45?(o="top",l.push("left","right")):n>=45&&n<135?o="right":n>=-135&&n<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),e.anchors=l,e.offset=20,e.rect=hi(e.rect,o,0),e}));return oi(c)}function di(e){return e>180?e-360:e}function ci(e,t){return 180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI+90}function ui(e,i){for(let r=0;r<e.length;r++){if(t.isPointInPolygon(i,e[r]))return!0}return!1}function hi(e,t,i=0){const r=Object.assign({},e);return"top"===t?(r.x-=e.width/2,r.y-=i+e.height/2):"bottom"===t?(r.x-=e.width/2,r.y+=i-e.height/2):"left"===t?(r.x-=i+e.width,r.y-=e.height/2):"right"===t&&(r.x+=i,r.y-=e.height/2),r}function pi(e,t,i,r=0){const a=[];return e.forEach((e=>{const{x:s,y:n}=hi(Object.assign(Object.assign({},t),{width:i.width,height:i.height}),e,r);a.push({x:s,y:n})})),a}const gi={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class mi extends t.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return gi}}class yi extends t.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=mi,this.layoutType="none",this.layoutZIndex=t.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(e){return t.getSpecInfo(e,this.specKey,this.type,(e=>e.visible&&t.isValid(e.seriesId)))}setAttrFromSpec(){var e,t,i,r;this.nameField=null!==(e=this._spec.nameField)&&void 0!==e?e:null===(t=this._series)||void 0===t?void 0:t.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(r=this._series)||void 0===r?void 0:r.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var e,t,i,r,a,s,n,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(t=null===(e=this._regions[0].getSeriesInType("map")[0])||void 0===e?void 0:e.getMapViewData())||void 0===t?void 0:t.latestData,this._longitudeField=null===(a=null===(r=(i=this._regions[0]).getSpec)||void 0===r?void 0:r.call(i))||void 0===a?void 0:a.longitudeField,this._latitudeField=null===(o=null===(n=(s=this._regions[0]).getSpec)||void 0===n?void 0:n.call(s))||void 0===o?void 0:o.latitudeField)}initData(){const e=this._series;if(!e)return;const i=e.getViewData();if(i){const e=new t.DataView(this._option.dataSet,{name:`${this.name}_data`});e.parse([i],{type:"dataview"}),e.transform({type:"copyDataView",level:t.TransformLevel.copyDataView},!1),this._data=new t.CompilableData(this._option,e),e.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:e=>this._isRelativeModel(e.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:e=>this._isRelativeModel(e.model)},(e=>(this.handlePan(e),!0)));const e=this._spec.trigger;"none"!==e&&("hover"===e?(this.event.on("element-highlight:start",(e=>{const i=e.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(t.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(e=>{this._activeDatum&&this._updateDatum(null)}))):"click"===e&&(this.event.on("element-select:start",(e=>{const i=e.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(t.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(e=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(e){const{delta:t}=e;this._markerComponents.forEach((e=>{e.translate(t[0],t[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(e){this._activeDatum=e,this._markerComponents.forEach(((e,t)=>{var i;const r=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[t];this._activeDatum.includes(r)?e.setAttribute("visible",!0):e.setAttribute("visible",!1)}))}dataToPosition(e){return this._series.dataToPosition(e)}updateLayoutAttribute(){var e;const t=null===(e=this._data)||void 0===e?void 0:e.getLatestData();t&&0!==t.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var e;const i=[],r=[];this._markerComponents||(this._markerComponents=null===(e=this._data)||void 0===e?void 0:e.getLatestData().map(((e,i)=>{var r;const a=new t.MarkPoint({position:void 0,animation:!1});return a&&(a.name=`${this.name}_marker_${i}`,a.id=null!==(r=this._spec.id)&&void 0!==r?r:`${this.name}_marker_${this.id}`,a.setAttribute("zIndex",this.layoutZIndex)),a})));this._markerComponents.forEach(((e,t)=>{const{pairInfo:a,contentMarks:s}=this._evaluateMarker(this._data.getLatestData()[t],t);a&&i.push(a),s&&r.push(s)}));const a=this._layoutLabels(i);this._layoutMarkers(a,r),this._renderMarkers()}_evaluateMarker(e,i){var r,a,s,n,o,l,d,c,u,h,p,g,m,y;let v=0,f=0,b=0,x=0,_=0;const S=this._spec.position||"top",k=this._spec.offset,C=t.normalizeLayoutPaddingSpec(null===(r=this._spec.background)||void 0===r?void 0:r.padding),M=this._spec.space||0;f+=((null==C?void 0:C.left)||0)+((null==C?void 0:C.right)||0),b+=((null==C?void 0:C.top)||0)+((null==C?void 0:C.bottom)||0);const A={},F=this.dataToPosition(e),T=t.graphicCreator.group({});if(T.name=`${this.name}_marker_itemContainer_${i}`,A.container=T,null===(a=this._spec.background)||void 0===a?void 0:a.visible){const e=t.graphicCreator.rect(t.transformToGraphic(Object.assign({},this._spec.background.style)));e.setAttributes(F),A.labelBackground=e,T.appendChild(e)}if(null===(s=this._spec.icon)||void 0===s?void 0:s.visible){const e=t.graphicCreator.symbol(t.transformToGraphic(Object.assign({},this._spec.icon.style)));e.setAttributes(F),e.setAttribute("symbolType",null!==(o=null===(n=this._spec.icon.style)||void 0===n?void 0:n.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=e.AABBBounds,r=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,a=null!==(c=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==c?c:0;A.icon=e,T.appendChild(e),_=r,x+=a,v++}if(null===(u=this._spec.nameLabel)||void 0===u?void 0:u.visible){const i=t.graphicCreator.text(t.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(F),i.setAttribute("text",e[this.nameField]);const r=i.AABBBounds,a=null!==(h=(null==r?void 0:r.y2)-(null==r?void 0:r.y1))&&void 0!==h?h:0,s=null!==(p=(null==r?void 0:r.x2)-(null==r?void 0:r.x1))&&void 0!==p?p:0;A.nameLabel=i,T.appendChild(i),_=Math.max(_,a),x+=s,v++}if((null===(g=this._spec.valueLabel)||void 0===g?void 0:g.visible)&&t.isValid(e[this.valueField])){const i=t.graphicCreator.text(t.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(F),i.setAttribute("text",e[this.valueField]);const r=i.AABBBounds,a=null!==(m=(null==r?void 0:r.y2)-(null==r?void 0:r.y1))&&void 0!==m?m:0,s=null!==(y=(null==r?void 0:r.x2)-(null==r?void 0:r.x1))&&void 0!==y?y:0;A.valueLabel=i,T.appendChild(i),_=Math.max(_,a),x+=s,v++}const L=Object.values(A).find((e=>!!e&&"group"!==e.type)),w={x:null==L?void 0:L.getComputedAttribute("x"),y:null==L?void 0:L.getComputedAttribute("y")},O={x:w.x,y:w.y,width:0,height:0};O.width=f+x+(v-1)*M,O.height=b+_;const I={rect:O,point:w,index:i};if("outer"!==S){const e=["top","right","left","bottom"].filter((e=>e!==S));I.rect=hi(O,S,k),I.anchors=e,I.offset=k}else I.pointCoord={x:+(null==e?void 0:e[this._longitudeField]),y:+(null==e?void 0:e[this._latitudeField])};return{pairInfo:I,contentMarks:A}}_layoutMarkers(e,i){var r,a,s;for(let n=0;n<i.length;n++){if(!e[n]||!i[n])return;const{icon:o,nameLabel:l,valueLabel:d,labelBackground:c,container:u}=i[n],h=e[n],p=t.normalizeLayoutPaddingSpec(null===(r=this._spec.background)||void 0===r?void 0:r.padding),g=this._spec.space||0,m=h.height/2;let y=(null==p?void 0:p.left)||0;[o,l,d].forEach(((e,t)=>{var i,r;if(e){const a=e.AABBBounds;let s=0;"symbol"===e.type&&(s+=(null!==(i=a.x2-a.x1)&&void 0!==i?i:0)/2),e.setAttributes({x:y+s,y:m}),y+=null!==(r=a.x2-a.x1)&&void 0!==r?r:0,2!==t&&(y+=g)}})),null==c||c.setAttributes({x:0,y:0,width:h.width,height:h.height}),null==u||u.setAttributes({dx:-h.width/2,dy:-h.height/2});const v=this._data.getLatestData()[n],f=this.dataToPosition(v),b=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(a=this._spec.leader)||void 0===a?void 0:a.visible)||!(o||l||d));this._markerComponents[n].setAttributes({x:b.x,y:b.y,position:f,visible:this._activeDatum.includes(v),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>u,autoRotate:!1,offsetX:h.x+h.width/2-f.x,offsetY:h.y+h.height/2-f.y},itemLine:{visible:x,type:"type-po",lineStyle:t.transformToGraphic(Object.assign({},null===(s=this._spec.leader)||void 0===s?void 0:s.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let e=0;e<this._markerComponents.length;e++)this.getContainer().add(this._markerComponents[e])}_layoutLabels(e){return"outer"===this._spec.position&&this._map?li(e,this._map,(e=>this._series.dataToPosition({[this._longitudeField]:e[0],[this._latitudeField]:e[1]}))):oi(e)}_isRelativeModel(e){var t,i,r;const a=null!==(i=null===(t=this._series.getXAxisHelper())||void 0===t?void 0:t.getAxisId())&&void 0!==i?i:null===(r=this._series.getCoordinateHelper())||void 0===r?void 0:r.getCoordinateId();return(null==e?void 0:e.id)===a}_isRelativeSeries(e){var t;return(null===(t=e.context)||void 0===t?void 0:t.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}yi.type="mapLabel",yi.specKey="mapLabel",yi.transformerConstructor=mi;const vi="regressionLine";class fi extends t.AbstractComponent{constructor(){super(...arguments),this.name=vi}render(){this.removeAllChild();const{data:e,line:i={},label:r,name:a="regression-line",confidenceInterval:s}=this.attribute;t.isEmpty(e)||e.forEach((e=>{const{color:n}=e;if(e.area&&!1!==(null==s?void 0:s.visible)){const i=t.createArea(Object.assign(Object.assign({points:e.area},t.isValid(n)?{fill:n,fillOpacity:.12}:null),null==s?void 0:s.style));i.name="scatter-regression-area",this.add(i)}if(e.line&&!1!==(null==i?void 0:i.visible)){const r=t.createLine(Object.assign(Object.assign({points:e.line,lineWidth:1},t.isValid(n)?{stroke:n}:null),null==i?void 0:i.style));r.name=`${a}-curve`,this.add(r)}const o=t.last(e.line);if(r&&!1!==r.visible&&r.text&&o){const e=t.createText(Object.assign(Object.assign(Object.assign({},o),{text:r.text,textAlign:"end",textBaseline:"middle"}),r.style));e.name=`${a}-label`,this.add(e)}}))}}const bi=(e,i,r=(e=>e.x),a=(e=>e.y),s)=>{switch(e){case"logisitc":return t.regressionLogistic(i,r,a);case"lowess":return t.regressionLowess(i,r,a);case"polynomial":return t.regressionPolynomial(i,r,a,{degree:s});default:return t.regressionLinear(i,r,a)}};function xi(e,i){const{color:r,line:a,confidenceInterval:s,label:n}=i;return{type:"component",componentType:vi,interactive:!1,style:{data:(a,s)=>{const n=s.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.scatter)),o=[];return n&&n.length&&n.forEach((a=>{var s,n;const l=a.getRegion().getLayoutStartPoint(),d=a.getRegion().getLayoutRect(),c=t.clamper(l.y,l.y+d.height),u=a.getColorAttribute(),h=a.getSeriesKeys(),p=a.getViewData().latestData,g=null===(s=a.fieldX)||void 0===s?void 0:s[0],m=null===(n=a.fieldY)||void 0===n?void 0:n[0];g&&m&&p&&!(p.length<=2)&&h.forEach((t=>{var s;const n=p.filter((e=>e[null==u?void 0:u.field]===t));if(!n.length)return;const{evaluateGrid:h,confidenceInterval:y}=bi(e,n,(e=>null==e?void 0:e[g]),(e=>null==e?void 0:e[m]),i.polynomialDegree),v=Math.max(3,Math.floor(n.length/4)),f=h(v),b=y(v);o.push({color:null!=r?r:null===(s=null==u?void 0:u.scale)||void 0===s?void 0:s.scale(t),line:f.map((t=>{const i={[g]:t.x,[m]:t.y};return{x:a.dataToPositionX(i)+l.x,y:c("logisitc"===e?l.y+d.height*(1-t.y):a.dataToPositionY(i)+l.y)}})),area:b.map((e=>{const t={[g]:e.x,[m]:e.lower};return{x:a.dataToPositionX(t)+l.x,y:c(a.dataToPositionY(t)+l.y),y1:c(a.dataToPositionY({[m]:e.upper})+l.y)}}))})}))})),o},line:a,confidenceInterval:s,label:n}}}function _i(e){const{color:i,line:r,confidenceInterval:a,label:s}=e;return{type:"component",componentType:vi,interactive:!1,zIndex:500,style:{data:(r,a)=>{const s=a.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),n=[];return s&&s.length&&s.forEach((r=>{var a,s,o;const l=r.getRegion().getLayoutStartPoint(),d=r.getRegion().getLayoutStartPoint(),c=r.getRegion().getLayoutRect(),u=t.clamper(d.y,d.y+c.height),h=r.getViewData().latestData,p=null===(a=r.fieldX)||void 0===a?void 0:a[0],g=null===(s=r.fieldY)||void 0===s?void 0:s[0],m="horizontal"===r.direction,y=r.getRawDataStatisticsByField(p).values;if(m||!p||!g||!h||h.length<=2||y.length<=2)return;const{evaluateGrid:v,confidenceInterval:f}=t.regressionPolynomial(h,(e=>y.indexOf(null==e?void 0:e[p])),(e=>null==e?void 0:e[g]),{degree:e.degree}),b=y.length,x=v(b),_=f(b),S=r.getXAxisHelper().getBandwidth(0)/2;n.push({color:null!=i?i:null===(o=r.getOption().globalScale.getScale("color"))||void 0===o?void 0:o.scale(r.getSeriesKeys()[0]),line:x.map((e=>{const t={[p]:y[e.x],[g]:e.y};return{x:r.dataToPositionX(t)+l.x+S,y:u(r.dataToPositionY(t)+l.y)}})),area:_.map((e=>{const t={[p]:y[e.x],[g]:e.lower};return{x:r.dataToPositionX(t)+l.x+S,y:u(r.dataToPositionY(t)+l.y),y1:u(r.dataToPositionY({[g]:e.upper})+l.y)}}))})})),n},line:r,confidenceInterval:a,label:s}}}const Si=(e,i,r)=>{switch(e){case"kde":return t.kde(i,r);case"ecdf":return t.ecdf(i)}};function ki(e,i){const{line:r,label:a,color:s}=i;return{type:"component",componentType:vi,interactive:!1,zIndex:500,style:{data:(i,r)=>{const a=r.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),n=[];return a&&a.length&&a.forEach((i=>{var r,a,o,l,d,c,u,h;const p=i.getRegion().getLayoutStartPoint(),g=i._rawData,m=null==g?void 0:g.rawData,y=null===(a=null===(r=g.transformsArr)||void 0===r?void 0:r.find((e=>"bin"===e.type)))||void 0===a?void 0:a.options,v=null===(o=i.fieldX)||void 0===o?void 0:o[0],f=i.getYAxisHelper().getScale(0),b=i.getViewData().latestData;if(!(m&&m.length&&(null==y?void 0:y.field)&&f&&b&&b.length))return;const x=m.map((e=>e[y.field])),_=Si(e,x,"kde"===e?{bandwidth:b[0][null!==(d=null===(l=y.outputNames)||void 0===l?void 0:l.x1)&&void 0!==d?d:"x1"]-b[0][null!==(u=null===(c=y.outputNames)||void 0===c?void 0:c.x0)&&void 0!==u?u:"x0"]}:null),S=Math.max(3,Math.floor(x.length/4)),k=_.evaluateGrid(S),C=f.range(),M=C[0],A=t.last(C),F="kde"===e?e=>f.scale(e*m.length*_.bandwidth):e=>M+(A-M)*e;n.push({color:null!=s?s:null===(h=i.getOption().globalScale.getScale("color"))||void 0===h?void 0:h.scale(i.getSeriesKeys()[0]),line:k.map((e=>{const t={[v]:e.x};return{x:i.dataToPositionX(t)+p.x,y:F(e.y)+p.y}}))})})),n},line:r,label:a}}}const Ci="ExtensionMarkSyncStatePlugin";class Mi extends t.BasePlugin{constructor(){super(Ci),this.type=Ci}onAfterInitChart(e,i){var r;if(!this._detectSyncState(i))return;const a=e.globalInstance.getChart();if(!a)return;const s=a.getEvent();if(this._subscribedEvent===s)return;null===(r=this._unsubscribeAfterRender)||void 0===r||r.call(this);const n=()=>this._syncStates();s.on(t.ChartEvent.afterRender,n),this._subscribedEvent=s,this._unsubscribeAfterRender=()=>{s.off(t.ChartEvent.afterRender,n),this._subscribedEvent=void 0}}release(){var e;null===(e=this._unsubscribeAfterRender)||void 0===e||e.call(this),super.release()}_detectSyncState(e){const t=null==e?void 0:e.series;return!!(null==t?void 0:t.some((e=>this._hasExtensionMarkWithSyncState(e.extensionMark))))||this._hasExtensionMarkWithSyncState(null==e?void 0:e.extensionMark)}_hasExtensionMarkWithSyncState(e){return!!(null==e?void 0:e.some((e=>"group"!==e.type&&e.syncState)))}_syncStates(){var e;const t=null===(e=this.service)||void 0===e?void 0:e.globalInstance.getChart();t&&t.getAllSeries().forEach((e=>{var t,i;const r=null===(i=null===(t=e.getSpec())||void 0===t?void 0:t.extensionMark)||void 0===i?void 0:i.filter((e=>"group"!==e.type&&e.syncState));(null==r?void 0:r.length)&&this._syncSeriesStates(e,r)}))}_syncSeriesStates(e,i){const r=new Map;if(e.getActiveMarks().forEach((e=>{e.getGraphics().forEach((e=>{var i;const a=null===(i=e.context)||void 0===i?void 0:i.key;t.isValid(a)&&r.set(String(a),e)}))})),0===r.size)return;const a=`${e.type}_${e.id}_extensionMark`;i.forEach(((i,s)=>{const n=t.isValid(i.name)?`${i.name}`:`${a}_${s}`,o=e.getMarkInName(n);o&&o.getGraphics().forEach((e=>{var i;const a=null===(i=e.context)||void 0===i?void 0:i.key;if(!t.isValid(a))return;const s=r.get(String(a));if(!s)return;const n=s.currentStates;(null==n?void 0:n.length)?e.useStates(n):e.clearStates()}))}))}}Mi.pluginType="chart",Mi.type=Ci;e.BAR_LINK=qt,e.Bar3dChart=se,e.Bar3dChartSpecTransformer=H,e.Bar3dSeries=te,e.Bar3dSeriesSpecTransformer=J,e.BarLinkComponent=Zt,e.CandlestickChart=De,e.CandlestickChartSpecTransformer=Se,e.CandlestickSeries=Ie,e.CombinationCandlestickChart=je,e.CombinationCandlestickChart_TYPE=_e,e.ConversionFunnelChart=T,e.ConversionFunnelSeries=L,e.DEFAULT_STROKE_COLOR="#000",e.DefaultBandWidth=6,e.ExtensionMarkSyncStatePlugin=Mi,e.Funnel3dChart=he,e.Funnel3dSeries=ce,e.Funnel3dSeriesSpecTransformer=oe,e.Histogram3dChart=pe,e.ImageCloudChart=Bt,e.MapLabelComponent=yi,e.PictogramChart=Ct,e.PictogramChartSpecTransformer=rt,e.PictogramSeries=St,e.Pie3dChart=xe,e.Pie3dChartSpecTransformer=ge,e.Pie3dSeries=fe,e.Pie3dSeriesSpecTransformer=ve,e.REGRESSION_LINE=vi,e.RangeColumn3dChart=Je,e.RangeColumn3dChartSpecTransformer=Ze,e.RangeColumn3dSeries=Xe,e.RangeColumn3dSeriesSpecTransformer=qe,e.RankingBar=n,e.RankingList=g,e.RegressionLine=fi,e.SERIES_BREAK=Ht,e.SequenceScatterKDE=j,e.SequenceScatterLink=I,e.SequenceScatterPixel=z,e.SeriesBreakComponent=Wt,e.SeriesLabelComponent=si,e.TimelineChart=zt,e.WordCloud3dChart=Ge,e.WordCloud3dChartSpecTransformer=He,e.WordCloud3dSeries=Ve,e.appendBarLinkConfig=function(e,i){e.customMark=t.array(e.customMark).filter((e=>e.componentType!==qt)),e.customMark.push(Qt(i))},e.appendBarRegressionLineConfig=function(e,i){var r,a;i||(i=null!==(r=t.get(e,vi))&&void 0!==r?r:t.get(null===(a=e.series)||void 0===a?void 0:a.find((e=>e.type===t.SeriesTypeEnum.bar)),vi)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const i=m(t,["visible"]);e.customMark.push(_i(i))}}))},e.appendHistogramRegressionLineConfig=function(e,i){var r,a;i||(i=null!==(r=t.get(e,vi))&&void 0!==r?r:t.get(null===(a=e.series)||void 0===a?void 0:a.find((e=>e.type===t.SeriesTypeEnum.bar)),vi)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,r=m(t,["type"]);e.customMark.push(ki(i,r))}}))},e.appendScatterRegressionLineConfig=function(e,i){var r,a;i||(i=null!==(r=t.get(e,vi))&&void 0!==r?r:t.get(null===(a=e.series)||void 0===a?void 0:a.find((e=>e.type===t.SeriesTypeEnum.scatter)),vi)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,r=m(t,["type"]);e.customMark.push(xi(i,r))}}))},e.appendSeriesBreakConfig=e=>{var i;if(null===(i=e.axes)||void 0===i?void 0:i.length){const i=e.axes.filter((e=>e.breaks&&e.breaks.length&&!1!==e.visible));if(i.length)return e.customMark=t.array(e.customMark).filter((e=>e.componentType!==Ht)),e.customMark.push(Ut(i,i.map((t=>e.axes.indexOf(t))))),!0}return!1},e.appendSeriesLabelConfig=function(e,i){var r,a,s;if(e.customMark=t.array(e.customMark).filter((e=>e.componentType!==ei)),i||(i=null!==(s=null!==(r=t.get(e,ei))&&void 0!==r?r:t.get(null===(a=e.series)||void 0===a?void 0:a[0],ei))&&void 0!==s?s:{}),i.visible){const{position:t="end"}=i,r=m(i,["position"]);e.customMark.push(ai(t,r))}},e.clearSVGSource=function(){at.clear(),st=null},e.getBarLinkConfig=Qt,e.getBarRegressionLineConfig=_i,e.getHistogramRegressionLineConfig=ki,e.getSVGSource=lt,e.getScatterRegressionLineConfig=xi,e.getSeriesBreakConfig=Ut,e.getSeriesLabelConfig=ai,e.register3DPlugin=q,e.registerAxis3dPlugin=()=>{q(),ae(),(()=>{t.registerCartesianBandAxis();const e=t.Factory.getComponentInKey(t.CartesianBandAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianBandAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ue)})(),(()=>{t.registerCartesianLinearAxis();const e=t.Factory.getComponentInKey(t.CartesianLinearAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianLinearAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ue)})(),(()=>{t.registerCartesianTimeAxis();const e=t.Factory.getComponentInKey(t.CartesianTimeAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},e.builtInTheme.axisX),$e)}),t.mixin(e,Ue)})(),(()=>{t.registerCartesianLogAxis();const e=t.Factory.getComponentInKey(t.CartesianSymlogAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},e.builtInTheme.axisX),$e)}),t.mixin(e,Ue)})(),(()=>{t.registerCartesianLogAxis();const e=t.Factory.getComponentInKey(t.CartesianLogAxis.type);e.builtInTheme=Object.assign(Object.assign({},e.builtInTheme),{axisZ:Object.assign(Object.assign({},t.CartesianLogAxis.builtInTheme.axisX),$e)}),t.mixin(e,Ue)})()},e.registerBar3dChart=()=>{q(),ae(),ie(),t.Factory.registerChart(se.type,se)},e.registerBar3dSeries=ie,e.registerBarLink=()=>{t.Factory.registerGraphicComponent(qt,(e=>new Zt(e)))},e.registerCandlestickChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),Ee(),t.Factory.registerChart(De.type,De)},e.registerCandlestickSeries=Ee,e.registerCombinationCandlestickChart=()=>{Ee(),t.Factory.registerChart(je.type,je)},e.registerConversionFunnelChart=e=>{t.registerMarkFilterTransform();const i=(null==e?void 0:e.VChart)||t.VChart;i&&(i.useChart([T]),i.useSeries([L]))},e.registerEventSeries=Nt,e.registerExtensionMarkSyncStatePlugin=()=>{t.registerChartPlugin(Mi)},e.registerFunnel3dChart=()=>{t.registerMarkTooltipProcessor(),q(),ae(),ue(),t.Factory.registerChart(he.type,he)},e.registerFunnel3dSeries=ue,e.registerHistogram3dChart=()=>{t.registerGroupTooltipProcessor(),t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),q(),ae(),ie(),t.Factory.registerChart(pe.type,pe)},e.registerImageCloudChart=()=>{Dt(),t.Factory.registerChart(Bt.type,Bt)},e.registerMapLabel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useComponent([yi])},e.registerPictogramChart=()=>{t.registerMarkTooltipProcessor(),kt(),t.Factory.registerChart(Ct.type,Ct)},e.registerPictogramSeries=kt,e.registerPie3dChart=()=>{t.registerMarkTooltipProcessor(),q(),ae(),be(),t.Factory.registerChart(xe.type,xe)},e.registerPie3dSeries=be,e.registerRangeColumn3dChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),q(),ae(),Ye(),t.Factory.registerChart(Je.type,Je)},e.registerRangeColumn3dSeries=Ye,e.registerRankingBarChart=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([n])},e.registerRankingList=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([g,t.BarChart])},e.registerRegressionLine=()=>{t.Factory.registerGraphicComponent(vi,(e=>new fi(e)))},e.registerSVGSource=nt,e.registerSequenceScatterKDE=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([j,t.ScatterChart])},e.registerSequenceScatterLink=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([I,t.ScatterChart])},e.registerSequenceScatterPixel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([z,t.ScatterChart])},e.registerSeriesBreak=()=>{t.Factory.registerGraphicComponent("seriesBreak",(e=>new Wt(e)))},e.registerSeriesLabel=()=>{t.Factory.registerGraphicComponent("seriesLabel",(e=>new si(e)))},e.registerTimelineChart=()=>{t.registerMarkTooltipProcessor(),Nt(),t.Factory.registerChart(zt.type,zt)},e.registerWordCloud3dChart=We,e.registerWordCloud3dSeries=Ne,e.registerWordCloudShape3dChart=()=>{q(),ze(),We()},e.registerWordCloudShape3dSeries=ze,e.svgSourceMap=at,e.transformCandlestickSeriesSpec=Be,e.unregisterSVGSource=ot}));
|
|
16
|
+
function y(t,e){var i={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(i[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(i[n[o]]=t[n[o]])}return i}const v={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},m={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},x={fill:"#606773",fontSize:12},f={fill:"#eff1f9"};class b extends e.FunnelChartSpecTransformer{transformSpec(t){const{conversionArrow:e,extensionMark:i=[],funnelBackground:n}=t;if(e&&e.arrows&&e.arrows.length){const t=function(t){const{arrows:e}=t,i=y(t,["arrows"]),n=e.filter((t=>"left"===t.position)),o=k(e.filter((t=>"right"===t.position)),i),r=k(n,i),a=[];o&&(o.name="arrowRight",a.push(o));r&&(r.name="arrowLeft",a.push(r));return a}(e);t&&t.length&&i.push(...t)}if(n&&n.visible){const t=function(t){const{style:e={}}=t,i=y(t,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},f),e),{x:0,y:(t,e)=>e.getPoints(t)[0].y,width:(t,e)=>{const i=e.getRegion(),{width:n}=i.getLayoutRect();return n},height:(t,e)=>{const i=e.getPoints(t),n=i[0];return i[3].y-n.y}})})}(n);t&&i.push(t)}t.extensionMark=i,super.transformSpec(t)}_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.conversionArrow=t.conversionArrow,e.funnelBackground=t.funnelBackground,e}}function k(t,i){if(0===(null==t?void 0:t.length))return null;const{line:n,symbol:o,text:r,margin:a}=i,s=[],l={type:"group",zIndex:e.LayoutZIndex.Mark+1,children:[]},d=function(t={},e){const{style:i={}}=t,n=y(t,["style"]),o=(t,e)=>{var i,n;const{from:o,to:r}=t,{vchart:a}=e,s=null===(n=null===(i=null==a?void 0:a.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===n?void 0:n.latestData;return!(r>s.length-1||o>s.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},n),{dataKey:t=>`${t.id}`,style:Object.assign(Object.assign(Object.assign({},v),i),{renderable:o,points:(t,i)=>{if(!o(t,i))return[];let n=t.layout.points;return n=_(t,i,e),n}})})}(n,a);d&&s.push(d);const c=function(t={},e){const{style:i={}}=t,n=y(t,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:t=>`${t.id}`},n),{style:Object.assign(Object.assign(Object.assign({},m),i),{x:(t,i)=>{var n,o;let r=t.layout.points;return r=_(t,i,e),null!==(o=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.x)&&void 0!==o?o:NaN},y:(t,i)=>{var n,o;let r=t.layout.points;return r=_(t,i,e),null!==(o=null===(n=r[(null==r?void 0:r.length)-1])||void 0===n?void 0:n.y)&&void 0!==o?o:NaN},angle:t=>"left"===t.position?90:-90})})}(o,a);c&&s.push(c);const h=function(t={},i){const{style:n={},formatMethod:o,textMargin:r=4}=t,a=y(t,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:t=>`${t.id}`,interactive:!1,animation:!1},a),{style:Object.assign(Object.assign(Object.assign({},x),{text:(t,i)=>{var n,r,a,s,l,d,c;const{text:h}=t;let u=h;if(e.isFunction(o)){const{vchart:e}=i,{from:g,to:p}=t,{field:y}=t.context,v=null!==(a=null===(r=null===(n=null==e?void 0:e.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===r?void 0:r.latestData)&&void 0!==a?a:[],m=null!==(c=null===(d=null===(l=null===(s=null==e?void 0:e.getChart())||void 0===s?void 0:s.getAllSeries()[0])||void 0===l?void 0:l.getViewData())||void 0===d?void 0:d.latestData)&&void 0!==c?c:[],x=m.find((t=>t[y]===v[g][y])),f=m.find((t=>t[y]===v[p][y]));u=o(h,{arrow:t,from:x,to:f})}return u},x:(t,e)=>{var n,o;let a=t.layout.points;return a=_(t,e,i),null!==(o=(null===(n=a[1])||void 0===n?void 0:n.x)+("left"===t.position?-r:r))&&void 0!==o?o:NaN},y:(t,e)=>{var n,o,r;let a=t.layout.points;return a=_(t,e,i),null!==(r=((null===(n=a[1])||void 0===n?void 0:n.y)+(null===(o=a[2])||void 0===o?void 0:o.y))/2)&&void 0!==r?r:NaN},textAlign:t=>"left"===t.position?"right":"left",textBaseline:"middle"}),n)})}(r,a);return h&&s.push(h),l.children=s,l}function _(t,e,i){var n,o,r,a,s;const{vchart:l}=e,{from:d,to:c}=t,{field:h}=t.context,u=null===(o=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getSeriesData())||void 0===o?void 0:o.latestData,g=null===(s=null===(a=null===(r=null==l?void 0:l.getChart())||void 0===r?void 0:r.getAllSeries()[0])||void 0===a?void 0:a.getViewData())||void 0===s?void 0:s.latestData;let p=[];if(u&&u.length){const n=g.find((t=>t[h]===u[d][h])),o=g.find((t=>t[h]===u[c][h])),r=g[0];if(n&&o&&r){p=function(t,e,i,n,o=12){const{layout:r,distance:a,position:s}=t,{level:l,fromIndex:d,toIndex:c,fromTotal:h,toTotal:u}=r,g="right"===s,p=g?e[1]:e[0],y=g?e[2]:e[3],v=Math.abs(p.y-y.y),m=g?i[1]:i[0],x=g?i[2]:i[3],f=Math.abs(m.y-x.y),b=g?n[1]:n[0],k=v/(h+1),_=f/(u+1),S=p.y+k*(d+1),M=m.y+_*(c+1),w=g?-1:1,A=[{x:p.x-o*w,y:S},{x:b.x-(o+(l+1)*a)*w,y:S},{x:b.x-(o+(l+1)*a)*w,y:M},{x:m.x-o*w,y:M}];return A}(t,e.getPoints(n),e.getPoints(o),e.getPoints(r),i),t.layout.points=p}}return p}function S(t,e){const{from:i,to:n}=t,{from:o,to:r}=e;return n>o&&r>i}function M(t,e){const{from:i,to:n}=t,{from:o,to:r}=e;return i===o&&n===r}const w=(t,i)=>{var n,o,r;if(!t||!(null===(n=t.arrows)||void 0===n?void 0:n.length))return[];const{arrows:a}=t,s=function(t,i){return t.filter((t=>e.isValidNumber(t.from*t.to))).map(((t,e)=>{const{from:n,to:o,position:r="right"}=t;return Object.assign(Object.assign({},t),{position:r,distance:t.distance||40,from:Math.min(n,o),to:Math.max(n,o),span:Math.abs(n-o),isLayout:!1,context:{field:i},layout:{level:0},id:`${n}-${o}-${r}-${e}`})}))}(a,i.categoryField),l=s.filter((t=>"left"===t.position)),d=s.filter((t=>"right"===t.position));return[...null!==(o=A(l))&&void 0!==o?o:[],...null!==(r=A(d))&&void 0!==r?r:[]]};function A(t){if(0===(null==t?void 0:t.length))return null;const i=new Map;return t.forEach((t=>{const n=i.get(t.from);if(e.isValid(n)){const e=n.fromArrows.find((e=>M(e,t)));e?t.layout.duplicateNode=e:n.degree+=1,n.fromArrows.push(t)}else i.set(t.from,{fromArrows:[t],toArrows:[],totalArrows:[],degree:1});const o=i.get(t.to);if(e.isValid(o)){const e=o.toArrows.find((e=>M(e,t)));e?t.layout.duplicateNode=e:o.degree+=1,o.toArrows.push(t)}else i.set(t.to,{toArrows:[t],fromArrows:[],totalArrows:[],degree:1})})),i.forEach((t=>{t.fromArrows.sort(((t,e)=>e.span-t.span)),t.toArrows.sort(((t,e)=>t.span-e.span)),t.totalArrows=[...t.toArrows,...t.fromArrows]})),t.sort(((t,e)=>t.span-e.span)).forEach((n=>{var o;const r=t.filter((t=>t.layout.isLayout)),a=e.maxInArray(r,((t,e)=>t.layout.level-e.layout.level));let s=null!==(o=null==a?void 0:a.layout.level)&&void 0!==o?o:0;for(;s>=0;){if(r.some((t=>t.layout.level===s&&S(t,n)))){s+=1;break}--s}n.layout.level=Math.max(0,s),n.layout.fromTotal=i.get(n.from).degree,n.layout.toTotal=i.get(n.to).degree;const l=n.layout.duplicateNode;l?(n.layout.fromIndex=l.layout.fromIndex,n.layout.toIndex=l.layout.toIndex):(n.layout.fromIndex=C(n,i.get(n.from).totalArrows),n.layout.toIndex=C(n,i.get(n.to).totalArrows)),n.layout.isLayout=!0})),t}function C(t,e){let i=0,n=0;for(let o=0;o<e.length;o++){const r=e[o];if(r===t){i=o-n;break}r.layout.duplicateNode&&n++}return i}class L extends e.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=b}}L.type="conversionFunnel",L.transformerConstructor=b;class F extends e.FunnelSeries{initData(){var t;super.initData();const{conversionArrow:i}=this._spec;i&&(null===(t=i.arrows)||void 0===t?void 0:t.length)&&(this._arrowData=new e.DataView(this._dataSet,{name:`${e.PREFIX}_series_${this.id}_arrowData`}),this._dataSet.getTransform("conversionArrow")||this._dataSet.registerTransform("conversionArrow",w),this._arrowData.parse(i).transform({type:"conversionArrow",options:{categoryField:this._spec.categoryField}}))}afterCompile(){var t;null===(t=super.afterCompile)||void 0===t||t.call(this);const e=this.getMarkInName("arrowRight");e&&e.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"right"===t.position}])}));const i=this.getMarkInName("arrowLeft");i&&i.getMarks().forEach((t=>{t.setDataView(this._arrowData),t.compileData(),t.setTransform([{type:"filter",callback:t=>"left"===t.position}])}))}}const B="dataKey";class O extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,o,r;super.transformSpec(t);const a=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].nodes;e.push({data:[{id:"nodes",values:n.map(((t,e)=>Object.assign(Object.assign({},t),{[B]:e})))},{id:"endpoints",values:[]},{id:"iter",values:[{iter:i}]},{id:"background",values:[{iter:i,x:t.scope[0],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[3]},{iter:i,x:t.scope[2],y:t.scope[1]},{iter:i,x:t.scope[0],y:t.scope[1]}]}]})})),e}(t),s="neighborhood"!==t.taskType;t.type="common",t.dataKey=B,t.data=a[0].data,t.series=[{id:"background-series",type:"area",dataId:"background",interactive:!1,persent:!0,xField:"x",yField:"y",point:{visible:!1},line:{visible:!1},area:{visible:!0,interactive:!1,style:{background:e=>"neighborhood"===t.taskType?"":`https://lf9-dp-fe-cms-tos.byteorg.com/obj/bit-cloud/sequence-scatter-bgimg-2/${e.iter}.png`,fill:"transparent",fillOpacity:.5}},hover:{enable:!1},select:{enable:!1}},{id:"line-series",type:"line",dataId:"endpoints",xField:"x",yField:"y",seriesField:"edgeId",animation:!0,point:{visible:!1},line:{visible:!0,style:{stroke:t=>t.color,lineDash:t=>"same_type"===t.type?[0,0]:[3,2],lineWidth:.8,strokeOpacity:.6}}},{id:"scatter-series",type:"scatter",dataId:"nodes",xField:t.xField,yField:t.yField,seriesField:"label",point:{state:{hover:{scaleX:1.5,scaleY:1.5,fillOpacity:1},hover_reverse:{scaleX:1,scaleY:1,fillOpacity:.3}},style:{size:()=>"neighborhood"===t.taskType?6:4,fill:e=>{var i;return null!==(i=t.labelColor[e.label])&&void 0!==i?i:"gray"},fillOpacity:t=>t.confidence}},label:{visible:!0,style:{visible:()=>"neighborhood"===t.taskType,type:"text",fontFamily:"Console",fontStyle:"italic",fontSize:12,fill:"black",fillOpacity:.6,text:t=>t.id}}}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(o=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==o?o:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",inverse:!0,min:t.scope[1],max:t.scope[3]},{orient:"bottom",type:"linear",min:t.scope[0],max:t.scope[2]}],t.customMark=[{type:"text",dataId:"iter",style:Object.assign({x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.legends=[{seriesId:"scatter-series",visible:!0,orient:"right",position:"middle",data:t=>t.map((t=>(t.shape.outerBorder={stroke:t.shape.fill,distance:2,lineWidth:1},t))),title:{visible:!0,align:"left",textStyle:{text:"Classes",fontFamily:"Console",fontSize:18,fontWeight:"bold"}},item:{visible:!0,width:"8%",value:{alignRight:!0,style:{fill:"#000",fillOpacity:1,fontSize:12},state:{unselected:{fill:"#d8d8d8"}}}}}],t.tooltip={visible:s,seriesId:"scatter-series",lockAfterClick:!1,activeType:"mark",trigger:"hover",mark:{title:{visible:!0,value:"Info"},content:[{key:"Label",value:t=>t.label,shapeType:"circle",shapeSize:8},{key:"Prediction",value:t=>t.prediction,shapeType:"circle",shapeSize:8,shapeFill:e=>{var i;return null!==(i=t.labelColor[e.prediction])&&void 0!==i?i:"gray"}},{key:"Confidence",value:t=>t.confidence.toFixed(2),shapeType:"square",shapeSize:8,shapeFill:t=>t.label===t.prediction?"green":"red"}]},style:{panel:{padding:{top:10,bottom:15,left:10,right:10},backgroundColor:"#fff",border:{color:"#eee",width:1,radius:10}},titleLabel:{fontSize:20,fontFamily:"Times New Roman",fill:"brown",fontWeight:"bold",textAlign:"center",lineHeight:24},keyLabel:{fontSize:16,fontFamily:"Times New Roman",fill:"black",textAlign:"center",lineHeight:15,spacing:10},valueLabel:{fontSize:14,fill:"black",textAlign:"center",lineHeight:15,spacing:10}}},t.dataZoom=[{visible:!1,orient:"left",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}},{visible:!1,orient:"bottom",filterMode:"axis",showDetail:!1,roamZoom:{enable:!0,focus:!0,rate:3},roamDrag:{enable:!0,reverse:!0,rate:1}}],super.transformSpec(t)}}class T extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=O}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:o,yField:r,data:a}=this._spec;return o&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}T.type="sequenceScatterLink",T.view="singleDefault",T.transformerConstructor=O;const I=.2;function D(t){const e=Math.sqrt((2*Math.PI)**2);return Math.exp(-(t**2)/2)/e}const E="dataKey";class j extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,o,r,a;super.transformSpec(t);const s=function(t){const e=[];return Object.keys(t.data).forEach((i=>{const n=t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[E]:e}))),o=function(t,e=100,i){const n=t.reduce(((t,e)=>{const i=e.label;return t[i]=t[i]||[],t[i].push(e),t}),{}),o=[];return Object.entries(n).forEach((([t,n])=>{const r=i||function(t){return t.length**(-1/6)}(n),a=n.map((t=>t.x)),s=n.map((t=>t.y)),l=Math.min(...a),d=Math.max(...a),c=Math.min(...s),h=Math.max(...s),u=l-(d-l)*I,g=c-(h-c)*I;for(let i=0;i<e;i++)for(let a=0;a<e;a++){const e=u+.1*i,s=g+.1*a;let l=0;for(const t of n)l+=D(Math.sqrt((e-t.x)**2+(s-t.y)**2)/r);l/=n.length*r*r,o.push({x:e,y:s,kde:l,label:t})}})),o}(n,150);e.push({data:[{id:"nodes",values:n},{id:"iter",values:[{iter:i}]},{id:"kde",values:o}]})})),e}(t);t.type="common",t.dataKey=E,t.data=s[0].data,t.scales=[{id:"colorScale",type:"ordinal",specified:{0:"rgb(150, 10, 100)",1:"rgb(31, 119, 180)",2:"rgb(255, 127, 14)",3:"rgb(44, 160, 44)",4:"rgb(214, 39, 40)",5:"rgb(148, 103, 189)",6:"rgb(140, 86, 75)",7:"rgb(227, 119, 194)",8:"rgb(127, 127, 127)",9:"rgb(188, 189, 34)",10:"rgb(23, 190, 207)"}},{id:"brighterColorScale",type:"ordinal",specified:{0:"rgb(150, 10, 150)",1:"rgb(31, 119, 230)",2:"rgb(255, 127, 64)",3:"rgb(44, 160, 94)",4:"rgb(214, 39, 90)",5:"rgb(148, 103, 239)",6:"rgb(140, 86, 125)",7:"rgb(227, 119, 244)",8:"rgb(127, 127, 177)",9:"rgb(188, 189, 84)",10:"rgb(23, 190, 255)"}},...null!==(e=t.scales)&&void 0!==e?e:[]],t.series=[{type:"scatter",dataIndex:0,xField:t.xField,yField:t.yField,seriesField:t.seriesField,size:5,point:{zIndex:1e3,style:{fill:{scale:"colorScale",field:t.seriesField}}}}];t.customMark=[{type:"text",dataIndex:1,style:Object.assign({text:t=>t.iter,x:10,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:25,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(i=t.infoLabel)||void 0===i?void 0:i.style)},{type:"symbol",dataIndex:2,style:{symbolType:"rect",x:(t,e)=>54+(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToX)([t.x]),y:(t,e)=>(0,e.chart.getAllSeries()[0]._markAttributeContext.valueToY)([t.y])+26,size:5,fill:{scale:"brighterColorScale",field:"label"},fillOpacity:t=>10*t.kde}}],t.tooltip={visible:!0,fields:["x","y","label"]},t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:s}),t.animationAppear={duration:null!==(o=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==o?o:2e3,easing:"linear"},t.animationUpdate={duration:null!==(a=null===(r=t.player)||void 0===r?void 0:r.duration)&&void 0!==a?a:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear",nice:!0},{orient:"bottom",type:"linear",nice:!0,label:{visible:!0}}],super.transformSpec(t)}}class P extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterKDE",this.transformerConstructor=j}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:o,yField:r,data:a}=this._spec;return o&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}P.type="sequenceScatterKDE",P.view="singleDefault",P.transformerConstructor=j;const R="dataKey";function $(t){const e=[];return Object.keys(t.data).forEach((i=>{let n=null;if(t.backgroundColors&&t.backgroundColors[i]){const e=function(t,e){var i;if("undefined"==typeof document)throw new Error("Canvas rendering requires browser environment with document object");const n=document.createElement("canvas");n.width=e.width,n.height=e.height;const o=n.getContext("2d");if(!o)throw new Error("Failed to get 2D rendering context from canvas");const r=o.createImageData(e.width,e.height);for(let e=0;e<300;e++)for(let n=0;n<300;n++){const o=(null===(i=t[e])||void 0===i?void 0:i[n])||[0,0,0],a=4*(300*e+n);r.data[a]=Math.round(255*o[0]),r.data[a+1]=Math.round(255*o[1]),r.data[a+2]=Math.round(255*o[2]),r.data[a+3]=255}return o.putImageData(r,0,0),n.toDataURL("image/png")}(t.backgroundColors[i],t);n={imageData:e}}e.push({data:[{id:"nodes",values:t.data[i].map(((t,e)=>Object.assign(Object.assign({},t),{[R]:e})))},{id:"inter",values:[{inter:i}]},{id:"background",values:n?[n]:[]}]})})),e}class z extends e.CommonChartSpecTransformer{transformSpec(t){var e,i,n,o,r;super.transformSpec(t);const a=$(t);t.type="common",t.dataKey=R,t.data=a[0].data,t.width=300,t.height=300,t.autoFit=!1,t.series=[{type:"scatter",xField:t.xField,yField:t.yField}],t.player&&(t.player=Object.assign(Object.assign({},t.player),{specs:a}),t.animationAppear={duration:null!==(i=null===(e=t.player)||void 0===e?void 0:e.duration)&&void 0!==i?i:2e3,easing:"linear"},t.animationUpdate={duration:null!==(o=null===(n=t.player)||void 0===n?void 0:n.duration)&&void 0!==o?o:2e3,easing:"linear"}),t.axes=[{orient:"left",type:"linear"},{orient:"bottom",label:{visible:!0},type:"linear"}],t.customMark=[{type:"image",dataIndex:2,style:{x:0,y:0,width:300,height:300,image:t=>t.imageData,zIndex:-1}},{type:"text",dataIndex:1,style:Object.assign({text:t=>t.inter,x:50,y:()=>10,textBaseline:"top",textAlign:"left",fontSize:100,fontWeight:"bolder",fill:"black",fillOpacity:.2},null===(r=t.infoLabel)||void 0===r?void 0:r.style)}],t.tooltip={visible:!1},super.transformSpec(t)}}class N extends e.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=z}init(){this.isValid()&&super.init()}isValid(){var t,e,i,n;const{xField:o,yField:r,data:a}=this._spec;return o&&r?!!a||(null===(n=(i=this._option).onError)||void 0===n||n.call(i,"Data is required"),!1):(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Missing Required Config: `xField`, `yField` "),!1)}}N.type="sequenceScatterPixel",N.view="singleDefault",N.transformerConstructor=z;class V extends e.BarChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.barWidth=t.barWidth,e.barMaxWidth=t.barMaxWidth,e.barMinWidth=t.barMinWidth,e.barGapInGroup=t.barGapInGroup,e}}var W,H,G,U,K;!function(t){t.bar3d="bar3d",t.histogram3d="histogram3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(W||(W={})),function(t){t.rect3d="rect3d",t.arc3d="arc3d",t.pyramid3d="pyramid3d"}(H||(H={})),function(t){t.bar3d="bar3d",t.rangeColumn3d="rangeColumn3d",t.pie3d="pie3d",t.wordCloud3d="wordCloud3d",t.funnel3d="funnel3d"}(G||(G={})),function(t){t.bar3d="bar3d",t.funnel3d="funnel3d",t.transform3d="transform3d",t.pie3d="pie3d"}(U||(U={})),function(t){t.bar3d_horizontal="bar3d_horizontal",t.bar3d_vertical="bar3d_vertical",t.bar3d_stack="bar3d_stack",t.rangeColumn3d_horizontal="rangeColumn3d_horizontal",t.rangeColumn3d_vertical="rangeColumn3d_vertical"}(K||(K={}));const Y=t=>t.zField||t.series&&t.series.some((t=>t.zField));class X extends e.BasePlugin{constructor(){super(X.type),this.type="VChart3dPlugin"}onInit(t,e){var i,n;if(this._is3d=!!(n=e)&&((t=>"bar3d"===t||"funnel3d"===t||"histogram3d"===t||"pie3d"===t||"rangeColumn3d"===t||"wordCloud3d"===t)(n.type)||Y(n),!0),this._is3d){const{globalInstance:e}=t;e.getCompiler().getStage().set3dOptions(Object.assign({},null===(i=e._option)||void 0===i?void 0:i.options3d))}}onBeforeInitChart(t,e,i){this._is3d&&Y(e)&&(e.layout={type:"layout3d"})}}X.pluginType="chart",X.type="VChart3dPlugin";const Z=()=>{e.registerChartPlugin(X),e.registerDirectionalLight(),e.registerOrthoCamera(),e.registerViewTransform3dPlugin()},q={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class J extends e.BarSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar3d")}}class Q extends e.BaseMark{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}setDataLabelType(){return"rect"}constructor(t,e){super(t,e),this.type=Q.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}Q.type="rect3d";const tt=()=>{e.Factory.registerMark(Q.type,Q),e.registerShadowRoot(),e.registerRect3d(),e.registerRectAnimation(),e.Factory.registerGraphicComponent("rect3d",e.createRect3d)};class et extends e.BarSeries{constructor(){super(...arguments),this.type=G.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=J}}et.type=G.bar3d,et.mark=q,et.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},et.transformerConstructor=J;const it=()=>{e.Factory.registerAnimation("bar3d",((t,i)=>({appear:e.barPresetAnimation(t,i),enter:e.barGrowIn(t,!1),exit:e.barGrowOut(t,!1),disappear:e.barGrowOut(t)}))),tt(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(et.type,et)};class nt extends e.Layout{layoutItems(t,i,n,o){this._layoutInit(t,i,n,o);const r={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,r);const a={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},s=i.filter((t=>"absolute"===t.layoutType)),l=s.filter((t=>"z"===t.layoutOrient));let d={width:0,height:0};if(l.length){d=l[0].getLayoutRect()}this.leftCurrent+=d.width/8,this.rightCurrent-=d.width/8,this.topCurrent+=d.height/8,this.bottomCurrent-=d.height/8;const{regionItems:c,relativeItems:h,relativeOverlapItems:u,allRelatives:g,overlapItems:p}=this._groupItems(i);this.layoutRegionItems(c,h,u,p,r),this._processAutoIndent(c,h,u,p,g,a,r);const y=s.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(y);const v=h.filter((t=>"axes"===t.model.specKey&&e.isXAxis(t.layoutOrient)))[0],m=h.filter((t=>"axes"===t.model.specKey&&e.isYAxis(t.layoutOrient)))[0];if(v&&l.length){const t=v.getLayoutStartPoint(),e=v.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};l[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const n=v.getLayoutRect(),o=m.getLayoutRect(),r={length:l[0].getLayoutRect().width,width:n.width,height:o.height};v.model.setLayout3dBox&&v.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(r),this.layoutZAxisItems(l,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0});return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,n=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const o="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();o?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-n)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}nt.type="layout3d";const ot=()=>{e.Factory.registerLayout(nt.type,nt)};class rt extends e.BarChart{constructor(){super(...arguments),this.transformerConstructor=V,this.type="bar3d",this.seriesType=G.bar3d}}rt.type="bar3d",rt.seriesType=G.bar3d,rt.transformerConstructor=V;const at=Object.assign(Object.assign({},e.baseSeriesMark),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class st extends e.FunnelSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class lt extends e.BasePolygonMark{_getDefaultStyle(){const t=super._getDefaultStyle();return t.stroke=!1,t}constructor(t,e){super(t,e),this.type=lt.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}lt.type="pyramid3d";const dt=e.getFunnelTheme(!0);class ct extends e.FunnelSeries{constructor(){super(...arguments),this.type=G.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=st}initMark(){var t,e,i,n,o,r,a,s;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},ct.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0},{support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},ct.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(n=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===n?void 0:n.visible){const{line:t}=null!==(o=this._spec.outerLabel)&&void 0!==o?o:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(ct.mark.outerLabel,{themeSpec:null===(s=this._theme)||void 0===s?void 0:s.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(ct.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t){var i,n;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",e.AttributeLevel.Series),this._labelMark=t,null===(i=this._funnelOuterLabelMark)||void 0===i||i.label,null===(n=this._funnelOuterLabelMark)||void 0===n||n.line}}ct.type=G.funnel3d,ct.mark=at,ct.builtInTheme={funnel3d:dt},ct.transformerConstructor=st;const ht=()=>{e.Factory.registerMark(lt.type,lt),e.registerShadowRoot(),e.registerPyramid3d(),e.registerPolygonAnimation(),e.Factory.registerGraphicComponent("pyramid3d",e.createPyramid3d),e.registerTextMark(),e.registerRuleMark(),e.Factory.registerSeries(ct.type,ct)};class ut extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=e.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=G.funnel3d}}ut.type="funnel3d",ut.seriesType=G.funnel3d,ut.transformerConstructor=e.FunnelChartSpecTransformer;class gt extends e.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=e.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=G.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}gt.type="histogram3d",gt.seriesType=G.bar3d,gt.transformerConstructor=e.HistogramChartSpecTransformer;class pt extends e.BasePieChartSpecTransformer{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class yt extends e.BaseArcMark{setDataLabelType(){return"arc"}constructor(t,e){super(t,e),this.type=yt.type,this._markConfig.support3d=!0}setMarkConfig(t){super.setMarkConfig(t),this._markConfig.support3d=!0}}yt.type="arc3d";const vt=Object.assign(Object.assign({},e.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class mt extends e.PieSeriesSpecTransformer{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class xt extends e.BasePieSeries{constructor(){super(...arguments),this.type=G.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=mt}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",e.AttributeLevel.Series)}initLabelMarkStyle(t,i={}){t&&(super.initLabelMarkStyle(t),this.setMarkStyle(t,{support3d:!0},void 0,e.AttributeLevel.Mark))}}xt.type=G.pie3d,xt.mark=vt,xt.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},xt.transformerConstructor=mt;const ft=()=>{e.Factory.registerAnimation("pie3d",((t,i)=>({appear:e.piePresetAnimation(t,i),enter:e.pieEnter(t),exit:e.pieExit(t),disappear:e.pieDisappear(t)}))),e.registerArcAnimation(),e.registerShadowRoot(),e.registerArc3d(),e.Factory.registerGraphicComponent("arc3d",e.createArc3d),e.Factory.registerMark("arc3d",yt),e.Factory.registerSeries(xt.type,xt)};class bt extends e.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=pt,this.type="pie3d",this.seriesType=G.pie3d}}bt.type="pie3d",bt.seriesType=G.pie3d,bt.transformerConstructor=pt;const kt="combinationCandlestick";class _t extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){const e=[t.openField,t.highField,t.lowField,t.closeField],i=super._getDefaultSeriesSpec(t,["candlestick","openField","highField","lowField","closeField","rising","falling","doji"]);return i.yField=e,i}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),e.setDefaultCrosshairForCartesianChart(t)}}class St extends e.GlyphMark{constructor(){super(...arguments),this.type=St.type}setGlyphConfig(t){super.setGlyphConfig(t),this._subMarks={line:{type:"line",defaultAttributes:{x:0,y:0}},box:{type:"rect"}},this._positionChannels=["x","boxWidth","open","close","high","low"],this._channelEncoder=null,this._positionEncoder=(t,e,i)=>{const{x:n=i.attribute.x,boxWidth:o=i.attribute.boxWidth,open:r=i.attribute.open,close:a=i.attribute.close,low:s=i.attribute.low,high:l=i.attribute.high}=t,d={};return d.line={points:[{x:n,y:s},{x:n,y:l}]},d.box={x:n-o/2,x1:n+o/2,y:Math.min(r,a),y1:Math.max(r,a),drawStrokeWhenZeroWH:!0},d}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}St.type="candlestick";class Mt extends e.ACustomAnimate{constructor(t,e,i,n,o){super(t,e,i,n,o)}onBind(){super.onBind();const t=this.target.getFinalAttribute();t&&this.target.setAttributes(t);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(t=>{const i=t.getFinalAttribute(),{x:n,y:o,open:r,high:a,low:s,close:l}=i,d={from:{x:n,y:o},to:{x:n,y:o}};return e.isValidNumber(r)&&e.isValidNumber(l)&&(r>l?(d.from.open=s,d.to.open=r,d.from.close=s,d.to.close=l,e.isValidNumber(a)&&(d.from.high=s,d.to.high=a)):(d.from.open=a,d.to.open=r,d.from.close=a,d.to.close=l,e.isValidNumber(s)&&(d.from.low=a,d.to.low=s))),d})(this.target,this.params,this.params.options)}onUpdate(t,e,i){const n=this.target.attribute;this.propKeys.forEach((t=>{n[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(n)}}class wt extends e.ACustomAnimate{constructor(t,e,i,n,o){super(t,e,i,n,o)}onBind(){var t;(null===(t=this.params)||void 0===t?void 0:t.diffAttrs)&&this.target.setAttributes(this.params.diffAttrs);const{from:e,to:i}=this.computeAttribute();this.propKeys=Object.keys(i).filter((t=>null!=i[t])),this.animate.reSyncProps(),this.from=e,this.to=i,this.target.setAttributes(this.from)}computeAttribute(){return(t=>{const i=t.getFinalAttribute(),{x:n,y:o,open:r,high:a,low:s,close:l}=i,d={from:{x:n,y:o},to:{x:n,y:o}};return e.isValidNumber(r)&&e.isValidNumber(l)&&(r>l?(d.from.open=r,d.to.open=s,d.from.close=l,d.to.close=s,e.isValidNumber(a)&&(d.from.high=a,d.to.high=s)):(d.from.open=r,d.to.open=a,d.from.close=l,d.to.close=a,e.isValidNumber(s)&&(d.from.low=s,d.to.low=a))),d})(this.target,this.params,this.params.options)}onUpdate(t,e,i){const n=this.target.attribute;this.propKeys.forEach((t=>{n[t]=this.from[t]+(this.to[t]-this.from[t])*e})),this.target.setAttributes(n)}}const At="candlestick";var Ct,Lt;!function(t){t.OPEN="open",t.HIGH="high",t.LOW="low",t.CLOSE="close",t.SERIES_FIELD="seriesField"}(Ct||(Ct={})),function(t){t.candlestick="candlestick"}(Lt||(Lt={}));const Ft=Object.assign(Object.assign({},e.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class Bt extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=t=>e=>{switch(t){case Ct.OPEN:return this.series.getOpenField();case Ct.HIGH:return this.series.getHighField();case Ct.LOW:return this.series.getLowField();case Ct.CLOSE:return this.series.getCloseField();case Ct.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{switch(t){case Ct.OPEN:return e[this.series.getOpenField()];case Ct.HIGH:return e[this.series.getHighField()];case Ct.LOW:return e[this.series.getLowField()];case Ct.CLOSE:return e[this.series.getCloseField()];case Ct.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>this.series.getMarkInName("candlestick").getAttribute("stroke",t)}getDefaultContentList(t){return[{key:this.getContentKey(Ct.OPEN),value:this.getContentValue(Ct.OPEN)},{key:this.getContentKey(Ct.HIGH),value:this.getContentValue(Ct.HIGH)},{key:this.getContentKey(Ct.LOW),value:this.getContentValue(Ct.LOW)},{key:this.getContentKey(Ct.CLOSE),value:this.getContentValue(Ct.CLOSE)},{key:this.getContentKey(Ct.SERIES_FIELD),value:this.getContentValue(Ct.SERIES_FIELD)}]}}const Ot={rising:{style:{boxFill:"#FF0000",stroke:"#FF0000"}},falling:{style:{boxFill:"#00AA00",stroke:"#00AA00"}},doji:{style:{boxFill:"#000000",stroke:"#000000"}},candlestick:{style:{lineWidth:1}}};class Tt extends e.CartesianSeries{constructor(){super(...arguments),this.type=At,this._mergedStyles={rising:{},falling:{},doji:{}}}getOpenField(){return this._openField}getHighField(){return this._highField}getLowField(){return this._lowField}getCloseField(){return this._closeField}getBoxFill(){return this._boxFill}getStrokeColor(){return this._strokeColor}setAttrFromSpec(){var t,e,i,n,o,r,a,s;super.setAttrFromSpec();const l=this._spec,d=null!==(e=null===(t=l.candlestick)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._openField=l.openField,this._highField=l.highField,this._lowField=l.lowField,this._closeField=l.closeField,this._boxWidth=d.boxWidth,this._boxFill=d.boxFill,this._strokeColor=d.strokeColor,this._buildMergedStyles(d,null!==(n=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==n?n:{},null!==(r=null===(o=l.falling)||void 0===o?void 0:o.style)&&void 0!==r?r:{},null!==(s=null===(a=l.doji)||void 0===a?void 0:a.style)&&void 0!==s?s:{})}initMark(){this._candlestickMark=this._createMark(Tt.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var t;const i=this._candlestickMark;if(i){const n={fill:t=>this.mergeStyle(t).boxFill,stroke:t=>this.mergeStyle(t).stroke,lineWidth:t=>this.mergeStyle(t).lineWidth,boxWidth:null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth.bind(this),x:this.dataToPositionX.bind(this)};i.setGlyphConfig({}),this.setMarkStyle(i,n,e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}initCandlestickMarkStyle(){var t;const i=this._candlestickMark,n=this._yAxisHelper;if(i&&n){const{dataToPosition:o}=n,r=null===(t=null==n?void 0:n.getScale)||void 0===t?void 0:t.call(n,0);this.setMarkStyle(i,{open:t=>e.valueInScaleRange(o(this.getDatumPositionValues(t,this._openField),{bandPosition:this._bandPosition}),r),high:t=>e.valueInScaleRange(o(this.getDatumPositionValues(t,this._highField),{bandPosition:this._bandPosition}),r),low:t=>e.valueInScaleRange(o(this.getDatumPositionValues(t,this._lowField),{bandPosition:this._bandPosition}),r),close:t=>e.valueInScaleRange(o(this.getDatumPositionValues(t,this._closeField),{bandPosition:this._bandPosition}),r)},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}}init(t){super.init(t),this.initCandlestickMarkStyle()}_initAnimationSpec(t={}){const i=e.merge({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{i[t]&&"scaleIn"===i[t].type?i[t].type="candlestickScaleIn":i[t]&&"scaleOut"===i[t].type&&(i[t].type="candlestickScaleOut")})),i}initAnimation(){var t;const i=e.getGroupAnimationParams(this);if(this._candlestickMark){const n=this._initAnimationSpec(null===(t=e.Factory.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),o=this._initAnimationSpec(e.userAnimationConfig(At,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(e.animationConfig(n,o,i))}}initTooltip(){this._tooltipHelper=new Bt(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(t,i,n,o){this._mergedStyles.rising=e.merge({},t,i),this._mergedStyles.falling=e.merge({},t,n),this._mergedStyles.doji=e.merge({},t,o)}mergeStyle(t){const e=this.getDatumPositionValues(t,this._openField)[0],i=this.getDatumPositionValues(t,this._closeField)[0];return e<i?this._mergedStyles.rising:e>i?this._mergedStyles.falling:this._mergedStyles.doji}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t=this._xAxisHelper,e=this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(){super.onLayoutEnd(),this._autoBoxWidth=null}getActiveMarks(){return[this._candlestickMark]}}Tt.type=At,Tt.builtInTheme={candlestick:Ot},Tt.mark=Ft;const It=()=>{e.registerGlyphMark(),e.registerLine(),e.registerRect(),e.Factory.registerGraphicComponent("line",(t=>e.createLine(t))),e.Factory.registerGraphicComponent("rect",(t=>e.createRect(t))),e.Factory.registerMark(St.type,St),e.registerSymbolMark(),e.registerScaleInOutAnimation(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.AnimateExecutor.registerBuiltInAnimate("candlestickScaleIn",Mt),e.AnimateExecutor.registerBuiltInAnimate("candlestickScaleOut",wt),e.Factory.registerSeries(Tt.type,Tt)};class Dt extends e.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}Dt.type="candlestick",Dt.seriesType=At,Dt.transformerConstructor=_t;function Et(t){t.yField=[t.openField,t.highField,t.lowField,t.closeField]}class jt extends e.CartesianChartSpecTransformer{needAxes(){return!0}transformSpec(t){this.transformRegion(t),void 0===t.tooltip&&(t.tooltip={}),this.transformSeriesSpec(t),this._transformAxisSpec(t),this._transformLayout(t)}transformRegion(t){var e,i;const n=t;n.region=[null!==(e=t.candlestickRegion)&&void 0!==e?e:{}],t.previewSeries&&n.region.push(null!==(i=t.previewRegion)&&void 0!==i?i:{})}transformSeriesSpec(t){var i;t.series=null!==(i=t.series)&&void 0!==i?i:[],t.series.forEach((e=>{this._transformSeriesData(t,e),e.regionIndex=0}));const n=t.series.find((e=>e.id===t.candlestickSeries.id));let o;n?(e.merge(n,t.candlestickSeries),o=n):(t.series.push(t.candlestickSeries),o=t.candlestickSeries),Et(o),this._transformSeriesData(t,o),o.regionIndex=0,t.previewSeries&&e.array(t.previewSeries).forEach((i=>{const n=t.series.find((t=>t.id===i.id));let o;n?(e.merge(n,i),o=n):(t.series.push(i),o=i),o.regionIndex=1,this._transformSeriesData(t,o)}))}_transformSeriesData(t,i){var n;i.data&&(t.data=e.array(null!==(n=t.data)&&void 0!==n?n:[]),e.array(i.data).forEach(((e,n)=>{t.data.push(e),0===n&&(i.dataIndex=t.data.length-1,"id"in e?i.dataId=e.id:"name"in e&&(i.dataId=e.name))})),delete i.data)}_transformAxisSpec(t){super._transformAxisSpec(t),t.previewSeries&&(t.previewAxes||(t.previewAxes={type:"linear",orient:"left",visible:!1}),t.previewAxes.regionIndex=[1],t.axes.push(t.previewAxes),t.axes.forEach((e=>{e!==t.previewAxes&&("left"!==e.orient&&"right"!==e.orient||(e.regionIndex=[0]))})))}_transformDataZoomSpec(t){t.dataZoom&&e.array(t.dataZoom).forEach((t=>{"left"!==t.orient&&"right"!==t.orient||(t.regionIndex=[0])}))}_transformLayout(t){var i,n;const o={type:"grid",col:2,row:6,elements:[],colWidth:[],rowHeight:[]};let r=0,a=0;if(t.title&&!1!==(null===(i=t.title)||void 0===i?void 0:i.visible)&&r++,t.legends){const i=e.array(t.legends)[0];!1!==(null==i?void 0:i.visible)&&("top"===i.orient||"bottom"===i.orient?r++:a++)}if(t.dataZoom&&e.array(t.dataZoom).forEach((t=>{!1!==(null==t?void 0:t.visible)&&("top"===t.orient||"bottom"===t.orient?r++:a++)})),t.axes){const i={top:!1,bottom:!1,left:!1,right:!1,z:!1};e.array(t.axes).forEach((t=>{i[t.orient]||(i[t.orient]=!0,"top"===t.orient||"bottom"===t.orient?r++:a++)}))}r++,a++,t.previewSeries&&r++,o.row=r,o.col=a;const s={top:0,bottom:0,left:0,right:0};if(t.title&&!1!==(null===(n=t.title)||void 0===n?void 0:n.visible)&&this._layoutOrientItem(o,t.title,s,{specKey:"title",index:0},"total"),t.legends){const i=e.array(t.legends)[0];!1!==(null==i?void 0:i.visible)&&this._layoutOrientItem(o,i,s,{specKey:"legends",index:0},"less")}if(t.dataZoom&&e.array(t.dataZoom).forEach(((t,e)=>{!1!==(null==t?void 0:t.visible)&&this._layoutOrientItem(o,t,s,{specKey:"dataZoom",index:e},"one")})),t.axes){const e={left:!1,right:!1};t.axes.forEach(((t,i)=>{"left"!==t.orient&&"right"!==t.orient||e[t.orient]||(e[t.orient]=!0,this._layoutOrientItem(o,t,s,{specKey:"axes",index:i},"one"))}))}const l=this._layoutOrientItem(o,{orient:"top"},s,{specKey:"region",index:0},"one");if(t.previewSeries){const i=this._layoutOrientItem(o,{orient:"bottom"},s,{specKey:"region",index:1},"one"),n=t.axes.findIndex((e=>e===t.previewAxes));if(-1!==n){const t={col:i.col-1,row:i.row,modelKey:"axes",modelIndex:n};o.elements.push(t)}if(t.previewHeight)if("string"==typeof t.previewHeight){if(e.isPercent(t.previewHeight)){const e=t.previewHeight;o.rowHeight.push({index:i.row,size:t=>Number(e.substring(0,e.length-1))*t/100})}}else o.rowHeight.push({index:i.row,size:t.previewHeight})}const d=t.axes.findIndex((t=>"bottom"===t.orient));this._layoutOrientItem(o,t.axes[d],s,{specKey:"axes",index:d},"one"),t.axes.forEach(((e,i)=>{if(e===t.previewAxes)return;const n=o.elements.find((t=>"modelKey"in t&&"axes"===t.modelKey&&t.modelIndex===i));n&&("top"===e.orient||"bottom"===e.orient?n.col=l.col:n.row=l.row)})),e.array(t.dataZoom).forEach(((t,e)=>{const i=o.elements.find((t=>"modelKey"in t&&"dataZoom"===t.modelKey&&t.modelIndex===e));i&&("top"===t.orient||"bottom"===t.orient?i.col=l.col:i.row=l.row)})),t.layout=o}_layoutOrientItem(t,e,i,n,o){var r;const a={modelKey:n.specKey,modelIndex:n.index,col:0,row:0},s=null!==(r=e.orient)&&void 0!==r?r:"top",{span:l,index:d}=this._getLayoutElementCommon(t,i,o,s);return t.elements.push(a),"top"===s?(a.row=i.top,a.rowSpan=1,a.colSpan=l,a.col=d,i.top++):"bottom"===s?(a.row=t.row-i.bottom-1,a.rowSpan=1,a.colSpan=l,a.col=d,i.bottom++):"left"===s?(a.col=i.left,a.colSpan=1,a.rowSpan=l,a.row=d,i.left++):"right"===s&&(a.col=t.col-i.right-1,a.colSpan=1,a.rowSpan=l,a.row=d,i.right++),a}_getLayoutElementCommon(t,e,i,n){return"top"===n||"bottom"===n?{span:"total"===i?t.col:"one"===i?1:t.col-e.left-e.right,index:"total"===i?0:e.left}:{span:"total"===i?t.row:"one"===i?1:t.row-e.top-e.bottom,index:"total"===i?0:e.top}}}class Pt extends e.BaseChart{constructor(){super(...arguments),this.type=kt,this.transformerConstructor=jt}_setModelOption(){this._modelOption.getDimensionInfo=(t,i,n)=>{var o;return[...null!==(o=e.getCartesianDimensionInfo(t,i,n))&&void 0!==o?o:[]]},this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}Pt.type=kt,Pt.transformerConstructor=jt,e.mixin(Pt,e.StackChartMixin);const Rt=t=>({custom:e.RotateBySphereAnimate,customParameters:()=>t,easing:"linear",loop:1/0,duration:6e3});class $t extends e.BaseWordCloudSeries{constructor(){super(...arguments),this.type=G.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(e.BaseWordCloudSeries.mark.word,{groupKey:this._seriesField,isSeriesMark:!0},{support3d:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",e.AttributeLevel.Series)}initAnimation(){var t,i;const n=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(e.animationConfig(null===(i=e.Factory.getAnimationInKey("wordCloud3d"))||void 0===i?void 0:i((()=>{var t;const e=this.getCompiler().getStage(),i=e.width-n.left||0-n.right||0,o=e.height-n.top||0-n.bottom||0,r=Math.max(i,o)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r:r}})),e.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}$t.type=G.wordCloud3d,$t.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const zt=()=>{e.registerTextMark(),e.Factory.registerAnimation("wordCloud3d",(t=>({appear:Rt(t)}))),e.Factory.registerSeries($t.type,$t)},Nt=()=>{zt()};class Vt extends e.BaseWordCloudChartSpecTransformer{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return e.depth_3d=t.depth_3d,e}}class Wt extends e.BaseWordCloudChart{constructor(){super(...arguments),this.transformerConstructor=Vt,this.type="wordCloud3d",this.seriesType=G.wordCloud3d}}Wt.type="wordCloud3d",Wt.seriesType=G.wordCloud3d,Wt.transformerConstructor=Vt;const Ht=()=>{Z(),zt(),e.Factory.registerChart(Wt.type,Wt)},Gt={label:{space:0}};class Ut{setLayout3dBox(t){this.layout3dBox=t}_afterUpdateAttribute(t,i){const n=e.isZAxis(this._orient),o=e.isXAxis(this._orient),r=e.isYAxis(this._orient);let a=0,s=0;if(!i){const t=this.getRegions();let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,o=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:s,y:l}=a.getLayoutStartPoint(),{width:d,height:c}=a.getLayoutRect();e=Math.min(e,s),n=Math.max(n,d+s),i=Math.min(i,l),o=Math.max(o,c+l)}a=Math.abs(o-i),s=Math.abs(n-e)}let l=0,d=0;const{width:c,height:h}=this.getLayoutRect();let u={x:0,y:0};o?(u={x:c,y:0},l=a,d=c):r&&(u={x:0,y:h},l=s,d=h);const g=this.layout3dBox?this.layout3dBox.length:0;if(!n){const e=this.getLabelItems(d);return t.grid={length:l},t.start={x:0,y:0},t.text=this._spec.title.text||this._dataFieldText,t.maxWidth=this._getTitleLimit(o),t.items=e,t.grid={type:"line",start:{x:0,y:0},end:u,items:e[0],depth:g,length:l},t}return((t,i)=>{var n;const o=e.getCombinedSizeOfRegions(t.getRegions()),{width:r}=t.getLayoutRect(),a=r,s=t.layout3dBox?t.layout3dBox.length:0,l=t.layout3dBox?t.layout3dBox.width:0,d={x:s,y:0},c=t.getLabelItems(a),h={start:{x:0,y:0},end:d,title:{text:t._spec.title.text||t._dataFieldText,maxWidth:t._getTitleLimit(!1)},items:c,scale:t._scale.clone()},u=null!==(n=t.directionStr)&&void 0!==n?n:"r2l";let g=[0,0],p=-Math.PI/2,y=0;return"l2r"===u&&(y=t.layout3dBox.length,g=[0,0,0],p=Math.PI/2),h.z=y,h.alpha=p,h.anchor3d=g,i||(h.grid={type:"line",start:{x:0,y:0},end:d,items:c[0],verticalFactor:t._axisStyle.verticalFactor,depth:l,length:i?0:o.height,alpha:p,z:y,anchor3d:g}),h})(this,i)}}const Kt=Object.assign(Object.assign({},q),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Yt extends e.RangeColumnSeries{constructor(){super(...arguments),this.type=G.rangeColumn3d,this._barMarkType="rect3d",this._barName=G.bar3d}}Yt.type=G.rangeColumn3d,Yt.mark=Kt;const Xt=()=>{tt(),e.registerCartesianBandAxis(),e.registerCartesianLinearAxis(),e.Factory.registerSeries(Yt.type,Yt)};class Zt extends e.RangeColumnSeriesSpecTransformer{_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar3d")}}class qt extends e.CartesianChartSpecTransformer{_getDefaultSeriesSpec(t){var e,i;const n=super._getDefaultSeriesSpec(t,["bar3d","barGapInGroup"]);return"horizontal"===t.direction?n.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:n.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],n}}class Jt extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=qt,this.type="rangeColumn3d",this.seriesType=G.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=e.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=e.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=e.getCartesianCrosshairRect}}Jt.type="rangeColumn3d",Jt.seriesType=G.rangeColumn3d,Jt.transformerConstructor=qt;const Qt="pictogram",te="pictogram";var ee;!function(t){t.pictogram="pictogram"}(ee||(ee={}));const ie=Object.assign(Object.assign({},e.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class ne extends e.BaseChartSpecTransformer{_isValidSeries(t){return t===te}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["type","nameField","valueField","svg","pictogram","defaultFillColor"])}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"})),super.transformSeriesSpec(t)}}const oe=new Map;let re;function ae(t,i){oe.has(t)&&e.warn(`svg source key of '${t}' already exists, will be overwritten.`),re||(re=new e.DataSet,e.registerDataSetInstanceParser(re,"svg",e.svgParser));const n=new e.DataView(re);n.parse(i,{type:"svg"}),oe.set(t,n)}function se(t){oe.has(t)?oe.delete(t):e.warn(`map type of '${t}' does not exists.`)}function le(t){return oe.get(t)}class de extends e.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(t){var i,n,o;const r=null!==(i=super._getDefaultSpecFromChart(t))&&void 0!==i?i:{},a=t.svg,s=null===(o=null===(n=oe.get(a))||void 0===n?void 0:n.latestData)||void 0===o?void 0:o.elements;if(s&&s.length){s.map((t=>t.name)).filter((t=>e.isValid(t))).forEach((e=>{t[e]&&(r[e]=t[e])}))}return r}}class ce extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)},this.markTooltipValueCallback=(t,e)=>{const{measureFields:i}=this._seriesCacheInfo;if(i[0]&&t.data)return t.data[i[0]]},this.markTooltipKeyCallback=t=>{var e;return null===(e=t.data)||void 0===e?void 0:e[this.series.getDimensionField()[0]]}}}const he="element-highlight-by-graphic-name";class ue extends e.ElementHighlight{constructor(){super(...arguments),this.type=he,this.handleStart=t=>{if(t&&t.item&&this.isGraphicInMark(t.item)){if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const e=this._parseTargetKey(t);this.start(e)}}},this.handleReset=t=>{t&&t.item&&this.isGraphicInMark(t.item)&&this.reset()}}_filterByName(t){var e;return!!(null===(e=null==t?void 0:t.node)||void 0===e?void 0:e.name)}_parseTargetKey(t){return t.node.name}start(t){if(e.isNil(t))return;const{interaction:i,highlightState:n,blurState:o}=this.options,r=i.getStatedGraphics(this),a=[];this.getMarks().forEach((e=>{var i;null===(i=e.getGraphics())||void 0===i||i.forEach((e=>{e.name===t&&a.push(e)}))})),i.updateStates(this,a,r,n,o),i.setStatedGraphics(this,a)}reset(){const{highlightState:t,blurState:e,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,t,e),i.setStatedGraphics(this,[])}}ue.type=he;const ge="element-select-by-graphic-name";class pe extends e.ElementSelect{constructor(){super(...arguments),this.type=ge}start(t){const e=null==t?void 0:t.name;e&&this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&super.start(t)}))}))}}pe.type=ge;function ye(t){var i;return e.isValid(t)&&"none"!==t&&!(null===(i=t.includes)||void 0===i?void 0:i.call(t,"url"))}const ve=t=>{const e=parseFloat(t.strokeWidth);if(!isNaN(e))return e;const i=t.stroke;return i&&ye(i)?1:0},me=(t,e)=>{var i;const n=null!==(i=t.fill)&&void 0!==i?i:e;return n&&ye(n)?n:void 0},xe=(t,e)=>{var i;const n=null!==(i=t.stroke)&&void 0!==i?i:e;return!(!n||!ye(n))&&n},fe=t=>Object.assign(Object.assign({},t),{x:parseFloat(t.x)||void 0,y:parseFloat(t.y)||void 0,fillStrokeOrder:!1,fill:me(t),lineWidth:ve(t),stroke:xe(t)}),be={group:t=>{const e=fe(t);return Object.assign(Object.assign({},e),{visibleAll:!1!==e.visible})},rule:t=>Object.assign(Object.assign({},fe(t)),{x:parseFloat(t.x1),y:parseFloat(t.y1),x1:parseFloat(t.x2),y1:parseFloat(t.y2)}),rect:t=>Object.assign(Object.assign({},fe(t)),{fill:me(t,"#000"),width:parseFloat(t.width),height:parseFloat(t.height)}),polygon:t=>Object.assign(Object.assign({},fe(t)),{fill:me(t,"#000"),points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),line:t=>Object.assign(Object.assign({},fe(t)),{points:t.points.trim().split(/\s+/).map((t=>{const[e,i]=t.split(",").map(Number);return{x:e,y:i}}))}),path:t=>Object.assign(Object.assign({},fe(t)),{path:t.d,fillStrokeOrder:!1,fill:me(t,"#000")}),arc:t=>{var e;return Object.assign(Object.assign({},fe(t)),{outerRadius:null!==(e=t.r)&&void 0!==e?e:t.ry,x:parseFloat(t.cx),y:parseFloat(t.cy),startAngle:0,endAngle:2*Math.PI,scaleX:parseFloat(t.rx)/parseFloat(t.ry)||1,fill:me(t,"#000")})},text:(t,e)=>{var i,n;return Object.assign(Object.assign({},fe(t)),{text:e,textAlign:null!==(i=t.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(n=t.textAnchor)&&void 0!==n?n:"middle",anchor:[0,0],fill:me(t,"#000")})}},ke=t=>{var i,n;if(!t||!t[0])return{};const{elements:o}=t[0].latestData;if(o&&o.length){o.forEach(((t,i)=>{var n;t[e.DEFAULT_DATA_INDEX]=i,t._uniqueId=`${t.id}-${i}`,t.data=void 0;const{graphicType:o,transform:r}=t,a={visible:"hidden"!==t.attributes.visibility&&"collapse"!==t.attributes.visibility};"text"===t.graphicType?e.merge(a,t._inheritStyle,null===(n=t.parent)||void 0===n?void 0:n._textGroupStyle,t.attributes):"group"!==t.graphicType&&e.merge(a,t._inheritStyle,t.attributes),be[o]?t._finalAttributes=be[o](a,t.value):t._finalAttributes=a,r&&(t._finalAttributes.postMatrix=Object.assign({},r))}));const t=o.filter((t=>"text"===t.tagName));for(let r=0;r<t.length;r++){const a=t[r]._uniqueId,s=o.filter((t=>{let e=!1,i=t.parent;for(;i;){if(i._uniqueId===a){e=!0;break}i=i.parent}return e}));if(s&&s.length){const o=null!==(n=null===(i=t[r]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==n?n:0;let a=o;for(let t=0;t<s.length;t++){const i=s[t];if("group"===i.graphicType)a=o;else if(i.value&&void 0===i.parent._textGroupStyle.x){const n=s.slice(0,t).reverse().find((t=>"text"===t.graphicType&&t.value));if(n){a+=e.measureText(n.value,n._finalAttributes).width}i._finalAttributes.x=a}}}}}return o};class _e extends e.GeoSeries{constructor(){super(...arguments),this.type=te,this._idToMark=new Map}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.svg=this._spec.svg,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this.svg||null===(t=this._option)||void 0===t||t.onError("svg source is not specified !"),this._parsedSvgResult=null===(e=le(this.svg))||void 0===e?void 0:e.latestData,this._parsedSvgResult||null===(i=this._option)||void 0===i||i.onError(`'${this.svg}' is not registered !`)}getDatumCenter(t){return[Number.NaN,Number.NaN]}getDatumName(t){return t.name||t._nameFromParent}getMarksWithoutRoot(){return this.getMarks().filter((t=>t.name&&!t.name.includes("seriesGroup")&&!t.name.includes("root")&&t!==this._pictogramMark))}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getTransformMatrix=this.getRootMatrix.bind(this),this._markAttributeContext.coordToPosition=this.coordToPosition.bind(this),this._markAttributeContext.dataToPosition=this.dataToPosition.bind(this)}_defaultHoverConfig(t){return{type:"element-highlight-by-graphic-name",trigger:t.trigger,triggerOff:"pointerout",blurState:e.STATE_VALUE_ENUM.STATE_HOVER_REVERSE,highlightState:e.STATE_VALUE_ENUM.STATE_HOVER}}_defaultSelectConfig(t){const i="multiple"===t.mode,n=e.isValid(t.triggerOff)?t.triggerOff:i?["empty","self"]:["empty",t.trigger];return{type:"element-select-by-graphic-name",trigger:t.trigger,triggerOff:n,reverseState:e.STATE_VALUE_ENUM.STATE_SELECTED_REVERSE,state:e.STATE_VALUE_ENUM.STATE_SELECTED,isMultiple:i}}initMark(){var t;if(this._pictogramMark=this._createMark(_e.mark.pictogram,{groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0},{morph:e.shouldMarkDoMorph(this._spec,_e.mark.pictogram.name)}),this._pictogramMark){this._pictogramMark.setData(this._mapViewData),this._pictogramMark.setUserId(_e.mark.pictogram.name);for(const i of this._mapViewData.getDataView().latestData){const{graphicType:n,name:o,parent:r,id:a,_nameFromParent:s,_uniqueId:l}=i,d=this._createMark({type:n,name:null!=o?o:s},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(t=this._idToMark.get(null==r?void 0:r._uniqueId))&&void 0!==t?t:this._pictogramMark},{morph:e.shouldMarkDoMorph(this._spec,_e.mark.pictogram.name)});d&&(d.setData(this._mapViewData),d.setUserId(l),this._idToMark.set(l,d),"group"!==d.type&&d.setMarkConfig({graphicName:d.name}),d.setTransform([{type:"filter",callback:t=>t._uniqueId===l}]))}this._initLabelMark()}}_initLabelMark(){if(!0!==this._spec.label.visible)return;const t=this._createMark(_e.mark.label,{isSeriesMark:!1,parent:this._pictogramMark,groupKey:"_uniqueId",skipBeforeLayouted:!0});t&&(this._labelMark=t,this._labelMark.setData(this._mapViewData))}initLabelMarkStyle(){this._labelMark&&this.setMarkStyle(this._labelMark,{visible:t=>!!this._validElement(t),x:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t,!0))||void 0===e?void 0:e.y},text:t=>t[this.nameField],textAlign:"center",textBaseline:"middle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}initMarkStyle(){const{root:t,viewBoxRect:i}=this._parsedSvgResult,n=this._mapViewData.getDataView().latestData;t&&(this.setMarkStyle(this._pictogramMark,be.group(t.attributes),"normal",e.AttributeLevel.Built_In),t.transform&&this.setMarkStyle(this._pictogramMark,{postMatrix:()=>t.transform},"normal",e.AttributeLevel.Built_In),i&&this._pictogramMark.setMarkConfig({clip:!0,clipPath:[e.createRect(Object.assign(Object.assign({},i),{fill:!0}))]}));for(const t of n){const{_uniqueId:i,_finalAttributes:n}=t,o=this._idToMark.get(i),r=this._validElement(t);o&&(this.setMarkStyle(o,{keepStrokeScale:!0},"normal",e.AttributeLevel.Built_In),r?(this.initMarkStyleWithSpec(o,e.merge({},this._spec.pictogram,this._spec[o.name])),this.setMarkStyle(o,n,"normal",e.AttributeLevel.Series),o.setPostProcess("fill",((t,i)=>e.isValid(t)?t:this._spec.defaultFillColor))):(o.setMarkConfig({interactive:!1}),this.setMarkStyle(o,n,"normal",e.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(t){return t.name||t._nameFromParent}initTooltip(){this._tooltipHelper=new ce(this),this.getMarksWithoutRoot().forEach((t=>{t&&t.name&&this._tooltipHelper.activeTriggerSet.mark.add(t)}))}dataToPosition(t,i=!1){if(!t)return null;const n=t[this.nameField];if(!n)return null;const o=this.getMarksWithoutRoot().filter((t=>t.name===n));if(!o||0===o.length)return null;let r=new e.Bounds;i?o.forEach((t=>{r=r.union(t.getGraphics()[0].globalAABBBounds)})):o.forEach((t=>{r=r.union(t.getProduct().AABBBounds)}));const a={x:(r.x1+r.x2)/2,y:(r.y1+r.y2)/2};if(i){const{x:t,y:e}=this.getLayoutStartPoint();a.x-=t,a.y-=e}return a}coordToPosition(t){if(!t)return null;const{x:e,y:i}=t,n=this.getRootMatrix();if(!n)return null;const o={};return n.getInverse().transformPoint({x:e,y:i},o),o}getRootMatrix(){var t;return null===(t=this.getPictogramRootGraphic())||void 0===t?void 0:t.transMatrix}getPictogramRootGraphic(){return this._pictogramMark.getProduct()}initData(){var t,i;super.initData();const n=oe.get(this.svg);n||null===(t=this._option)||void 0===t||t.onError("no valid svg found!");const o=new e.DataView(this._dataSet,{name:`pictogram_${this.id}_data`});e.registerDataSetInstanceTransform(this._dataSet,"pictogram",ke),e.registerDataSetInstanceTransform(this._dataSet,"lookup",e.lookup),o.parse([n],{type:"dataview"}).transform({type:"pictogram"}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"name",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}).transform({type:"lookup",options:{from:()=>this.getViewData().latestData,key:"_nameFromParent",fields:this._nameField,set:(t,e)=>{e&&(t.data=e)}}}),null===(i=this._data)||void 0===i||i.getDataView().target.addListener("change",o.reRunAllTransform),this._mapViewData=new e.CompilableData(this._option,o)}mapViewDataUpdate(){this._mapViewData.updateData()}onLayoutEnd(){var t;super.onLayoutEnd(),null===(t=this._mapViewData)||void 0===t||t.getDataView().reRunAllTransform()}updateSVGSize(){const{width:t,height:e}=this.getLayoutRect(),i=t/2,n=e/2,o=this.getPictogramRootGraphic();if(o){const r=o.AABBBounds,{x1:a,x2:s,y1:l,y2:d}=o.AABBBounds,c=(a+s)/2,h=(l+d)/2,u=t/r.width(),g=e/r.height(),p=Math.min(u,g);o.scale(p,p,{x:c,y:h}),o.translate(i-c,n-h)}}initEvent(){var t;super.initEvent(),null===(t=this._mapViewData.getDataView())||void 0===t||t.target.addListener("change",this.mapViewDataUpdate.bind(this)),this.event.on(e.ChartEvent.afterMarkLayoutEnd,this.updateSVGSize.bind(this))}handleZoom(t){const{scale:i,scaleCenter:n}=t;if(1===i)return;const o=this.getPictogramRootGraphic();o&&(o.attribute.postMatrix||o.setAttributes({postMatrix:new e.Matrix}),o.scale(i,i,n))}handlePan(t){const{delta:i}=t;if(0===i[0]&&0===i[1])return;const n=this.getPictogramRootGraphic();n&&(n.attribute.postMatrix||n.setAttributes({postMatrix:new e.Matrix}),n.translate(i[0],i[1]))}getMarkData(t){var e;return null!==(e=t.data)&&void 0!==e?e:{}}getMeasureField(){return[this.valueField]}getDimensionField(){return[this.nameField]}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({data:{[t]:e}}),shapeType:i})))}release(){this._parsedSvgResult=null,this._idToMark.clear(),this._idToMark=null}}_e.type=te,_e.mark=ie,_e.transformerConstructor=de;const Se=()=>{e.Factory.registerSeries(_e.type,_e),e.Factory.registerImplement("registerSVG",ae),e.Factory.registerImplement("unregisterSVG",se),e.Factory.registerInteractionTrigger(ue.type,ue),e.Factory.registerInteractionTrigger(pe.type,pe)};class Me extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=ne,this.type=Qt,this.seriesType=te}}Me.type=te,Me.seriesType=Qt,Me.transformerConstructor=ne;class we extends e.BaseChartSpecTransformer{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["urlField","nameField","valueField","imageSize","imageSizeRange","ratio","maskShape","imageMask","layoutConfig","image"])}}const Ae="imageCloud",Ce="imageCloud";var Le;!function(t){t.image="image",t.imageMask="imageMask"}(Le||(Le={}));const Fe=Object.assign(Object.assign({},e.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}});class Be extends e.ACustomAnimate{constructor(t,e,i,n,o){var r;super(t,e,i,n,o),this._rotations=null!==(r=null==o?void 0:o.rotation)&&void 0!==r?r:1}onBind(){this._scaleX=this.target.attribute.scaleX,e.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(t,e,i){var n;if(!1===this.valid)return;if(t)return void(i.scaleX=this._scaleX);const o=360*this._rotations*e*Math.PI/180,r=Math.abs(Math.cos(o))*(null!==(n=this._scaleX)&&void 0!==n?n:1);this.target.attribute.scaleX=r,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Oe(t,i){switch(i){case"axialRotate":return[{custom:Be,customParameters:{rotation:1},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration},{channel:{y:{from:(e,i)=>t.height()+i.getFinalAttribute().y},fillOpacity:{from:0,to:1}},easing:"sineInOut"}];case"growIn":return{channel:{scaleX:{from:0,to:1},scaleY:{from:0,to:1},x:{from:()=>t.center().x},y:{from:()=>t.center().y}},duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};case"scaleIn":return{type:"scaleIn",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration};default:return{type:"fadeIn",easing:"linear",duration:e.DEFAULT_ANIMATION_CONFIG.appear.duration}}}class Te extends e.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:n}=this._seriesCacheInfo,o=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(n[0]&&o)return null!==(i=o[n[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&n)return n[i[0]]}}get defaultShapeType(){return"square"}}class Ie extends e.BaseSeries{constructor(){super(...arguments),this.type=Ce}setValueField(t){e.isValid(t)&&(this._valueField=t)}setAttrFromSpec(){super.setAttrFromSpec(),this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._urlField=this._spec.urlField}initMark(){var t;(null===(t=this._spec.imageMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(Fe.imageMask,{dataView:!1,skipBeforeLayouted:!0})),this._imageMark=this._createMark(Fe.image,{key:t=>`${t[e.DEFAULT_DATA_KEY]}-${t.frequency}`,isSeriesMark:!0,skipBeforeLayouted:!0})}initMarkStyle(){this._initImageMarkStyle(),this._initMaskMarkStyle()}_initImageMarkStyle(){var t,i;if(!this._imageMark)return;this._imageMark.setTransform([Object.assign({type:"imagecloud"},this._imageCloudTransformOption())]),this.setMarkStyle(this._imageMark,{x:t=>t.x,y:t=>t.y,width:t=>t.width,height:t=>t.height,visible:t=>t.visible,angle:t=>t.angle,clipConfig:t=>t.clipConfig,image:t=>t[this._urlField],scaleCenter:["50%","50%"]},"normal",e.AttributeLevel.Series);"masked"===(null===(t=this._spec.layoutConfig)||void 0===t?void 0:t.placement)&&(this.setMarkStyle(this._imageMark,{globalCompositeOperation:"source-atop"},"normal",e.AttributeLevel.Series),this.setMarkStyle(this._rootMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,globalCompositeOperation:"destination-in",clip:!0,drawMode:1},"normal",e.AttributeLevel.Series)),"stack"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.layoutMode)&&this.setMarkStyle(this._imageMark,{stroke:"white",lineWidth:2,shadowBlur:6,shadowColor:"grey"},"normal",e.AttributeLevel.Series)}isFillingImage(t){return t._frequency>1}_initMaskMarkStyle(){this._maskMark&&(this._maskMark.setMarkConfig({interactive:!1}),this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height},"normal",e.AttributeLevel.Series))}initTooltip(){this._tooltipHelper=new Te(this),this._imageMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._imageMark)}_imageCloudTransformOption(){var t;return{size:()=>{const{width:t,height:e}=this._region.getLayoutRect();return[t,e]},image:{field:this._urlField},weight:{field:this._valueField},imageConfig:{imageSize:this._spec.imageSize,imageSizeRange:this._spec.imageSizeRange,padding:null===(t=this._spec.image)||void 0===t?void 0:t.padding},ratio:this._spec.ratio,mask:this._spec.maskShape,maskConfig:this._spec.imageMask,layoutConfig:this._spec.layoutConfig,createCanvas:e.vglobal.createCanvas.bind(e.vglobal),createImage:e.createImage,onUpdateMaskCanvas:((t,e)=>{var i;t&&this._maskMark&&this._maskMark.getProduct().getChildren().forEach((e=>{e.setAttribute("background",t)})),e&&"masked"===(null===(i=this._spec.layoutConfig)||void 0===i?void 0:i.placement)&&this._rootMark.getProduct().setAttribute("background",e)}).bind(this),onLayoutFinished:()=>{var t,e;return null===(e=null===(t=this._option.globalInstance.getChart().getOption().performanceHook)||void 0===t?void 0:t.afterWordcloudShapeDraw)||void 0===e?void 0:e.call(t,this._option.globalInstance)}}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.isFillingImage=this.isFillingImage.bind(this)}initAnimation(){[this._imageMark].forEach((t=>{var i,n;if(t){const o=null===(n=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===n?void 0:n.preset,r={center:()=>{const{width:t,height:e}=this._region.getLayoutRect();return{x:t/2,y:e/2}},height:()=>{const{height:t}=this._region.getLayoutRect();return t}};t.setAnimationConfig(e.animationConfig(e.Factory.getAnimationInKey("imageCloud")(r,o),e.userAnimationConfig("image",this._spec,this._markAttributeContext)))}}))}getDimensionField(){var t;return[null!==(t=this._nameField)&&void 0!==t?t:this._spec.urlField]}getMeasureField(){return[this._valueField]}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getActiveMarks(){return[this._imageMark]}getMarkData(t){var e;return null!==(e=null==t?void 0:t.datum)&&void 0!==e?e:t}getGroupFields(){return[]}dataToPosition(t){return null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}valueToPosition(t,e){return null}getStackGroupFields(){return[]}getStackValueField(){return""}}Ie.type=Ce,Ie.mark=Fe;const De=()=>{e.registerImageMark(),e.Factory.registerAnimation("imageCloud",((t,e)=>({appear:Oe(t,e),enter:Oe(t,e),exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),e.Factory.registerSeries(Ie.type,Ie),e.Factory.registerGrammarTransform("imagecloud",{transform:e.imagecloudTransform})};class Ee extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Ee.transformerConstructor,this.type=Ae,this.seriesType=Ce}}Ee.type=Ae,Ee.seriesType=Ce,Ee.transformerConstructor=we;class je extends e.BaseChartSpecTransformer{_getDefaultSeriesSpec(t){return super._getDefaultSeriesSpec(t,["timeField","eventField","seriesField","titleField","subTitleField","iconField","dot","title","subTitle","icon","line","arrow","labelPosition","sortDataByAxis"])}_setDefaultXAxisSpec(t){return{type:"band",orient:"bottom",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_setDefaultYAxisSpec(t){return{type:"band",inverse:!0,orient:"left",label:{visible:!1},tick:{visible:!1},grid:{visible:!1},domainLine:{visible:!1},paddingInner:0,paddingOuter:0}}_transformAxisSpec(t){t.axes||(t.axes=[]);const e={x:!1,y:!1};t.axes.forEach((n=>{const{orient:o}=n;let r=null;"top"!==o&&"bottom"!==o||(e.x=!0,r=this._setDefaultXAxisSpec(t)),"left"!==o&&"right"!==o||(e.y=!0,r=this._setDefaultYAxisSpec(t)),r&&Object.keys(r).forEach((t=>{n[t]=i.isObject(n[t])?i.merge(r[t],n[t]):i.isNil(n[t])?r[t]:n[t]}))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t))}transformSpec(t){var e,i;super.transformSpec(t),this.transformSeriesSpec(t),this._transformAxisSpec(t);const n=null!==(e=t.direction)&&void 0!==e?e:"horizontal";null===(i=t.series)||void 0===i||i.forEach((t=>{"vertical"===n?(t.timeField&&!t.yField&&(t.yField=t.timeField),t.xField||(t.xField=t.seriesField||"__vchart_timeline_dummy__")):(t.timeField&&!t.xField&&(t.xField=t.timeField),t.yField||(t.yField=t.seriesField||"__vchart_timeline_dummy__"))}))}}const Pe="event",Re=Object.assign(Object.assign({},e.baseSeriesMark),{line:{name:"line",type:"line"},dot:{name:"dot",type:"symbol"},icon:{name:"icon",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},arrow:{name:"arrow",type:"path"}});class $e extends e.CartesianSeries{constructor(){super(...arguments),this.type=Pe,this.transformerConstructor=e.BaseSeriesSpecTransformer,this.coordinate="cartesian"}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),this._timeField=this._spec.timeField,this._eventField=this._spec.eventField,this._subTitleField=this._spec.subTitleField,this._iconField=this._spec.iconField,this._labelPosition=this._spec.labelPosition}getDimensionField(){return this._timeField?[this._timeField]:[]}getMeasureField(){const t=[];return this._eventField&&t.push(this._eventField),this._subTitleField&&t.push(this._subTitleField),t}initMark(){this._axisLineMark=this._createMark($e.mark.line,{isSeriesMark:!0,groupKey:this._seriesField}),this._arrowMark=this._createMark($e.mark.arrow,{isSeriesMark:!0}),this._dotMark=this._createMark($e.mark.dot,{isSeriesMark:!0}),this._iconMark=this._createMark($e.mark.icon,{isSeriesMark:!0}),this._titleMark=this._createMark($e.mark.title),this._subTitleMark=this._createMark($e.mark.subTitle)}initTooltip(){super.initTooltip(),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark),this._titleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._titleMark),this._subTitleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._subTitleMark),this._iconMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._iconMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}initMarkStyle(){var t,n,o,r,a,s,l,d,c,h,u;this._axisLineMark&&this.setMarkStyle(this._axisLineMark,{points:this._getAxisPoints.bind(this),visible:this._isFirstDataInGroup.bind(this),stroke:"#c0c3c7",lineWidth:1},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series);const g=this._spec.dot,p="number"==typeof(null===(t=null==g?void 0:g.style)||void 0===t?void 0:t.size)?g.style.size:8,y=this._spec.title,v=null!==(n=null==y?void 0:y.style)&&void 0!==n?n:{},m=this._spec.subTitle,x=null!==(o=null==m?void 0:m.style)&&void 0!==o?o:{},f="number"==typeof v.fontSize?v.fontSize:14,b=p/2+(null!==(r=null==y?void 0:y.offset)&&void 0!==r?r:6);this._dotMark&&this.setMarkStyle(this._dotMark,{x:t=>this._getPoint(t).x,y:t=>this._getPoint(t).y,size:p,fill:null!==(s=null===(a=null==g?void 0:g.style)||void 0===a?void 0:a.fill)&&void 0!==s?s:this.getColorAttribute()},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._arrowMark&&this.setMarkStyle(this._arrowMark,{path:t=>this._getArrowPath(t),fill:null!==(d=null===(l=null==g?void 0:g.style)||void 0===l?void 0:l.fill)&&void 0!==d?d:this.getColorAttribute()},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._titleMark&&this.setMarkStyle(this._titleMark,Object.assign(Object.assign({fontSize:14},v),{x:t=>this._getTitlePosition(t,b).x,y:t=>this._getTitlePosition(t,b).y,textAlign:t=>this._getLabelTextAlign(t),textBaseline:t=>this._getLabelTextBaseline(t,!0),text:t=>this._getDatumString(t,this._eventField)}),e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series),this._subTitleMark&&this.setMarkStyle(this._subTitleMark,Object.assign(Object.assign({},x),{x:t=>this._getSubTitlePosition(t,b,f).x,y:t=>this._getSubTitlePosition(t,b,f).y,textAlign:t=>this._getLabelTextAlign(t),textBaseline:t=>this._getLabelTextBaseline(t,!1),text:t=>this._getDatumString(t,this._subTitleField)}),e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series);const k=this._spec.icon,_="number"==typeof(null===(c=null==k?void 0:k.style)||void 0===c?void 0:c.size)?k.style.size:20,S=(i.isValid(null==k?void 0:k.offset)?k.offset+p/2:b)+_/2;this._iconMark&&this.setMarkStyle(this._iconMark,{x:t=>this._getIconPosition(t,S).x,y:t=>this._getIconPosition(t,S).y,size:_,fill:null!==(u=null===(h=null==k?void 0:k.style)||void 0===h?void 0:h.fill)&&void 0!==u?u:this.getColorAttribute(),shape:t=>this._getDatumString(t,this._iconField)||"circle"},e.STATE_VALUE_ENUM.STATE_NORMAL,e.AttributeLevel.Series)}_getLabelSide(t){const e=this._getViewDataList().indexOf(t),i=this._labelPosition;if("vertical"===this.direction)switch(i){case"left":default:return"primary";case"right":return"secondary";case"left-right":return e%2==0?"primary":"secondary";case"right-left":return e%2==0?"secondary":"primary"}else switch(i){case"top":default:return"primary";case"bottom":return"secondary";case"top-bottom":return e%2==0?"primary":"secondary";case"bottom-top":return e%2==0?"secondary":"primary"}}_getLabelTextAlign(t){if("vertical"===this.direction){return"primary"===this._getLabelSide(t)?"right":"left"}return"center"}_getLabelTextBaseline(t,e){if("vertical"===this.direction)return"middle";return"primary"===this._getLabelSide(t)?"bottom":"top"}_getTitlePosition(t,e){const i=this._getPoint(t),n=this._getLabelSide(t);return"vertical"===this.direction?{x:"primary"===n?i.x-e:i.x+e,y:i.y}:{x:i.x,y:"primary"===n?i.y-e:i.y+e}}_getSubTitlePosition(t,e,i){var n,o,r,a;const s=this._getPoint(t),l=this._getLabelSide(t),d=null!==(o=null===(n=this._spec.title)||void 0===n?void 0:n.subTitleGap)&&void 0!==o?o:4;if("vertical"===this.direction){const t=null!==(a=null===(r=this._spec.title)||void 0===r?void 0:r.style)&&void 0!==a?a:{},n="number"==typeof t.lineHeight?t.lineHeight:1.2*i;return{x:"primary"===l?s.x-e:s.x+e,y:s.y+n+d}}return{x:s.x,y:"primary"===l?s.y-(e+i+d):s.y+(e+i+d)}}_getIconPosition(t,e){const i=this._getPoint(t),n=this._getLabelSide(t);return"vertical"===this.direction?{x:"primary"===n?i.x+e:i.x-e,y:i.y}:{x:i.x,y:"primary"===n?i.y+e:i.y-e}}_getViewDataList(){var t,e;return null!==(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)&&void 0!==e?e:[]}_getPoint(t){if("vertical"===this.direction){return{x:this._getPositionFromAxis(t,this.getXAxisHelper(),this._seriesField),y:this._getPositionFromAxis(t,this.getYAxisHelper(),this._timeField)}}return{x:this._getPositionFromAxis(t,this.getXAxisHelper(),this._timeField),y:this._getPositionFromAxis(t,this.getYAxisHelper(),this._seriesField)}}_getPositionFromAxis(t,e,i){var n,o,r,a,s,l;if(!e)return this._getDefaultPosition(i);if(!i||!(i in t))return this._getDefaultPosition(i);const d=t[i];return"band"!==(null===(o=null===(n=e.getSpec)||void 0===n?void 0:n.call(e))||void 0===o?void 0:o.type)&&e.isContinuous?null!==(l=null===(s=e.valueToPosition)||void 0===s?void 0:s.call(e,d))&&void 0!==l?l:this._getDefaultPosition(i):null!==(a=null===(r=e.dataToPosition)||void 0===r?void 0:r.call(e,[d],{bandPosition:.5}))&&void 0!==a?a:this._getDefaultPosition(i)}onXAxisHelperUpdate(){var t;null===(t=super.onXAxisHelperUpdate)||void 0===t||t.call(this),this.onMarkPositionUpdate()}onYAxisHelperUpdate(){var t;null===(t=super.onYAxisHelperUpdate)||void 0===t||t.call(this),this.onMarkPositionUpdate()}_getDefaultPosition(t){const e=this._region.getLayoutRect();if(!this._seriesField||t===this._seriesField){return"vertical"!==this.direction?.5*e.height:.5*e.width}return 0}_getAxisPoints(t){const e=this._region.getLayoutRect();if("vertical"===this.direction){const i=this._getPositionFromAxis(t,this.getXAxisHelper(),this._seriesField);return[{x:i,y:0},{x:i,y:e.height}]}const i=this._getPositionFromAxis(t,this.getYAxisHelper(),this._seriesField);return[{x:0,y:i},{x:e.width,y:i}]}_isFirstDataInGroup(t){if(!this._seriesField){return 0===this._getViewDataList().indexOf(t)}const e=this._getViewDataList(),i=t[this._seriesField];return t===e.find((t=>this._seriesField&&t[this._seriesField]===i))}_getNextDatum(t){const e=this._getViewDataList(),i=e.indexOf(t);if(-1===i||i===e.length-1)return null;if(!this._seriesField)return e[i+1];const n=t[this._seriesField];for(let t=i+1;t<e.length;t++){const i=e[t];if(i[this._seriesField]===n)return i}return null}_getPreviousDatum(t){const e=this._getViewDataList(),i=e.indexOf(t);if(-1===i||0===i)return null;if(!this._seriesField)return e[i-1];const n=t[this._seriesField];for(let t=i-1;t>=0;t--){const i=e[t];if(i[this._seriesField]===n)return i}return null}_getArrowPath(t){var e,i;const n=this._getPoint(t),o=this._getNextDatum(t),r=this._getPreviousDatum(t),a=null!==(i=null===(e=this._spec.arrow)||void 0===e?void 0:e.thickness)&&void 0!==i?i:16,s=this._region.getLayoutRect();if("vertical"===this.direction){const t=this.getYAxisHelper().isInverse(),e=r?{x:n.x,y:(this._getPoint(r).y+n.y)/2}:{x:n.x,y:t?0:s.height},i=o?{x:n.x,y:(this._getPoint(o).y+n.y)/2}:{x:n.x,y:t?s.height:0},l=t?1:-1,d=a/3,c=a/2;return`M ${e.x-c} ${e.y} L ${e.x} ${e.y+l*d} L ${e.x+c} ${e.y} \n L ${i.x+c} ${i.y-l*d} \n L ${i.x} ${i.y}\n L ${i.x-c} ${i.y-l*d} Z`}const l=this.getXAxisHelper().isInverse(),d=r?{x:(this._getPoint(r).x+n.x)/2,y:n.y}:{x:l?s.width:0,y:n.y},c=o?{x:(this._getPoint(o).x+n.x)/2,y:n.y}:{x:l?0:s.width,y:n.y},h=l?-1:1,u=a/2,g=a/3;return`M ${d.x} ${d.y-u} L ${d.x+h*g} ${d.y} L ${d.x} ${d.y+u} \n L ${c.x-h*g} ${c.y+u} \n L ${c.x} ${c.y} \n L ${c.x-h*g} ${c.y-u} Z`}_getDatumString(t,e){if(!t||!e)return"";const i=t[e];return"string"==typeof i?i:null==i?"":String(i)}valueToPosition(t,e){if(t&&"object"==typeof t)return this.dataToPosition(t);const i={};return this._timeField&&(i[this._timeField]=t),this._eventField&&void 0!==e&&(i[this._eventField]=e),this._getPoint(i)}getActiveMarks(){return[this._axisLineMark,this._dotMark,this._iconMark,this._arrowMark,this._titleMark,this._subTitleMark].filter(Boolean)}}$e.type=Pe,$e.mark=Re,$e.builtInTheme={event:{dot:{style:{size:8}},icon:{visible:!1,style:{size:20}},line:{visible:!0,style:{stroke:"#c0c3c7",lineWidth:1}},title:{visible:!0,offset:6,subTitleGap:4,style:{fontSize:14}},subTitle:{visible:!0,style:{fontSize:12}},arrow:{visible:!1,thickness:16}}},$e.transformerConstructor=e.BaseSeriesSpecTransformer;const ze=()=>{e.registerSymbolMark(),e.registerTextMark(),e.registerLineMark(),e.registerPathMark(),e.Factory.registerSeries($e.type,$e)};class Ne extends e.BaseChart{constructor(){super(...arguments),this.transformerConstructor=je,this.type="timeline",this.seriesType="event"}}Ne.type="timeline",Ne.seriesType="event",Ne.transformerConstructor=je;const Ve=t=>{var e,i,n,o,r,a,s,l,d;if(Array.isArray(t))return{top:null!==(e=t[0])&&void 0!==e?e:0,right:null!==(i=t[1])&&void 0!==i?i:0,bottom:null!==(n=t[2])&&void 0!==n?n:0,left:null!==(o=t[3])&&void 0!==o?o:0};if(t&&"object"==typeof t&&"top"in t)return{top:null!==(r=t.top)&&void 0!==r?r:0,right:null!==(a=t.right)&&void 0!==a?a:0,bottom:null!==(s=t.bottom)&&void 0!==s?s:0,left:null!==(l=t.left)&&void 0!==l?l:0};const c=null!==(d=t)&&void 0!==d?d:24;return{top:c,right:c,bottom:c,left:c}},We=t=>t?"string"==typeof t?{type:t}:t:{type:"landscape"},He=(t,e)=>{var i,n,o;const r=We(e.layout),a=Ve(null!==(i=r.padding)&&void 0!==i?i:e.padding),s=null!==(n=e.gap)&&void 0!==n?n:40,l=null!==(o=e.lineDistance)&&void 0!==o?o:8,d=Ge(t,r,e.viewBox,e.block,a,s),c="clock"===r.type?Xe(e.viewBox,e.block,a,r):void 0;return{blocks:d,links:Qe(d,l),circleGuide:c}},Ge=(t,e,i,n,o,r)=>{const a=t.length;if(!a)return[];const s={x:o.left,y:o.top,width:Math.max(i.width-o.left-o.right,n.width),height:Math.max(i.height-o.top-o.bottom,n.height)},l={x:s.x+s.width/2,y:s.y+s.height/2};let d;switch(e.type){case"portrait":d=Ue(a,l.x,s.y+n.height/2,l.x,s.y+s.height-n.height/2);break;case"ladder":{const t="down"===e.direction,i=s.x+n.width/2,o=s.x+s.width-n.width/2,r=s.y+n.height/2,l=s.y+s.height-n.height/2,c=t?r:l,h=t?l:r,u=Ue(a,i,c,o,h),g=o-i,p=h-c,y=Math.hypot(g,p)||1,v=-p/y,m=g/y,x=1.2*Math.max(80,Math.min(240,Math.round(.42*s.height)));d=u.map(((t,e)=>{const i=e%2==0?1:-1;return{x:t.x+v*x*i,y:t.y+m*x*i}}));break}case"spiral":d=Ke(a,s,n,r);break;case"clock":d=Ye(a,i,n,o,e);break;case"arc":{const t="down"===e.direction,[i,o]=t?[20,160]:[200,340];d=Ze(a,s,n,e,i,o);break}case"wing":{const t="right"===e.direction?"right":"left",[i,o]="right"===t?[110,250]:[-70,70];d=Ze(a,s,n,e,i,o);break}default:d=Ue(a,s.x+n.width/2,l.y,s.x+s.width-n.width/2,l.y)}return d.map(((e,i)=>{var o,r;return{id:null!==(r=null===(o=t[i])||void 0===o?void 0:o.id)&&void 0!==r?r:i,index:i,datum:t[i],width:n.width,height:n.height,x:e.x-n.width/2,y:e.y-n.height/2,center:e}}))},Ue=(t,e,i,n,o)=>1===t?[{x:(e+n)/2,y:(i+o)/2}]:Array.from({length:t},((r,a)=>{const s=a/(t-1);return{x:e+(n-e)*s,y:i+(o-i)*s}})),Ke=(t,e,i,n)=>{const o=e.x+e.width/2,r=Math.min(Math.max(.65*i.width+n/2,0),Math.max((e.width-i.width)/2,0));return Ue(t,o,e.y+i.height/2,o,e.y+e.height-i.height/2).map(((t,e)=>({x:t.x+(e%2==0?-r:r),y:t.y})))},Ye=(t,e,i,n,o)=>{var r;const a=Xe(e,i,n,o),s=null!==(r=o.startAngle)&&void 0!==r?r:-90;if(1===t){const t=Je(s);return[{x:a.center.x+Math.cos(t)*a.radius,y:a.center.y+Math.sin(t)*a.radius}]}return Array.from({length:t},((e,i)=>{const n=Je(s+360*i/t);return{x:a.center.x+Math.cos(n)*a.radius,y:a.center.y+Math.sin(n)*a.radius}}))},Xe=(t,e,i,n)=>{var o;const r=Math.max(t.width-i.left-i.right,1),a=Math.max(t.height-i.top-i.bottom,1),s={x:i.left+r/2,y:i.top+a/2},l=null!==(o=n.radiusRatio)&&void 0!==o?o:.7,d=Math.max(Math.min(r-e.width,a-e.height)/2,1);return{center:s,radius:Math.max(1,d*l)}},Ze=(t,e,i,n,o,r,a=.88)=>{var s,l,d,c,h;const u=null!==(l=null!==(s=n.startAngle)&&void 0!==s?s:o)&&void 0!==l?l:-90,g=null!==(c=null!==(d=n.endAngle)&&void 0!==d?d:r)&&void 0!==c?c:270,p=null!==(h=n.radiusRatio)&&void 0!==h?h:a,y=Math.max((e.width-i.width)/2,1)*p,v=Math.max((e.height-i.height)/2,1)*p,m=e.x+e.width/2,x=e.y+e.height/2;if(1===t){const t=Je((u+g)/2);return[{x:m+Math.cos(t)*y,y:x+Math.sin(t)*v}]}return Array.from({length:t},((e,i)=>{const n=i/(t-1),o=Je(u+qe(u,g)*n);return{x:m+Math.cos(o)*y,y:x+Math.sin(o)*v}}))},qe=(t,e)=>{const i=e-t;return Math.abs(i)>=360?360:i},Je=t=>t/180*Math.PI,Qe=(t,e)=>{const i=[];for(let n=0;n<t.length-1;n++){const o=t[n],r=t[n+1],a=ti(o,r.center,e),s=ti(r,o.center,e);i.push({from:o,to:r,start:a,end:s,points:[a,s]})}return i},ti=(t,e,i)=>{const n=e.x-t.center.x,o=e.y-t.center.y;if(0===n&&0===o)return{x:t.center.x,y:t.center.y};const r=0===n?Number.POSITIVE_INFINITY:t.width/2/Math.abs(n),a=0===o?Number.POSITIVE_INFINITY:t.height/2/Math.abs(o),s=Math.min(r,a),l=Math.sqrt(n*n+o*o)||1;return{x:t.center.x+n*s+n/l*i,y:t.center.y+o*s+o/l*i}},ei=400,ii=t=>"landscape"===We(t.layout).type,ni=t=>"portrait"===We(t.layout).type,oi=t=>"clock"===We(t.layout).type,ri=t=>"arc"===We(t.layout).type,ai=t=>"wing"===We(t.layout).type,si=t=>"ladder"===We(t.layout).type,li=t=>{var e;return null!==(e=t.themeColor)&&void 0!==e?e:"#e8543d"},di=(t,e)=>{const i=Math.max(0,Math.min(1,e));if(!t)return`rgba(0, 0, 0, ${i})`;const n=t.trim();if(n.startsWith("#")){let t=n.slice(1);if(3!==t.length&&4!==t.length||(t=t.split("").map((t=>t+t)).join("")),6===t.length||8===t.length){return`rgba(${parseInt(t.slice(0,2),16)}, ${parseInt(t.slice(2,4),16)}, ${parseInt(t.slice(4,6),16)}, ${i})`}}const o=n.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return o?`rgba(${o[1]}, ${o[2]}, ${o[3]}, ${i})`:n},ci=(t,e)=>{var i,n,o,r,a,s,l;if(null===(i=t.block)||void 0===i?void 0:i.width)return t.block.width;const d=null!==(o=null===(n=t.block)||void 0===n?void 0:n.widthRatio)&&void 0!==o?o:.24,c=null!==(a=null===(r=t.block)||void 0===r?void 0:r.minWidth)&&void 0!==a?a:180,h=null!==(l=null===(s=t.block)||void 0===s?void 0:s.maxWidth)&&void 0!==l?l:Math.max(c,320);return Math.max(c,Math.min(h,Math.round(e*d)))},hi=(t,e)=>{var i,n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b,k;const _=null===(o=null===(n=null===(i=t.chart)||void 0===i?void 0:i.getAllRegions)||void 0===n?void 0:n.call(i))||void 0===o?void 0:o[0],S=null===(r=null==_?void 0:_.getLayoutRect)||void 0===r?void 0:r.call(_),M=null===(a=null==_?void 0:_.getLayoutStartPoint)||void 0===a?void 0:a.call(_),w=null===(l=null===(s=t.chart)||void 0===s?void 0:s.getLayoutRect)||void 0===l?void 0:l.call(s),A=null===(d=t.getLayoutBounds)||void 0===d?void 0:d.call(t);return{width:Math.max(null!==(p=null!==(g=null!==(h=null!==(c=null==S?void 0:S.width)&&void 0!==c?c:null==w?void 0:w.width)&&void 0!==h?h:null===(u=null==A?void 0:A.width)||void 0===u?void 0:u.call(A))&&void 0!==g?g:null==e?void 0:e.width)&&void 0!==p?p:0,1),height:Math.max(null!==(f=null!==(x=null!==(v=null!==(y=null==S?void 0:S.height)&&void 0!==y?y:null==w?void 0:w.height)&&void 0!==v?v:null===(m=null==A?void 0:A.height)||void 0===m?void 0:m.call(A))&&void 0!==x?x:null==e?void 0:e.height)&&void 0!==f?f:0,1),startX:null!==(b=null==M?void 0:M.x)&&void 0!==b?b:0,startY:null!==(k=null==M?void 0:M.y)&&void 0!==k?k:0}},ui=(t,e)=>{var i,n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x;const{width:f,height:b,startX:k,startY:_}=hi(e,t);let S=ci(t,f),M=null!==(n=null===(i=t.block)||void 0===i?void 0:i.height)&&void 0!==n?n:ii(t)?320:ei;if(ii(t)&&!(null===(o=t.block)||void 0===o?void 0:o.width)){const e=null!==(a=null===(r=t.data)||void 0===r?void 0:r.length)&&void 0!==a?a:0;if(e>0){const i=Ve(null===(s=t.block)||void 0===s?void 0:s.padding),n=80,o=(Math.max(f-i.left-i.right,1)-40*Math.max(e-1,0))/e;S=Math.max(n,Math.floor(o))}}if(ni(t)&&!(null===(l=t.block)||void 0===l?void 0:l.height)){const e=null!==(c=null===(d=t.data)||void 0===d?void 0:d.length)&&void 0!==c?c:0;if(e>0){const i=Ve(null!==(u=null===(h=t.layout)||void 0===h?void 0:h.padding)&&void 0!==u?u:null===(g=t.block)||void 0===g?void 0:g.padding),n=Math.max(b-i.top-i.bottom,1);M=Math.max(120,Math.floor(n/(e+1)))}}const w=He(null!==(p=t.data)&&void 0!==p?p:[],{layout:t.layout,viewBox:{width:f,height:b},block:{width:S,height:M},gap:null!==(v=null===(y=t.block)||void 0===y?void 0:y.gap)&&void 0!==v?v:36,padding:null===(m=t.block)||void 0===m?void 0:m.padding,lineDistance:null===(x=t.line)||void 0===x?void 0:x.distance});return k||_?Object.assign(Object.assign({},w),{blocks:w.blocks.map((t=>Object.assign(Object.assign({},t),{x:t.x+k,y:t.y+_,center:{x:t.center.x+k,y:t.center.y+_}}))),links:w.links.map((t=>Object.assign(Object.assign({},t),{start:{x:t.start.x+k,y:t.start.y+_},end:{x:t.end.x+k,y:t.end.y+_},points:t.points.map((t=>({x:t.x+k,y:t.y+_})))})))}):w},gi=(t,e,i)=>{var n,o,r,a,s,l,d,c,h,u,g,p,y;const v=Number(null!==(a=null!==(n=null==i?void 0:i.fontSize)&&void 0!==n?n:null===(r=null===(o=e.content)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:18),m=Number(null!==(c=null!==(s=null==i?void 0:i.lineHeight)&&void 0!==s?s:null===(d=null===(l=e.content)||void 0===l?void 0:l.style)||void 0===d?void 0:d.lineHeight)&&void 0!==c?c:26),x=null!==(p=null!==(h=null==i?void 0:i.fill)&&void 0!==h?h:null===(g=null===(u=e.content)||void 0===u?void 0:u.style)||void 0===g?void 0:g.fill)&&void 0!==p?p:"#596173",f=null!==(y=null==i?void 0:i.align)&&void 0!==y?y:"left";return{type:"rich",text:t.reduce(((e,i,n)=>{const o=n===t.length-1?"":"\n";return e.push({text:`${i}${o}`,fontSize:v,lineHeight:m,fill:x,align:f}),e}),[])}},pi=t=>{if(!t)return{};return y(t,["width","height","position","gap"])},yi=(t,e,i,n,o,r,a,s)=>{if(!s)return{x:n.left,y:n.top,width:0,height:0};switch(t){case"left":return{x:n.left,y:(i-r)/2,width:o,height:r};case"right":return{x:e-n.right-o,y:(i-r)/2,width:o,height:r};case"bottom":return{x:(e-o)/2,y:i-n.bottom-r,width:o,height:r};default:return{x:(e-o)/2,y:n.top,width:o,height:r}}},vi=(t,e,i,n,o,r,a,s)=>{if(!s)return{x:n.left,y:n.top,width:e-n.left-n.right,height:i-n.top-n.bottom};switch(t){case"left":return{x:n.left+o+a,y:n.top,width:e-n.left-n.right-o-a,height:i-n.top-n.bottom};case"right":return{x:n.left,y:n.top,width:e-n.left-n.right-o-a,height:i-n.top-n.bottom};case"bottom":return{x:n.left,y:n.top,width:e-n.left-n.right,height:i-n.top-n.bottom-r-a};default:return{x:n.left,y:n.top+r+a,width:e-n.left-n.right,height:i-n.top-n.bottom-r-a}}},mi=.6,xi=.9,fi=.92,bi=[4,4],ki=(t,e)=>{var i,n,o;const{width:r,height:a,startX:s,startY:l}=hi(e),d=Ve(null===(i=t.block)||void 0===i?void 0:i.padding),c=Math.max(r-d.left-d.right,1),h=Math.max(a-d.top-d.bottom,1),u=s+d.left+c/2,g=l+d.top+h/2,p=(c/2-280)/fi,y=(h/2-92)/fi,v=Math.max(Math.min(p,y),1),m=null!==(o=null===(n=t.data)||void 0===n?void 0:n.length)&&void 0!==o?o:0;return{cx:u,cy:g,R:v,count:m,step:m>0?2*Math.PI/m:0}},_i=(t,e)=>-Math.PI/2+t.step*(e+.5),Si=(t,e,i,n)=>({x:t+Math.cos(n)*i,y:e+Math.sin(n)*i}),Mi=(t,e,i)=>{const n=ki(t,e),o=_i(n,i),r=.68*n.R;return Object.assign(Object.assign({},Si(n.cx,n.cy,r,o)),{diameter:.32*n.R,angle:o})},wi=(t,e,i)=>{var n;const o=ki(t,e),{width:r,startX:a}=hi(e),s=Ve(null===(n=t.block)||void 0===n?void 0:n.padding),l=_i(o,i),d=(t=>Math.cos(t)<0)(l),c=o.R*fi,h=Si(o.cx,o.cy,c,l),u=a+s.left,g=a+r-s.right,p=d?Math.min(Math.max(h.x-u,80),280):Math.min(Math.max(g-h.x,80),280);return{x:h.x,y:h.y,width:p,onLeft:d,anchorY:h.y}},Ai=(t,i,n)=>{var o,r,a;const s=!!i.image,l=li(t),d=Array.isArray(i.content)?i.content:i.content?[i.content]:[],c=[{type:"path",name:`storyline-clock-lead-${n}`,interactive:!1,style:{path:(e,i)=>{const{start:o,end:r}=((t,e,i)=>{const n=ki(t,e),o=_i(n,i),r=.32*n.R/2;return{start:Si(n.cx,n.cy,.68*n.R+r+6,o),end:Si(n.cx,n.cy,n.R*fi-8,o)}})(t,i,n);return`M ${o.x.toFixed(2)} ${o.y.toFixed(2)} L ${r.x.toFixed(2)} ${r.y.toFixed(2)}`},stroke:di(l,.7),lineWidth:1,lineDash:[3,3],fill:"transparent",fillOpacity:0}},s?{type:"image",name:`storyline-clock-dot-${n}`,interactive:!1,style:{x:(e,i)=>{const o=Mi(t,i,n);return o.x-o.diameter/2},y:(e,i)=>{const o=Mi(t,i,n);return o.y-o.diameter/2},width:(e,i)=>Mi(t,i,n).diameter,height:(e,i)=>Mi(t,i,n).diameter,image:i.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center",cornerRadius:(e,i)=>Mi(t,i,n).diameter/2}}:{type:"symbol",name:`storyline-clock-dot-${n}`,interactive:!1,style:{x:(e,i)=>Mi(t,i,n).x,y:(e,i)=>Mi(t,i,n).y,size:(e,i)=>Mi(t,i,n).diameter,symbolType:"circle",fill:l,stroke:"#ffffff",lineWidth:1.5}},i.title?Object.assign(Object.assign({type:"text",name:`storyline-clock-title-${n}`,interactive:!1},t.title),{style:Object.assign({x:(e,i)=>wi(t,i,n).x,y:(e,i)=>wi(t,i,n).anchorY-28,text:i.title,maxLineWidth:(e,i)=>wi(t,i,n).width,fontSize:22,lineHeight:28,fontWeight:"bold",fill:l,stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:(e,i)=>wi(t,i,n).onLeft?"right":"left",textBaseline:"top"},null===(o=t.title)||void 0===o?void 0:o.style)}):null,d.length?Object.assign(Object.assign({type:"text",name:`storyline-clock-content-${n}`,interactive:!1},t.content),{textType:"rich",style:Object.assign({x:(e,i)=>wi(t,i,n).x,y:(e,i)=>wi(t,i,n).anchorY+4,width:(e,i)=>wi(t,i,n).width,maxLineWidth:(e,i)=>wi(t,i,n).width,text:gi(d,t),fontSize:16,lineHeight:22,fill:"#3a3f4d",textAlign:(e,i)=>wi(t,i,n).onLeft?"right":"left",textBaseline:"top",wordBreak:"break-word"},null===(r=t.content)||void 0===r?void 0:r.style)}):null];return{type:"group",id:`storyline-block-${null!==(a=i.id)&&void 0!==a?a:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,children:c.filter(Boolean)}},Ci=(t,e,i)=>{var n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b,k,_,S,M,w,A,C,L;const F=ui(t,e).blocks[i],B=Ve(null!==(o=null===(n=t.block)||void 0===n?void 0:n.padding)&&void 0!==o?o:12),O=null!==(a=null===(r=t.image)||void 0===r?void 0:r.position)&&void 0!==a?a:"top",T=null!==(l=null===(s=t.image)||void 0===s?void 0:s.width)&&void 0!==l?l:48,I=null!==(c=null===(d=t.image)||void 0===d?void 0:d.height)&&void 0!==c?c:48,D=null!==(u=null===(h=t.image)||void 0===h?void 0:h.gap)&&void 0!==u?u:10,E=!!(null===(p=null===(g=t.data)||void 0===g?void 0:g[i])||void 0===p?void 0:p.image),j=Number(null!==(m=null===(v=null===(y=t.title)||void 0===y?void 0:y.style)||void 0===v?void 0:v.fontSize)&&void 0!==m?m:18),P=Number(null!==(b=null===(f=null===(x=t.title)||void 0===x?void 0:x.style)||void 0===f?void 0:f.lineHeight)&&void 0!==b?b:Math.round(1.35*j)),R=(null===(_=null===(k=t.data)||void 0===k?void 0:k[i])||void 0===_?void 0:_.title)?P:0,$=null!==(S=null==F?void 0:F.width)&&void 0!==S?S:ci(t,0),z=null!==(A=null!==(M=null==F?void 0:F.height)&&void 0!==M?M:null===(w=t.block)||void 0===w?void 0:w.height)&&void 0!==A?A:ei,N=yi(O,$,z,B,T,I,0,E),V=vi(O,$,z,B,T,I,D,E),W=(null===(L=null===(C=t.data)||void 0===C?void 0:C[i])||void 0===L?void 0:L.title)?8:0;return{block:{width:$,height:z},imageBox:N,textBox:V,contentBox:{y:V.y+R+W,height:Math.max(0,V.height-R-W)}}},Li=(t,e,i,n)=>{const o=t[0],r=t[t.length-1];if(!o||!r)return"";let a;if("curve"===e){const t=r.x-o.x,e=r.y-o.y,i=Math.max(Math.min(.22*Math.sqrt(t*t+e*e),80),24);a=`M ${o.x} ${o.y} C ${o.x+t/2} ${o.y-i} ${r.x-t/2} ${r.y+i} ${r.x} ${r.y}`}else if("polyline"===e){const t={x:(o.x+r.x)/2,y:(o.y+r.y)/2};a=`M ${o.x} ${o.y} L ${t.x} ${o.y} L ${t.x} ${r.y} L ${r.x} ${r.y}`}else a=`M ${o.x} ${o.y} L ${r.x} ${r.y}`;return i?`${a} ${Fi(o,r,n)}`:a},Fi=(t,e,i)=>{const n=Math.atan2(e.y-t.y,e.x-t.x),o=e.x-Math.cos(n-Math.PI/6)*i,r=e.y-Math.sin(n-Math.PI/6)*i,a=e.x-Math.cos(n+Math.PI/6)*i,s=e.y-Math.sin(n+Math.PI/6)*i;return`M ${o} ${r} L ${e.x} ${e.y} L ${a} ${s}`},Bi=(t,e,i)=>{var n,o,r,a;const s=ui(t,e).blocks[i];if(!s)return null;return{x:null!==(o=null===(n=s.center)||void 0===n?void 0:n.x)&&void 0!==o?o:s.x+s.width/2,y:(null!==(a=null===(r=s.center)||void 0===r?void 0:r.y)&&void 0!==a?a:s.y+s.height/2)+(i%2==0?-1:1)*s.height*.1}},Oi=(t,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b;const k=!!i.image,_=Array.isArray(i.content)?i.content:i.content?[i.content]:[],S=Number(null!==(a=null===(r=null===(o=t.title)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:26),M=Number(null!==(d=null===(l=null===(s=t.title)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:Math.round(1.35*S)),w=e=>{var i,o,r,a;const s=ui(t,e).blocks[n],l=null!==(i=null==s?void 0:s.width)&&void 0!==i?i:ci(t,0),d=null!==(a=null!==(o=null==s?void 0:s.height)&&void 0!==o?o:null===(r=t.block)||void 0===r?void 0:r.height)&&void 0!==a?a:ei;return((t,e,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f;const b=Ve(null!==(r=null===(o=t.block)||void 0===o?void 0:o.padding)&&void 0!==r?r:12),k=Number(null!==(l=null===(s=null===(a=t.title)||void 0===a?void 0:a.style)||void 0===s?void 0:s.fontSize)&&void 0!==l?l:26),_=Number(null!==(h=null===(c=null===(d=t.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.lineHeight)&&void 0!==h?h:Math.max(34,Math.round(1.35*k))),S=Number(null!==(p=null===(g=null===(u=t.content)||void 0===u?void 0:u.style)||void 0===g?void 0:g.fontSize)&&void 0!==p?p:18),M=Number(null!==(m=null===(v=null===(y=t.content)||void 0===y?void 0:y.style)||void 0===v?void 0:v.lineHeight)&&void 0!==m?m:26),w=Math.max(null!==(f=null===(x=t.image)||void 0===x?void 0:x.height)&&void 0!==f?f:Math.round(.42*i),_+b.top+b.bottom),A=t.height,C=A?Math.max(2*M,Math.round(A/4)):10*M,L=_+4+C,F=n%2==0;let B,O,T,I,D,E;const j=0+.2*e,P=j+12,R=Math.max(e-(P-0),0);if(F){const t=0,i=t-64-L;T={x:0,y:t,width:e,height:w},B={x:P,y:i,width:R,height:L},O={x:P,y:i+_+4,width:R,height:C},I={x1:j,y1:t,x2:j,y2:i+_/2},D=i,E=w-D}else{const t=0,i=t+w+64;T={x:0,y:t,width:e,height:w},B={x:P,y:i,width:R,height:L},O={x:P,y:i+_+4,width:R,height:C},I={x1:j,y1:t+w,x2:j,y2:i+L},D=t,E=i+L-t}return{padding:b,titleFontSize:k,titleLineHeight:_,contentFontSize:S,contentLineHeight:M,contentHeight:C,blockWidth:e,imageBox:T,textBox:B,contentBox:O,connector:I,textOnTop:F,groupTop:D,groupHeight:E}})(t,l,d,n)},A=null!==(h=null===(c=t.block)||void 0===c?void 0:c.style)&&void 0!==h?h:{},C=null!==(g=null===(u=t.line)||void 0===u?void 0:u.style)&&void 0!==g?g:{},L=li(t),F=null!==(p=C.stroke)&&void 0!==p?p:L,B=null!==(y=C.lineWidth)&&void 0!==y?y:2,O=null!==(v=C.lineDash)&&void 0!==v?v:[4,4];return{type:"group",id:`storyline-block-${null!==(m=i.id)&&void 0!==m?m:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>{var o;const r=ui(t,i).blocks[n];return null!==(o=null==r?void 0:r.x)&&void 0!==o?o:0},y:(e,i)=>{var o,r,a,s,l,d,c;const h=ui(t,i).blocks[n],u=w(i),g=null!==(r=null===(o=null==h?void 0:h.center)||void 0===o?void 0:o.y)&&void 0!==r?r:(null!==(a=null==h?void 0:h.y)&&void 0!==a?a:0)+(null!==(s=null==h?void 0:h.height)&&void 0!==s?s:0)/2,p=null!==(c=null!==(l=null==h?void 0:h.height)&&void 0!==l?l:null===(d=t.block)||void 0===d?void 0:d.height)&&void 0!==c?c:ei,y=u.textOnTop?.1*p:.1*-p;return g-u.imageBox.height/2+y},width:(t,e)=>w(e).blockWidth,height:(t,e)=>w(e).groupHeight},children:[{type:"rect",name:`storyline-block-image-bg-${n}`,interactive:!1,style:Object.assign({x:(t,e)=>w(e).imageBox.x,y:(t,e)=>w(e).imageBox.y,width:(t,e)=>w(e).imageBox.width,height:(t,e)=>w(e).imageBox.height,cornerRadius:8,fill:"#ffffff",stroke:L,lineWidth:2},A)},k?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1},pi(t.image)),{style:Object.assign({x:(t,e)=>w(e).imageBox.x,y:(t,e)=>w(e).imageBox.y,width:(t,e)=>w(e).imageBox.width,height:(t,e)=>w(e).imageBox.height,image:i.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center"},null===(x=t.image)||void 0===x?void 0:x.style)}):null,{type:"path",name:`storyline-block-connector-${n}`,interactive:!1,style:{stroke:F,lineWidth:B,lineDash:O,fill:F,path:(t,e)=>{const i=w(e),n=i.connector.x1,o=i.connector.y1,r=i.connector.y2,a=r-9*(r<o?-1:1);return`${`M ${n} ${o} L ${n} ${a}`} ${`M ${n-4.5} ${a} L ${n+4.5} ${a} L ${n} ${r} Z`}`}}},i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1},t.title),{style:Object.assign({x:(t,e)=>w(e).textBox.x,y:(t,e)=>w(e).textBox.y,text:i.title,maxLineWidth:(t,e)=>w(e).textBox.width,fontSize:S,lineHeight:M,fontWeight:"bold",fill:"#1f2430",stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:"left",textBaseline:"top"},null===(f=t.title)||void 0===f?void 0:f.style)}):null,_.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1},t.content),{textType:"rich",style:Object.assign({x:(t,e)=>w(e).contentBox.x,y:(t,e)=>w(e).contentBox.y,width:(t,e)=>w(e).contentBox.width,height:(t,e)=>w(e).contentBox.height,maxLineWidth:(t,e)=>w(e).contentBox.width,heightLimit:(t,e)=>w(e).contentBox.height,text:gi(_,t,{fontSize:18,lineHeight:26,fill:"#596173"}),textAlign:"left",textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#596173"},null===(b=t.content)||void 0===b?void 0:b.style)}):null].filter(Boolean)}},Ti=(t,e)=>{const i=ui(t,e).blocks;if(!i.length)return{x:0,y:0,width:0,height:0};const n=i[0].center.y,o=i[i.length-1].center.y,r=Math.min(n,o),a=Math.max(n,o);return{x:i[0].center.x-48,y:r-50,width:96,height:a-r+100}},Ii=(t,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y,v;const m=!!i.image,x=!!i.subImage,f=Array.isArray(i.content)?i.content:i.content?[i.content]:[],b=Number(null!==(a=null===(r=null===(o=t.title)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:26),k=Number(null!==(d=null===(l=null===(s=t.title)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:Math.max(34,Math.round(1.35*b))),_=e=>{var i,o,r,a;const s=ui(t,e).blocks[n],l=null!==(i=null==s?void 0:s.width)&&void 0!==i?i:ci(t,0),d=null!==(a=null!==(o=null==s?void 0:s.height)&&void 0!==o?o:null===(r=t.block)||void 0===r?void 0:r.height)&&void 0!==a?a:ei;return((t,e,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f;const b=Number(null!==(a=null===(r=null===(o=t.title)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:26),k=Number(null!==(d=null===(l=null===(s=t.title)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:Math.max(34,Math.round(1.35*b))),_=Number(null!==(u=null===(h=null===(c=t.content)||void 0===c?void 0:c.style)||void 0===h?void 0:h.fontSize)&&void 0!==u?u:18),S=Number(null!==(y=null===(p=null===(g=t.content)||void 0===g?void 0:g.style)||void 0===p?void 0:p.lineHeight)&&void 0!==y?y:26),M=null!==(m=null===(v=t.image)||void 0===v?void 0:v.width)&&void 0!==m?m:Math.max(e,80),w=null!==(f=null===(x=t.image)||void 0===x?void 0:x.height)&&void 0!==f?f:Math.round(.6*i),A=3*S,C=Math.max(A,Math.round(1*i)),L=n%2==0,F=L?-72-M:72,B=-w/2,O=B+w+8,T=1*M,I=1*w;return{onLeft:L,titleFontSize:b,titleLineHeight:k,contentFontSize:_,contentLineHeight:S,blockWidth:e,imageBox:{x:F,y:B,width:M,height:w},shadowBox:{x:F-(T-M)/2+(L?-24:24),y:B-(I-w)/2+16,width:T,height:I},textBox:{x:F,y:O,width:M,height:k+4+C},contentBox:{x:F,y:O+k+4,width:M,height:C}}})(t,l,d,n)},S=li(t),M=null!==(h=null===(c=t.block)||void 0===c?void 0:c.style)&&void 0!==h?h:{};return{type:"group",id:`storyline-block-${null!==(u=i.id)&&void 0!==u?u:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>{var o,r;const a=ui(t,i).blocks[n];return null!==(r=null===(o=null==a?void 0:a.center)||void 0===o?void 0:o.x)&&void 0!==r?r:0},y:(e,i)=>{var o,r;const a=ui(t,i).blocks[n];return null!==(r=null===(o=null==a?void 0:a.center)||void 0===o?void 0:o.y)&&void 0!==r?r:0}},children:[x?{type:"image",name:`storyline-block-shadow-image-${n}`,interactive:!1,style:{x:(t,e)=>_(e).shadowBox.x,y:(t,e)=>_(e).shadowBox.y,width:(t,e)=>_(e).shadowBox.width,height:(t,e)=>_(e).shadowBox.height,image:i.subImage,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center"}}:null,!0===(null===(g=t.image)||void 0===g?void 0:g.showBackground)?{type:"rect",name:`storyline-block-image-bg-${n}`,interactive:!1,style:Object.assign({x:(t,e)=>_(e).imageBox.x,y:(t,e)=>_(e).imageBox.y,width:(t,e)=>_(e).imageBox.width,height:(t,e)=>_(e).imageBox.height,cornerRadius:8,fill:"#ffffff",stroke:S,lineWidth:2},M)}:null,m?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1},pi(t.image)),{style:Object.assign({x:(t,e)=>_(e).imageBox.x,y:(t,e)=>_(e).imageBox.y,width:(t,e)=>_(e).imageBox.width,height:(t,e)=>_(e).imageBox.height,image:i.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center"},null===(p=t.image)||void 0===p?void 0:p.style)}):null,i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1},t.title),{style:Object.assign({x:(t,e)=>_(e).textBox.x,y:(t,e)=>_(e).textBox.y,text:i.title,maxLineWidth:(t,e)=>_(e).textBox.width,fontSize:b,lineHeight:k,fontWeight:"bold",fill:"#1f2430",stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:"left",textBaseline:"top"},null===(y=t.title)||void 0===y?void 0:y.style)}):null,f.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1},t.content),{textType:"rich",style:Object.assign({x:(t,e)=>_(e).contentBox.x,y:(t,e)=>_(e).contentBox.y,width:(t,e)=>_(e).contentBox.width,height:(t,e)=>_(e).contentBox.height,maxLineWidth:(t,e)=>_(e).contentBox.width,heightLimit:(t,e)=>_(e).contentBox.height,text:gi(f,t,{fontSize:18,lineHeight:26,fill:"#596173"}),textAlign:"left",textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#596173"},null===(v=t.content)||void 0===v?void 0:v.style)}):null].filter(Boolean)}},Di=.8,Ei=t=>"down"===We(t.layout).direction,ji=(t,e)=>{var i,n,o,r;const{width:a,height:s,startX:l,startY:d}=hi(e),c=Math.max(a,1),h=Math.max(s,1),u=.55*Math.min(c,h),g=Math.max(null!==(n=null===(i=t.centerImage)||void 0===i?void 0:i.width)&&void 0!==n?n:u,80),p=Math.max(null!==(r=null===(o=t.centerImage)||void 0===o?void 0:o.height)&&void 0!==r?r:u,80);return{x:l+c/2-g/2,y:Ei(t)?d:d+h-p,width:g,height:p}},Pi=(t,e)=>{var i,n,o;const{width:r,startX:a}=hi(e),s=Math.max(r,1),l=ci(t,r),d=We(t.layout),c="down"===d.direction,h=null!==(i=d.startAngle)&&void 0!==i?i:c?20:200,u=null!==(n=d.endAngle)&&void 0!==n?n:c?160:340,g=null!==(o=d.radiusRatio)&&void 0!==o?o:.88,p=Math.max((s-l)/2,1)*g,y=ji(t,e),v=y.y,m=y.y+y.height,x=Math.sin(h/180*Math.PI);let f,b;if(c){const t=Math.max(1-x,.05);b=(y.height+200)/t,f=v-b*x}else{const t=Math.max(1+x,.05);b=(y.height+200)/t,f=m-b*x}return{cx:a+s/2,cy:f,rx:p,ry:b,startAngle:h,endAngle:u,centerTop:v,centerBottom:m}},Ri=(t,e,i)=>{var n,o,r,a;const s=Pi(t,e),l=null!==(o=null===(n=t.data)||void 0===n?void 0:n.length)&&void 0!==o?o:0;if(l<=0)return{x:s.cx,y:s.cy};const d=1===l?.5:i/(l-1),c=(s.startAngle+(s.endAngle-s.startAngle)*d)/180*Math.PI,h=s.cx+Math.cos(c)*s.rx,u=s.cy+Math.sin(c)*s.ry,g=Math.cos(c)/s.rx,p=Math.sin(c)/s.ry,y=Math.hypot(g,p)||1,v=g/y,m=p/y,x=(null!==(a=null===(r=t.image)||void 0===r?void 0:r.height)&&void 0!==a?a:240)/2;return{x:h+v*x,y:u+m*x}},$i=(t,i,n)=>{var o,r,a,s,l;const d=!!i.image,c=Array.isArray(i.content)?i.content:i.content?[i.content]:[],h=li(t),u=((t,e=0)=>{var i,n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b,k,_;const S=Number(null!==(o=null===(n=null===(i=t.title)||void 0===i?void 0:i.style)||void 0===n?void 0:n.fontSize)&&void 0!==o?o:32),M=Number(null!==(s=null===(a=null===(r=t.title)||void 0===r?void 0:r.style)||void 0===a?void 0:a.lineHeight)&&void 0!==s?s:Math.max(34,Math.round(1.35*S))),w=Number(null!==(c=null===(d=null===(l=t.content)||void 0===l?void 0:l.style)||void 0===d?void 0:d.fontSize)&&void 0!==c?c:20),A=Number(null!==(g=null===(u=null===(h=t.content)||void 0===h?void 0:h.style)||void 0===u?void 0:u.lineHeight)&&void 0!==g?g:26),C=Math.max(240-M-4,A),L=Math.max(null!==(y=null===(p=t.image)||void 0===p?void 0:p.width)&&void 0!==y?y:240,null!==(m=null===(v=t.image)||void 0===v?void 0:v.height)&&void 0!==m?m:240),F=L,B=L,O=Ei(t),T=Math.max(null!==(f=null===(x=t.data)||void 0===x?void 0:x.length)&&void 0!==f?f:0,1),I=Number(null!==(b=t.width)&&void 0!==b?b:F*T),D=Math.round(I/(T+1)),E=Math.max(Number(null!==(_=null===(k=t.block)||void 0===k?void 0:k.width)&&void 0!==_?_:D),240),j=e<T/2,P={x:-F/2,y:-B/2,width:F,height:B},R={x:j?-20:20,y:O?P.y+B+10:P.y-10-240,width:E,height:240};return{titleFontSize:S,titleLineHeight:M,contentFontSize:w,contentLineHeight:A,imageBox:P,textBox:R,contentBox:{x:R.x,y:R.y+M+4,width:R.width,height:C},isDown:O,textAlign:j?"right":"left"}})(t,n),g=u.isDown?u.imageBox.y+u.imageBox.height:u.textBox.y,p=u.isDown?Math.max(u.textBox.y+u.textBox.height-(u.imageBox.y+u.imageBox.height),0):Math.max(u.imageBox.y-u.textBox.y,0);return{type:"group",id:`storyline-block-${null!==(o=i.id)&&void 0!==o?o:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>Ri(t,i,n).x,y:(e,i)=>Ri(t,i,n).y},children:[{type:"rect",name:`storyline-block-connector-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+2,style:{x:-1,y:g,width:2,height:p,fill:h,fillOpacity:.6}},d?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+3},pi(t.image)),{style:Object.assign({x:u.imageBox.x,y:u.imageBox.y,width:u.imageBox.width,height:u.imageBox.height,cornerRadius:Math.min(u.imageBox.width,u.imageBox.height)/2,image:i.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center"},null===(r=t.image)||void 0===r?void 0:r.style)}):{type:"symbol",name:`storyline-block-image-bg-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+3,style:{x:0,y:0,size:Math.min(u.imageBox.width,u.imageBox.height),symbolType:"circle",fill:"#ffffff",stroke:h,lineWidth:2}},!0===(null===(a=t.image)||void 0===a?void 0:a.showBackground)?{type:"symbol",name:`storyline-block-image-halo-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+3,style:{x:0,y:0,size:Math.min(u.imageBox.width,u.imageBox.height)+12,symbolType:"circle",fill:"transparent",stroke:h,lineWidth:3}}:null,i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+5},t.title),{style:Object.assign({x:u.textBox.x,y:u.textBox.y,text:i.title,maxLineWidth:u.textBox.width,fontSize:u.titleFontSize,lineHeight:u.titleLineHeight,fontWeight:"bold",fill:"#1f2430",stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:u.textAlign,textBaseline:"top"},null===(s=t.title)||void 0===s?void 0:s.style)}):null,c.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+4},t.content),{textType:"rich",style:Object.assign({x:u.contentBox.x,y:u.contentBox.y,width:u.contentBox.width,height:u.contentBox.height,maxLineWidth:u.contentBox.width,heightLimit:u.contentBox.height,text:gi(c,t,{fontSize:u.contentFontSize,lineHeight:u.contentLineHeight,fill:"#596173",align:u.textAlign}),textAlign:u.textAlign,textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#596173"},null===(l=t.content)||void 0===l?void 0:l.style)}):null].filter(Boolean)}},zi=t=>{var e;return null!==(e=We(t.layout).direction)&&void 0!==e?e:"left"},Ni=(t,e)=>{var i,n,o;const{width:r,height:a,startX:s,startY:l}=hi(e),d=Math.max(r,1),c=Math.max(a,1),h=We(t.layout),u=zi(t),g="right"===u?110:-70,p="right"===u?250:70,y=null!==(i=h.startAngle)&&void 0!==i?i:g,v=null!==(n=h.endAngle)&&void 0!==n?n:p,m=null!==(o=h.radiusRatio)&&void 0!==o?o:.92,x=.6*d*m;return{cx:"right"===u?s+d-.1*x:s+.1*x,cy:l+c/2,rx:x,ry:c/2*m,startAngle:y,endAngle:v}},Vi=(t,e,i)=>{var n,o;const r=Ni(t,e),a=null!==(o=null===(n=t.data)||void 0===n?void 0:n.length)&&void 0!==o?o:0;if(a<=0)return{x:r.cx,y:r.cy};const s=1===a?.5:i/(a-1),l=(r.startAngle+(r.endAngle-r.startAngle)*s)/180*Math.PI;return{x:r.cx+Math.cos(l)*r.rx,y:r.cy+Math.sin(l)*r.ry}},Wi=120,Hi=(t,e,i)=>{var n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b;const k=Number(null!==(r=null===(o=null===(n=t.title)||void 0===n?void 0:n.style)||void 0===o?void 0:o.fontSize)&&void 0!==r?r:22),_=Number(null!==(l=null===(s=null===(a=t.title)||void 0===a?void 0:a.style)||void 0===s?void 0:s.lineHeight)&&void 0!==l?l:Math.max(30,Math.round(1.3*k))),S=Number(null!==(h=null===(c=null===(d=t.content)||void 0===d?void 0:d.style)||void 0===c?void 0:c.fontSize)&&void 0!==h?h:12),M=Number(null!==(p=null===(g=null===(u=t.content)||void 0===u?void 0:u.style)||void 0===g?void 0:g.lineHeight)&&void 0!==p?p:17),w=1e5,A=Number(null!==(v=null===(y=t.image)||void 0===y?void 0:y.width)&&void 0!==v?v:160),C=Number(null!==(x=null===(m=t.image)||void 0===m?void 0:m.height)&&void 0!==x?x:160),L={x:-A/2,y:-C/2,width:A,height:C},F=zi(t),B=null!==(b=null===(f=t.data)||void 0===f?void 0:f.length)&&void 0!==b?b:0,O=240;let T,I,D,E,j;if("right"===F&&B>0&&i===B-1||"left"===F&&0===i){const t=-120,e=C/2+Wi;T={x:t,y:e,width:O,height:110},I={x:t,y:e+_+4,width:O,height:w},D={x:-1,y:C/2,width:2,height:Wi},E=!1,j="below"}else{const t="right"===F,e=t?-A/2-Wi-O:A/2+Wi,i=-55;T={x:e,y:i,width:O,height:110},I={x:e,y:i+_+4,width:O,height:w};const n=t?-A/2:A/2,o=t?e+O:e;D={x:Math.min(n,o),y:0,width:Math.abs(o-n),height:2},E=t,j=null}return{onLeft:E,verticalAlign:j,titleFontSize:k,titleLineHeight:_,contentFontSize:S,contentLineHeight:M,imageBox:L,textBox:T,contentBox:I,connectorBox:D}},Gi=[12,8],Ui=(t,e)=>{var i;const{width:n,height:o,startX:r,startY:a}=hi(e),s=Ve(null===(i=t.block)||void 0===i?void 0:i.padding),l=r+s.left,d=a+s.top,c=Math.max(n-s.left-s.right,1),h=Math.max(o-s.top-s.bottom,1),u=(t=>"down"===We(t.layout).direction)(t),g=l+c,p=u?d:d+h,y=u?d+h:d,v=g-l,m=y-p;return{x0:l,y0:p,x1:g,y1:y,cx:(l+g)/2,cy:(p+y)/2,angleRad:Math.atan2(m,v)/Math.PI*180,fontSize:Math.max(80,Math.min(240,Math.round(.42*h)))}},Ki=t=>{const i=(t=>{var e,i;const n=We(t.layout);if("string"==typeof n.headline&&n.headline.length>0)return n.headline;const o=null===(i=null===(e=t.title)||void 0===e?void 0:e.style)||void 0===i?void 0:i.text;return"string"==typeof o&&o.length>0?o:"storyline"})(t);if(!i)return null;const n=li(t);return{type:"group",name:"storyline-ladder-headline",zIndex:e.LayoutZIndex.Mark,style:{x:(e,i)=>Ui(t,i).cx,y:(e,i)=>Ui(t,i).cy,angle:(e,i)=>Ui(t,i).angleRad},children:[{type:"text",name:"storyline-ladder-headline-text",interactive:!1,style:{x:0,y:0,text:i,fontSize:(e,i)=>Ui(t,i).fontSize,fontWeight:900,fontFamily:'Impact, "Arial Black", sans-serif',fill:di(n,.92),textAlign:"center",textBaseline:"middle"}}]}},Yi=t=>t%2==1,Xi=(t,e,i)=>{var n,o,r,a,s,l,d,c,h,u,g,p,y,v,m,x,f,b,k,_,S,M,w,A;const C=ui(t,e).blocks[i],L=Ve(null!==(o=null===(n=t.block)||void 0===n?void 0:n.padding)&&void 0!==o?o:12),F=Yi(i)?"right":"left",B=null!==(a=null===(r=t.image)||void 0===r?void 0:r.width)&&void 0!==a?a:100,O=null!==(l=null===(s=t.image)||void 0===s?void 0:s.height)&&void 0!==l?l:100,T=null!==(c=null===(d=t.image)||void 0===d?void 0:d.gap)&&void 0!==c?c:10,I=!!(null===(u=null===(h=t.data)||void 0===h?void 0:h[i])||void 0===u?void 0:u.image),D=Number(null!==(y=null===(p=null===(g=t.title)||void 0===g?void 0:g.style)||void 0===p?void 0:p.fontSize)&&void 0!==y?y:28),E=Number(null!==(x=null===(m=null===(v=t.title)||void 0===v?void 0:v.style)||void 0===m?void 0:m.lineHeight)&&void 0!==x?x:Math.round(D*(26/28))),j=(null===(b=null===(f=t.data)||void 0===f?void 0:f[i])||void 0===b?void 0:b.title)?E:0,P=null!==(k=null==C?void 0:C.width)&&void 0!==k?k:ci(t,0),R=null!==(M=null!==(_=null==C?void 0:C.height)&&void 0!==_?_:null===(S=t.block)||void 0===S?void 0:S.height)&&void 0!==M?M:ei,$=yi(F,P,R,L,B,O,0,I),z=vi(F,P,R,L,B,O,T,I),N=(null===(A=null===(w=t.data)||void 0===w?void 0:w[i])||void 0===A?void 0:A.title)?8:0;return{block:{width:P,height:R},imageBox:$,textBox:z,contentBox:{y:z.y+j+N,height:Math.max(0,z.height-j-N)}}};class Zi extends e.CommonChartSpecTransformer{transformSpec(t){var e;qi(t);const i=Object.assign(Object.assign({},t),{data:[...null!==(e=t.data)&&void 0!==e?e:[]]});t.type="common",t.data=[],t.series=[],t.axes=[],t.customMark=Ji(i),delete t.layout,delete t.title,super.transformSpec(t)}}const qi=t=>{var e,i,n,o;const r=ri(t),a=r&&"down"===We(t.layout).direction,s=r&&!a,l=ni(t),d=si(t),c=ai(t),h=oi(t),u=(()=>{var e,i,n,o,r,a,s,d,c,h;if(!l)return 0;const u=null!==(i=null===(e=t.data)||void 0===e?void 0:e.length)&&void 0!==i?i:0,g=t.height;if(!u||!g)return 100;const p=g/(u+1),y=null!==(o=null===(n=t.image)||void 0===n?void 0:n.height)&&void 0!==o?o:.6*p,v=1*p,m=Number(null!==(s=null===(a=null===(r=t.title)||void 0===r?void 0:r.style)||void 0===a?void 0:a.fontSize)&&void 0!==s?s:26),x=Number(null!==(h=null===(c=null===(d=t.title)||void 0===d?void 0:d.style)||void 0===c?void 0:c.lineHeight)&&void 0!==h?h:Math.round(1.35*m));return Math.max(100,Math.round(y/2+8+x+4+v+16))})(),g=(()=>{var e,i,n,o,r,a;if(!d)return 0;const s=null!==(i=null===(e=t.block)||void 0===e?void 0:e.minWidth)&&void 0!==i?i:ci(t,0),l=null!==(o=null===(n=t.image)||void 0===n?void 0:n.width)&&void 0!==o?o:96,c=null!==(a=null===(r=t.image)||void 0===r?void 0:r.gap)&&void 0!==a?a:10,h=Math.max(s-l-c-24,90),u=Math.round(2*h),g=t.width,p=g?Math.floor(.3*g):u;return Math.min(u,p)})(),p=(()=>{var e,i;if(!d)return 0;const n=null!==(i=null===(e=t.block)||void 0===e?void 0:e.height)&&void 0!==i?i:132,o=Math.round(3*n),r=t.height,a=r?Math.floor(.3*r):o;return Math.min(o,a)})(),y=h?40:d?p:a?0:s?280:20,v=h?60:l?u:c?300:s?0:a?280:100,m=(()=>{var e,i;if(!r)return 20;const n=Math.max(null!==(i=null===(e=t.data)||void 0===e?void 0:e.length)&&void 0!==i?i:0,1),o=t.width;return o?Math.round(o/(n+1)):20})(),x=h?40:d?g:m,f=h?40:d?g:m,b=t.padding;if(null!=b)if(Array.isArray(b)){const[e,i=f,n,o=x]=b;t.padding=[null!=e?e:y,i,null!=n?n:v,o]}else"object"==typeof b&&(t.padding={top:null!==(e=b.top)&&void 0!==e?e:y,right:null!==(i=b.right)&&void 0!==i?i:f,bottom:null!==(n=b.bottom)&&void 0!==n?n:v,left:null!==(o=b.left)&&void 0!==o?o:x});else t.padding=[y,f,v,x]},Ji=t=>{var i;const n=Qi(t),o=(null!==(i=t.data)&&void 0!==i?i:[]).map(((e,i)=>tn(t,e,i)));if(ii(t))return[...o,n].filter(Boolean);if(ni(t))return[n,...o].filter(Boolean);if(ri(t)){const i=(t=>{var i,n,o,r;if(!1===(null===(i=t.centerImage)||void 0===i?void 0:i.visible))return null;const a=li(t),s=!!(null===(n=t.centerImage)||void 0===n?void 0:n.image),l={gradient:"linear",x0:.5,y0:0,x1:.5,y1:1,stops:[{offset:0,color:di(a,.15)},{offset:1,color:a}]};return{type:"group",name:"storyline-arc-center",zIndex:e.LayoutZIndex.Mark,children:[{type:"symbol",name:"storyline-arc-center-symbol",interactive:!1,style:{x:(e,i)=>{const n=ji(t,i);return n.x+n.width/2},y:(e,i)=>{const n=ji(t,i);return n.y+n.height/2},size:(e,i)=>{const n=ji(t,i);return Math.max(n.width,n.height)},symbolType:"circle",fill:s?l:"#ffffff",stroke:a,lineWidth:2}},s?Object.assign(Object.assign({type:"image",name:"storyline-arc-center-image",interactive:!1},t.centerImage),{style:Object.assign({x:(e,i)=>{var n,o;const r=ji(t,i),a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.width,s="number"==typeof a?a:Math.max(r.width,r.height)*Di;return r.x+(r.width-s)/2},y:(e,i)=>{var n,o;const r=ji(t,i),a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.height,s="number"==typeof a?a:Math.max(r.width,r.height)*Di;return r.y+(r.height-s)/2},width:(e,i)=>{var n,o;const r=ji(t,i),a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.width;return"number"==typeof a?a:Math.max(r.width,r.height)*Di},height:(e,i)=>{var n,o;const r=ji(t,i),a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.height;return"number"==typeof a?a:Math.max(r.width,r.height)*Di},cornerRadius:(e,i)=>{var n,o,r,a;const s=ji(t,i),l=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.width,d=null===(a=null===(r=t.centerImage)||void 0===r?void 0:r.style)||void 0===a?void 0:a.height,c="number"==typeof l?l:Math.max(s.width,s.height)*Di,h="number"==typeof d?d:Math.max(s.width,s.height)*Di;return Math.max(c,h)/2},image:null===(o=t.centerImage)||void 0===o?void 0:o.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center",anchor:(e,i)=>{const n=ji(t,i);return[n.x+n.width/2,n.y+n.height/2]}},null===(r=t.centerImage)||void 0===r?void 0:r.style)}):null].filter(Boolean)}})(t),n=(t=>{var i;if(!0!==(null===(i=t.line)||void 0===i?void 0:i.visible))return null;const n=li(t);return{type:"group",name:"storyline-arc",zIndex:e.LayoutZIndex.Mark,children:[{type:"path",name:"storyline-arc-path",interactive:!1,style:{stroke:n,lineWidth:2,lineCap:"round",fill:"transparent",fillOpacity:0,path:(e,i)=>{const n=Pi(t,i),o=n.endAngle-n.startAngle,r=[];for(let t=0;t<=64;t++){const e=t/64,i=(n.startAngle+o*e)/180*Math.PI,a=n.cx+Math.cos(i)*n.rx,s=n.cy+Math.sin(i)*n.ry;r.push(`${0===t?"M":"L"} ${a.toFixed(2)} ${s.toFixed(2)}`)}return r.join(" ")}}}]}})(t);return[i,n,...o].filter(Boolean)}if(oi(t)){const i=(t=>{const i=li(t);return{type:"group",name:"storyline-clock-orbit",zIndex:e.LayoutZIndex.Mark,children:[{type:"path",name:"storyline-clock-orbit-path",interactive:!1,style:{path:(e,i)=>{const n=ki(t,i),o=.68*n.R;return[`M ${(n.cx+o).toFixed(2)} ${n.cy.toFixed(2)}`,`A ${o.toFixed(2)} ${o.toFixed(2)} 0 1 1 ${(n.cx-o).toFixed(2)} ${n.cy.toFixed(2)}`,`A ${o.toFixed(2)} ${o.toFixed(2)} 0 1 1 ${(n.cx+o).toFixed(2)} ${n.cy.toFixed(2)}`].join(" ")},stroke:di(i,.7),lineWidth:1,lineDash:bi,fill:"transparent",fillOpacity:0}}]}})(t),n=(t=>{var i,n,o,r;if(!1===(null===(i=t.centerImage)||void 0===i?void 0:i.visible))return null;const a=li(t),s=!!(null===(n=t.centerImage)||void 0===n?void 0:n.image);return{type:"group",name:"storyline-clock-center",zIndex:e.LayoutZIndex.Mark+2,children:[{type:"symbol",name:"storyline-clock-center-halo",interactive:!1,style:{x:(e,i)=>ki(t,i).cx,y:(e,i)=>ki(t,i).cy,size:(e,i)=>ki(t,i).R*mi*2.16,symbolType:"circle",fill:di(a,.28),stroke:"transparent"}},s?{type:"image",name:"storyline-clock-center-image",interactive:!1,style:Object.assign({x:(e,i)=>{const n=ki(t,i);return n.cx-n.R*mi*xi},y:(e,i)=>{const n=ki(t,i);return n.cy-n.R*mi*xi},width:(e,i)=>ki(t,i).R*mi*xi*2,height:(e,i)=>ki(t,i).R*mi*xi*2,image:null===(o=t.centerImage)||void 0===o?void 0:o.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center",cornerRadius:(e,i)=>ki(t,i).R*mi*xi,anchor:(e,i)=>{const n=ki(t,i);return[n.cx,n.cy]},dx:(e,i)=>{var n,o;const r=ki(t,i).R*mi*xi*2,a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.width;return(r-("number"==typeof a?a:r))/2},dy:(e,i)=>{var n,o;const r=ki(t,i).R*mi*xi*2,a=null===(o=null===(n=t.centerImage)||void 0===n?void 0:n.style)||void 0===o?void 0:o.height;return(r-("number"==typeof a?a:r))/2}},null===(r=t.centerImage)||void 0===r?void 0:r.style)}:{type:"symbol",name:"storyline-clock-center-placeholder",interactive:!1,style:{x:(e,i)=>ki(t,i).cx,y:(e,i)=>ki(t,i).cy,size:(e,i)=>ki(t,i).R*mi*2,symbolType:"circle",fill:"#ffffff",stroke:a,lineWidth:2}}].filter(Boolean)}})(t);return[i,...o,n].filter(Boolean)}if(ai(t)){const i=(t=>{var i,n,o,r,a,s,l,d;if(!1===(null===(i=t.line)||void 0===i?void 0:i.visible))return null;const c=li(t),h=null!==(o=null===(n=t.line)||void 0===n?void 0:n.style)&&void 0!==o?o:{},u=Math.max(Number(null!==(r=h.startWidth)&&void 0!==r?r:50),.5),g=Math.max(Number(null!==(s=null!==(a=h.endWidth)&&void 0!==a?a:h.lineWidth)&&void 0!==s?s:350),u);return{type:"group",name:"storyline-wing-arc",zIndex:e.LayoutZIndex.Mark,children:[{type:"path",name:"storyline-wing-arc-path",interactive:!1,style:{stroke:!1,lineWidth:0,fill:null!==(d=null!==(l=h.fill)&&void 0!==l?l:h.stroke)&&void 0!==d?d:c,opacity:.95,path:(e,i)=>{const n=Ni(t,i),o=n.endAngle-n.startAngle,r=[];for(let t=0;t<=96;t++){const e=t/96,i=(n.startAngle+o*e)/180*Math.PI,a=n.cx+Math.cos(i)*n.rx,s=n.cy+Math.sin(i)*n.ry,l=Math.cos(i)/n.rx,d=Math.sin(i)/n.ry,c=Math.hypot(l,d)||1;r.push({x:a,y:s,nx:l/c,ny:d/c,w:u+(g-u)*e})}const a=[];for(let t=0;t<r.length;t++){const e=r[t],i=e.x+e.nx*(e.w/2),n=e.y+e.ny*(e.w/2);a.push(`${0===t?"M":"L"} ${i.toFixed(2)} ${n.toFixed(2)}`)}for(let t=r.length-1;t>=0;t--){const e=r[t],i=e.x-e.nx*(e.w/2),n=e.y-e.ny*(e.w/2);a.push(`L ${i.toFixed(2)} ${n.toFixed(2)}`)}return a.push("Z"),a.join(" ")}}}]}})(t);return[i,...o].filter(Boolean)}if(si(t)){const i=(t=>{const i=li(t);return{type:"group",name:"storyline-ladder-diagonal",zIndex:e.LayoutZIndex.Mark-1,children:[{type:"path",name:"storyline-ladder-diagonal-line",interactive:!1,style:{path:(e,i)=>{const n=Ui(t,i);return`M ${n.x0} ${n.y0} L ${n.x1} ${n.y1}`},stroke:di(i,.85),lineWidth:2,lineDash:Gi,fill:"transparent"}}]}})(t);return[i,Ki(t),...o].filter(Boolean)}return[n,...o].filter(Boolean)},Qi=t=>{var i,n,o;return!1===(null===(i=t.line)||void 0===i?void 0:i.visible)||(null!==(o=null===(n=t.data)||void 0===n?void 0:n.length)&&void 0!==o?o:0)<=1?null:ii(t)?(t=>{var i,n,o,r,a,s,l;const d=li(t),c=null!==(n=null===(i=t.line)||void 0===i?void 0:i.style)&&void 0!==n?n:{},h=null!==(r=null===(o=t.data)||void 0===o?void 0:o.length)&&void 0!==r?r:0,u=[];for(let e=0;e<h;e++){const i=e;u.push({type:"symbol",name:`storyline-landscape-curve-symbol-${i}`,interactive:!1,style:{symbolType:"circle",size:14,fill:d,x:(e,n)=>{var o,r;return null!==(r=null===(o=Bi(t,n,i))||void 0===o?void 0:o.x)&&void 0!==r?r:0},y:(e,n)=>{var o,r;return null!==(r=null===(o=Bi(t,n,i))||void 0===o?void 0:o.y)&&void 0!==r?r:0}}})}return{type:"group",name:"storyline-landscape-curve",zIndex:e.LayoutZIndex.Mark+2,children:[{type:"path",name:"storyline-landscape-curve-path",interactive:!1,style:{stroke:null!==(a=c.stroke)&&void 0!==a?a:d,lineWidth:null!==(s=c.lineWidth)&&void 0!==s?s:4,lineDash:null!==(l=c.lineDash)&&void 0!==l?l:[6,5],lineCap:"round",fill:"transparent",fillOpacity:0,path:(e,i)=>{const n=[];for(let e=0;e<h;e++){const o=Bi(t,i,e);o&&n.push(o)}return(t=>{var e,i;if(t.length<2)return"";if(2===t.length)return`M ${t[0].x} ${t[0].y} L ${t[1].x} ${t[1].y}`;let n=`M ${t[0].x} ${t[0].y}`;for(let o=0;o<t.length-1;o++){const r=null!==(e=t[o-1])&&void 0!==e?e:t[o],a=t[o],s=t[o+1],l=null!==(i=t[o+2])&&void 0!==i?i:s;n+=` C ${a.x+(s.x-r.x)/6} ${a.y+(s.y-r.y)/6}, ${s.x-(l.x-a.x)/6} ${s.y-(l.y-a.y)/6}, ${s.x} ${s.y}`}return n})(n)}}},...u]}})(t):ni(t)?(t=>{var i,n,o,r,a,s,l,d,c,h,u,g,p,y;const v=li(t),m=null!==(n=null===(i=t.line)||void 0===i?void 0:i.style)&&void 0!==n?n:{},x={gradient:"linear",x0:0,y0:0,x1:0,y1:1,stops:[{offset:0,color:di(v,.2)},{offset:1,color:di(v,1)}]},f=Number(null!==(a=null===(r=null===(o=t.marker)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:40),b=Number(null!==(d=null===(l=null===(s=t.marker)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:28),k=!1!==(null===(c=t.marker)||void 0===c?void 0:c.visible)?(null!==(h=t.data)&&void 0!==h?h:[]).map(((e,i)=>{var n;if(!e.marker)return null;const o=i%2==0,r=o?-42:42,a=o?"left":"right";return Object.assign(Object.assign({type:"text",textType:"rich",name:`storyline-portrait-marker-${i}`,interactive:!1},t.marker),{style:Object.assign({x:(e,n)=>{var o,a;const s=ui(t,n).blocks[i];return(null!==(a=null===(o=null==s?void 0:s.center)||void 0===o?void 0:o.x)&&void 0!==a?a:0)+r},y:(e,n)=>{var o,r;const a=ui(t,n).blocks[i];return null!==(r=null===(o=null==a?void 0:a.center)||void 0===o?void 0:o.y)&&void 0!==r?r:0},text:{type:"rich",text:e.marker.split("").map(((t,e,i)=>({text:t+(e<i.length-1?"\n":""),fontSize:f,lineHeight:b,fill:"#fff",align:a})))},fontWeight:"bold",lineJoin:"round",shadowColor:"rgba(0, 0, 0, 0.3)",shadowBlur:8,shadowOffsetX:0,shadowOffsetY:5,textAlign:a,textBaseline:"middle"},null===(n=t.marker)||void 0===n?void 0:n.style)})})).filter(Boolean):[];return{type:"group",name:"storyline-portrait-axis",zIndex:e.LayoutZIndex.Mark,children:[{type:"rect",name:"storyline-portrait-axis-rect",interactive:!1,style:{fill:null!==(u=m.fill)&&void 0!==u?u:x,stroke:null!==(g=m.stroke)&&void 0!==g&&g,lineWidth:null!==(p=m.lineWidth)&&void 0!==p?p:0,cornerRadius:null!==(y=m.cornerRadius)&&void 0!==y?y:0,x:(e,i)=>Ti(t,i).x,y:(e,i)=>Ti(t,i).y,width:(e,i)=>Ti(t,i).width,height:(e,i)=>Ti(t,i).height}},...k]}})(t):(t=>{var i,n,o,r;return!1===(null===(i=t.line)||void 0===i?void 0:i.visible)||(null!==(o=null===(n=t.data)||void 0===n?void 0:n.length)&&void 0!==o?o:0)<=1?null:{type:"group",name:"storyline-links",zIndex:e.LayoutZIndex.Mark,children:(null!==(r=t.data)&&void 0!==r?r:[]).slice(1).map(((e,i)=>{var n;const o=null!==(n=t.line)&&void 0!==n?n:{},{style:r={},type:a="line",showArrow:s=!1,arrowSize:l=8}=o,d=y(o,["style","type","showArrow","arrowSize"]);return Object.assign(Object.assign({type:"path",name:`storyline-link-${i}`,interactive:!1},d),{style:Object.assign(Object.assign({stroke:"#8a94a6",lineWidth:1.5,fill:"transparent",fillOpacity:0},r),{path:(e,n)=>{const o=ui(t,n).links[i];return o?Li(o.points,a,s,l):""}})})}))}})(t)},tn=(t,i,n)=>ii(t)?Oi(t,i,n):ni(t)?Ii(t,i,n):ri(t)?$i(t,i,n):oi(t)?Ai(t,i,n):ai(t)?((t,i,n)=>{var o,r,a,s,l;const d=!!i.image,c=Array.isArray(i.content)?i.content:i.content?[i.content]:[],h=li(t),u=!0===(null===(o=t.image)||void 0===o?void 0:o.showBackground);return{type:"group",id:`storyline-block-${null!==(r=i.id)&&void 0!==r?r:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>Vi(t,i,n).x,y:(e,i)=>Vi(t,i,n).y},children:[{type:"rect",name:`storyline-block-connector-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+2,style:{x:(e,i)=>Hi(t,0,n).connectorBox.x,y:(e,i)=>Hi(t,0,n).connectorBox.y,width:(e,i)=>Hi(t,0,n).connectorBox.width,height:(e,i)=>Hi(t,0,n).connectorBox.height,fill:h,opacity:.6}},u?{type:"symbol",name:`storyline-block-image-halo-${n}`,interactive:!1,style:{x:0,y:0,size:(e,i)=>Math.max(Hi(t,0,n).imageBox.width,Hi(t,0,n).imageBox.height)+12,symbolType:"circle",fill:di(h,.18),stroke:h,lineWidth:1.5}}:null,d?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1},pi(t.image)),{style:Object.assign({x:(e,i)=>Hi(t,0,n).imageBox.x,y:(e,i)=>Hi(t,0,n).imageBox.y,width:(e,i)=>Hi(t,0,n).imageBox.width,height:(e,i)=>Hi(t,0,n).imageBox.height,cornerRadius:(e,i)=>Math.min(Hi(t,0,n).imageBox.width,Hi(t,0,n).imageBox.height)/2,image:i.image,repeatX:"no-repeat",repeatY:"no-repeat",imageMode:"cover",imagePosition:"center"},null===(a=t.image)||void 0===a?void 0:a.style)}):{type:"rect",name:`storyline-block-image-bg-${n}`,interactive:!1,style:{x:(e,i)=>Hi(t,0,n).imageBox.x,y:(e,i)=>Hi(t,0,n).imageBox.y,width:(e,i)=>Hi(t,0,n).imageBox.width,height:(e,i)=>Hi(t,0,n).imageBox.height,cornerRadius:(e,i)=>Math.min(Hi(t,0,n).imageBox.width,Hi(t,0,n).imageBox.height)/2,fill:"#ffffff",stroke:h,lineWidth:2}},i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+10},t.title),{style:Object.assign({x:(e,i)=>{const o=Hi(t,0,n);return o.verticalAlign?o.textBox.x+o.textBox.width/2:o.onLeft?o.textBox.x+o.textBox.width:o.textBox.x},y:(e,i)=>Hi(t,0,n).textBox.y,text:i.title,maxLineWidth:(e,i)=>Hi(t,0,n).textBox.width,fontSize:(e,i)=>Hi(t,0,n).titleFontSize,lineHeight:(e,i)=>Hi(t,0,n).titleLineHeight,fontWeight:"bold",fill:h,stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:(e,i)=>{const o=Hi(t,0,n);return o.verticalAlign?"center":o.onLeft?"right":"left"},textBaseline:"top"},null===(s=t.title)||void 0===s?void 0:s.style)}):null,c.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1,zIndex:e.LayoutZIndex.Mark+10},t.content),{textType:"rich",style:Object.assign({x:(e,i)=>{const o=Hi(t,0,n);return o.verticalAlign?o.contentBox.x+o.contentBox.width/2:o.onLeft?o.contentBox.x+o.contentBox.width:o.contentBox.x},y:(e,i)=>Hi(t,0,n).contentBox.y,width:(e,i)=>Hi(t,0,n).contentBox.width,height:(e,i)=>Hi(t,0,n).contentBox.height,maxLineWidth:(e,i)=>Hi(t,0,n).contentBox.width,heightLimit:(e,i)=>Hi(t,0,n).contentBox.height,text:gi(c,t),fontSize:(e,i)=>Hi(t,0,n).contentFontSize,lineHeight:(e,i)=>Hi(t,0,n).contentLineHeight,textAlign:(e,i)=>{const o=Hi(t,0,n);return o.verticalAlign?"center":o.onLeft?"right":"left"},textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#1f2430"},null===(l=t.content)||void 0===l?void 0:l.style)}):null].filter(Boolean)}})(t,i,n):si(t)?((t,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y;const v=!!i.image,m=Yi(n)?"right":"left",x=Array.isArray(i.content)?i.content:i.content?[i.content]:[],f=Number(null!==(a=null===(r=null===(o=t.title)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:28),b=Number(null!==(d=null===(l=null===(s=t.title)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:Math.round(f*(26/28))),k=!0===(null===(c=t.block)||void 0===c?void 0:c.showBackground),_=e=>{const i=Xi(t,e,n);return"right"===m?i.textBox.x+i.textBox.width:i.textBox.x};return{type:"group",id:`storyline-block-${null!==(h=i.id)&&void 0!==h?h:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>{var o,r;return null!==(r=null===(o=ui(t,i).blocks[n])||void 0===o?void 0:o.x)&&void 0!==r?r:0},y:(e,i)=>{var o,r;return null!==(r=null===(o=ui(t,i).blocks[n])||void 0===o?void 0:o.y)&&void 0!==r?r:0},width:(e,i)=>Xi(t,i,n).block.width,height:(e,i)=>Xi(t,i,n).block.height},children:[k?{type:"rect",name:`storyline-block-bg-${n}`,interactive:!1,style:Object.assign({x:0,y:0,width:(e,i)=>Xi(t,i,n).block.width,height:(e,i)=>Xi(t,i,n).block.height,cornerRadius:8,fill:"#ffffff",stroke:"#d7dce5",lineWidth:1,shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.08)"},null===(u=t.block)||void 0===u?void 0:u.style)}:null,v?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1},pi(t.image)),{style:Object.assign({x:(e,i)=>Xi(t,i,n).imageBox.x,y:(e,i)=>Xi(t,i,n).imageBox.y,width:(e,i)=>Xi(t,i,n).imageBox.width,height:(e,i)=>Xi(t,i,n).imageBox.height,image:i.image},null===(g=t.image)||void 0===g?void 0:g.style)}):null,i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1},t.title),{style:Object.assign(Object.assign({x:(t,e)=>_(e),y:(e,i)=>Xi(t,i,n).textBox.y,text:i.title,maxLineWidth:(e,i)=>Xi(t,i,n).textBox.width,fontSize:f,lineHeight:b,fontWeight:"bold",fill:"#1f2430",stroke:"#fff",lineWidth:5,lineJoin:"round",textBaseline:"top"},null===(p=t.title)||void 0===p?void 0:p.style),{textAlign:m})}):null,x.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1},t.content),{textType:"rich",style:Object.assign(Object.assign({x:(t,e)=>_(e),y:(e,i)=>Xi(t,i,n).contentBox.y,width:(e,i)=>Xi(t,i,n).textBox.width,text:gi(x,t,{fontSize:18,lineHeight:26,align:m}),maxLineWidth:(e,i)=>Xi(t,i,n).textBox.width,heightLimit:(e,i)=>Xi(t,i,n).contentBox.height,textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#596173"},null===(y=t.content)||void 0===y?void 0:y.style),{textAlign:m})}):null].filter(Boolean)}})(t,i,n):((t,i,n)=>{var o,r,a,s,l,d,c,h,u,g,p,y;const v=!!i.image,m=Array.isArray(i.content)?i.content:i.content?[i.content]:[],x=Number(null!==(a=null===(r=null===(o=t.title)||void 0===o?void 0:o.style)||void 0===r?void 0:r.fontSize)&&void 0!==a?a:18),f=Number(null!==(d=null===(l=null===(s=t.title)||void 0===s?void 0:s.style)||void 0===l?void 0:l.lineHeight)&&void 0!==d?d:Math.round(1.35*x));return{type:"group",id:`storyline-block-${null!==(c=i.id)&&void 0!==c?c:n}`,name:`storyline-block-${n}`,zIndex:e.LayoutZIndex.Mark+1,style:{x:(e,i)=>{var o,r;return null!==(r=null===(o=ui(t,i).blocks[n])||void 0===o?void 0:o.x)&&void 0!==r?r:0},y:(e,i)=>{var o,r;return null!==(r=null===(o=ui(t,i).blocks[n])||void 0===o?void 0:o.y)&&void 0!==r?r:0},width:(e,i)=>Ci(t,i,n).block.width,height:(e,i)=>Ci(t,i,n).block.height},children:[!0===(null===(h=t.block)||void 0===h?void 0:h.showBackground)?{type:"rect",name:`storyline-block-bg-${n}`,interactive:!1,style:Object.assign({x:0,y:0,width:(e,i)=>Ci(t,i,n).block.width,height:(e,i)=>Ci(t,i,n).block.height,cornerRadius:8,fill:"#ffffff",stroke:"#d7dce5",lineWidth:1,shadowBlur:6,shadowColor:"rgba(0, 0, 0, 0.08)"},null===(u=t.block)||void 0===u?void 0:u.style)}:null,v?Object.assign(Object.assign({type:"image",name:`storyline-block-image-${n}`,interactive:!1},pi(t.image)),{style:Object.assign({x:(e,i)=>Ci(t,i,n).imageBox.x,y:(e,i)=>Ci(t,i,n).imageBox.y,width:(e,i)=>Ci(t,i,n).imageBox.width,height:(e,i)=>Ci(t,i,n).imageBox.height,image:i.image},null===(g=t.image)||void 0===g?void 0:g.style)}):null,i.title?Object.assign(Object.assign({type:"text",name:`storyline-block-title-${n}`,interactive:!1},t.title),{style:Object.assign({x:(e,i)=>Ci(t,i,n).textBox.x,y:(e,i)=>Ci(t,i,n).textBox.y,text:i.title,maxLineWidth:(e,i)=>Ci(t,i,n).textBox.width,fontSize:x,lineHeight:f,fontWeight:"bold",fill:"#1f2430",stroke:"#fff",lineWidth:5,lineJoin:"round",textAlign:"left",textBaseline:"top"},null===(p=t.title)||void 0===p?void 0:p.style)}):null,m.length?Object.assign(Object.assign({type:"text",name:`storyline-block-content-${n}`,interactive:!1},t.content),{textType:"rich",style:Object.assign({x:(e,i)=>Ci(t,i,n).textBox.x,y:(e,i)=>Ci(t,i,n).contentBox.y,width:(e,i)=>Ci(t,i,n).textBox.width,text:gi(m,t,{fontSize:18,lineHeight:26,fill:"#596173"}),maxLineWidth:(e,i)=>Ci(t,i,n).textBox.width,heightLimit:(e,i)=>Ci(t,i,n).contentBox.height,textAlign:"left",textBaseline:"top",wordBreak:"break-word",ellipsis:"...",fill:"#596173"},null===(y=t.content)||void 0===y?void 0:y.style)}):null].filter(Boolean)}})(t,i,n);class en extends e.BaseChart{constructor(){super(...arguments),this.type="storyline",this.transformerConstructor=Zi}init(){this.isValid()&&super.init()}isValid(){var t,e;const{data:i}=this._spec;return!!Array.isArray(i)||(null===(e=(t=this._option).onError)||void 0===e||e.call(t,"Data is required and should be an array for storyline chart"),!1)}}en.type="storyline",en.view="singleDefault",en.transformerConstructor=Zi;const nn="seriesBreak";function on(t,e,i,n,o=!1){const r=[],{x:a,y:s}=t,{x:l,y:d}=e,c=o?Math.floor((d-s)/(2*i)):Math.floor((l-a)/(2*i)),h=Math.PI/180*n,u=i*Math.cos(h),g=i*Math.sin(h);r.push(`M ${a} ${s}`);for(let t=0;t<=c;t++){const e=o?a+(t%2==0?u:-u):a+t*i*2,n=o?s+t*i*2:t%2==0?s-g:s+g;r.push(`L ${e} ${n}`)}return r.push(`L ${o?a:l} ${o?d:s}`),r.join(" ")}class rn extends e.AbstractComponent{constructor(){super(...arguments),this.name=nn}render(){this.removeAllChild();const{data:t=[]}=this.attribute;if(e.isEmpty(t))return;const i=[],n=[];t.forEach((t=>{const{start:o,end:r}=t;((t,i)=>{const{start:n,end:o}=i,r=n.x===o.x,a=r?"x":"y",s=r?"y":"x";let l=!0;const d=1e-6;t.length&&t.forEach((t=>{if(e.isNumberClose(t.start[a],n[a])){const e=Math.min(n[s],o[s]),i=Math.max(n[s],o[s]),r=Math.min(t.start[s],t.end[s]),a=Math.max(t.start[s],t.end[s]);if(!(i<r-d||e>a+d))return t.start[s]=Math.min(r,e),t.end[s]=Math.max(a,i),void(l=!1)}})),l&&t.push(i)})(o.x===r.x?i:n,t)})),[...i,...n].forEach(((t,i)=>{var n;const{start:o,end:r,size:a=4,gap:s=5,style:l={}}=t,d=y(t,["start","end","size","gap","style"]),c=e.createGroup({}),h=o.x===r.x;let u,g,p,v;h?(u={x:o.x-s/2,y:o.y},g={x:r.x-s/2,y:r.y},p={x:o.x+s/2,y:o.y},v={x:r.x+s/2,y:r.y}):(u={x:o.x,y:o.y-s/2},g={x:r.x,y:r.y-s/2},p={x:o.x,y:o.y+s/2},v={x:r.x,y:r.y+s/2});const m=on(u,g,a,h?75:15,h),x=on(o,r,a,h?75:15,h),f=on(p,v,a,h?75:15,h);c.add(e.createPath(Object.assign(Object.assign({path:m,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(e.createPath(Object.assign(Object.assign({path:f,stroke:"#000",lineWidth:1},l),{pickable:!1,zIndex:1}))),c.add(e.createPath({path:x,stroke:"#fff",lineWidth:s,pickable:!1,zIndex:0})),c.name="series-break",c.data=d,e.isValid(d.axisId)&&(c.id=`${null!==(n=d.axisId)&&void 0!==n?n:""}_${i}`),this.add(c)}))}}function an(t,e,i=1){return Math.abs(t-e)<i}function sn(t,i){return{type:"component",componentType:nn,interactive:!0,zIndex:500,style:{data:(n,o)=>{const r=[],a=o.vchart.getChart(),s="horizontal"===a.getAllSeries()[0].direction;return t.forEach(((t,n)=>{var o,l;const d=t.id,c=e.isValid(d)?a.getComponentByUserId(d):i&&e.isValid(i[n])?a.getComponentByIndex("axes",i[n]):null===(o=a.getComponentsByKey("axes").filter((e=>e.getSpec().breaks===t.breaks)))||void 0===o?void 0:o[0];if(!c)return;const h=null!=d?d:`${c.type}-${c.id}`,u=function(t){let{x:e,y:i}=t[0].getLayoutStartPoint(),n=e+t[0].getLayoutRect().width,o=i+t[0].getLayoutRect().height;for(let r=1;r<t.length;r++){const a=t[r],{x:s,y:l}=a.getLayoutStartPoint(),{width:d,height:c}=a.getLayoutRect();e=Math.min(e,s),n=Math.max(n,d+s),i=Math.min(i,l),o=Math.max(o,c+l)}return{x1:e,y1:i,x2:n,y2:o}}(c.getRegions());e.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((t=>{const{range:e,breakSymbol:i,gap:n=5}=t,o=c.valueToPosition(e[0]),l=c.valueToPosition(e[1]),d=(o+l)/2+(s?u.x1:u.y1);a.getAllSeries().forEach((t=>{if("bar"===t.type||"waterfall"===t.type){t.getMarkInName("bar").getGraphics().forEach((t=>{const a=t.AABBBounds;let c,g,p,y,v=!1;s?(v=a.x1<(o+l-n)/2&&a.x2>(o+l+n)/2,c=d,g=Math.max(a.y1+u.y1-2,u.y1),p=d,y=Math.min(a.y2+u.y1+2,u.y2)):(v=a.y1<(o+l-n)/2&&a.y2>(o+l+n)/2,c=Math.max(a.x1+u.x1-2,u.x1),g=d,p=Math.min(a.x2+u.x1+2,u.x2),y=d),v&&r.push({start:{x:c,y:g},end:{x:p,y:y},gap:n,style:null==i?void 0:i.style,axisId:h,data:e})}))}else if("line"===t.type){t.getMarkInName(t.type).getGraphics().forEach((t=>{dn(t,"line").forEach((t=>{ln(s?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(o+l)/2},end:{x:u.x2-u.x1,y:(o+l)/2}},t).forEach((t=>{let o,a;s?(o={x:d,y:Math.max(t[1]+u.y1-10,u.y1)},a={x:d,y:Math.min(t[1]+u.y1+10,u.y2)}):(o={x:Math.max(t[0]+u.x1-10,u.x1),y:d},a={x:Math.min(t[0]+u.x1+10,u.x2),y:d}),r.push({start:o,end:a,gap:n,style:null==i?void 0:i.style,axisId:h,data:e})}))}))}))}else if("area"===t.type){t.getMarkInName("area").getGraphics().forEach((t=>{dn(t,"area").forEach((t=>{const a=ln(s?{start:{x:(o+l)/2,y:0},end:{x:(o+l)/2,y:u.y2-u.y1}}:{start:{x:0,y:(o+l)/2},end:{x:u.x2-u.x1,y:(o+l)/2}},t);a.sort(((t,e)=>t[0]-e[0]));for(let o=0;o<a.length-1;o++){const l={x:a[o][0],y:a[o][1]},d={x:a[o+1][0],y:a[o+1][1]};if(cn(s?{x:l.x,y:(l.y+d.y)/2}:{x:(l.x+d.x)/2,y:l.y},t)){let t,o;s?(t={x:l.x+u.x1,y:Math.max(l.y+u.y1-0,u.y1)},o={x:d.x+u.x1,y:Math.min(d.y+u.y1+0,u.y2)}):(t={x:Math.max(l.x+u.x1-0,u.x1),y:l.y+u.y1},o={x:Math.min(d.x+u.x1+0,u.x2),y:d.y+u.y1}),r.push({start:t,end:o,gap:n,style:null==i?void 0:i.style,axisId:h,data:e})}}}))}))}}))}))})),r}}}}function ln(t,i){const n=[];for(let o=1;o<i.length;o++){const r=e.getIntersectPoint([t.start.x,t.start.y],[t.end.x,t.end.y],[i[o].x,i[o].y],[i[o-1].x,i[o-1].y]);r&&!n.find((t=>an(e.PointService.distancePP({x:t[0],y:t[1]},{x:r[0],y:r[1]}),0)))&&n.push(r)}return n}function dn(t,e){const{points:i,segments:n}=t.attribute,o=[];let r=[];const a=t=>{if(t&&t.length){let i=[];if(t.forEach((t=>{var n,a;if(!1===t.defined){if(o.push(r),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}r=[],i=[]}else r.push({x:t.x,y:t.y}),"area"===e&&i.push({x:null!==(n=t.x1)&&void 0!==n?n:t.x,y:null!==(a=t.y1)&&void 0!==a?a:t.y})})),"area"===e&&i.length){for(let t=i.length-1;t>=0;t--)r.push({x:i[t].x,y:i[t].y});r.push(r[0])}o.push(r)}};return i&&i.length?a(i):n&&n.length&&n.forEach((t=>{a(t.points)})),o}function cn(t,e){const{x:i,y:n}=t;let o=!1;for(let t=0,r=e.length-1;t<e.length;r=t++){const{x:a,y:s}=e[t],{x:l,y:d}=e[r];s>n!=d>n&&i<(l-a)*(n-s)/(d-s)+a&&(o=!o)}return o}const hn="barLink";class un extends e.AbstractComponent{constructor(){super(...arguments),this.name=hn}render(){const{data:t,linkStyle:i,areaStyle:n,styleMap:o,label:r,linkType:a="total"}=this.attribute;e.isEmpty(t)||(this.removeAllChild(),t.forEach(((t,s)=>{var l,d,c,h,u;const{linePoints:g,areaPoints:p,id:y=s,color:v,data:m}=t;if(p&&!1!==(null===(l=null==o?void 0:o[`area-${y}`])||void 0===l?void 0:l.visible)){const t=e.createArea(Object.assign(Object.assign({points:p,fillOpacity:.3,fill:v,zIndex:0},n),null==o?void 0:o[`area-${y}`]));t.name="bar-link-area",t.id=`area-${y}`,this.add(t)}if(g&&!1!==(null===(d=null==o?void 0:o[`line-${y}`])||void 0===d?void 0:d.visible)&&0!==(null===(c=null==i?void 0:i.lineStyle)||void 0===c?void 0:c.lineWidth)&&0!==(null===(h=null==o?void 0:o[`line-${y}`])||void 0===h?void 0:h.lineWidth)){const{startSymbol:t={},endSymbol:n={},lineStyle:r}=i||{},a=e.cloneDeep(t),s=e.cloneDeep(n);(null==o?void 0:o[`line-${y}`])&&o[`line-${y}`].stroke&&(a.style=Object.assign(Object.assign({},a.style),{color:o[`line-${y}`].stroke}),s.style=Object.assign(Object.assign({},s.style),{color:o[`line-${y}`].stroke})),a.symbolType||a.originSymbolType||(a.originSymbolType="solidArrow"),s.symbolType||s.originSymbolType||(s.originSymbolType="solidArrow");const l=new e.Segment({points:g,startSymbol:Object.assign({size:8},a),endSymbol:Object.assign({size:8},s),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},r),null==o?void 0:o[`line-${y}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${y}`,this.add(l)}if((null==r?void 0:r.visible)&&!1!==(null===(u=null==o?void 0:o[`label-${y}`])||void 0===u?void 0:u.visible)){const{style:t,formatMethod:i}=r,[n,s]=m;let l=n[e.STACK_FIELD_END],d=s[e.STACK_FIELD_END];"value"===a&&(l=n[e.STACK_FIELD_END]-n[e.STACK_FIELD_START],d=s[e.STACK_FIELD_END]-s[e.STACK_FIELD_START]);const c=d-l,h=(d-l)/l*100,u=e.createText(Object.assign(Object.assign({x:.5*(g[0].x+g[1].x),y:.5*(g[0].y+g[1].y),text:i?i(c,h,m):`${c} ${h}`,fontSize:14,fill:"#000",stroke:"#fff",lineWidth:1,textAlign:"center",textBaseline:"middle",background:"#fff",zIndex:2},t),null==o?void 0:o[`label-${y}`]));u.name="bar-link-label",u.id=`label-${y}`,this.add(u)}})))}}function gn(t,i,n){const{isHorizontal:o,isXAxisInverse:r,isYAxisInverse:a,linkType:s,doFill:l,regionStartX:d,regionStartY:c}=n,h=t.AABBBounds,u=i.AABBBounds;let g,p;return o?(g=[{x:(h.x1+h.x2)/2+d,y:h.y1+c},{x:(u.x1+u.x2)/2+d,y:u.y2+c}],r?("total"===s&&(g=[{x:h.x1+d,y:h.y1+c},{x:u.x1+d,y:u.y2+c}]),l&&(p=[{x:h.x1+d,x1:h.x2+d,y:h.y1+c},{x:u.x1+d,x1:u.x2+d,y:u.y2+c}])):("total"===s&&(g=[{x:h.x2+d,y:h.y1+c},{x:u.x2+d,y:u.y2+c}]),l&&(p=[{x:h.x2+d,x1:h.x1+d,y:h.y1+c},{x:u.x2+d,x1:u.x1+d,y:u.y2+c}]))):(g=[{x:h.x2+d,y:(h.y1+h.y2)/2+c},{x:u.x1+d,y:(u.y1+u.y2)/2+c}],a?("total"===s&&(g=[{x:h.x2+d,y:h.y2+c},{x:u.x1+d,y:u.y2+c}]),l&&(p=[{x:h.x2+d,y:h.y2+c,y1:h.y1+c},{x:u.x1+d,y:u.y2+c,y1:u.y1+c}])):("total"===s&&(g=[{x:h.x2+d,y:h.y1+c},{x:u.x1+d,y:u.y1+c}]),l&&(p=[{x:h.x2+d,y:h.y1+c,y1:h.y2+c},{x:u.x1+d,y:u.y1+c,y1:u.y2+c}]))),{areaPoints:p,linePoints:g,data:[e.getDatumOfGraphic(t),e.getDatumOfGraphic(i)],color:t.attribute.fill}}function pn(t={},i){const{linkType:n="total",doFill:o}=t,r=y(t,["linkType","doFill"]);return{type:"component",componentType:hn,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(t,i)=>{const{vchart:r}=i,a=r.getChart().getAllRegions(),s=[];return a.forEach((t=>{const i=t.getSeries().filter((t=>"bar"===t.type)),{x:r,y:a}=t.getLayoutStartPoint();if(i.length){const t=i[0].getGroupFields(),l=[];i.forEach((t=>{var e;(null===(e=t.getMarkInName("bar"))||void 0===e?void 0:e.getGraphics()).forEach((t=>{l.push(t)}))}));const d=function(t,i){const n={};for(let o=0;o<t.length;o++){const r=t[o],a=e.getDatumOfGraphic(r),s=i.map((t=>a[t])).join("-");n[s]||(n[s]=[]),n[s].push(r)}return n}(l,t);Object.values(d).forEach((t=>{t.sort(((t,i)=>e.getDatumOfGraphic(t)[e.STACK_FIELD_END]-e.getDatumOfGraphic(i)[e.STACK_FIELD_END]))}));const c=i[0],h="horizontal"===c.direction,u=c.getYAxisHelper().isInverse(),g=c.getXAxisHelper().isInverse(),p=Object.values(d);if(p.length)if(h){p[0][0].AABBBounds.y1<p[p.length-1][0].AABBBounds.y1&&p.reverse()}else{p[0][0].AABBBounds.x1>p[p.length-1][0].AABBBounds.x1&&p.reverse()}for(let t=0;t<p.length-1;t++){const e=p[t],i=p[t+1];if(e.forEach(((t,e)=>{var l;const d=gn(t,null!==(l=i[e])&&void 0!==l?l:i[i.length-1],{isHorizontal:h,isXAxisInverse:g,isYAxisInverse:u,doFill:o,linkType:n,regionStartX:r,regionStartY:a});s.push(d)})),e.length<i.length){const t=e[e.length-1];for(let l=e.length;l<i.length;l++){const e=gn(t,i[l],{isHorizontal:h,isXAxisInverse:g,isYAxisInverse:u,doFill:o,linkType:n,regionStartX:r,regionStartY:a});s.push(e)}}}}})),s},linkType:n},r),i)}}const yn="seriesLabel";function vn(t,e=10,i=10,n=.1){const o=t.length;if(!t.every(isFinite))return t;if(!(o>1))return t;const r=function(t,e,i){t=+t,e=+e;let n=arguments.length;i=n<2?(e=t,t=0,1):n<3?1:+i;let o=-1;n=0|Math.max(0,Math.ceil((e-t)/i));const r=new Array(n);for(;++o<n;)r[o]=t+o*i;return r}(t.length);for(let a=0;a<i;++a){r.sort(((e,i)=>{return n=t[e],o=t[i],null==n||null==o?NaN:n<o?-1:n>o?1:n>=o?0:NaN;var n,o}));let i=0;for(let n=1;n<o;++n){let o=t[r[n]]-t[r[n-1]];o<e&&(o=(e-o)/2,i=Math.max(i,o),t[r[n-1]]-=o,t[r[n]]+=o)}if(i<n)break}return t}function mn(t,e){return!(e.x1>t.x2||e.x2<t.x1||e.y1>t.y2||e.y2<t.y1)}function xn(t,e=10,i=10){const n=t.length;let o,r=0;do{o=!1;for(let i=0;i<n;++i)for(let r=i+1;r<n;++r){const n=t[i].AABBBounds,a=t[r].AABBBounds;if(mn(n,a)){const i=e-(a.x1-n.x2);i>0&&(t[r].attribute.x+=i,a.x1+=i,a.x2+=i,o=!0)}}r++}while(o&&r<i)}function fn(t,i){const{label:n,line:o}=i;return{type:"component",componentType:yn,interactive:!1,style:{position:t,layout:(t,e)=>{var i;return null!==(i=e.vchart.getChart().getAllSeries()[0].getSpec().direction)&&void 0!==i?i:"vertical"},data:(i,n)=>{var o;const r=n.vchart.getChart(),a=r.getAllSeries()[0],s="horizontal"===a.direction,l=s?a.getYAxisHelper():a.getXAxisHelper(),d=null===(o=l.getScale)||void 0===o?void 0:o.call(l,0),c=l.isInverse(),h=a.getDimensionField()[0],u=a.getSeriesField(),g=r.getAllSeries().map((t=>t.type)).filter(((t,e,i)=>i.indexOf(t)===e)),p=[];if(1===g.length&&["bar","area","line","waterfall"].includes(g[0])){("both-ends"===t?["start","end"]:[t]).forEach((t=>{const i="end"===t?e.last(d.domain()):d.domain()[0],n=a.getRegion(),{x:o,y:l}=n.getLayoutStartPoint();let y=0;r.getAllSeries().forEach((e=>{e.getMarkInName("waterfall"===g[0]?"bar":g[0]).getGraphics().forEach((n=>{var r;const a=n.context.data.find((t=>t[h]===i));if(a){const i=n.AABBBounds;let d,v,m,x;"bar"===g[0]||"waterfall"===g[0]?(d="end"===t?{x:s?(i.x1+i.x2)/2:c?i.x1:i.x2,y:s?c?i.y2:i.y1:(i.y1+i.y2)/2}:{x:s?(i.x1+i.x2)/2:c?i.x2:i.x1,y:s?c?i.y1:i.y2:(i.y1+i.y2)/2},v=n.attribute.fill):(d=e.dataToPosition(a),v=n.attribute.stroke||n.attribute.fill),"end"===t?(m=s?"center":c?"end":"start",x=s?c?"top":"bottom":"middle"):(m=s?"center":c?"start":"end",x=s?c?"bottom":"top":"middle");const f=null!==(r=a[u])&&void 0!==r?r:a[h];p.push({point:{x:d.x+o,y:d.y+l},label:f,color:v,textAlign:m,textBaseline:x,series:e,datum:a,id:`${t}-${y}`,position:t}),y++}}))}))}))}return p},line:o,label:Object.assign({space:12},n)}}}class bn extends e.AbstractComponent{constructor(){super(...arguments),this.name=yn}render(){var t,i,n,o;this.removeAllChild();const{data:r,layout:a,label:s,line:l={}}=this.attribute;if(e.isEmpty(r))return;const d=null!==(t=null==s?void 0:s.styleMap)&&void 0!==t?t:{},c={},h=r.filter((t=>{var e;return!1!==(null===(e=d[t.id])||void 0===e?void 0:e.visible)}));if("vertical"===a){const t=1.5*(null!==(n=null===(i=null==s?void 0:s.style)||void 0===i?void 0:i.fontSize)&&void 0!==n?n:12),o=(t,i,n)=>{var o,r,a,s,l,d,c,h;const{label:u,color:g,textAlign:p,textBaseline:y,id:v}=t,m=null!==(r=null===(o=n[v])||void 0===o?void 0:o.formatMethod)&&void 0!==r?r:null===(a=this.attribute.label)||void 0===a?void 0:a.formatMethod,x=e.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:m?m(u,t.datum,{series:t.series}):u},null===(s=this.attribute.label)||void 0===s?void 0:s.style),i),{textAlign:p,textBaseline:y,fill:null!==(c=null===(d=null===(l=this.attribute.label)||void 0===l?void 0:l.style)||void 0===d?void 0:d.fill)&&void 0!==c?c:g}),null===(h=n[v])||void 0===h?void 0:h.style));return x.name="series-label-text",x.id=v,this.add(x),x};["start","end"].forEach((e=>{const i=h.filter((t=>t.position===e)),n=vn(i.map((t=>t.point.y)),t);i.forEach(((t,e)=>{var i;const r={x:t.point.x+(null!==(i=null==s?void 0:s.space)&&void 0!==i?i:8)*("start"===t.textAlign?1:-1),y:n[e]};o(t,r,d),c[t.id]=r}))}))}else{const t=[],i=[];h.forEach((n=>{var o,r,a,l,c;const{point:h,label:u,color:g,textAlign:p,textBaseline:y,id:v,position:m}=n,x={x:h.x,y:h.y},f=null!==(r=null===(o=d[v])||void 0===o?void 0:o.formatMethod)&&void 0!==r?r:null==s?void 0:s.formatMethod,b=e.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:f?f(u,n.datum,{series:n.series}):u},null==s?void 0:s.style),x),{textAlign:p,textBaseline:y,fill:null!==(l=null===(a=null==s?void 0:s.style)||void 0===a?void 0:a.fill)&&void 0!==l?l:g}),null===(c=d[v])||void 0===c?void 0:c.style));b.id=v,b.name="series-label-text",this.add(b),"start"===m?t.push(b):"end"===m&&i.push(b)})),t.length&&xn(t,4,10),i.length&&xn(i,4,10);const n=null!==(o=null==s?void 0:s.space)&&void 0!==o?o:8;[...t,...i].forEach((t=>{const e="top"===t.attribute.textBaseline?1:-1;t.setAttribute("y",t.attribute.y+n*e),c[t.id]={x:t.attribute.x,y:t.attribute.y}}))}!1!==l.visible&&h.forEach((t=>{var i,n,o,r,s,h;const{point:u,color:g,id:p}=t,y={x:c[p].x+(null!==(o=null===(n=null===(i=d[p])||void 0===i?void 0:i.style)||void 0===n?void 0:n.dx)&&void 0!==o?o:0),y:c[p].y+(null!==(h=null===(s=null===(r=d[p])||void 0===r?void 0:r.style)||void 0===s?void 0:s.dy)&&void 0!==h?h:0)};if(!1!==l.autoVisible){if("vertical"===a&&u.y!==y.y||"horizontal"===a&&u.x!==y.x){const t=e.createLine(Object.assign({points:[u,y],lineWidth:1,stroke:g},l.style));t.name="series-label-line",this.add(t)}}else{const t=e.createLine(Object.assign({points:[u,y],lineWidth:1,stroke:g},l.style));t.name="series-label-line",this.add(t)}}))}}function kn(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function _n(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e,i;return Object.assign(Object.assign({},t),{bound:(i=t.rect,{x1:i.x,x2:i.x+i.width,y1:i.y,y2:i.y+i.height}),anchorCandidates:Ln(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),n=[];n.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const o=i[t],r=o.bound;let a=n.some((t=>kn(t,r)));if(o.anchorCandidates)if(a&&(null===(e=o.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;t<o.anchorCandidates.length;t++){const e=o.anchorCandidates[t],i={x1:e.x,y1:e.y,x2:e.x+r.x2-r.x1,y2:e.y+r.y2-r.y1,anchor:e};if(!n.some((t=>kn(t,i)))){n.push(i),a=!1;break}}a&&n.push(o.bound)}else n.push(o.bound)}return n.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function Sn(t,i,n){const o=t.map((t=>t.pointCoord)),{x1:r,x2:a,y1:s,y2:l}=e.getAABBFromPoints(o),d=n([(r+a)/2,(s+l)/2]);if(!d)return[];const c=t.map((t=>{const o=t.rect,r=An(i,t.pointCoord)?n(function(t,i,n,o=200){const r=5621/o;let a=i;for(let i=1;i<=r;i++){const i=e.destination(a,o,n);if(!An(t,i))return[i.x,i.y];a=[i.x,i.y]}return i}(i,[t.pointCoord.x,t.pointCoord.y],Mn(wn(t.point,d)))):t.point;r&&(o.x=r.x,o.y=r.y);const a=Mn(wn(t.point,d));let s;const l=[];return a>=-45&&a<45?(s="top",l.push("left","right")):a>=45&&a<135?s="right":a>=-135&&a<-45?(s="left",l.push("left")):(s="bottom",l.push("left","right")),t.anchors=l,t.offset=20,t.rect=Cn(t.rect,s,0),t}));return _n(c)}function Mn(t){return t>180?t-360:t}function wn(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function An(t,i){for(let n=0;n<t.length;n++){if(e.isPointInPolygon(i,t[n]))return!0}return!1}function Cn(t,e,i=0){const n=Object.assign({},t);return"top"===e?(n.x-=t.width/2,n.y-=i+t.height/2):"bottom"===e?(n.x-=t.width/2,n.y+=i-t.height/2):"left"===e?(n.x-=i+t.width,n.y-=t.height/2):"right"===e&&(n.x+=i,n.y-=t.height/2),n}function Ln(t,e,i,n=0){const o=[];return t.forEach((t=>{const{x:r,y:a}=Cn(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,n);o.push({x:r,y:a})})),o}const Fn={visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:10}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"black"}}};class Bn extends e.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return Fn}}class On extends e.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=Bn,this.layoutType="none",this.layoutZIndex=e.LayoutZIndex.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return e.getSpecInfo(t,this.specKey,this.type,(t=>t.visible&&e.isValid(t.seriesId)))}setAttrFromSpec(){var t,e,i,n;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(n=this._series)||void 0===n?void 0:n.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,n,o,r,a,s;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(o=null===(n=(i=this._regions[0]).getSpec)||void 0===n?void 0:n.call(i))||void 0===o?void 0:o.longitudeField,this._latitudeField=null===(s=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===s?void 0:s.latitudeField)}initData(){const t=this._series;if(!t)return;const i=t.getViewData();if(i){const t=new e.DataView(this._option.dataSet,{name:`${this.name}_data`});t.parse([i],{type:"dataview"}),t.transform({type:"copyDataView",level:e.TransformLevel.copyDataView},!1),this._data=new e.CompilableData(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(()=>(this.handleZoom(),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const t=this._spec.trigger;"none"!==t&&("hover"===t?(this.event.on("element-highlight:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("element-highlight:reset",(t=>{this._activeDatum&&this._updateDatum(null)}))):"click"===t&&(this.event.on("element-select:start",(t=>{const i=t.graphics[0];this._isRelativeSeries(i)&&this._updateDatum(e.getDatumOfGraphic(i))})),this.event.on("elementSelectReset",(t=>{this._activeDatum&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const n=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(n)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const i=[],n=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,i)=>{var n;const o=new e.MarkPoint({position:void 0,animation:!1});return o&&(o.name=`${this.name}_marker_${i}`,o.id=null!==(n=this._spec.id)&&void 0!==n?n:`${this.name}_marker_${this.id}`,o.setAttribute("zIndex",this.layoutZIndex)),o})));this._markerComponents.forEach(((t,e)=>{const{pairInfo:o,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[e],e);o&&i.push(o),r&&n.push(r)}));const o=this._layoutLabels(i);this._layoutMarkers(o,n),this._renderMarkers()}_evaluateMarker(t,i){var n,o,r,a,s,l,d,c,h,u,g,p,y,v;let m=0,x=0,f=0,b=0,k=0;const _=this._spec.position||"top",S=this._spec.offset,M=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),w=this._spec.space||0;x+=((null==M?void 0:M.left)||0)+((null==M?void 0:M.right)||0),f+=((null==M?void 0:M.top)||0)+((null==M?void 0:M.bottom)||0);const A={},C=this.dataToPosition(t),L=e.graphicCreator.group({});if(L.name=`${this.name}_marker_itemContainer_${i}`,A.container=L,null===(o=this._spec.background)||void 0===o?void 0:o.visible){const t=e.graphicCreator.rect(e.transformToGraphic(Object.assign({},this._spec.background.style)));t.setAttributes(C),A.labelBackground=t,L.appendChild(t)}if(null===(r=this._spec.icon)||void 0===r?void 0:r.visible){const t=e.graphicCreator.symbol(e.transformToGraphic(Object.assign({},this._spec.icon.style)));t.setAttributes(C),t.setAttribute("symbolType",null!==(s=null===(a=this._spec.icon.style)||void 0===a?void 0:a.symbolType)&&void 0!==s?s:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=t.AABBBounds,n=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,o=null!==(c=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==c?c:0;A.icon=t,L.appendChild(t),k=n,b+=o,m++}if(null===(h=this._spec.nameLabel)||void 0===h?void 0:h.visible){const i=e.graphicCreator.text(e.transformToGraphic(Object.assign({},this._spec.nameLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.nameField]);const n=i.AABBBounds,o=null!==(u=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==u?u:0,r=null!==(g=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==g?g:0;A.nameLabel=i,L.appendChild(i),k=Math.max(k,o),b+=r,m++}if((null===(p=this._spec.valueLabel)||void 0===p?void 0:p.visible)&&e.isValid(t[this.valueField])){const i=e.graphicCreator.text(e.transformToGraphic(Object.assign({},this._spec.valueLabel.style)));i.setAttributes(C),i.setAttribute("text",t[this.valueField]);const n=i.AABBBounds,o=null!==(y=(null==n?void 0:n.y2)-(null==n?void 0:n.y1))&&void 0!==y?y:0,r=null!==(v=(null==n?void 0:n.x2)-(null==n?void 0:n.x1))&&void 0!==v?v:0;A.valueLabel=i,L.appendChild(i),k=Math.max(k,o),b+=r,m++}const F=Object.values(A).find((t=>!!t&&"group"!==t.type)),B={x:null==F?void 0:F.getComputedAttribute("x"),y:null==F?void 0:F.getComputedAttribute("y")},O={x:B.x,y:B.y,width:0,height:0};O.width=x+b+(m-1)*w,O.height=f+k;const T={rect:O,point:B,index:i};if("outer"!==_){const t=["top","right","left","bottom"].filter((t=>t!==_));T.rect=Cn(O,_,S),T.anchors=t,T.offset=S}else T.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:T,contentMarks:A}}_layoutMarkers(t,i){var n,o,r;for(let a=0;a<i.length;a++){if(!t[a]||!i[a])return;const{icon:s,nameLabel:l,valueLabel:d,labelBackground:c,container:h}=i[a],u=t[a],g=e.normalizeLayoutPaddingSpec(null===(n=this._spec.background)||void 0===n?void 0:n.padding),p=this._spec.space||0,y=u.height/2;let v=(null==g?void 0:g.left)||0;[s,l,d].forEach(((t,e)=>{var i,n;if(t){const o=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=o.x2-o.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:v+r,y:y}),v+=null!==(n=o.x2-o.x1)&&void 0!==n?n:0,2!==e&&(v+=p)}})),null==c||c.setAttributes({x:0,y:0,width:u.width,height:u.height}),null==h||h.setAttributes({dx:-u.width/2,dy:-u.height/2});const m=this._data.getLatestData()[a],x=this.dataToPosition(m),f=this.getRegions()[0].getLayoutStartPoint(),b=!(!(null===(o=this._spec.leader)||void 0===o?void 0:o.visible)||!(s||l||d));this._markerComponents[a].setAttributes({x:f.x,y:f.y,position:x,visible:this._activeDatum.includes(m),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>h,autoRotate:!1,offsetX:u.x+u.width/2-x.x,offsetY:u.y+u.height/2-x.y},itemLine:{visible:b,type:"type-po",lineStyle:e.transformToGraphic(Object.assign({},null===(r=this._spec.leader)||void 0===r?void 0:r.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;t<this._markerComponents.length;t++)this.getContainer().add(this._markerComponents[t])}_layoutLabels(t){return"outer"===this._spec.position&&this._map?Sn(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):_n(t)}_isRelativeModel(t){var e,i,n;const o=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(n=this._series.getCoordinateHelper())||void 0===n?void 0:n.getCoordinateId();return(null==t?void 0:t.id)===o}_isRelativeSeries(t){var e;return(null===(e=t.context)||void 0===e?void 0:e.modelId)===this._series.id}_getNeedClearVRenderComponents(){return this._markerComponents}getVRenderComponents(){return this._markerComponents}}On.type="mapLabel",On.specKey="mapLabel",On.transformerConstructor=Bn;const Tn="regressionLine";class In extends e.AbstractComponent{constructor(){super(...arguments),this.name=Tn}render(){this.removeAllChild();const{data:t,line:i={},label:n,name:o="regression-line",confidenceInterval:r}=this.attribute;e.isEmpty(t)||t.forEach((t=>{const{color:a}=t;if(t.area&&!1!==(null==r?void 0:r.visible)){const i=e.createArea(Object.assign(Object.assign({points:t.area},e.isValid(a)?{fill:a,fillOpacity:.12}:null),null==r?void 0:r.style));i.name="scatter-regression-area",this.add(i)}if(t.line&&!1!==(null==i?void 0:i.visible)){const n=e.createLine(Object.assign(Object.assign({points:t.line,lineWidth:1},e.isValid(a)?{stroke:a}:null),null==i?void 0:i.style));n.name=`${o}-curve`,this.add(n)}const s=e.last(t.line);if(n&&!1!==n.visible&&n.text&&s){const t=e.createText(Object.assign(Object.assign(Object.assign({},s),{text:n.text,textAlign:"end",textBaseline:"middle"}),n.style));t.name=`${o}-label`,this.add(t)}}))}}const Dn=(t,i,n=(t=>t.x),o=(t=>t.y),r)=>{switch(t){case"logisitc":return e.regressionLogistic(i,n,o);case"lowess":return e.regressionLowess(i,n,o);case"polynomial":return e.regressionPolynomial(i,n,o,{degree:r});default:return e.regressionLinear(i,n,o)}};function En(t,i){const{color:n,line:o,confidenceInterval:r,label:a}=i;return{type:"component",componentType:Tn,interactive:!1,style:{data:(o,r)=>{const a=r.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.scatter)),s=[];return a&&a.length&&a.forEach((o=>{var r,a;const l=o.getRegion().getLayoutStartPoint(),d=o.getRegion().getLayoutRect(),c=e.clamper(l.y,l.y+d.height),h=o.getColorAttribute(),u=o.getSeriesKeys(),g=o.getViewData().latestData,p=null===(r=o.fieldX)||void 0===r?void 0:r[0],y=null===(a=o.fieldY)||void 0===a?void 0:a[0];p&&y&&g&&!(g.length<=2)&&u.forEach((e=>{var r;const a=g.filter((t=>t[null==h?void 0:h.field]===e));if(!a.length)return;const{evaluateGrid:u,confidenceInterval:v}=Dn(t,a,(t=>null==t?void 0:t[p]),(t=>null==t?void 0:t[y]),i.polynomialDegree),m=Math.max(3,Math.floor(a.length/4)),x=u(m),f=v(m);s.push({color:null!=n?n:null===(r=null==h?void 0:h.scale)||void 0===r?void 0:r.scale(e),line:x.map((e=>{const i={[p]:e.x,[y]:e.y};return{x:o.dataToPositionX(i)+l.x,y:c("logisitc"===t?l.y+d.height*(1-e.y):o.dataToPositionY(i)+l.y)}})),area:f.map((t=>{const e={[p]:t.x,[y]:t.lower};return{x:o.dataToPositionX(e)+l.x,y:c(o.dataToPositionY(e)+l.y),y1:c(o.dataToPositionY({[y]:t.upper})+l.y)}}))})}))})),s},line:o,confidenceInterval:r,label:a}}}function jn(t){const{color:i,line:n,confidenceInterval:o,label:r}=t;return{type:"component",componentType:Tn,interactive:!1,zIndex:500,style:{data:(n,o)=>{const r=o.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.bar)),a=[];return r&&r.length&&r.forEach((n=>{var o,r,s;const l=n.getRegion().getLayoutStartPoint(),d=n.getRegion().getLayoutStartPoint(),c=n.getRegion().getLayoutRect(),h=e.clamper(d.y,d.y+c.height),u=n.getViewData().latestData,g=null===(o=n.fieldX)||void 0===o?void 0:o[0],p=null===(r=n.fieldY)||void 0===r?void 0:r[0],y="horizontal"===n.direction,v=n.getRawDataStatisticsByField(g).values;if(y||!g||!p||!u||u.length<=2||v.length<=2)return;const{evaluateGrid:m,confidenceInterval:x}=e.regressionPolynomial(u,(t=>v.indexOf(null==t?void 0:t[g])),(t=>null==t?void 0:t[p]),{degree:t.degree}),f=v.length,b=m(f),k=x(f),_=n.getXAxisHelper().getBandwidth(0)/2;a.push({color:null!=i?i:null===(s=n.getOption().globalScale.getScale("color"))||void 0===s?void 0:s.scale(n.getSeriesKeys()[0]),line:b.map((t=>{const e={[g]:v[t.x],[p]:t.y};return{x:n.dataToPositionX(e)+l.x+_,y:h(n.dataToPositionY(e)+l.y)}})),area:k.map((t=>{const e={[g]:v[t.x],[p]:t.lower};return{x:n.dataToPositionX(e)+l.x+_,y:h(n.dataToPositionY(e)+l.y),y1:h(n.dataToPositionY({[p]:t.upper})+l.y)}}))})})),a},line:n,confidenceInterval:o,label:r}}}const Pn=(t,i,n)=>{switch(t){case"kde":return e.kde(i,n);case"ecdf":return e.ecdf(i)}};function Rn(t,i){const{line:n,label:o,color:r}=i;return{type:"component",componentType:Tn,interactive:!1,zIndex:500,style:{data:(i,n)=>{const o=n.vchart.getChart().getAllSeries().filter((t=>t.type===e.SeriesTypeEnum.bar)),a=[];return o&&o.length&&o.forEach((i=>{var n,o,s,l,d,c,h,u;const g=i.getRegion().getLayoutStartPoint(),p=i._rawData,y=null==p?void 0:p.rawData,v=null===(o=null===(n=p.transformsArr)||void 0===n?void 0:n.find((t=>"bin"===t.type)))||void 0===o?void 0:o.options,m=null===(s=i.fieldX)||void 0===s?void 0:s[0],x=i.getYAxisHelper().getScale(0),f=i.getViewData().latestData;if(!(y&&y.length&&(null==v?void 0:v.field)&&x&&f&&f.length))return;const b=y.map((t=>t[v.field])),k=Pn(t,b,"kde"===t?{bandwidth:f[0][null!==(d=null===(l=v.outputNames)||void 0===l?void 0:l.x1)&&void 0!==d?d:"x1"]-f[0][null!==(h=null===(c=v.outputNames)||void 0===c?void 0:c.x0)&&void 0!==h?h:"x0"]}:null),_=Math.max(3,Math.floor(b.length/4)),S=k.evaluateGrid(_),M=x.range(),w=M[0],A=e.last(M),C="kde"===t?t=>x.scale(t*y.length*k.bandwidth):t=>w+(A-w)*t;a.push({color:null!=r?r:null===(u=i.getOption().globalScale.getScale("color"))||void 0===u?void 0:u.scale(i.getSeriesKeys()[0]),line:S.map((t=>{const e={[m]:t.x};return{x:i.dataToPositionX(e)+g.x,y:C(t.y)+g.y}}))})})),a},line:n,label:o}}}const $n="ExtensionMarkSyncStatePlugin";class zn extends e.BasePlugin{constructor(){super($n),this.type=$n}onAfterInitChart(t,i){var n;if(!this._detectSyncState(i))return;const o=t.globalInstance.getChart();if(!o)return;const r=o.getEvent();if(this._subscribedEvent===r)return;null===(n=this._unsubscribeAfterRender)||void 0===n||n.call(this);const a=()=>this._syncStates();r.on(e.ChartEvent.afterRender,a),this._subscribedEvent=r,this._unsubscribeAfterRender=()=>{r.off(e.ChartEvent.afterRender,a),this._subscribedEvent=void 0}}release(){var t;null===(t=this._unsubscribeAfterRender)||void 0===t||t.call(this),super.release()}_detectSyncState(t){const e=null==t?void 0:t.series;return!!(null==e?void 0:e.some((t=>this._hasExtensionMarkWithSyncState(t.extensionMark))))||this._hasExtensionMarkWithSyncState(null==t?void 0:t.extensionMark)}_hasExtensionMarkWithSyncState(t){return!!(null==t?void 0:t.some((t=>"group"!==t.type&&t.syncState)))}_syncStates(){var t;const e=null===(t=this.service)||void 0===t?void 0:t.globalInstance.getChart();e&&e.getAllSeries().forEach((t=>{var e,i;const n=null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.extensionMark)||void 0===i?void 0:i.filter((t=>"group"!==t.type&&t.syncState));(null==n?void 0:n.length)&&this._syncSeriesStates(t,n)}))}_syncSeriesStates(t,i){const n=new Map;if(t.getActiveMarks().forEach((t=>{t.getGraphics().forEach((t=>{var i;const o=null===(i=t.context)||void 0===i?void 0:i.key;e.isValid(o)&&n.set(String(o),t)}))})),0===n.size)return;const o=`${t.type}_${t.id}_extensionMark`;i.forEach(((i,r)=>{const a=e.isValid(i.name)?`${i.name}`:`${o}_${r}`,s=t.getMarkInName(a);s&&s.getGraphics().forEach((t=>{var i;const o=null===(i=t.context)||void 0===i?void 0:i.key;if(!e.isValid(o))return;const r=n.get(String(o));if(!r)return;const a=r.currentStates;(null==a?void 0:a.length)?t.useStates(a):t.clearStates()}))}))}}zn.pluginType="chart",zn.type=$n;t.BAR_LINK=hn,t.Bar3dChart=rt,t.Bar3dChartSpecTransformer=V,t.Bar3dSeries=et,t.Bar3dSeriesSpecTransformer=J,t.BarLinkComponent=un,t.CandlestickChart=Dt,t.CandlestickChartSpecTransformer=_t,t.CandlestickSeries=Tt,t.CombinationCandlestickChart=Pt,t.CombinationCandlestickChart_TYPE=kt,t.ConversionFunnelChart=L,t.ConversionFunnelSeries=F,t.DEFAULT_STROKE_COLOR="#000",t.DefaultBandWidth=6,t.ExtensionMarkSyncStatePlugin=zn,t.Funnel3dChart=ut,t.Funnel3dSeries=ct,t.Funnel3dSeriesSpecTransformer=st,t.Histogram3dChart=gt,t.ImageCloudChart=Ee,t.MapLabelComponent=On,t.PictogramChart=Me,t.PictogramChartSpecTransformer=ne,t.PictogramSeries=_e,t.Pie3dChart=bt,t.Pie3dChartSpecTransformer=pt,t.Pie3dSeries=xt,t.Pie3dSeriesSpecTransformer=mt,t.REGRESSION_LINE=Tn,t.RangeColumn3dChart=Jt,t.RangeColumn3dChartSpecTransformer=qt,t.RangeColumn3dSeries=Yt,t.RangeColumn3dSeriesSpecTransformer=Zt,t.RankingBar=a,t.RankingList=p,t.RegressionLine=In,t.SERIES_BREAK=nn,t.SequenceScatterKDE=P,t.SequenceScatterLink=T,t.SequenceScatterPixel=N,t.SeriesBreakComponent=rn,t.SeriesLabelComponent=bn,t.StorylineChart=en,t.StorylineChartSpecTransformer=Zi,t.TimelineChart=Ne,t.WordCloud3dChart=Wt,t.WordCloud3dChartSpecTransformer=Vt,t.WordCloud3dSeries=$t,t.appendBarLinkConfig=function(t,i){t.customMark=e.array(t.customMark).filter((t=>t.componentType!==hn)),t.customMark.push(pn(i))},t.appendBarRegressionLineConfig=function(t,i){var n,o;i||(i=null!==(n=e.get(t,Tn))&&void 0!==n?n:e.get(null===(o=t.series)||void 0===o?void 0:o.find((t=>t.type===e.SeriesTypeEnum.bar)),Tn)),e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const i=y(e,["visible"]);t.customMark.push(jn(i))}}))},t.appendHistogramRegressionLineConfig=function(t,i){var n,o;i||(i=null!==(n=e.get(t,Tn))&&void 0!==n?n:e.get(null===(o=t.series)||void 0===o?void 0:o.find((t=>t.type===e.SeriesTypeEnum.bar)),Tn)),e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const{type:i}=e,n=y(e,["type"]);t.customMark.push(Rn(i,n))}}))},t.appendScatterRegressionLineConfig=function(t,i){var n,o;i||(i=null!==(n=e.get(t,Tn))&&void 0!==n?n:e.get(null===(o=t.series)||void 0===o?void 0:o.find((t=>t.type===e.SeriesTypeEnum.scatter)),Tn)),e.array(i).forEach((e=>{if(!1!==e.visible){t.customMark||(t.customMark=[]);const{type:i}=e,n=y(e,["type"]);t.customMark.push(En(i,n))}}))},t.appendSeriesBreakConfig=t=>{var i;if(null===(i=t.axes)||void 0===i?void 0:i.length){const i=t.axes.filter((t=>t.breaks&&t.breaks.length&&!1!==t.visible));if(i.length)return t.customMark=e.array(t.customMark).filter((t=>t.componentType!==nn)),t.customMark.push(sn(i,i.map((e=>t.axes.indexOf(e))))),!0}return!1},t.appendSeriesLabelConfig=function(t,i){var n,o,r;if(t.customMark=e.array(t.customMark).filter((t=>t.componentType!==yn)),i||(i=null!==(r=null!==(n=e.get(t,yn))&&void 0!==n?n:e.get(null===(o=t.series)||void 0===o?void 0:o[0],yn))&&void 0!==r?r:{}),i.visible){const{position:e="end"}=i,n=y(i,["position"]);t.customMark.push(fn(e,n))}},t.clearSVGSource=function(){oe.clear(),re=null},t.computeStorylineLayout=He,t.getBarLinkConfig=pn,t.getBarRegressionLineConfig=jn,t.getHistogramRegressionLineConfig=Rn,t.getSVGSource=le,t.getScatterRegressionLineConfig=En,t.getSeriesBreakConfig=sn,t.getSeriesLabelConfig=fn,t.normalizeLayout=We,t.normalizePadding=Ve,t.register3DPlugin=Z,t.registerAxis3dPlugin=()=>{Z(),ot(),(()=>{e.registerCartesianBandAxis();const t=e.Factory.getComponentInKey(e.CartesianBandAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianBandAxis.builtInTheme.axisX),Gt)}),e.mixin(t,Ut)})(),(()=>{e.registerCartesianLinearAxis();const t=e.Factory.getComponentInKey(e.CartesianLinearAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLinearAxis.builtInTheme.axisX),Gt)}),e.mixin(t,Ut)})(),(()=>{e.registerCartesianTimeAxis();const t=e.Factory.getComponentInKey(e.CartesianTimeAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),Gt)}),e.mixin(t,Ut)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianSymlogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},t.builtInTheme.axisX),Gt)}),e.mixin(t,Ut)})(),(()=>{e.registerCartesianLogAxis();const t=e.Factory.getComponentInKey(e.CartesianLogAxis.type);t.builtInTheme=Object.assign(Object.assign({},t.builtInTheme),{axisZ:Object.assign(Object.assign({},e.CartesianLogAxis.builtInTheme.axisX),Gt)}),e.mixin(t,Ut)})()},t.registerBar3dChart=()=>{Z(),ot(),it(),e.Factory.registerChart(rt.type,rt)},t.registerBar3dSeries=it,t.registerBarLink=()=>{e.Factory.registerGraphicComponent(hn,(t=>new un(t)))},t.registerCandlestickChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),It(),e.Factory.registerChart(Dt.type,Dt)},t.registerCandlestickSeries=It,t.registerCombinationCandlestickChart=()=>{It(),e.Factory.registerChart(Pt.type,Pt)},t.registerConversionFunnelChart=t=>{e.registerMarkFilterTransform();const i=(null==t?void 0:t.VChart)||e.VChart;i&&(i.useChart([L]),i.useSeries([F]))},t.registerEventSeries=ze,t.registerExtensionMarkSyncStatePlugin=()=>{e.registerChartPlugin(zn)},t.registerFunnel3dChart=()=>{e.registerMarkTooltipProcessor(),Z(),ot(),ht(),e.Factory.registerChart(ut.type,ut)},t.registerFunnel3dSeries=ht,t.registerHistogram3dChart=()=>{e.registerGroupTooltipProcessor(),e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Z(),ot(),it(),e.Factory.registerChart(gt.type,gt)},t.registerImageCloudChart=()=>{De(),e.Factory.registerChart(Ee.type,Ee)},t.registerMapLabel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useComponent([On])},t.registerPictogramChart=()=>{e.registerMarkTooltipProcessor(),Se(),e.Factory.registerChart(Me.type,Me)},t.registerPictogramSeries=Se,t.registerPie3dChart=()=>{e.registerMarkTooltipProcessor(),Z(),ot(),ft(),e.Factory.registerChart(bt.type,bt)},t.registerPie3dSeries=ft,t.registerRangeColumn3dChart=()=>{e.registerDimensionTooltipProcessor(),e.registerMarkTooltipProcessor(),e.registerDimensionEvents(),e.registerDimensionHover(),Z(),ot(),Xt(),e.Factory.registerChart(Jt.type,Jt)},t.registerRangeColumn3dSeries=Xt,t.registerRankingBarChart=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([a])},t.registerRankingList=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([p,e.BarChart])},t.registerRegressionLine=()=>{e.Factory.registerGraphicComponent(Tn,(t=>new In(t)))},t.registerSVGSource=ae,t.registerSequenceScatterKDE=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([P,e.ScatterChart])},t.registerSequenceScatterLink=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([T,e.ScatterChart])},t.registerSequenceScatterPixel=t=>{const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([N,e.ScatterChart])},t.registerSeriesBreak=()=>{e.Factory.registerGraphicComponent("seriesBreak",(t=>new rn(t)))},t.registerSeriesLabel=()=>{e.Factory.registerGraphicComponent("seriesLabel",(t=>new bn(t)))},t.registerStorylineChart=t=>{e.registerCommonChart(),e.registerCustomMark(),e.registerGroupMark(),e.registerRectMark(),e.registerTextMark(),e.registerImageMark(),e.registerLineMark(),e.registerPathMark(),e.registerArcMark();const i=(null==t?void 0:t.VChart)||e.VChart;i&&i.useChart([en])},t.registerTimelineChart=()=>{e.registerMarkTooltipProcessor(),ze(),e.Factory.registerChart(Ne.type,Ne)},t.registerWordCloud3dChart=Ht,t.registerWordCloud3dSeries=zt,t.registerWordCloudShape3dChart=()=>{Z(),Nt(),Ht()},t.registerWordCloudShape3dSeries=Nt,t.svgSourceMap=oe,t.transformCandlestickSeriesSpec=Et,t.unregisterSVGSource=se}));
|