@visactor/vchart-extension 2.0.14 → 2.0.16-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/build/index.js +592 -11
  2. package/build/index.min.js +2 -2
  3. package/cjs/charts/conversion-funnel/arrow-data-transform.js +0 -1
  4. package/cjs/charts/funnel-3d/chart.js +2 -1
  5. package/cjs/charts/histogram-3d/chart.js +1 -1
  6. package/cjs/charts/image-cloud/image-cloud-transformer.js +1 -1
  7. package/cjs/charts/ranking-bar/ranking-bar.d.ts +1 -1
  8. package/cjs/charts/ranking-bar/ranking-bar.js.map +1 -1
  9. package/cjs/charts/ranking-list/constant.d.ts +1 -1
  10. package/cjs/charts/ranking-list/constant.js.map +1 -1
  11. package/cjs/charts/ranking-list/ranking-list.d.ts +1 -1
  12. package/cjs/charts/ranking-list/ranking-list.js.map +1 -1
  13. package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +1 -1
  14. package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +1 -1
  15. package/cjs/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +1 -1
  16. package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +1 -1
  17. package/cjs/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +1 -1
  18. package/cjs/charts/sequence-scatter-link/sequence-scatter-link.d.ts +1 -1
  19. package/cjs/charts/sequence-scatter-link/sequence-scatter-link.js.map +1 -1
  20. package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +1 -1
  21. package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +1 -1
  22. package/cjs/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +1 -1
  23. package/cjs/charts/sequence-scatter-pixel/utils.d.ts +1 -1
  24. package/cjs/charts/sequence-scatter-pixel/utils.js.map +1 -1
  25. package/cjs/charts/timeline/index.d.ts +4 -0
  26. package/cjs/charts/timeline/index.js +31 -0
  27. package/cjs/charts/timeline/index.js.map +1 -0
  28. package/cjs/charts/timeline/interface.d.ts +7 -0
  29. package/cjs/charts/timeline/interface.js +6 -0
  30. package/cjs/charts/timeline/interface.js.map +1 -0
  31. package/cjs/charts/timeline/series/constant.d.ts +1 -0
  32. package/cjs/charts/timeline/series/constant.js +6 -0
  33. package/cjs/charts/timeline/series/constant.js.map +1 -0
  34. package/cjs/charts/timeline/series/event-series.d.ts +53 -0
  35. package/cjs/charts/timeline/series/event-series.js +339 -0
  36. package/cjs/charts/timeline/series/event-series.js.map +1 -0
  37. package/cjs/charts/timeline/series/interface.d.ts +28 -0
  38. package/cjs/charts/timeline/series/interface.js +6 -0
  39. package/cjs/charts/timeline/series/interface.js.map +1 -0
  40. package/cjs/charts/timeline/series/theme.d.ts +2 -0
  41. package/cjs/charts/timeline/series/theme.js +43 -0
  42. package/cjs/charts/timeline/series/theme.js.map +1 -0
  43. package/cjs/charts/timeline/timeline-transformer.d.ts +10 -0
  44. package/cjs/charts/timeline/timeline-transformer.js +84 -0
  45. package/cjs/charts/timeline/timeline-transformer.js.map +1 -0
  46. package/cjs/charts/timeline/timeline.d.ts +12 -0
  47. package/cjs/charts/timeline/timeline.js +25 -0
  48. package/cjs/charts/timeline/timeline.js.map +1 -0
  49. package/cjs/components/map-label/map-label-transformer.d.ts +1 -1
  50. package/cjs/components/map-label/map-label-transformer.js.map +1 -1
  51. package/cjs/index.d.ts +1 -0
  52. package/cjs/index.js +5 -5
  53. package/cjs/index.js.map +1 -1
  54. package/esm/charts/conversion-funnel/arrow-data-transform.js +1 -2
  55. package/esm/charts/funnel-3d/chart.js +2 -1
  56. package/esm/charts/histogram-3d/chart.js +1 -1
  57. package/esm/charts/image-cloud/image-cloud-transformer.js +1 -1
  58. package/esm/charts/ranking-bar/ranking-bar.d.ts +1 -1
  59. package/esm/charts/ranking-bar/ranking-bar.js.map +1 -1
  60. package/esm/charts/ranking-list/constant.d.ts +1 -1
  61. package/esm/charts/ranking-list/constant.js.map +1 -1
  62. package/esm/charts/ranking-list/ranking-list.d.ts +1 -1
  63. package/esm/charts/ranking-list/ranking-list.js.map +1 -1
  64. package/esm/charts/sequence-scatter-kde/sequence-scatter-kde-transformer.js.map +1 -1
  65. package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.d.ts +1 -1
  66. package/esm/charts/sequence-scatter-kde/sequence-scatter-kde.js.map +1 -1
  67. package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js +1 -1
  68. package/esm/charts/sequence-scatter-link/sequence-scatter-link-transformer.js.map +1 -1
  69. package/esm/charts/sequence-scatter-link/sequence-scatter-link.d.ts +1 -1
  70. package/esm/charts/sequence-scatter-link/sequence-scatter-link.js.map +1 -1
  71. package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel-transformer.js.map +1 -1
  72. package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.d.ts +1 -1
  73. package/esm/charts/sequence-scatter-pixel/sequence-scatter-pixel.js.map +1 -1
  74. package/esm/charts/sequence-scatter-pixel/utils.d.ts +1 -1
  75. package/esm/charts/sequence-scatter-pixel/utils.js.map +1 -1
  76. package/esm/charts/timeline/index.d.ts +4 -0
  77. package/esm/charts/timeline/index.js +6 -0
  78. package/esm/charts/timeline/index.js.map +1 -0
  79. package/esm/charts/timeline/interface.d.ts +7 -0
  80. package/esm/charts/timeline/interface.js +2 -0
  81. package/esm/charts/timeline/interface.js.map +1 -0
  82. package/esm/charts/timeline/series/constant.d.ts +1 -0
  83. package/esm/charts/timeline/series/constant.js +2 -0
  84. package/esm/charts/timeline/series/constant.js.map +1 -0
  85. package/esm/charts/timeline/series/event-series.d.ts +53 -0
  86. package/esm/charts/timeline/series/event-series.js +337 -0
  87. package/esm/charts/timeline/series/event-series.js.map +1 -0
  88. package/esm/charts/timeline/series/interface.d.ts +28 -0
  89. package/esm/charts/timeline/series/interface.js +2 -0
  90. package/esm/charts/timeline/series/interface.js.map +1 -0
  91. package/esm/charts/timeline/series/theme.d.ts +2 -0
  92. package/esm/charts/timeline/series/theme.js +39 -0
  93. package/esm/charts/timeline/series/theme.js.map +1 -0
  94. package/esm/charts/timeline/timeline-transformer.d.ts +10 -0
  95. package/esm/charts/timeline/timeline-transformer.js +77 -0
  96. package/esm/charts/timeline/timeline-transformer.js.map +1 -0
  97. package/esm/charts/timeline/timeline.d.ts +12 -0
  98. package/esm/charts/timeline/timeline.js +19 -0
  99. package/esm/charts/timeline/timeline.js.map +1 -0
  100. package/esm/components/map-label/map-label-transformer.d.ts +1 -1
  101. package/esm/components/map-label/map-label-transformer.js.map +1 -1
  102. package/esm/index.d.ts +1 -0
  103. package/esm/index.js +2 -0
  104. package/esm/index.js.map +1 -1
  105. package/package.json +8 -8
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@visactor/vchart")):"function"==typeof define&&define.amd?define(["exports","@visactor/vchart"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).VChartExtension={},e.VChart)}(this,(function(e,t){"use strict";class i extends t.BaseChartSpecTransformer{transformSpec(e){const{timeData:i,timeNodes:n}=function(e){const{xField:i,yField:a,timeField:r,data:n,topN:s=10,icon:o}=e,l=new Set,d=new Map;return n.sort(((e,t)=>Number(t[i])-Number(e[i]))),n.forEach((e=>{const i=e[r];t.isValid(i)&&l.add(i),d.has(i)||d.set(i,[]);const n=d.get(i);if(n.length<s){const t=Object.assign({},e);o&&o[t[a]]&&(t.icon=o[t[a]]),n.push(t)}})),{timeData:d,timeNodes:Array.from(l).sort()}}(e),{interval:s,xField:o,yField:l,color:d,icon:c,iconPosition:u,iconShape:h,timeLabel:p,label:g,nameLabel:m,xAxis:y,yAxis:v}=e,f=s||1e3,b=Math.min(f,500);if(e.type="common",e.data=[{id:"timeData",values:i.get(n[0])},{id:"time",values:[{time:n[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}},a={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&&(a.label=e.label);return[i,a]}(y,v),e.player={type:"continuous",auto:!0,loop:!1,interval:f,specs:n.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:a}){return{type:"symbol",dataId:"timeData",style:{symbolType:t,stroke:"white",lineWidth:1,size:(e,t)=>{var i,a;const r=t.vchart,n=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&n){const e=null!==(a=n.getYAxisHelper().getBandwidth(0))&&void 0!==a?a:0;return Math.max(e-4,0)}return 10},background:e=>e.icon,x:(t,i)=>{var a,r;const n=i.vchart,s=null===(a=n.getChart())||void 0===a?void 0:a.getSeriesInIndex(0)[0];if(n&&s){const i=null!==(r=s.getYAxisHelper().getBandwidth(0))&&void 0!==r?r:0;return"bar-start"===e?i/2:"axis"===e?-i/2:s.dataToPositionX(t)-i/2}},y:(e,t)=>{var i,a;const r=t.vchart,n=null===(i=r.getChart())||void 0===i?void 0:i.getSeriesInIndex(0)[0];if(r&&n){const t=null!==(a=n.getYAxisHelper().getBandwidth(0))&&void 0!==a?a:0;return n.dataToPositionY(e)+t/2}},scaleY:"rect"===t?1.2:1},animationUpdate:r(i,a),animationEnter:[{type:"moveIn",duration:a,easing:"cubicInOut",options:{direction:"y",orient:"negative",point:(e,t,i)=>({y:i.groupHeight+t.getBounds().height()})}}],animationExit:[{type:"moveOut",duration:a,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,a,r,n;const s=[];return!1!==e.visible&&s.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===(a=e.style)||void 0===a?void 0:a.stroke)?"null":void 0}}),t.visible&&s.push({visible:!0,overlap:!1,style:Object.assign({},t.style),smartInvert:{fillStrategy:(null===(r=t.style)||void 0===r?void 0:r.fill)?"null":void 0,strokeStrategy:(null===(n=t.style)||void 0===n?void 0:n.stroke)?"null":void 0},position:"bar-end"===t.position?"inside-right":"inside-left",formatter:`{${t.yField}}`}),s}function r(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=i}init(){this.isValid()&&super.init()}isValid(){var e,t,i,a;const{xField:r,yField:n,timeField:s,data:o}=this._spec;return r&&n&&s?!!o||(null===(a=(i=this._option).onError)||void 0===a||a.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=i;const s=1e3,o="#21252c",l={labelLayout:"top",bar:{style:{cornerRadius:5}},barBackground:{type:"rect",style:{fill:"rgba(33,37,44,0.1)",cornerRadius:5}},rankingIcon:{visible:!0,style:{fill:o,size:20}},nameLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:o,textBaseline:"middle"}},orderLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:o,textBaseline:"middle"}},valueLabel:{visible:!0,style:{fontSize:20,fontWeight:"normal",fill:o,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}},d="dataKey",c="VCHART_ORDER",u="SUPPLY_DATA_KEY";class h extends t.CommonChartSpecTransformer{constructor(){super(...arguments),this.formatMap={},this.paginateDataArr=e=>{const{scrollSize:t=1,pageSize:i=5}=e,a=this.originalData,r={};let n=0;for(let s=0;s<a.length;s+=t)if(n++,r[`page${n}`]=a.slice(s,s+i),s+i-1>=a.length-1){a.push(...Array.from({length:s+i-a.length},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[u]:!0}))));break}return{orderCount:n,result:r}},this.processRankingData=e=>{const t=[];e.data.forEach(((e,t)=>e[c]=t+1<10?`0${t+1}`:t+1));const i=this.paginateDataArr(e).result,a=this.paginateDataArr(e).orderCount;this.orderCount=a;const r=e.pageSize-i[`page${a}`].length;return i[`page${a}`].push(...Array.from({length:r},(t=>({[e.yField]:100*Math.random(),[e.xField]:null,[u]:!0})))),Object.keys(i).forEach((a=>{t.push({data:[{id:"datas",values:i[a].map((t=>Object.assign(Object.assign({},t),{[d]:t[e.yField]})))},{id:"order",values:[{order:a}]}]})})),t}}isSpecValid(e){const{xField:t,yField:i,data:a}=e;return!!(t&&i&&a&&0!==a.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 a in i)"__proto__"!==a&&"constructor"!==a&&"prototype"!==a&&"object"==typeof i[a]&&null!==i[a]?(t.hasOwnProperty(a)||(t[a]=Array.isArray(i[a])?[]:{}),e(t[a],i[a])):t.hasOwnProperty(a)||"object"!=typeof t||(t[a]=i[a]);return t})(e,l),((e,i)=>{i.forEach((i=>{var a,r,n,s,o,l,d;t.isArray(e[i])?null===(a=e[i])||void 0===a||a.forEach(((t,a)=>{var r,n,s;e[i][a]=Object.assign(Object.assign({},t),{style:Object.assign(Object.assign({},null==t?void 0:t.style),{visible:null===(s=null!==(n=null===(r=null==t?void 0:t.style)||void 0===r?void 0:r.visible)&&void 0!==n?n:null==t?void 0:t.visible)||void 0===s||s})})})):e[i]=Object.assign(Object.assign({},e[i]),{style:Object.assign(Object.assign({},null===(r=e[i])||void 0===r?void 0:r.style),{visible:null===(d=null!==(o=null===(s=null===(n=e[i])||void 0===n?void 0:n.style)||void 0===s?void 0:s.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,a,r,n,s,o,l,d,c;null===(i=this.nameLabelTextMeasure)||void 0===i||i.release(),null===(a=this.valueLabelTextMeasure)||void 0===a||a.release(),null===(r=this.orderLabelTextMeasure)||void 0===r||r.release(),this.nameLabelTextMeasure=new t.TextMeasure({defaultFontParams:null!==(s=null===(n=e.nameLabel)||void 0===n?void 0:n.style)&&void 0!==s?s:{}}),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[c]=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,a;e.type="common",e.dataKey=d,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===(a=e.bar)||void 0===a?void 0:a.style),{x1:0,visible:t=>{var i,a;return!t[u]&&(null===(a=null===(i=e.bar)||void 0===i?void 0:i.style)||void 0===a||a)}})})}]}transformAnimationSpec(e){var t,i,a;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!==(a=e.animationUpdate.duration)&&void 0!==a?a: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,a;const r=e.map((e=>e[t])).filter((e=>null!=e));if(0===r.length)i=0,a=1;else{i=Math.min(...r)-(Math.max(...r)-Math.min(...r))/3,a=(Math.max(...r)-i)/.8+i;const e=10,t=i;i===a&&(i=t-e,a=(4*t+e)/4)}return{min:i,max:a}})(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:d,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[u]&&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:d,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[u]&&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:d,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(c,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(c,t)).height)/2},e.rankingIcon.style),{lineWidth:0,stroke:null,visible:t=>!t[u]&&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:d,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,c,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[u]&&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:d,state:null===(t=e.orderLabel)||void 0===t?void 0:t.state,style:Object.assign(Object.assign({text:e=>this.formatDatum(c,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[u]&&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:d,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[u]&&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,c,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 a=this.originalData.map((e=>e[u]?0:i.fullMeasure(this.formatDatum(t,e)).width));return Math.max(...a)}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,a,r,n;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!==(a=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==a?a:1e3,easing:null!==(n=null===(r=e.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==n?n:"linear"}}getAnimationEnter(e){var t,i,a,r,n;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!==(a=null===(i=e.animationUpdate)||void 0===i?void 0:i.duration)&&void 0!==a?a:1e3,easing:null!==(n=null===(r=e.animationUpdate)||void 0===r?void 0:r.easing)&&void 0!==n?n:"linear"}}getAnimationAppear(e,t){var i,a,r,n,s,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!==(r=null===(a=e.animationAppear)||void 0===a?void 0:a.duration)&&void 0!==r?r:1e3,easing:null!==(s=null===(n=e.animationAppear)||void 0===n?void 0:n.easing)&&void 0!==s?s:"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,a,r;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!==(r=null===(a=e.animationUpdate)||void 0===a?void 0:a.easing)&&void 0!==r?r:"linear"}}}class p extends t.BaseChart{constructor(){super(...arguments),this.type="rankingList",this.transformerConstructor=h}init(){this.isValid()&&super.init()}isValid(){var e,t,i,a;const{xField:r,yField:n,data:s}=this._spec;return r&&n?!!s||(null===(a=(i=this._option).onError)||void 0===a||a.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}p.type="rankingList",p.view="singleDefault",p.transformerConstructor=h;
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;
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 g(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&Object.prototype.propertyIsEnumerable.call(e,a[r])&&(i[a[r]]=e[a[r]])}return i}const m={cornerRadius:4,stroke:"black",strokeOpacity:1,lineWidth:1,closePath:!1,pickable:!1},y={symbolType:"triangle",size:8,scaleX:.7,fill:"black"},v={fill:"#606773",fontSize:12},f={fill:"#eff1f9"};class b extends t.FunnelChartSpecTransformer{transformSpec(e){const{conversionArrow:t,extensionMark:i=[],funnelBackground:a}=e;if(t&&t.arrows&&t.arrows.length){const e=function(e){const{arrows:t}=e,i=g(e,["arrows"]),a=t.filter((e=>"left"===e.position)),r=x(t.filter((e=>"right"===e.position)),i),n=x(a,i),s=[];r&&(r.name="arrowRight",s.push(r));n&&(n.name="arrowLeft",s.push(n));return s}(t);e&&e.length&&i.push(...e)}if(a&&a.visible){const e=function(e){const{style:t={}}=e,i=g(e,["style"]);return Object.assign(Object.assign({type:"rect"},i),{dataIndex:0,zIndex:0,style:Object.assign(Object.assign(Object.assign({},f),t),{x:0,y:(e,t)=>t.getPoints(e)[0].y,width:(e,t)=>{const i=t.getRegion(),{width:a}=i.getLayoutRect();return a},height:(e,t)=>{const i=t.getPoints(e),a=i[0];return i[3].y-a.y}})})}(a);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 x(e,i){if(0===(null==e?void 0:e.length))return null;const{line:a,symbol:r,text:n,margin:s}=i,o=[],l={type:"group",zIndex:t.LayoutZIndex.Mark+1,children:[]},d=function(e={},t){const{style:i={}}=e,a=g(e,["style"]),r=(e,t)=>{var i,a;const{from:r,to:n}=e,{vchart:s}=t,o=null===(a=null===(i=null==s?void 0:s.getChart())||void 0===i?void 0:i.getSeriesData())||void 0===a?void 0:a.latestData;return!(n>o.length-1||r>o.length-1)};return Object.assign(Object.assign({type:"polygon",interactive:!1},a),{dataKey:e=>`${e.id}`,style:Object.assign(Object.assign(Object.assign({},m),i),{renderable:r,points:(e,i)=>{if(!r(e,i))return[];let a=e.layout.points;return a=S(e,i,t),a}})})}(a,s);d&&o.push(d);const c=function(e={},t){const{style:i={}}=e,a=g(e,["style"]);return Object.assign(Object.assign({type:"symbol",interactive:!1,dataKey:e=>`${e.id}`},a),{style:Object.assign(Object.assign(Object.assign({},y),i),{x:(e,i)=>{var a,r;let n=e.layout.points;return n=S(e,i,t),null!==(r=null===(a=n[(null==n?void 0:n.length)-1])||void 0===a?void 0:a.x)&&void 0!==r?r:NaN},y:(e,i)=>{var a,r;let n=e.layout.points;return n=S(e,i,t),null!==(r=null===(a=n[(null==n?void 0:n.length)-1])||void 0===a?void 0:a.y)&&void 0!==r?r:NaN},angle:e=>"left"===e.position?90:-90})})}(r,s);c&&o.push(c);const u=function(e={},i){const{style:a={},formatMethod:r,textMargin:n=4}=e,s=g(e,["style","formatMethod","textMargin"]);return Object.assign(Object.assign({type:"text",dataKey:e=>`${e.id}`,interactive:!1,animation:!1},s),{style:Object.assign(Object.assign(Object.assign({},v),{text:(e,i)=>{var a,n,s,o,l,d,c;const{text:u}=e;let h=u;if(t.isFunction(r)){const{vchart:t}=i,{from:p,to:g}=e,{field:m}=e.context,y=null!==(s=null===(n=null===(a=null==t?void 0:t.getChart())||void 0===a?void 0:a.getSeriesData())||void 0===n?void 0:n.latestData)&&void 0!==s?s:[],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=r(u,{arrow:e,from:f,to:b})}return h},x:(e,t)=>{var a,r;let s=e.layout.points;return s=S(e,t,i),null!==(r=(null===(a=s[1])||void 0===a?void 0:a.x)+("left"===e.position?-n:n))&&void 0!==r?r:NaN},y:(e,t)=>{var a,r,n;let s=e.layout.points;return s=S(e,t,i),null!==(n=((null===(a=s[1])||void 0===a?void 0:a.y)+(null===(r=s[2])||void 0===r?void 0:r.y))/2)&&void 0!==n?n:NaN},textAlign:e=>"left"===e.position?"right":"left",textBaseline:"middle"}),a)})}(n,s);return u&&o.push(u),l.children=o,l}function S(e,t,i){var a,r,n,s,o;const{vchart:l}=t,{from:d,to:c}=e,{field:u}=e.context,h=null===(r=null===(a=null==l?void 0:l.getChart())||void 0===a?void 0:a.getSeriesData())||void 0===r?void 0:r.latestData,p=null===(o=null===(s=null===(n=null==l?void 0:l.getChart())||void 0===n?void 0:n.getAllSeries()[0])||void 0===s?void 0:s.getViewData())||void 0===o?void 0:o.latestData;let g=[];if(h&&h.length){const a=p.find((e=>e[u]===h[d][u])),r=p.find((e=>e[u]===h[c][u])),n=p[0];if(a&&r&&n){g=function(e,t,i,a,r=12){const{layout:n,distance:s,position:o}=e,{level:l,fromIndex:d,toIndex:c,fromTotal:u,toTotal:h}=n,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?a[1]:a[0],S=y/(u+1),_=b/(h+1),k=g.y+S*(d+1),C=v.y+_*(c+1),M=p?-1:1,A=[{x:g.x-r*M,y:k},{x:x.x-(r+(l+1)*s)*M,y:k},{x:x.x-(r+(l+1)*s)*M,y:C},{x:v.x-r*M,y:C}];return A}(e,t.getPoints(a),t.getPoints(r),t.getPoints(n),i),e.layout.points=g}}return g}function _(e,t){const{from:i,to:a}=e,{from:r,to:n}=t;return a>r&&n>i}function k(e,t){const{from:i,to:a}=e,{from:r,to:n}=t;return i===r&&a===n}const C=(e,i)=>{var a,r,n;if(!e||!(null===(a=e.arrows)||void 0===a?void 0:a.length))return[];const{arrows:s}=e,o=function(e,i){return e.filter((e=>t.isValidNumber(e.from*e.to))).map(((e,t)=>{const{from:a,to:r,position:n="right"}=e;return Object.assign(Object.assign({},e),{position:n,distance:e.distance||40,from:Math.min(a,r),to:Math.max(a,r),span:Math.abs(a-r),isLayout:!1,context:{field:i},layout:{level:0},id:`${a}-${r}-${n}-${t}`})}))}(s,i.categoryField),l=o.filter((e=>"left"===e.position)),d=o.filter((e=>"right"===e.position));return[...null!==(r=M(l))&&void 0!==r?r:[],...null!==(n=M(d))&&void 0!==n?n:[]]};function M(e){if(0===(null==e?void 0:e.length))return null;const i=new Map;return e.forEach((e=>{const a=i.get(e.from);if(t.isValid(a)){const t=a.fromArrows.find((t=>k(t,e)));t?e.layout.duplicateNode=t:a.degree+=1,a.fromArrows.push(e)}else i.set(e.from,{fromArrows:[e],toArrows:[],totalArrows:[],degree:1});const r=i.get(e.to);if(t.isValid(r)){const t=r.toArrows.find((t=>k(t,e)));t?e.layout.duplicateNode=t:r.degree+=1,r.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((a=>{var r;const n=e.filter((e=>e.layout.isLayout)),s=t.maxInArray(n,((e,t)=>e.layout.level-t.layout.level));let o=null!==(r=null==s?void 0:s.layout.level)&&void 0!==r?r:0;for(;o>=0;){if(n.some((e=>e.layout.level===o&&_(e,a)))){o+=1;break}--o}a.layout.level=Math.max(0,o),a.layout.fromTotal=i.get(a.from).degree,a.layout.toTotal=i.get(a.to).degree;const l=a.layout.duplicateNode;l?(a.layout.fromIndex=l.layout.fromIndex,a.layout.toIndex=l.layout.toIndex):(a.layout.fromIndex=A(a,i.get(a.from).totalArrows),a.layout.toIndex=A(a,i.get(a.to).totalArrows)),a.layout.isLayout=!0})),e}function A(e,t){let i=0,a=0;for(let r=0;r<t.length;r++){const n=t[r];if(n===e){i=r-a;break}n.layout.duplicateNode&&a++}return i}class F extends t.FunnelChart{constructor(){super(...arguments),this.type="conversionFunnel",this.transformerConstructor=b}}F.type="conversionFunnel",F.transformerConstructor=b;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",C),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 T="dataKey";class O extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,a,r,n;super.transformSpec(e);const s=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const a=e.data[i].nodes;t.push({data:[{id:"nodes",values:a.map(((e,t)=>Object.assign(Object.assign({},e),{[T]: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=T,e.data=s[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:s}),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!==(r=null===(a=e.player)||void 0===a?void 0:a.duration)&&void 0!==r?r: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===(n=e.infoLabel)||void 0===n?void 0:n.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 w extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterLink",this.transformerConstructor=O}init(){this.isValid()&&super.init()}isValid(){var e,t,i,a;const{xField:r,yField:n,data:s}=this._spec;return r&&n?!!s||(null===(a=(i=this._option).onError)||void 0===a||a.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}w.type="sequenceScatterLink",w.view="singleDefault",w.transformerConstructor=O;const I=.2;function D(e){const t=Math.sqrt((2*Math.PI)**2);return Math.exp(-(e**2)/2)/t}const E="dataKey";class B extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,a,r,n,s;super.transformSpec(e);const o=function(e){const t=[];return Object.keys(e.data).forEach((i=>{const a=e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[E]:t}))),r=function(e,t=100,i){const a=e.reduce(((e,t)=>{const i=t.label;return e[i]=e[i]||[],e[i].push(t),e}),{}),r=[];return Object.entries(a).forEach((([e,a])=>{const n=i||function(e){return e.length**(-1/6)}(a),s=a.map((e=>e.x)),o=a.map((e=>e.y)),l=Math.min(...s),d=Math.max(...s),c=Math.min(...o),u=Math.max(...o),h=l-(d-l)*I,p=c-(u-c)*I;for(let i=0;i<t;i++)for(let s=0;s<t;s++){const t=h+.1*i,o=p+.1*s;let l=0;for(const e of a)l+=D(Math.sqrt((t-e.x)**2+(o-e.y)**2)/n);l/=a.length*n*n,r.push({x:t,y:o,kde:l,label:e})}})),r}(a,150);t.push({data:[{id:"nodes",values:a},{id:"iter",values:[{iter:i}]},{id:"kde",values:r}]})})),t}(e);e.type="common",e.dataKey=E,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!==(r=null===(a=e.player)||void 0===a?void 0:a.duration)&&void 0!==r?r:2e3,easing:"linear"},e.animationUpdate={duration:null!==(s=null===(n=e.player)||void 0===n?void 0:n.duration)&&void 0!==s?s: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=B}init(){this.isValid()&&super.init()}isValid(){var e,t,i,a;const{xField:r,yField:n,data:s}=this._spec;return r&&n?!!s||(null===(a=(i=this._option).onError)||void 0===a||a.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=B;const P="dataKey";function R(e){const t=[];return Object.keys(e.data).forEach((i=>{let a=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 a=document.createElement("canvas");a.width=t.width,a.height=t.height;const r=a.getContext("2d");if(!r)throw new Error("Failed to get 2D rendering context from canvas");const n=r.createImageData(t.width,t.height);for(let t=0;t<300;t++)for(let a=0;a<300;a++){const r=(null===(i=e[t])||void 0===i?void 0:i[a])||[0,0,0],s=4*(300*t+a);n.data[s]=Math.round(255*r[0]),n.data[s+1]=Math.round(255*r[1]),n.data[s+2]=Math.round(255*r[2]),n.data[s+3]=255}return r.putImageData(n,0,0),a.toDataURL("image/png")}(e.backgroundColors[i],e);a={imageData:t}}t.push({data:[{id:"nodes",values:e.data[i].map(((e,t)=>Object.assign(Object.assign({},e),{[P]:t})))},{id:"inter",values:[{inter:i}]},{id:"background",values:a?[a]:[]}]})})),t}class V extends t.CommonChartSpecTransformer{transformSpec(e){var t,i,a,r,n;super.transformSpec(e);const s=R(e);e.type="common",e.dataKey=P,e.data=s[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:s}),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!==(r=null===(a=e.player)||void 0===a?void 0:a.duration)&&void 0!==r?r: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===(n=e.infoLabel)||void 0===n?void 0:n.style)}],e.tooltip={visible:!1},super.transformSpec(e)}}class N extends t.BaseChart{constructor(){super(...arguments),this.type="sequenceScatterPixel",this.transformerConstructor=V}init(){this.isValid()&&super.init()}isValid(){var e,t,i,a;const{xField:r,yField:n,data:s}=this._spec;return r&&n?!!s||(null===(a=(i=this._option).onError)||void 0===a||a.call(i,"Data is required"),!1):(null===(t=(e=this._option).onError)||void 0===t||t.call(e,"Missing Required Config: `xField`, `yField` "),!1)}}N.type="sequenceScatterPixel",N.view="singleDefault",N.transformerConstructor=V;class z 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,K,W,H,U;!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"}(K||(K={})),function(e){e.bar3d="bar3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}(W||(W={})),function(e){e.bar3d="bar3d",e.funnel3d="funnel3d",e.transform3d="transform3d",e.pie3d="pie3d"}(H||(H={})),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"}(U||(U={}));const $=e=>e.zField||e.series&&e.series.some((e=>e.zField));class X extends t.BasePlugin{constructor(){super(X.type),this.type="VChart3dPlugin"}onInit(e,t){var i,a;if(this._is3d=!!(a=t)&&((e=>"bar3d"===e||"funnel3d"===e||"histogram3d"===e||"pie3d"===e||"rangeColumn3d"===e||"wordCloud3d"===e)(a.type)||$(a),!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&&$(t)&&(t.layout={type:"layout3d"})}}X.pluginType="chart",X.type="VChart3dPlugin";const Y=()=>{t.registerChartPlugin(X),t.registerDirectionalLight(),t.registerOrthoCamera(),t.registerViewTransform3dPlugin()},q={label:{name:"label",type:"text"},bar3d:{name:"bar3d",type:"rect3d"}};class Z extends t.BarSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"bar3d")}}class J 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=J.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}J.type="rect3d";const Q=()=>{t.Factory.registerMark(J.type,J),t.registerShadowRoot(),t.registerRect3d(),t.registerRectAnimation(),t.Factory.registerGraphicComponent("rect3d",t.createRect3d)};class ee extends t.BarSeries{constructor(){super(...arguments),this.type=W.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=Z}}ee.type=W.bar3d,ee.mark=q,ee.builtInTheme={bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}}},ee.transformerConstructor=Z;const te=()=>{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)}))),Q(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries(ee.type,ee)};class ie extends t.Layout{layoutItems(e,i,a,r){this._layoutInit(e,i,a,r);const n={recomputeWidth:this.recomputeWidth,recomputeHeight:this.recomputeHeight};this._layoutNormalItems(i,n);const s={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,n),this._processAutoIndent(c,u,h,g,p,s,n);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 a=y.getLayoutRect(),r=v.getLayoutRect(),n={length:l[0].getLayoutRect().width,width:a.width,height:r.height};y.model.setLayout3dBox&&y.model.setLayout3dBox(n),v.model.setLayout3dBox&&v.model.setLayout3dBox(n),l[0].model.setLayout3dBox&&l[0].model.setLayout3dBox(n),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,a=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return e.forEach((e=>{if(!e.getModelVisible()||!e.autoIndent)return;const r="left"===e.layoutOrient||"right"===e.layoutOrient,n=e.getLastComputeOutBounds();r?(t.top=Math.max(t.top,n.y1-this.topCurrent),t.bottom=Math.max(t.bottom,n.y2-a)):(t.left=Math.max(t.left,n.x1-this.leftCurrent),t.right=Math.max(t.right,n.x2-i))})),t}}ie.type="layout3d";const ae=()=>{t.Factory.registerLayout(ie.type,ie)};class re extends t.BarChart{constructor(){super(...arguments),this.transformerConstructor=z,this.type="bar3d",this.seriesType=W.bar3d}}re.type="bar3d",re.seriesType=W.bar3d,re.transformerConstructor=z;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 se extends t.FunnelSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"funnel3d"),e.isTransform&&this._addMarkLabelSpec(e,"transform3d","transformLabel")}}class oe extends t.BasePolygonMark{_getDefaultStyle(){const e=super._getDefaultStyle();return e.stroke=!1,e}constructor(e,t){super(e,t),this.type=oe.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}oe.type="pyramid3d";const le=t.getFunnelTheme(!0);class de extends t.FunnelSeries{constructor(){super(...arguments),this.type=W.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=se}initMark(){var e,t,i,a,r,n,s,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},de.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({},de.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===(a=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===a?void 0:a.visible){const{line:e}=null!==(r=this._spec.outerLabel)&&void 0!==r?r:{},{line:t}=null!==(s=null===(n=this._theme)||void 0===n?void 0:n.outerLabel)&&void 0!==s?s:{};this._funnelOuterLabelMark.label=this._createMark(de.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(de.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,a;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===(a=this._funnelOuterLabelMark)||void 0===a||a.line}}de.type=W.funnel3d,de.mark=ne,de.builtInTheme={funnel3d:le},de.transformerConstructor=se;const ce=()=>{t.Factory.registerMark(oe.type,oe),t.registerShadowRoot(),t.registerPyramid3d(),t.registerPolygonAnimation(),t.Factory.registerGraphicComponent("pyramid3d",t.createPyramid3d),t.registerTextMark(),t.registerRuleMark(),t.Factory.registerSeries(de.type,de)};class ue extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=t.FunnelChartSpecTransformer,this.type="funnel3d",this.seriesType=W.funnel3d}}ue.type="funnel3d",ue.seriesType=W.funnel3d,ue.transformerConstructor=t.FunnelChartSpecTransformer;class he extends t.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=t.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=W.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}he.type="histogram3d",he.seriesType=W.bar3d,he.transformerConstructor=t.HistogramChartSpecTransformer;class pe extends t.BasePieChartSpecTransformer{transformSpec(e){super.transformSpec(e),e.series.forEach((t=>{"pie3d"===t.type&&(t.angle3d=e.angle3d)}))}}class ge extends t.BaseArcMark{setDataLabelType(){return"arc"}constructor(e,t){super(e,t),this.type=ge.type,this._markConfig.support3d=!0}setMarkConfig(e){super.setMarkConfig(e),this._markConfig.support3d=!0}}ge.type="arc3d";const me=Object.assign(Object.assign({},t.baseSeriesMark),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class ye extends t.PieSeriesSpecTransformer{_transformLabelSpec(e){this._addMarkLabelSpec(e,"pie3d")}}class ve extends t.BasePieSeries{constructor(){super(...arguments),this.type=W.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=ye}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))}}ve.type=W.pie3d,ve.mark=me,ve.builtInTheme={pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}}},ve.transformerConstructor=ye;const fe=()=>{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",ge),t.Factory.registerSeries(ve.type,ve)};class be extends t.BasePieChart{constructor(){super(...arguments),this.transformerConstructor=pe,this.type="pie3d",this.seriesType=W.pie3d}}be.type="pie3d",be.seriesType=W.pie3d,be.transformerConstructor=pe;const xe="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 _e extends t.GlyphMark{constructor(){super(...arguments),this.type=_e.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:a=i.attribute.x,boxWidth:r=i.attribute.boxWidth,open:n=i.attribute.open,close:s=i.attribute.close,low:o=i.attribute.low,high:l=i.attribute.high}=e,d={};return d.line={points:[{x:a,y:o},{x:a,y:l}]},d.box={x:a-r/2,x1:a+r/2,y:Math.min(n,s),y1:Math.max(n,s),drawStrokeWhenZeroWH:!0},d}}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}}_e.type="candlestick";class ke extends t.ACustomAnimate{constructor(e,t,i,a,r){super(e,t,i,a,r)}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:a,y:r,open:n,high:s,low:o,close:l}=i,d={from:{x:a,y:r},to:{x:a,y:r}};return t.isValidNumber(n)&&t.isValidNumber(l)&&(n>l?(d.from.open=o,d.to.open=n,d.from.close=o,d.to.close=l,t.isValidNumber(s)&&(d.from.high=o,d.to.high=s)):(d.from.open=s,d.to.open=n,d.from.close=s,d.to.close=l,t.isValidNumber(o)&&(d.from.low=s,d.to.low=o))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const a=this.target.attribute;this.propKeys.forEach((e=>{a[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(a)}}class Ce extends t.ACustomAnimate{constructor(e,t,i,a,r){super(e,t,i,a,r)}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:a,y:r,open:n,high:s,low:o,close:l}=i,d={from:{x:a,y:r},to:{x:a,y:r}};return t.isValidNumber(n)&&t.isValidNumber(l)&&(n>l?(d.from.open=n,d.to.open=o,d.from.close=l,d.to.close=o,t.isValidNumber(s)&&(d.from.high=s,d.to.high=o)):(d.from.open=n,d.to.open=s,d.from.close=l,d.to.close=s,t.isValidNumber(o)&&(d.from.low=o,d.to.low=s))),d})(this.target,this.params,this.params.options)}onUpdate(e,t,i){const a=this.target.attribute;this.propKeys.forEach((e=>{a[e]=this.from[e]+(this.to[e]-this.from[e])*t})),this.target.setAttributes(a)}}const Me="candlestick";var Ae,Fe;!function(e){e.OPEN="open",e.HIGH="high",e.LOW="low",e.CLOSE="close",e.SERIES_FIELD="seriesField"}(Ae||(Ae={})),function(e){e.candlestick="candlestick"}(Fe||(Fe={}));const Le=Object.assign(Object.assign({},t.baseSeriesMark),{candlestick:{name:"candlestick",type:"candlestick"}});class Te extends t.BaseSeriesTooltipHelper{constructor(){super(...arguments),this.getContentKey=e=>t=>{switch(e){case Ae.OPEN:return this.series.getOpenField();case Ae.HIGH:return this.series.getHighField();case Ae.LOW:return this.series.getLowField();case Ae.CLOSE:return this.series.getCloseField();case Ae.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=e=>t=>{switch(e){case Ae.OPEN:return t[this.series.getOpenField()];case Ae.HIGH:return t[this.series.getHighField()];case Ae.LOW:return t[this.series.getLowField()];case Ae.CLOSE:return t[this.series.getCloseField()];case Ae.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(Ae.OPEN),value:this.getContentValue(Ae.OPEN)},{key:this.getContentKey(Ae.HIGH),value:this.getContentValue(Ae.HIGH)},{key:this.getContentKey(Ae.LOW),value:this.getContentValue(Ae.LOW)},{key:this.getContentKey(Ae.CLOSE),value:this.getContentValue(Ae.CLOSE)},{key:this.getContentKey(Ae.SERIES_FIELD),value:this.getContentValue(Ae.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 we extends t.CartesianSeries{constructor(){super(...arguments),this.type=Me,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,a,r,n,s,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!==(a=null===(i=l.rising)||void 0===i?void 0:i.style)&&void 0!==a?a:{},null!==(n=null===(r=l.falling)||void 0===r?void 0:r.style)&&void 0!==n?n:{},null!==(o=null===(s=l.doji)||void 0===s?void 0:s.style)&&void 0!==o?o:{})}initMark(){this._candlestickMark=this._createMark(we.mark.candlestick,{groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){var e;const i=this._candlestickMark;if(i){const a={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,a,t.STATE_VALUE_ENUM.STATE_NORMAL,t.AttributeLevel.Series)}}initCandlestickMarkStyle(){var e;const i=this._candlestickMark,a=this._yAxisHelper;if(i&&a){const{dataToPosition:r}=a,n=null===(e=null==a?void 0:a.getScale)||void 0===e?void 0:e.call(a,0);this.setMarkStyle(i,{open:e=>t.valueInScaleRange(r(this.getDatumPositionValues(e,this._openField),{bandPosition:this._bandPosition}),n),high:e=>t.valueInScaleRange(r(this.getDatumPositionValues(e,this._highField),{bandPosition:this._bandPosition}),n),low:e=>t.valueInScaleRange(r(this.getDatumPositionValues(e,this._lowField),{bandPosition:this._bandPosition}),n),close:e=>t.valueInScaleRange(r(this.getDatumPositionValues(e,this._closeField),{bandPosition:this._bandPosition}),n)},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 a=this._initAnimationSpec(null===(e=t.Factory.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e()),r=this._initAnimationSpec(t.userAnimationConfig(Me,this._spec,this._markAttributeContext));this._candlestickMark.setAnimationConfig(t.animationConfig(a,r,i))}}initTooltip(){this._tooltipHelper=new Te(this),this._candlestickMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._candlestickMark)}_buildMergedStyles(e,i,a,r){this._mergedStyles.rising=t.merge({},e,i),this._mergedStyles.falling=t.merge({},e,a),this._mergedStyles.doji=t.merge({},e,r)}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]}}we.type=Me,we.builtInTheme={candlestick:Oe},we.mark=Le;const Ie=()=>{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(_e.type,_e),t.registerSymbolMark(),t.registerScaleInOutAnimation(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleIn",ke),t.AnimateExecutor.registerBuiltInAnimate("candlestickScaleOut",Ce),t.Factory.registerSeries(we.type,we)};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=Me,De.transformerConstructor=Se;function Ee(e){e.yField=[e.openField,e.highField,e.lowField,e.closeField]}class Be 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 a=e;a.region=[null!==(t=e.candlestickRegion)&&void 0!==t?t:{}],e.previewSeries&&a.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 a=e.series.find((t=>t.id===e.candlestickSeries.id));let r;a?(t.merge(a,e.candlestickSeries),r=a):(e.series.push(e.candlestickSeries),r=e.candlestickSeries),Ee(r),this._transformSeriesData(e,r),r.regionIndex=0,e.previewSeries&&t.array(e.previewSeries).forEach((i=>{const a=e.series.find((e=>e.id===i.id));let r;a?(t.merge(a,i),r=a):(e.series.push(i),r=i),r.regionIndex=1,this._transformSeriesData(e,r)}))}_transformSeriesData(e,i){var a;i.data&&(e.data=t.array(null!==(a=e.data)&&void 0!==a?a:[]),t.array(i.data).forEach(((t,a)=>{e.data.push(t),0===a&&(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,a;const r={type:"grid",col:2,row:6,elements:[],colWidth:[],rowHeight:[]};let n=0,s=0;if(e.title&&!1!==(null===(i=e.title)||void 0===i?void 0:i.visible)&&n++,e.legends){const i=t.array(e.legends)[0];!1!==(null==i?void 0:i.visible)&&("top"===i.orient||"bottom"===i.orient?n++:s++)}if(e.dataZoom&&t.array(e.dataZoom).forEach((e=>{!1!==(null==e?void 0:e.visible)&&("top"===e.orient||"bottom"===e.orient?n++:s++)})),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?n++:s++)}))}n++,s++,e.previewSeries&&n++,r.row=n,r.col=s;const o={top:0,bottom:0,left:0,right:0};if(e.title&&!1!==(null===(a=e.title)||void 0===a?void 0:a.visible)&&this._layoutOrientItem(r,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(r,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(r,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(r,e,o,{specKey:"axes",index:i},"one"))}))}const l=this._layoutOrientItem(r,{orient:"top"},o,{specKey:"region",index:0},"one");if(e.previewSeries){const i=this._layoutOrientItem(r,{orient:"bottom"},o,{specKey:"region",index:1},"one"),a=e.axes.findIndex((t=>t===e.previewAxes));if(-1!==a){const e={col:i.col-1,row:i.row,modelKey:"axes",modelIndex:a};r.elements.push(e)}if(e.previewHeight)if("string"==typeof e.previewHeight){if(t.isPercent(e.previewHeight)){const t=e.previewHeight;r.rowHeight.push({index:i.row,size:e=>Number(t.substring(0,t.length-1))*e/100})}}else r.rowHeight.push({index:i.row,size:e.previewHeight})}const d=e.axes.findIndex((e=>"bottom"===e.orient));this._layoutOrientItem(r,e.axes[d],o,{specKey:"axes",index:d},"one"),e.axes.forEach(((t,i)=>{if(t===e.previewAxes)return;const a=r.elements.find((e=>"modelKey"in e&&"axes"===e.modelKey&&e.modelIndex===i));a&&("top"===t.orient||"bottom"===t.orient?a.col=l.col:a.row=l.row)})),t.array(e.dataZoom).forEach(((e,t)=>{const i=r.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=r}_layoutOrientItem(e,t,i,a,r){var n;const s={modelKey:a.specKey,modelIndex:a.index,col:0,row:0},o=null!==(n=t.orient)&&void 0!==n?n:"top",{span:l,index:d}=this._getLayoutElementCommon(e,i,r,o);return e.elements.push(s),"top"===o?(s.row=i.top,s.rowSpan=1,s.colSpan=l,s.col=d,i.top++):"bottom"===o?(s.row=e.row-i.bottom-1,s.rowSpan=1,s.colSpan=l,s.col=d,i.bottom++):"left"===o?(s.col=i.left,s.colSpan=1,s.rowSpan=l,s.row=d,i.left++):"right"===o&&(s.col=e.col-i.right-1,s.colSpan=1,s.rowSpan=l,s.row=d,i.right++),s}_getLayoutElementCommon(e,t,i,a){return"top"===a||"bottom"===a?{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=xe,this.transformerConstructor=Be}_setModelOption(){this._modelOption.getDimensionInfo=(e,i,a)=>{var r;return[...null!==(r=t.getCartesianDimensionInfo(e,i,a))&&void 0!==r?r:[]]},this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}je.type=xe,je.transformerConstructor=Be,t.mixin(je,t.StackChartMixin);const Pe=e=>({custom:t.RotateBySphereAnimate,customParameters:()=>e,easing:"linear",loop:1/0,duration:6e3});class Re extends t.BaseWordCloudSeries{constructor(){super(...arguments),this.type=W.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 a=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-a.left||0-a.right||0,r=t.height-a.top||0-a.bottom||0,n=Math.max(i,r)/2;return{center:{x:n,y:n,z:null!==(e=this._spec.depth_3d)&&void 0!==e?e:n},r:n}})),t.userAnimationConfig("word",this._spec,this._markAttributeContext)))}}Re.type=W.wordCloud3d,Re.builtInTheme={wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}}};const Ve=()=>{t.registerTextMark(),t.Factory.registerAnimation("wordCloud3d",(e=>({appear:Pe(e)}))),t.Factory.registerSeries(Re.type,Re)},Ne=()=>{Ve()};class ze 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=ze,this.type="wordCloud3d",this.seriesType=W.wordCloud3d}}Ge.type="wordCloud3d",Ge.seriesType=W.wordCloud3d,Ge.transformerConstructor=ze;const Ke=()=>{Y(),Ve(),t.Factory.registerChart(Ge.type,Ge)},We={label:{space:0}};class He{setLayout3dBox(e){this.layout3dBox=e}_afterUpdateAttribute(e,i){const a=t.isZAxis(this._orient),r=t.isXAxis(this._orient),n=t.isYAxis(this._orient);let s=0,o=0;if(!i){const e=this.getRegions();let{x:t,y:i}=e[0].getLayoutStartPoint(),a=t+e[0].getLayoutRect().width,r=i+e[0].getLayoutRect().height;for(let n=1;n<e.length;n++){const s=e[n],{x:o,y:l}=s.getLayoutStartPoint(),{width:d,height:c}=s.getLayoutRect();t=Math.min(t,o),a=Math.max(a,d+o),i=Math.min(i,l),r=Math.max(r,c+l)}s=Math.abs(r-i),o=Math.abs(a-t)}let l=0,d=0;const{width:c,height:u}=this.getLayoutRect();let h={x:0,y:0};r?(h={x:c,y:0},l=s,d=c):n&&(h={x:0,y:u},l=o,d=u);const p=this.layout3dBox?this.layout3dBox.length:0;if(!a){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(r),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 a;const r=t.getCombinedSizeOfRegions(e.getRegions()),{width:n}=e.getLayoutRect(),s=n,o=e.layout3dBox?e.layout3dBox.length:0,l=e.layout3dBox?e.layout3dBox.width:0,d={x:o,y:0},c=e.getLabelItems(s),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!==(a=e.directionStr)&&void 0!==a?a:"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:r.height,alpha:g,z:m,anchor3d:p}),u})(this,i)}}const Ue=Object.assign(Object.assign({},q),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class $e extends t.RangeColumnSeries{constructor(){super(...arguments),this.type=W.rangeColumn3d,this._barMarkType="rect3d",this._barName=W.bar3d}}$e.type=W.rangeColumn3d,$e.mark=Ue;const Xe=()=>{Q(),t.registerCartesianBandAxis(),t.registerCartesianLinearAxis(),t.Factory.registerSeries($e.type,$e)};class Ye extends t.RangeColumnSeriesSpecTransformer{_transformLabelSpec(e){var t;"bothEnd"!==(null===(t=e.label)||void 0===t?void 0:t.position)&&this._addMarkLabelSpec(e,"bar3d")}}class qe extends t.CartesianChartSpecTransformer{_getDefaultSeriesSpec(e){var t,i;const a=super._getDefaultSeriesSpec(e,["bar3d","barGapInGroup"]);return"horizontal"===e.direction?a.xField=null!==(t=e.xField)&&void 0!==t?t:[e.minField,e.maxField]:a.yField=null!==(i=e.yField)&&void 0!==i?i:[e.minField,e.maxField],a}}class Ze extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=qe,this.type="rangeColumn3d",this.seriesType=W.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}Ze.type="rangeColumn3d",Ze.seriesType=W.rangeColumn3d,Ze.transformerConstructor=qe;const Je="pictogram",Qe="pictogram";var et;!function(e){e.pictogram="pictogram"}(et||(et={}));const tt=Object.assign(Object.assign({},t.baseSeriesMark),{pictogram:{name:"pictogram",type:"group"}});class it extends t.BaseChartSpecTransformer{_isValidSeries(e){return e===Qe}_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 rt;function nt(e,i){at.has(e)&&t.warn(`svg source key of '${e}' already exists, will be overwritten.`),rt||(rt=new t.DataSet,t.registerDataSetInstanceParser(rt,"svg",t.svgParser));const a=new t.DataView(rt);a.parse(i,{type:"svg"}),at.set(e,a)}function st(e){at.has(e)?at.delete(e):t.warn(`map type of '${e}' does not exists.`)}function ot(e){return at.get(e)}class lt extends t.BaseSeriesSpecTransformer{_getDefaultSpecFromChart(e){var i,a,r;const n=null!==(i=super._getDefaultSpecFromChart(e))&&void 0!==i?i:{},s=e.svg,o=null===(r=null===(a=at.get(s))||void 0===a?void 0:a.latestData)||void 0===r?void 0:r.elements;if(o&&o.length){o.map((e=>e.name)).filter((e=>t.isValid(e))).forEach((t=>{e[t]&&(n[t]=e[t])}))}return n}}class dt 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 ct="element-highlight-by-graphic-name";class ut extends t.ElementHighlight{constructor(){super(...arguments),this.type=ct,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:a,blurState:r}=this.options,n=i.getStatedGraphics(this),s=[];this.getMarks().forEach((t=>{var i;null===(i=t.getGraphics())||void 0===i||i.forEach((t=>{t.name===e&&s.push(t)}))})),i.updateStates(this,s,n,a,r),i.setStatedGraphics(this,s)}reset(){const{highlightState:e,blurState:t,interaction:i}=this.options;i.clearAllStatesOfTrigger(this,e,t),i.setStatedGraphics(this,[])}}ut.type=ct;const ht="element-select-by-graphic-name";class pt extends t.ElementSelect{constructor(){super(...arguments),this.type=ht}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)}))}))}}pt.type=ht;function gt(e){var i;return t.isValid(e)&&"none"!==e&&!(null===(i=e.includes)||void 0===i?void 0:i.call(e,"url"))}const mt=e=>{const t=parseFloat(e.strokeWidth);if(!isNaN(t))return t;const i=e.stroke;return i&&gt(i)?1:0},yt=(e,t)=>{var i;const a=null!==(i=e.fill)&&void 0!==i?i:t;return a&&gt(a)?a:void 0},vt=(e,t)=>{var i;const a=null!==(i=e.stroke)&&void 0!==i?i:t;return!(!a||!gt(a))&&a},ft=e=>Object.assign(Object.assign({},e),{x:parseFloat(e.x)||void 0,y:parseFloat(e.y)||void 0,fillStrokeOrder:!1,fill:yt(e),lineWidth:mt(e),stroke:vt(e)}),bt={group:e=>{const t=ft(e);return Object.assign(Object.assign({},t),{visibleAll:!1!==t.visible})},rule:e=>Object.assign(Object.assign({},ft(e)),{x:parseFloat(e.x1),y:parseFloat(e.y1),x1:parseFloat(e.x2),y1:parseFloat(e.y2)}),rect:e=>Object.assign(Object.assign({},ft(e)),{fill:yt(e,"#000"),width:parseFloat(e.width),height:parseFloat(e.height)}),polygon:e=>Object.assign(Object.assign({},ft(e)),{fill:yt(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({},ft(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({},ft(e)),{path:e.d,fillStrokeOrder:!1,fill:yt(e,"#000")}),arc:e=>{var t;return Object.assign(Object.assign({},ft(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:yt(e,"#000")})},text:(e,t)=>{var i,a;return Object.assign(Object.assign({},ft(e)),{text:t,textAlign:null!==(i=e.textAlign)&&void 0!==i?i:"left",textBaseLine:null!==(a=e.textAnchor)&&void 0!==a?a:"middle",anchor:[0,0],fill:yt(e,"#000")})}},xt=e=>{var i,a;if(!e||!e[0])return{};const{elements:r}=e[0].latestData;if(r&&r.length){r.forEach(((e,i)=>{var a;e[t.DEFAULT_DATA_INDEX]=i,e._uniqueId=`${e.id}-${i}`,e.data=void 0;const{graphicType:r,transform:n}=e,s={visible:"hidden"!==e.attributes.visibility&&"collapse"!==e.attributes.visibility};"text"===e.graphicType?t.merge(s,e._inheritStyle,null===(a=e.parent)||void 0===a?void 0:a._textGroupStyle,e.attributes):"group"!==e.graphicType&&t.merge(s,e._inheritStyle,e.attributes),bt[r]?e._finalAttributes=bt[r](s,e.value):e._finalAttributes=s,n&&(e._finalAttributes.postMatrix=Object.assign({},n))}));const e=r.filter((e=>"text"===e.tagName));for(let n=0;n<e.length;n++){const s=e[n]._uniqueId,o=r.filter((e=>{let t=!1,i=e.parent;for(;i;){if(i._uniqueId===s){t=!0;break}i=i.parent}return t}));if(o&&o.length){const r=null!==(a=null===(i=e[n]._textGroupStyle)||void 0===i?void 0:i.x)&&void 0!==a?a:0;let s=r;for(let e=0;e<o.length;e++){const i=o[e];if("group"===i.graphicType)s=r;else if(i.value&&void 0===i.parent._textGroupStyle.x){const a=o.slice(0,e).reverse().find((e=>"text"===e.graphicType&&e.value));if(a){s+=t.measureText(a.value,a._finalAttributes).width}i._finalAttributes.x=s}}}}}return r};class St extends t.GeoSeries{constructor(){super(...arguments),this.type=Qe,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=ot(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,a=t.isValid(e.triggerOff)?e.triggerOff:i?["empty","self"]:["empty",e.trigger];return{type:"element-select-by-graphic-name",trigger:e.trigger,triggerOff:a,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:a,name:r,parent:n,id:s,_nameFromParent:o,_uniqueId:l}=i,d=this._createMark({type:a,name:null!=r?r:o},{groupKey:l,isSeriesMark:!1,skipBeforeLayouted:!0,parent:null!==(e=this._idToMark.get(null==n?void 0:n._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,a=this._mapViewData.getDataView().latestData;e&&(this.setMarkStyle(this._pictogramMark,bt.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 a){const{_uniqueId:i,_finalAttributes:a}=e,r=this._idToMark.get(i),n=this._validElement(e);r&&(this.setMarkStyle(r,{keepStrokeScale:!0},"normal",t.AttributeLevel.Built_In),n?(this.initMarkStyleWithSpec(r,t.merge({},this._spec.pictogram,this._spec[r.name])),this.setMarkStyle(r,a,"normal",t.AttributeLevel.Series),r.setPostProcess("fill",((e,i)=>t.isValid(e)?e:this._spec.defaultFillColor))):(r.setMarkConfig({interactive:!1}),this.setMarkStyle(r,a,"normal",t.AttributeLevel.Built_In)))}this.initLabelMarkStyle()}_validElement(e){return e.name||e._nameFromParent}initTooltip(){this._tooltipHelper=new dt(this),this.getMarksWithoutRoot().forEach((e=>{e&&e.name&&this._tooltipHelper.activeTriggerSet.mark.add(e)}))}dataToPosition(e,i=!1){if(!e)return null;const a=e[this.nameField];if(!a)return null;const r=this.getMarksWithoutRoot().filter((e=>e.name===a));if(!r||0===r.length)return null;let n=new t.Bounds;i?r.forEach((e=>{n=n.union(e.getGraphics()[0].globalAABBBounds)})):r.forEach((e=>{n=n.union(e.getProduct().AABBBounds)}));const s={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2};if(i){const{x:e,y:t}=this.getLayoutStartPoint();s.x-=e,s.y-=t}return s}coordToPosition(e){if(!e)return null;const{x:t,y:i}=e,a=this.getRootMatrix();if(!a)return null;const r={};return a.getInverse().transformPoint({x:t,y:i},r),r}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 a=at.get(this.svg);a||null===(e=this._option)||void 0===e||e.onError("no valid svg found!");const r=new t.DataView(this._dataSet,{name:`pictogram_${this.id}_data`});t.registerDataSetInstanceTransform(this._dataSet,"pictogram",xt),t.registerDataSetInstanceTransform(this._dataSet,"lookup",t.lookup),r.parse([a],{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",r.reRunAllTransform),this._mapViewData=new t.CompilableData(this._option,r)}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,a=t/2,r=this.getPictogramRootGraphic();if(r){const n=r.AABBBounds,{x1:s,x2:o,y1:l,y2:d}=r.AABBBounds,c=(s+o)/2,u=(l+d)/2,h=e/n.width(),p=t/n.height(),g=Math.min(h,p);r.scale(g,g,{x:c,y:u}),r.translate(i-c,a-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:a}=e;if(1===i)return;const r=this.getPictogramRootGraphic();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new t.Matrix}),r.scale(i,i,a))}handlePan(e){const{delta:i}=e;if(0===i[0]&&0===i[1])return;const a=this.getPictogramRootGraphic();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new t.Matrix}),a.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=Qe,St.mark=tt,St.transformerConstructor=lt;const _t=()=>{t.Factory.registerSeries(St.type,St),t.Factory.registerImplement("registerSVG",nt),t.Factory.registerImplement("unregisterSVG",st),t.Factory.registerInteractionTrigger(ut.type,ut),t.Factory.registerInteractionTrigger(pt.type,pt)};class kt extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=it,this.type=Je,this.seriesType=Qe}}kt.type=Qe,kt.seriesType=Je,kt.transformerConstructor=it;class Ct 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 Mt="imageCloud",At="imageCloud";var Ft;!function(e){e.image="image",e.imageMask="imageMask"}(Ft||(Ft={}));const Lt=Object.assign(Object.assign({},t.baseSeriesMark),{image:{name:"image",type:"image"},imageMask:{name:"imageMask",type:"rect"}});class Tt extends t.ACustomAnimate{constructor(e,t,i,a,r){var n;super(e,t,i,a,r),this._rotations=null!==(n=null==r?void 0:r.rotation)&&void 0!==n?n:1}onBind(){this._scaleX=this.target.attribute.scaleX,t.isValidNumber(this._rotations)||(this.valid=!1)}onUpdate(e,t,i){var a;if(!1===this.valid)return;if(e)return void(i.scaleX=this._scaleX);const r=360*this._rotations*t*Math.PI/180,n=Math.abs(Math.cos(r))*(null!==(a=this._scaleX)&&void 0!==a?a:1);this.target.attribute.scaleX=n,this.target.addUpdatePositionTag(),this.target.addUpdateShapeAndBoundsTag()}}function Ot(e,i){switch(i){case"axialRotate":return[{custom:Tt,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 wt 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:a}=this._seriesCacheInfo,r=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(a[0]&&r)return null!==(i=r[a[0]])&&void 0!==i?i:e.value},this.dimensionTooltipTitleCallback=e=>{var t;const{dimensionFields:i}=this._seriesCacheInfo,a=null===(t=this.series)||void 0===t?void 0:t.getMarkData(e);if(i[0]&&a)return a[i[0]]}}get defaultShapeType(){return"square"}}class It extends t.BaseSeries{constructor(){super(...arguments),this.type=At}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 wt(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,a;if(e){const r=null===(a=null===(i=this._spec)||void 0===i?void 0:i.animationAppear)||void 0===a?void 0:a.preset,n={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")(n,r),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""}}It.type=At,It.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(It.type,It),t.Factory.registerGrammarTransform("imagecloud",{transform:t.imagecloudTransform})};class Et extends t.BaseChart{constructor(){super(...arguments),this.transformerConstructor=Et.transformerConstructor,this.type=Mt,this.seriesType=At}}Et.type=Mt,Et.seriesType=At,Et.transformerConstructor=Ct;const Bt="seriesBreak";function jt(e,t,i,a,r=!1){const n=[],{x:s,y:o}=e,{x:l,y:d}=t,c=r?Math.floor((d-o)/(2*i)):Math.floor((l-s)/(2*i)),u=Math.PI/180*a,h=i*Math.cos(u),p=i*Math.sin(u);n.push(`M ${s} ${o}`);for(let e=0;e<=c;e++){const t=r?s+(e%2==0?h:-h):s+e*i*2,a=r?o+e*i*2:e%2==0?o-p:o+p;n.push(`L ${t} ${a}`)}return n.push(`L ${r?s:l} ${r?d:o}`),n.join(" ")}class Pt extends t.AbstractComponent{constructor(){super(...arguments),this.name=Bt}render(){this.removeAllChild();const{data:e=[]}=this.attribute;if(t.isEmpty(e))return;const i=[],a=[];e.forEach((e=>{const{start:r,end:n}=e;((e,i)=>{const{start:a,end:r}=i,n=a.x===r.x,s=n?"x":"y",o=n?"y":"x";let l=!0;const d=1e-6;e.length&&e.forEach((e=>{if(t.isNumberClose(e.start[s],a[s])){const t=Math.min(a[o],r[o]),i=Math.max(a[o],r[o]),n=Math.min(e.start[o],e.end[o]),s=Math.max(e.start[o],e.end[o]);if(!(i<n-d||t>s+d))return e.start[o]=Math.min(n,t),e.end[o]=Math.max(s,i),void(l=!1)}})),l&&e.push(i)})(r.x===n.x?i:a,e)})),[...i,...a].forEach(((e,i)=>{var a;const{start:r,end:n,size:s=4,gap:o=5,style:l={}}=e,d=g(e,["start","end","size","gap","style"]),c=t.createGroup({}),u=r.x===n.x;let h,p,m,y;u?(h={x:r.x-o/2,y:r.y},p={x:n.x-o/2,y:n.y},m={x:r.x+o/2,y:r.y},y={x:n.x+o/2,y:n.y}):(h={x:r.x,y:r.y-o/2},p={x:n.x,y:n.y-o/2},m={x:r.x,y:r.y+o/2},y={x:n.x,y:n.y+o/2});const v=jt(h,p,s,u?75:15,u),f=jt(r,n,s,u?75:15,u),b=jt(m,y,s,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!==(a=d.axisId)&&void 0!==a?a:""}_${i}`),this.add(c)}))}}function Rt(e,t,i=1){return Math.abs(e-t)<i}function Vt(e,i){return{type:"component",componentType:Bt,interactive:!0,zIndex:500,style:{data:(a,r)=>{const n=[],s=r.vchart.getChart(),o="horizontal"===s.getAllSeries()[0].direction;return e.forEach(((e,a)=>{var r,l;const d=e.id,c=t.isValid(d)?s.getComponentByUserId(d):i&&t.isValid(i[a])?s.getComponentByIndex("axes",i[a]):null===(r=s.getComponentsByKey("axes").filter((t=>t.getSpec().breaks===e.breaks)))||void 0===r?void 0:r[0];if(!c)return;const u=null!=d?d:`${c.type}-${c.id}`,h=function(e){let{x:t,y:i}=e[0].getLayoutStartPoint(),a=t+e[0].getLayoutRect().width,r=i+e[0].getLayoutRect().height;for(let n=1;n<e.length;n++){const s=e[n],{x:o,y:l}=s.getLayoutStartPoint(),{width:d,height:c}=s.getLayoutRect();t=Math.min(t,o),a=Math.max(a,d+o),i=Math.min(i,l),r=Math.max(r,c+l)}return{x1:t,y1:i,x2:a,y2:r}}(c.getRegions());t.array(null===(l=c._break)||void 0===l?void 0:l.breaks).forEach((e=>{const{range:t,breakSymbol:i,gap:a=5}=e,r=c.valueToPosition(t[0]),l=c.valueToPosition(t[1]),d=(r+l)/2+(o?h.x1:h.y1);s.getAllSeries().forEach((e=>{if("bar"===e.type||"waterfall"===e.type){e.getMarkInName("bar").getGraphics().forEach((e=>{const s=e.AABBBounds;let c,p,g,m,y=!1;o?(y=s.x1<(r+l-a)/2&&s.x2>(r+l+a)/2,c=d,p=Math.max(s.y1+h.y1-2,h.y1),g=d,m=Math.min(s.y2+h.y1+2,h.y2)):(y=s.y1<(r+l-a)/2&&s.y2>(r+l+a)/2,c=Math.max(s.x1+h.x1-2,h.x1),p=d,g=Math.min(s.x2+h.x1+2,h.x2),m=d),y&&n.push({start:{x:c,y:p},end:{x:g,y:m},gap:a,style:null==i?void 0:i.style,axisId:u,data:t})}))}else if("line"===e.type){e.getMarkInName(e.type).getGraphics().forEach((e=>{zt(e,"line").forEach((e=>{Nt(o?{start:{x:(r+l)/2,y:0},end:{x:(r+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(r+l)/2},end:{x:h.x2-h.x1,y:(r+l)/2}},e).forEach((e=>{let r,s;o?(r={x:d,y:Math.max(e[1]+h.y1-10,h.y1)},s={x:d,y:Math.min(e[1]+h.y1+10,h.y2)}):(r={x:Math.max(e[0]+h.x1-10,h.x1),y:d},s={x:Math.min(e[0]+h.x1+10,h.x2),y:d}),n.push({start:r,end:s,gap:a,style:null==i?void 0:i.style,axisId:u,data:t})}))}))}))}else if("area"===e.type){e.getMarkInName("area").getGraphics().forEach((e=>{zt(e,"area").forEach((e=>{const s=Nt(o?{start:{x:(r+l)/2,y:0},end:{x:(r+l)/2,y:h.y2-h.y1}}:{start:{x:0,y:(r+l)/2},end:{x:h.x2-h.x1,y:(r+l)/2}},e);s.sort(((e,t)=>e[0]-t[0]));for(let r=0;r<s.length-1;r++){const l={x:s[r][0],y:s[r][1]},d={x:s[r+1][0],y:s[r+1][1]};if(Gt(o?{x:l.x,y:(l.y+d.y)/2}:{x:(l.x+d.x)/2,y:l.y},e)){let e,r;o?(e={x:l.x+h.x1,y:Math.max(l.y+h.y1-0,h.y1)},r={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},r={x:Math.min(d.x+h.x1+0,h.x2),y:d.y+h.y1}),n.push({start:e,end:r,gap:a,style:null==i?void 0:i.style,axisId:u,data:t})}}}))}))}}))}))})),n}}}}function Nt(e,i){const a=[];for(let r=1;r<i.length;r++){const n=t.getIntersectPoint([e.start.x,e.start.y],[e.end.x,e.end.y],[i[r].x,i[r].y],[i[r-1].x,i[r-1].y]);n&&!a.find((e=>Rt(t.PointService.distancePP({x:e[0],y:e[1]},{x:n[0],y:n[1]}),0)))&&a.push(n)}return a}function zt(e,t){const{points:i,segments:a}=e.attribute,r=[];let n=[];const s=e=>{if(e&&e.length){let i=[];if(e.forEach((e=>{var a,s;if(!1===e.defined){if(r.push(n),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)n.push({x:i[e].x,y:i[e].y});n.push(n[0])}n=[],i=[]}else n.push({x:e.x,y:e.y}),"area"===t&&i.push({x:null!==(a=e.x1)&&void 0!==a?a:e.x,y:null!==(s=e.y1)&&void 0!==s?s:e.y})})),"area"===t&&i.length){for(let e=i.length-1;e>=0;e--)n.push({x:i[e].x,y:i[e].y});n.push(n[0])}r.push(n)}};return i&&i.length?s(i):a&&a.length&&a.forEach((e=>{s(e.points)})),r}function Gt(e,t){const{x:i,y:a}=e;let r=!1;for(let e=0,n=t.length-1;e<t.length;n=e++){const{x:s,y:o}=t[e],{x:l,y:d}=t[n];o>a!=d>a&&i<(l-s)*(a-o)/(d-o)+s&&(r=!r)}return r}const Kt="barLink";class Wt extends t.AbstractComponent{constructor(){super(...arguments),this.name=Kt}render(){const{data:e,linkStyle:i,areaStyle:a,styleMap:r,label:n,linkType:s="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==r?void 0:r[`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},a),null==r?void 0:r[`area-${m}`]));e.name="bar-link-area",e.id=`area-${m}`,this.add(e)}if(p&&!1!==(null===(d=null==r?void 0:r[`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==r?void 0:r[`line-${m}`])||void 0===u?void 0:u.lineWidth)){const{startSymbol:e={},endSymbol:a={},lineStyle:n}=i||{},s=t.cloneDeep(e),o=t.cloneDeep(a);(null==r?void 0:r[`line-${m}`])&&r[`line-${m}`].stroke&&(s.style=Object.assign(Object.assign({},s.style),{color:r[`line-${m}`].stroke}),o.style=Object.assign(Object.assign({},o.style),{color:r[`line-${m}`].stroke})),s.symbolType||s.originSymbolType||(s.originSymbolType="solidArrow"),o.symbolType||o.originSymbolType||(o.originSymbolType="solidArrow");const l=new t.Segment({points:p,startSymbol:Object.assign({size:8},s),endSymbol:Object.assign({size:8},o),lineStyle:Object.assign(Object.assign({lineDash:[3,3],lineWidth:1,stroke:"#000"},n),null==r?void 0:r[`line-${m}`]),pickable:!0,childrenPickable:!1,zIndex:1});l.name="bar-link-line",l.id=`line-${m}`,this.add(l)}if((null==n?void 0:n.visible)&&!1!==(null===(h=null==r?void 0:r[`label-${m}`])||void 0===h?void 0:h.visible)){const{style:e,formatMethod:i}=n,[a,o]=v;let l=a[t.STACK_FIELD_END],d=o[t.STACK_FIELD_END];"value"===s&&(l=a[t.STACK_FIELD_END]-a[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==r?void 0:r[`label-${m}`]));h.name="bar-link-label",h.id=`label-${m}`,this.add(h)}})))}}function Ht(e,i,a){const{isHorizontal:r,isXAxisInverse:n,isYAxisInverse:s,linkType:o,doFill:l,regionStartX:d,regionStartY:c}=a,u=e.AABBBounds,h=i.AABBBounds;let p,g;return r?(p=[{x:(u.x1+u.x2)/2+d,y:u.y1+c},{x:(h.x1+h.x2)/2+d,y:h.y2+c}],n?("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}],s?("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 Ut(e={},i){const{linkType:a="total",doFill:r}=e,n=g(e,["linkType","doFill"]);return{type:"component",componentType:Kt,zIndex:500,interactive:!1,style:Object.assign(Object.assign({data:(e,i)=>{const{vchart:n}=i,s=n.getChart().getAllRegions(),o=[];return s.forEach((e=>{const i=e.getSeries().filter((e=>"bar"===e.type)),{x:n,y:s}=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 a={};for(let r=0;r<e.length;r++){const n=e[r],s=t.getDatumOfGraphic(n),o=i.map((e=>s[e])).join("-");a[o]||(a[o]=[]),a[o].push(n)}return a}(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=Ht(e,null!==(l=i[t])&&void 0!==l?l:i[i.length-1],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:h,doFill:r,linkType:a,regionStartX:n,regionStartY:s});o.push(d)})),t.length<i.length){const e=t[t.length-1];for(let l=t.length;l<i.length;l++){const t=Ht(e,i[l],{isHorizontal:u,isXAxisInverse:p,isYAxisInverse:h,doFill:r,linkType:a,regionStartX:n,regionStartY:s});o.push(t)}}}}})),o},linkType:a},n),i)}}const $t="seriesLabel";function Xt(e,t=10,i=10,a=.1){const r=e.length;if(!e.every(isFinite))return e;if(!(r>1))return e;const n=function(e,t,i){e=+e,t=+t;let a=arguments.length;i=a<2?(t=e,e=0,1):a<3?1:+i;let r=-1;a=0|Math.max(0,Math.ceil((t-e)/i));const n=new Array(a);for(;++r<a;)n[r]=e+r*i;return n}(e.length);for(let s=0;s<i;++s){n.sort(((t,i)=>{return a=e[t],r=e[i],null==a||null==r?NaN:a<r?-1:a>r?1:a>=r?0:NaN;var a,r}));let i=0;for(let a=1;a<r;++a){let r=e[n[a]]-e[n[a-1]];r<t&&(r=(t-r)/2,i=Math.max(i,r),e[n[a-1]]-=r,e[n[a]]+=r)}if(i<a)break}return e}function Yt(e,t){return!(t.x1>e.x2||t.x2<e.x1||t.y1>e.y2||t.y2<e.y1)}function qt(e,t=10,i=10){const a=e.length;let r,n=0;do{r=!1;for(let i=0;i<a;++i)for(let n=i+1;n<a;++n){const a=e[i].AABBBounds,s=e[n].AABBBounds;if(Yt(a,s)){const i=t-(s.x1-a.x2);i>0&&(e[n].attribute.x+=i,s.x1+=i,s.x2+=i,r=!0)}}n++}while(r&&n<i)}function Zt(e,i){const{label:a,line:r}=i;return{type:"component",componentType:$t,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,a)=>{var r;const n=a.vchart.getChart(),s=n.getAllSeries()[0],o="horizontal"===s.direction,l=o?s.getYAxisHelper():s.getXAxisHelper(),d=null===(r=l.getScale)||void 0===r?void 0:r.call(l,0),c=l.isInverse(),u=s.getDimensionField()[0],h=s.getSeriesField(),p=n.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],a=s.getRegion(),{x:r,y:l}=a.getLayoutStartPoint();let m=0;n.getAllSeries().forEach((t=>{t.getMarkInName("waterfall"===p[0]?"bar":p[0]).getGraphics().forEach((a=>{var n;const s=a.context.data.find((e=>e[u]===i));if(s){const i=a.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=a.attribute.fill):(d=t.dataToPosition(s),y=a.attribute.stroke||a.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!==(n=s[h])&&void 0!==n?n:s[u];g.push({point:{x:d.x+r,y:d.y+l},label:b,color:y,textAlign:v,textBaseline:f,series:t,datum:s,id:`${e}-${m}`,position:e}),m++}}))}))}))}return g},line:r,label:Object.assign({space:12},a)}}}class Jt extends t.AbstractComponent{constructor(){super(...arguments),this.name=$t}render(){var e,i,a,r;this.removeAllChild();const{data:n,layout:s,label:o,line:l={}}=this.attribute;if(t.isEmpty(n))return;const d=null!==(e=null==o?void 0:o.styleMap)&&void 0!==e?e:{},c={},u=n.filter((e=>{var t;return!1!==(null===(t=d[e.id])||void 0===t?void 0:t.visible)}));if("vertical"===s){const e=1.5*(null!==(a=null===(i=null==o?void 0:o.style)||void 0===i?void 0:i.fontSize)&&void 0!==a?a:12),r=(e,i,a)=>{var r,n,s,o,l,d,c,u;const{label:h,color:p,textAlign:g,textBaseline:m,id:y}=e,v=null!==(n=null===(r=a[y])||void 0===r?void 0:r.formatMethod)&&void 0!==n?n:null===(s=this.attribute.label)||void 0===s?void 0:s.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=a[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)),a=Xt(i.map((e=>e.point.y)),e);i.forEach(((e,t)=>{var i;const n={x:e.point.x+(null!==(i=null==o?void 0:o.space)&&void 0!==i?i:8)*("start"===e.textAlign?1:-1),y:a[t]};r(e,n,d),c[e.id]=n}))}))}else{const e=[],i=[];u.forEach((a=>{var r,n,s,l,c;const{point:u,label:h,color:p,textAlign:g,textBaseline:m,id:y,position:v}=a,f={x:u.x,y:u.y},b=null!==(n=null===(r=d[y])||void 0===r?void 0:r.formatMethod)&&void 0!==n?n:null==o?void 0:o.formatMethod,x=t.createText(Object.assign(Object.assign(Object.assign(Object.assign({text:b?b(h,a.datum,{series:a.series}):h},null==o?void 0:o.style),f),{textAlign:g,textBaseline:m,fill:null!==(l=null===(s=null==o?void 0:o.style)||void 0===s?void 0:s.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&&qt(e,4,10),i.length&&qt(i,4,10);const a=null!==(r=null==o?void 0:o.space)&&void 0!==r?r:8;[...e,...i].forEach((e=>{const t="top"===e.attribute.textBaseline?1:-1;e.setAttribute("y",e.attribute.y+a*t),c[e.id]={x:e.attribute.x,y:e.attribute.y}}))}!1!==l.visible&&u.forEach((e=>{var i,a,r,n,o,u;const{point:h,color:p,id:g}=e,m={x:c[g].x+(null!==(r=null===(a=null===(i=d[g])||void 0===i?void 0:i.style)||void 0===a?void 0:a.dx)&&void 0!==r?r:0),y:c[g].y+(null!==(u=null===(o=null===(n=d[g])||void 0===n?void 0:n.style)||void 0===o?void 0:o.dy)&&void 0!==u?u:0)};if(!1!==l.autoVisible){if("vertical"===s&&h.y!==m.y||"horizontal"===s&&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 Qt(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 ei(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:si(null!==(t=e.anchors)&&void 0!==t?t:[],e.point,e.rect,e.offset)})})),a=[];a.push(i[0].bound);for(let e=1;e<=i.length-1;e++){const r=i[e],n=r.bound;let s=a.some((e=>Qt(e,n)));if(r.anchorCandidates)if(s&&(null===(t=r.anchorCandidates)||void 0===t?void 0:t.length)>0){for(let e=0;e<r.anchorCandidates.length;e++){const t=r.anchorCandidates[e],i={x1:t.x,y1:t.y,x2:t.x+n.x2-n.x1,y2:t.y+n.y2-n.y1,anchor:t};if(!a.some((e=>Qt(e,i)))){a.push(i),s=!1;break}}s&&a.push(r.bound)}else a.push(r.bound)}return a.map((e=>function(e){return{x:e.x1,y:e.y1,width:e.x2-e.x1,height:e.y2-e.y1}}(e)))}function ti(e,i,a){const r=e.map((e=>e.pointCoord)),{x1:n,x2:s,y1:o,y2:l}=t.getAABBFromPoints(r),d=a([(n+s)/2,(o+l)/2]);if(!d)return[];const c=e.map((e=>{const r=e.rect,n=ri(i,e.pointCoord)?a(function(e,i,a,r=200){const n=5621/r;let s=i;for(let i=1;i<=n;i++){const i=t.destination(s,r,a);if(!ri(e,i))return[i.x,i.y];s=[i.x,i.y]}return i}(i,[e.pointCoord.x,e.pointCoord.y],ii(ai(e.point,d)))):e.point;n&&(r.x=n.x,r.y=n.y);const s=ii(ai(e.point,d));let o;const l=[];return s>=-45&&s<45?(o="top",l.push("left","right")):s>=45&&s<135?o="right":s>=-135&&s<-45?(o="left",l.push("left")):(o="bottom",l.push("left","right")),e.anchors=l,e.offset=20,e.rect=ni(e.rect,o,0),e}));return ei(c)}function ii(e){return e>180?e-360:e}function ai(e,t){return 180*Math.atan2(e.y-t.y,e.x-t.x)/Math.PI+90}function ri(e,i){for(let a=0;a<e.length;a++){if(t.isPointInPolygon(i,e[a]))return!0}return!1}function ni(e,t,i=0){const a=Object.assign({},e);return"top"===t?(a.x-=e.width/2,a.y-=i+e.height/2):"bottom"===t?(a.x-=e.width/2,a.y+=i-e.height/2):"left"===t?(a.x-=i+e.width,a.y-=e.height/2):"right"===t&&(a.x+=i,a.y-=e.height/2),a}function si(e,t,i,a=0){const r=[];return e.forEach((e=>{const{x:n,y:s}=ni(Object.assign(Object.assign({},t),{width:i.width,height:i.height}),e,a);r.push({x:n,y:s})})),r}const oi={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 li extends t.BaseComponentSpecTransformer{_getDefaultSpecFromChart(){return oi}}class di extends t.BaseComponent{constructor(){super(...arguments),this.type="mapLabel",this.name=" mapLabel",this.specKey="mapLabel",this.transformerConstructor=li,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,a;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===(a=this._series)||void 0===a?void 0:a.getMeasureField()[0]}created(){super.created(),!1!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var e,t,i,a,r,n,s,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===(r=null===(a=(i=this._regions[0]).getSpec)||void 0===a?void 0:a.call(i))||void 0===r?void 0:r.longitudeField,this._latitudeField=null===(o=null===(s=(n=this._regions[0]).getSpec)||void 0===s?void 0:s.call(n))||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 a=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[t];this._activeDatum.includes(a)?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=[],a=[];this._markerComponents||(this._markerComponents=null===(e=this._data)||void 0===e?void 0:e.getLatestData().map(((e,i)=>{var a;const r=new t.MarkPoint({position:void 0,animation:!1});return r&&(r.name=`${this.name}_marker_${i}`,r.id=null!==(a=this._spec.id)&&void 0!==a?a:`${this.name}_marker_${this.id}`,r.setAttribute("zIndex",this.layoutZIndex)),r})));this._markerComponents.forEach(((e,t)=>{const{pairInfo:r,contentMarks:n}=this._evaluateMarker(this._data.getLatestData()[t],t);r&&i.push(r),n&&a.push(n)}));const r=this._layoutLabels(i);this._layoutMarkers(r,a),this._renderMarkers()}_evaluateMarker(e,i){var a,r,n,s,o,l,d,c,u,h,p,g,m,y;let v=0,f=0,b=0,x=0,S=0;const _=this._spec.position||"top",k=this._spec.offset,C=t.normalizeLayoutPaddingSpec(null===(a=this._spec.background)||void 0===a?void 0:a.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),L=t.graphicCreator.group({});if(L.name=`${this.name}_marker_itemContainer_${i}`,A.container=L,null===(r=this._spec.background)||void 0===r?void 0:r.visible){const e=t.graphicCreator.rect(t.transformToGraphic(Object.assign({},this._spec.background.style)));e.setAttributes(F),A.labelBackground=e,L.appendChild(e)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const e=t.graphicCreator.symbol(t.transformToGraphic(Object.assign({},this._spec.icon.style)));e.setAttributes(F),e.setAttribute("symbolType",null!==(o=null===(s=this._spec.icon.style)||void 0===s?void 0:s.symbolType)&&void 0!==o?o:null===(l=this._spec.icon.style)||void 0===l?void 0:l.shape);const i=e.AABBBounds,a=null!==(d=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==d?d:0,r=null!==(c=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==c?c:0;A.icon=e,L.appendChild(e),S=a,x+=r,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 a=i.AABBBounds,r=null!==(h=(null==a?void 0:a.y2)-(null==a?void 0:a.y1))&&void 0!==h?h:0,n=null!==(p=(null==a?void 0:a.x2)-(null==a?void 0:a.x1))&&void 0!==p?p:0;A.nameLabel=i,L.appendChild(i),S=Math.max(S,r),x+=n,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 a=i.AABBBounds,r=null!==(m=(null==a?void 0:a.y2)-(null==a?void 0:a.y1))&&void 0!==m?m:0,n=null!==(y=(null==a?void 0:a.x2)-(null==a?void 0:a.x1))&&void 0!==y?y:0;A.valueLabel=i,L.appendChild(i),S=Math.max(S,r),x+=n,v++}const T=Object.values(A).find((e=>!!e&&"group"!==e.type)),O={x:null==T?void 0:T.getComputedAttribute("x"),y:null==T?void 0:T.getComputedAttribute("y")},w={x:O.x,y:O.y,width:0,height:0};w.width=f+x+(v-1)*M,w.height=b+S;const I={rect:w,point:O,index:i};if("outer"!==_){const e=["top","right","left","bottom"].filter((e=>e!==_));I.rect=ni(w,_,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 a,r,n;for(let s=0;s<i.length;s++){if(!e[s]||!i[s])return;const{icon:o,nameLabel:l,valueLabel:d,labelBackground:c,container:u}=i[s],h=e[s],p=t.normalizeLayoutPaddingSpec(null===(a=this._spec.background)||void 0===a?void 0:a.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,a;if(e){const r=e.AABBBounds;let n=0;"symbol"===e.type&&(n+=(null!==(i=r.x2-r.x1)&&void 0!==i?i:0)/2),e.setAttributes({x:y+n,y:m}),y+=null!==(a=r.x2-r.x1)&&void 0!==a?a: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()[s],f=this.dataToPosition(v),b=this.getRegions()[0].getLayoutStartPoint(),x=!(!(null===(r=this._spec.leader)||void 0===r?void 0:r.visible)||!(o||l||d));this._markerComponents[s].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===(n=this._spec.leader)||void 0===n?void 0:n.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?ti(e,this._map,(e=>this._series.dataToPosition({[this._longitudeField]:e[0],[this._latitudeField]:e[1]}))):ei(e)}_isRelativeModel(e){var t,i,a;const r=null!==(i=null===(t=this._series.getXAxisHelper())||void 0===t?void 0:t.getAxisId())&&void 0!==i?i:null===(a=this._series.getCoordinateHelper())||void 0===a?void 0:a.getCoordinateId();return(null==e?void 0:e.id)===r}_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}}di.type="mapLabel",di.specKey="mapLabel",di.transformerConstructor=li;const ci="regressionLine";class ui extends t.AbstractComponent{constructor(){super(...arguments),this.name=ci}render(){this.removeAllChild();const{data:e,line:i={},label:a,name:r="regression-line",confidenceInterval:n}=this.attribute;t.isEmpty(e)||e.forEach((e=>{const{color:s}=e;if(e.area&&!1!==(null==n?void 0:n.visible)){const i=t.createArea(Object.assign(Object.assign({points:e.area},t.isValid(s)?{fill:s,fillOpacity:.12}:null),null==n?void 0:n.style));i.name="scatter-regression-area",this.add(i)}if(e.line&&!1!==(null==i?void 0:i.visible)){const a=t.createLine(Object.assign(Object.assign({points:e.line,lineWidth:1},t.isValid(s)?{stroke:s}:null),null==i?void 0:i.style));a.name=`${r}-curve`,this.add(a)}const o=t.last(e.line);if(a&&!1!==a.visible&&a.text&&o){const e=t.createText(Object.assign(Object.assign(Object.assign({},o),{text:a.text,textAlign:"end",textBaseline:"middle"}),a.style));e.name=`${r}-label`,this.add(e)}}))}}const hi=(e,i,a=(e=>e.x),r=(e=>e.y),n)=>{switch(e){case"logisitc":return t.regressionLogistic(i,a,r);case"lowess":return t.regressionLowess(i,a,r);case"polynomial":return t.regressionPolynomial(i,a,r,{degree:n});default:return t.regressionLinear(i,a,r)}};function pi(e,i){const{color:a,line:r,confidenceInterval:n,label:s}=i;return{type:"component",componentType:ci,interactive:!1,style:{data:(r,n)=>{const s=n.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.scatter)),o=[];return s&&s.length&&s.forEach((r=>{var n,s;const l=r.getRegion().getLayoutStartPoint(),d=r.getRegion().getLayoutRect(),c=t.clamper(l.y,l.y+d.height),u=r.getColorAttribute(),h=r.getSeriesKeys(),p=r.getViewData().latestData,g=null===(n=r.fieldX)||void 0===n?void 0:n[0],m=null===(s=r.fieldY)||void 0===s?void 0:s[0];g&&m&&p&&!(p.length<=2)&&h.forEach((t=>{var n;const s=p.filter((e=>e[null==u?void 0:u.field]===t));if(!s.length)return;const{evaluateGrid:h,confidenceInterval:y}=hi(e,s,(e=>null==e?void 0:e[g]),(e=>null==e?void 0:e[m]),i.polynomialDegree),v=Math.max(3,Math.floor(s.length/4)),f=h(v),b=y(v);o.push({color:null!=a?a:null===(n=null==u?void 0:u.scale)||void 0===n?void 0:n.scale(t),line:f.map((t=>{const i={[g]:t.x,[m]:t.y};return{x:r.dataToPositionX(i)+l.x,y:c("logisitc"===e?l.y+d.height*(1-t.y):r.dataToPositionY(i)+l.y)}})),area:b.map((e=>{const t={[g]:e.x,[m]:e.lower};return{x:r.dataToPositionX(t)+l.x,y:c(r.dataToPositionY(t)+l.y),y1:c(r.dataToPositionY({[m]:e.upper})+l.y)}}))})}))})),o},line:r,confidenceInterval:n,label:s}}}function gi(e){const{color:i,line:a,confidenceInterval:r,label:n}=e;return{type:"component",componentType:ci,interactive:!1,zIndex:500,style:{data:(a,r)=>{const n=r.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),s=[];return n&&n.length&&n.forEach((a=>{var r,n,o;const l=a.getRegion().getLayoutStartPoint(),d=a.getRegion().getLayoutStartPoint(),c=a.getRegion().getLayoutRect(),u=t.clamper(d.y,d.y+c.height),h=a.getViewData().latestData,p=null===(r=a.fieldX)||void 0===r?void 0:r[0],g=null===(n=a.fieldY)||void 0===n?void 0:n[0],m="horizontal"===a.direction,y=a.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),S=f(b),_=a.getXAxisHelper().getBandwidth(0)/2;s.push({color:null!=i?i:null===(o=a.getOption().globalScale.getScale("color"))||void 0===o?void 0:o.scale(a.getSeriesKeys()[0]),line:x.map((e=>{const t={[p]:y[e.x],[g]:e.y};return{x:a.dataToPositionX(t)+l.x+_,y:u(a.dataToPositionY(t)+l.y)}})),area:S.map((e=>{const t={[p]:y[e.x],[g]:e.lower};return{x:a.dataToPositionX(t)+l.x+_,y:u(a.dataToPositionY(t)+l.y),y1:u(a.dataToPositionY({[g]:e.upper})+l.y)}}))})})),s},line:a,confidenceInterval:r,label:n}}}const mi=(e,i,a)=>{switch(e){case"kde":return t.kde(i,a);case"ecdf":return t.ecdf(i)}};function yi(e,i){const{line:a,label:r,color:n}=i;return{type:"component",componentType:ci,interactive:!1,zIndex:500,style:{data:(i,a)=>{const r=a.vchart.getChart().getAllSeries().filter((e=>e.type===t.SeriesTypeEnum.bar)),s=[];return r&&r.length&&r.forEach((i=>{var a,r,o,l,d,c,u,h;const p=i.getRegion().getLayoutStartPoint(),g=i._rawData,m=null==g?void 0:g.rawData,y=null===(r=null===(a=g.transformsArr)||void 0===a?void 0:a.find((e=>"bin"===e.type)))||void 0===r?void 0:r.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])),S=mi(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),_=Math.max(3,Math.floor(x.length/4)),k=S.evaluateGrid(_),C=f.range(),M=C[0],A=t.last(C),F="kde"===e?e=>f.scale(e*m.length*S.bandwidth):e=>M+(A-M)*e;s.push({color:null!=n?n: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}}))})})),s},line:a,label:r}}}e.BAR_LINK=Kt,e.Bar3dChart=re,e.Bar3dChartSpecTransformer=z,e.Bar3dSeries=ee,e.Bar3dSeriesSpecTransformer=Z,e.BarLinkComponent=Wt,e.CandlestickChart=De,e.CandlestickChartSpecTransformer=Se,e.CandlestickSeries=we,e.CombinationCandlestickChart=je,e.CombinationCandlestickChart_TYPE=xe,e.ConversionFunnelChart=F,e.ConversionFunnelSeries=L,e.DEFAULT_STROKE_COLOR="#000",e.DefaultBandWidth=6,e.Funnel3dChart=ue,e.Funnel3dSeries=de,e.Funnel3dSeriesSpecTransformer=se,e.Histogram3dChart=he,e.ImageCloudChart=Et,e.MapLabelComponent=di,e.PictogramChart=kt,e.PictogramChartSpecTransformer=it,e.PictogramSeries=St,e.Pie3dChart=be,e.Pie3dChartSpecTransformer=pe,e.Pie3dSeries=ve,e.Pie3dSeriesSpecTransformer=ye,e.REGRESSION_LINE=ci,e.RangeColumn3dChart=Ze,e.RangeColumn3dChartSpecTransformer=qe,e.RangeColumn3dSeries=$e,e.RangeColumn3dSeriesSpecTransformer=Ye,e.RankingBar=n,e.RankingList=p,e.RegressionLine=ui,e.SERIES_BREAK=Bt,e.SequenceScatterKDE=j,e.SequenceScatterLink=w,e.SequenceScatterPixel=N,e.SeriesBreakComponent=Pt,e.SeriesLabelComponent=Jt,e.WordCloud3dChart=Ge,e.WordCloud3dChartSpecTransformer=ze,e.WordCloud3dSeries=Re,e.appendBarLinkConfig=function(e,i){e.customMark=t.array(e.customMark).filter((e=>e.componentType!==Kt)),e.customMark.push(Ut(i))},e.appendBarRegressionLineConfig=function(e,i){var a,r;i||(i=null!==(a=t.get(e,ci))&&void 0!==a?a:t.get(null===(r=e.series)||void 0===r?void 0:r.find((e=>e.type===t.SeriesTypeEnum.bar)),ci)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const i=g(t,["visible"]);e.customMark.push(gi(i))}}))},e.appendHistogramRegressionLineConfig=function(e,i){var a,r;i||(i=null!==(a=t.get(e,ci))&&void 0!==a?a:t.get(null===(r=e.series)||void 0===r?void 0:r.find((e=>e.type===t.SeriesTypeEnum.bar)),ci)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,a=g(t,["type"]);e.customMark.push(yi(i,a))}}))},e.appendScatterRegressionLineConfig=function(e,i){var a,r;i||(i=null!==(a=t.get(e,ci))&&void 0!==a?a:t.get(null===(r=e.series)||void 0===r?void 0:r.find((e=>e.type===t.SeriesTypeEnum.scatter)),ci)),t.array(i).forEach((t=>{if(!1!==t.visible){e.customMark||(e.customMark=[]);const{type:i}=t,a=g(t,["type"]);e.customMark.push(pi(i,a))}}))},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!==Bt)),e.customMark.push(Vt(i,i.map((t=>e.axes.indexOf(t))))),!0}return!1},e.appendSeriesLabelConfig=function(e,i){var a,r,n;if(e.customMark=t.array(e.customMark).filter((e=>e.componentType!==$t)),i||(i=null!==(n=null!==(a=t.get(e,$t))&&void 0!==a?a:t.get(null===(r=e.series)||void 0===r?void 0:r[0],$t))&&void 0!==n?n:{}),i.visible){const{position:t="end"}=i,a=g(i,["position"]);e.customMark.push(Zt(t,a))}},e.clearSVGSource=function(){at.clear(),rt=null},e.getBarLinkConfig=Ut,e.getBarRegressionLineConfig=gi,e.getHistogramRegressionLineConfig=yi,e.getSVGSource=ot,e.getScatterRegressionLineConfig=pi,e.getSeriesBreakConfig=Vt,e.getSeriesLabelConfig=Zt,e.register3DPlugin=Y,e.registerAxis3dPlugin=()=>{Y(),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),We)}),t.mixin(e,He)})(),(()=>{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),We)}),t.mixin(e,He)})(),(()=>{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),We)}),t.mixin(e,He)})(),(()=>{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),We)}),t.mixin(e,He)})(),(()=>{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),We)}),t.mixin(e,He)})()},e.registerBar3dChart=()=>{Y(),ae(),te(),t.Factory.registerChart(re.type,re)},e.registerBar3dSeries=te,e.registerBarLink=()=>{t.Factory.registerGraphicComponent(Kt,(e=>new Wt(e)))},e.registerCandlestickChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),Ie(),t.Factory.registerChart(De.type,De)},e.registerCandlestickSeries=Ie,e.registerCombinationCandlestickChart=()=>{Ie(),t.Factory.registerChart(je.type,je)},e.registerConversionFunnelChart=e=>{t.registerMarkFilterTransform();const i=(null==e?void 0:e.VChart)||t.VChart;i&&(i.useChart([F]),i.useSeries([L]))},e.registerFunnel3dChart=()=>{t.registerMarkTooltipProcessor(),Y(),ae(),ce(),t.Factory.registerChart(ue.type,ue)},e.registerFunnel3dSeries=ce,e.registerHistogram3dChart=()=>{t.registerGroupTooltipProcessor(),t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),Y(),ae(),te(),t.Factory.registerChart(he.type,he)},e.registerImageCloudChart=()=>{Dt(),t.Factory.registerChart(Et.type,Et)},e.registerMapLabel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useComponent([di])},e.registerPictogramChart=()=>{t.registerMarkTooltipProcessor(),_t(),t.Factory.registerChart(kt.type,kt)},e.registerPictogramSeries=_t,e.registerPie3dChart=()=>{t.registerMarkTooltipProcessor(),Y(),ae(),fe(),t.Factory.registerChart(be.type,be)},e.registerPie3dSeries=fe,e.registerRangeColumn3dChart=()=>{t.registerDimensionTooltipProcessor(),t.registerMarkTooltipProcessor(),t.registerDimensionEvents(),t.registerDimensionHover(),Y(),ae(),Xe(),t.Factory.registerChart(Ze.type,Ze)},e.registerRangeColumn3dSeries=Xe,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([p,t.BarChart])},e.registerRegressionLine=()=>{t.Factory.registerGraphicComponent(ci,(e=>new ui(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([w,t.ScatterChart])},e.registerSequenceScatterPixel=e=>{const i=(null==e?void 0:e.VChart)||t.VChart;i&&i.useChart([N,t.ScatterChart])},e.registerSeriesBreak=()=>{t.Factory.registerGraphicComponent("seriesBreak",(e=>new Pt(e)))},e.registerSeriesLabel=()=>{t.Factory.registerGraphicComponent("seriesLabel",(e=>new Jt(e)))},e.registerWordCloud3dChart=Ke,e.registerWordCloud3dSeries=Ve,e.registerWordCloudShape3dChart=()=>{Y(),Ne(),Ke()},e.registerWordCloudShape3dSeries=Ne,e.svgSourceMap=at,e.transformCandlestickSeriesSpec=Ee,e.unregisterSVGSource=st}));
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 D=.2;function E(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)*D,p=c-(u-c)*D;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+=E(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,U,K,W,$;!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"}(U||(U={})),function(e){e.bar3d="bar3d",e.rangeColumn3d="rangeColumn3d",e.pie3d="pie3d",e.wordCloud3d="wordCloud3d",e.funnel3d="funnel3d"}(K||(K={})),function(e){e.bar3d="bar3d",e.funnel3d="funnel3d",e.transform3d="transform3d",e.pie3d="pie3d"}(W||(W={})),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"}($||($={}));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=K.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d",this.transformerConstructor=J}}te.type=K.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=K.bar3d}}se.type="bar3d",se.seriesType=K.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=K.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=K.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=K.funnel3d}}he.type="funnel3d",he.seriesType=K.funnel3d,he.transformerConstructor=t.FunnelChartSpecTransformer;class pe extends t.BaseHistogramChart{constructor(){super(...arguments),this.transformerConstructor=t.HistogramChartSpecTransformer,this.type="histogram3d",this.seriesType=K.bar3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}pe.type="histogram3d",pe.seriesType=K.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=K.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=K.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=K.pie3d}}xe.type="pie3d",xe.seriesType=K.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 De=()=>{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 Ee extends t.BaseChart{_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}Ee.type="candlestick",Ee.seriesType=Ae,Ee.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=K.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=K.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=K.wordCloud3d}}Ge.type="wordCloud3d",Ge.seriesType=K.wordCloud3d,Ge.transformerConstructor=He;const Ue=()=>{q(),Ne(),t.Factory.registerChart(Ge.type,Ge)},Ke={label:{space:0}};class We{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 $e=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=K.rangeColumn3d,this._barMarkType="rect3d",this._barName=K.bar3d}}Xe.type=K.rangeColumn3d,Xe.mark=$e;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=K.rangeColumn3d}_setModelOption(){this._modelOption.getDimensionInfo=t.getCartesianDimensionInfo,this._modelOption.getDimensionInfoByValue=t.getDimensionInfoByValue,this._modelOption.getRectByDimensionData=t.getCartesianCrosshairRect}}Je.type="rangeColumn3d",Je.seriesType=K.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 Dt 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""}}Dt.type=Ft,Dt.mark=Lt;const Et=()=>{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(Dt.type,Dt),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 Ut 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 Kt(e,t,i=1){return Math.abs(e-t)<i}function Wt(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=>{$t(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=$t(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 $t(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=>Kt(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}}}e.BAR_LINK=qt,e.Bar3dChart=se,e.Bar3dChartSpecTransformer=H,e.Bar3dSeries=te,e.Bar3dSeriesSpecTransformer=J,e.BarLinkComponent=Zt,e.CandlestickChart=Ee,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.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=Ut,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(Wt(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=Wt,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),Ke)}),t.mixin(e,We)})(),(()=>{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),Ke)}),t.mixin(e,We)})(),(()=>{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),Ke)}),t.mixin(e,We)})(),(()=>{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),Ke)}),t.mixin(e,We)})(),(()=>{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),Ke)}),t.mixin(e,We)})()},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(),De(),t.Factory.registerChart(Ee.type,Ee)},e.registerCandlestickSeries=De,e.registerCombinationCandlestickChart=()=>{De(),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.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=()=>{Et(),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 Ut(e)))},e.registerSeriesLabel=()=>{t.Factory.registerGraphicComponent("seriesLabel",(e=>new si(e)))},e.registerTimelineChart=()=>{t.registerMarkTooltipProcessor(),Nt(),t.Factory.registerChart(zt.type,zt)},e.registerWordCloud3dChart=Ue,e.registerWordCloud3dSeries=Ne,e.registerWordCloudShape3dChart=()=>{q(),ze(),Ue()},e.registerWordCloudShape3dSeries=ze,e.svgSourceMap=at,e.transformCandlestickSeriesSpec=Be,e.unregisterSVGSource=ot}));