smart-webcomponents-react
Version:
[](https://jqwidgets.com/license/)
6 lines (4 loc) • 104 kB
JavaScript
/* Smart UI v23.0.8 (2025-05-13)
Copyright (c) 2011-2024 jQWidgets.
License: https://htmlelements.com/license/ */ //
Smart("smart-3d-chart",class extends Smart.BaseElement{static get properties(){return{lightColor:{type:"string",value:"#ffffff"},autoRotate:{type:"boolean",value:!1},autoRotateSpeed:{type:"number",value:1},animationSpeed:{type:"number",value:1},animation:{type:"string",value:""},borderLineColor:{value:null,type:"string?"},borderLineWidth:{value:1,type:"number"},cameraAnimationSpeed:{type:"number",value:1},customModels:{type:"array",value:[]},showConnectionLines:{type:"boolean",value:!1},transitionSpeed:{type:"number",value:1},backgroundColor:{type:"string",value:"#ffffff"},backgroundGradient:{type:"array",value:[]},backgroundTexture:{type:"array",value:[]},backgroundImage:{type:"string",value:""},caption:{type:"string",value:""},colorScheme:{value:"scheme01",type:"string"},cameraPosition:{type:"object",value:{x:{value:5,type:"number"},y:{value:20,type:"number"},z:{value:55,type:"number"}}},messages:{value:{en:{resetCamera:"Reset Camera",cameraMode:"Camera Mode",panMode:"Pan Mode",zoomMode:"Zoom Mode",saveImage:"Save Image",zoomOut:"Zoom Out",zoomIn:"Zoom In",field:"Field",invalidSeries:"smart-chart: Invalid property: each series group must have a 'series' property which must be a valid array.",invalidSeriesGroups:"smart-chart: Invalid property: 'seriesGroups' property is required and must be a valid array.",invalidType:'smart-chart: Invalid serie type "{{type}}".',missingReference:"smart-chart: Missing reference to {{files}}.",missingType:"smart-chart: Invalid property: each series group must have a valid 'type' property."}},type:"object",extend:!0},cameraZoom:{type:"number",value:1},controlsSettings:{type:"object",value:{enablePan:{type:"boolean",value:!0},enableZoom:{type:"boolean",value:!0},enableRotate:{type:"boolean",value:!0},enableDamping:{type:"boolean",value:!0},dampingFactor:{type:"number",value:.15}}},selectMode:{type:"string",value:"multiple",allowedValues:["none","one","multiple"]},legendLayout:{value:{flow:{value:"horizontal",allowedValues:["horizontal","vertical"],type:"string"},height:{value:null,type:"number?"},left:{value:null,type:"number?"},top:{value:null,type:"number?"},width:{value:null,type:"number?"}},type:"object?"},legendIndex:{value:"auto",allowedValues:["auto","group","serie"],type:"string"},seriesGroups:{value:[],type:"any",reflectToAttribute:!1},dataSource:{value:[],type:"object",reflectToAttribute:!1},description:{type:"string",value:"Description"},greyScale:{type:"boolean",value:!1},showBorderLine:{type:"boolean",value:!0},showLegend:{type:"boolean",value:!0},showLegendTable:{type:"boolean",value:!1},showToolTips:{type:"boolean",value:!0},toolTipFormatFunction:{value:null,type:"function?"},toolTipFormatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},toolTipLineColor:{value:null,type:"string?"},gridOptions:{value:{dynamicWidth:{value:!1,type:"boolean"},slotWidthX:{value:16,type:"number?"},slotWidthZ:{value:16,type:"number?"},height:{value:30,type:"number"},width:{value:90,type:"number"},lineColor:{value:"#808080",type:"string?"},orientation:{value:"vertical",type:"string",allowedValues:["vertical","horizontal"]}},type:"object",reflectToAttribute:!1},xAxis:{value:{alternatingBackgroundColor:{value:"",type:"string"},alternatingBackgroundColor2:{value:"",type:"string"},alternatingBackgroundOpacity:{value:1,type:"number"},axisSize:{value:null,type:"any"},bands:{value:null,type:"array?"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},customDraw:{value:!1,type:"boolean"},dataField:{value:"",type:"string"},dateFormat:{value:null,type:"string?"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},formatFunction:{value:null,type:"function?"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"bottom",allowedValues:["bottom","top","left","right"],type:"string"},rangeSelector:{value:{backgroundColor:{value:null,type:"string?"},backgroundImage:{value:"",type:"string"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},borderLineColor:{value:null,type:"string?"},borderLineWidth:{value:null,type:"number?"},caption:{value:"",type:"string"},colorScheme:{value:null,type:"string?"},columnSeriesOverlap:{value:!1,type:"boolean"},dynamic:{value:!1,type:"boolean"},columnsGapPercent:{value:25,type:"number"},dataField:{value:null,type:"string?"},description:{value:"",type:"string"},greyScale:{value:null,type:"boolean?"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},maxValue:{value:150,type:"any"},minValue:{value:50,type:"any"},padding:{value:{bottom:{value:0,type:"number"},left:{value:0,type:"number"},right:{value:0,type:"number"},top:{value:0,type:"number"}},type:"object"},position:{value:null,allowedValues:["bottom","top","left","right"],type:"string?"},renderTo:{value:null,type:"any"},rightToLeft:{value:null,type:"boolean?"},seriesGapPercent:{value:10,type:"number"},seriesGroups:{value:null,type:"array?"},serieType:{value:"area",type:"string"},showBorderLine:{value:null,type:"boolean?"},size:{value:null,type:"number?"},skipOverlappingPoints:{value:!0,type:"boolean"},titlePadding:{value:{bottom:{value:10,type:"number"},left:{value:5,type:"number"},right:{value:5,type:"number"},top:{value:5,type:"number"}},type:"object"},visible:{value:!1,type:"boolean"}},type:"object"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},type:{value:"auto",allowedValues:["auto","date","basic","linear"],type:"string"},unitInterval:{value:null,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object",reflectToAttribute:!1},zAxis:{value:{alternatingBackgroundColor:{value:"",type:"string"},alternatingBackgroundColor2:{value:"",type:"string"},alternatingBackgroundOpacity:{value:1,type:"number"},axisSize:{value:null,type:"any"},bands:{value:null,type:"array?"},baseUnit:{value:null,allowedValues:["year","month","day","hour","minute","second","millisecond",null],type:"string?"},customDraw:{value:!1,type:"boolean"},dataField:{value:"",type:"string"},dateFormat:{value:null,type:"string?"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"bottom",allowedValues:["bottom","top","left","right"],type:"string"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},type:{value:"auto",allowedValues:["auto","date","basic","linear"],type:"string"},unitInterval:{value:null,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object",reflectToAttribute:!1},valueAxis:{value:{bands:{value:null,type:"array?"},baselineValue:{value:null,type:"any"},customDraw:{value:!1,type:"boolean"},displayText:{value:null,type:"string?"},flip:{value:!1,type:"boolean"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},gridLines:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},labels:{value:{angle:{value:0,type:"number"},autoRotate:{value:!1,type:"boolean"},class:{value:null,type:"string?"},custom:{value:null,type:"array?"},formatFunction:{value:null,type:"function?"},formatSettings:{value:{dateFormat:{value:null,type:"string?"},decimalPlaces:{value:null,type:"number?"},decimalSeparator:{value:null,type:"string?"},negativeWithBrackets:{value:!1,type:"boolean"},prefix:{value:"",type:"string"},sufix:{value:"",type:"string"},thousandsSeparator:{value:null,type:"string?"}},type:"object"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},offset:{value:{x:{value:0,type:"number"},y:{value:0,type:"number"}},type:"object"},rotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"any"}},type:"object"},line:{value:{color:{value:"",type:"string"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},visible:{value:!0,type:"any"}},type:"object"},logarithmicScale:{value:!1,type:"boolean"},logarithmicScaleBase:{value:10,type:"number"},maxValue:{value:NaN,type:"any"},minValue:{value:NaN,type:"any"},position:{value:"left",allowedValues:["left","right","top","bottom"],type:"string"},textRotationAngle:{value:null,type:"number?"},textRotationPoint:{value:"auto",allowedValues:["auto","left","center","right","topleft","topcenter","topright","bottomleft","bottomcenter","bottomright","centermiddle"],type:"string"},tickMarks:{value:{color:{value:"",type:"string"},custom:{value:null,type:"array?"},dashStyle:{value:"",type:"string"},lineWidth:{value:1,type:"number"},size:{value:4,type:"number"},step:{value:null,type:"number?"},unitInterval:{value:null,type:"number?"},visible:{value:!0,type:"any"}},type:"object"},title:{value:{class:{value:null,type:"string?"},horizontalAlignment:{value:"center",allowedValues:["left","center","right"],type:"string"},text:{value:"",type:"string"},verticalAlignment:{value:"center",allowedValues:["top","center","bottom"],type:"string"},visible:{value:!0,type:"boolean"}},type:"object"},unitInterval:{value:10,type:"number?"},valuesOnTicks:{value:!0,type:"boolean"},visible:{value:!0,type:"boolean"}},type:"object"},enableControlsToolbar:{value:!0,type:"boolean"},controlsToolbarItems:{value:["reset-camera","zoom-in","zoom-out","save-image","camera-control"],reflectToAttribute:!1,type:"array"}}}static get listeners(){return{click:"_clickHandler",down:"_downMoveHandler",mouseleave:"_mouseleaveHandler",move:"_moveHandler",resize:"_resizeHandler","document.move":"_downMoveHandler","document.up":"_documentUpHandler",mousedown:"_documentUpHandler",mouseover:"_mouseoverHandler"}}static get requires(){return{"Smart.DropDownList":"smart.dropdownlist.js","Smart.Tooltip":"smart.tooltip.js"}}static get styleUrls(){return["smart.3dchart.css"]}_setDefaults(){const e=this;e._hiddenIndexes=[],e._inMotionQueue=[],e._inTransitionQueue=[],e._hiddenIndexes=[],e._scaledLabels=[],e._seriesData=[],e._chartObjects=[],e._startPoints=[],e._labels=[],e._rangeSelector={},e._grid=null,e._drawComplete=!1,e.colorSchemes=[{name:"scheme01",colors:["#307DD7","#AA4643","#89A54E","#71588F","#4198AF"]},{name:"scheme02",colors:["#7FD13B","#EA157A","#FEB80A","#00ADDC","#738AC8"]},{name:"scheme03",colors:["#E8601A","#FF9639","#F5BD6A","#599994","#115D6E"]},{name:"scheme04",colors:["#D02841","#FF7C41","#FFC051","#5B5F4D","#364651"]},{name:"scheme05",colors:["#25A0DA","#309B46","#8EBC00","#FF7515","#FFAE00"]},{name:"scheme06",colors:["#0A3A4A","#196674","#33A6B2","#9AC836","#D0E64B"]},{name:"scheme07",colors:["#CC6B32","#FFAB48","#FFE7AD","#A7C9AE","#888A63"]},{name:"scheme08",colors:["#3F3943","#01A2A6","#29D9C2","#BDF271","#FFFFA6"]},{name:"scheme09",colors:["#1B2B32","#37646F","#A3ABAF","#E1E7E8","#B22E2F"]},{name:"scheme10",colors:["#5A4B53","#9C3C58","#DE2B5B","#D86A41","#D2A825"]},{name:"scheme11",colors:["#993144","#FFA257","#CCA56A","#ADA072","#949681"]},{name:"scheme12",colors:["#105B63","#EEEAC5","#FFD34E","#DB9E36","#BD4932"]},{name:"scheme13",colors:["#BBEBBC","#F0EE94","#F5C465","#FA7642","#FF1E54"]},{name:"scheme14",colors:["#60573E","#F2EEAC","#BFA575","#A63841","#BFB8A3"]},{name:"scheme15",colors:["#444546","#FFBB6E","#F28D00","#D94F00","#7F203B"]},{name:"scheme16",colors:["#583C39","#674E49","#948658","#F0E99A","#564E49"]},{name:"scheme17",colors:["#142D58","#447F6E","#E1B65B","#C8782A","#9E3E17"]},{name:"scheme18",colors:["#4D2B1F","#635D61","#7992A2","#97BFD5","#BFDCF5"]},{name:"scheme19",colors:["#844341","#D5CC92","#BBA146","#897B26","#55591C"]},{name:"scheme20",colors:["#56626B","#6C9380","#C0CA55","#F07C6C","#AD5472"]},{name:"scheme21",colors:["#96003A","#FF7347","#FFBC7B","#FF4154","#642223"]},{name:"scheme22",colors:["#5D7359","#E0D697","#D6AA5C","#8C5430","#661C0E"]},{name:"scheme23",colors:["#16193B","#35478C","#4E7AC7","#7FB2F0","#ADD5F7"]},{name:"scheme24",colors:["#7B1A25","#BF5322","#9DA860","#CEA457","#B67818"]},{name:"scheme25",colors:["#0081DA","#3AAFFF","#99C900","#FFEB3D","#309B46"]},{name:"scheme26",colors:["#0069A5","#0098EE","#7BD2F6","#FFB800","#FF6800"]},{name:"scheme27",colors:["#FF6800","#A0A700","#FF8D00","#678900","#0069A5"]},{name:"scheme28",colors:["#3A43BA","#281E5D","#48AAAD","#0492C2","#1E456E","#59788D","#52B2C0","#82EDFD"]},{name:"scheme29",colors:["#003F5C","#BC5090","#58508D","#FF6361","#FFA600"]},{name:"scheme30",colors:["#16736F","#A2D56A","#1C515C","#62B773","#EEEF63","#1F313F","#309577"]},{name:"scheme31",colors:["#74CC66","#191A4D","#2D867A","#EEE3CD","#224D19","#0D261B","#5771C7","#B6D7E7","#206052","#6B5724","#C3AF4B","#603620","#536722","#B6E7B9","#34819D","#94ACDB"]},{name:"scheme32",colors:["#87C5FF","#5B5B60","#9BE076","#F7A384","#7479D3","#F13A80","#E4D388","#2BC6B2","#F45B14"]}],e._seriesTypes=["line","stackedline","stackedline100","spline","stackedspline","stackedspline100","stepline","stackedstepline","stackedstepline100","area","stackedarea","stackedarea100","splinearea","stackedsplinearea","stackedsplinearea100","steparea","stackedsteparea","stackedsteparea100","rangearea","splinerangearea","steprangearea","column","stackedcolumn","stackedcolumn100","rangecolumn","bar","stackedbar","stackedbar100","rangebar","scatter","stackedscatter","stackedscatter100","bubble","stackedbubble","stackedbubble100","pie","donut","candlestick","ohlc","waterfall","stackedwaterfall"],e._seriesGridTypes=e._seriesTypes.filter((e=>!["pie","donut","pyramid","funnel"].includes(e)))}template(){return'<div class="smart-3d-chart-controls"></div> <div class="smart-3d-chart-container"><div class="smart-3d-chart-tooltip"></div></div> <div class="smart-3d-chart-footer"></div>'}propertyChangedHandler(e,t,a){super.propertyChangedHandler(e,t,a);const r="xAxis_rangeSelector_minValue"===e||"xAxis_rangeSelector_maxValue"===e,n="controlsToolbarItems"===e||"enableControlsToolbar"===e;this.refresh(!1,r,n)}refresh(e=!1,t=!1){this._internalRefresh(e,t)}update(){this._internalRefresh()}_internalRefresh(e=!1,t=!1,a=!1){const r=this;let n;r.$.fireEvent("refreshStart",{}),e||(r._drawComplete=!0),r._camera&&(n=r._camera.position),(a||e)&&r._setControls(),t||(r._setCaption(),r._setLegendTable(),r._setScene(),r._buildSource()),r._setChart(),t||(r._rangeSelector.rangeSelector||r._setRangeSelector(),r._chartResize(r)),e&&r._rangeSelector.rangeSelector&&r._setRangeValues(),n&&r._camera.position.set(n.x,n.y,n.z),r.$.fireEvent("refreshEnd",{})}_setLegendTable(){const e=this;if(e.querySelector(".smart-3d-chart-legend-table")&&e.querySelector(".smart-3d-chart-legend-table").parentNode.removeChild(e.querySelector(".smart-3d-chart-legend-table")),e.showLegendTable){const t=e._getAxisLabels();let a=e._createLegendTable("column",t);a.style.width="100%",e.querySelector(".smart-3d-chart-footer").appendChild(a)}}_setRangeSelector(){const e=this;if(e.querySelector(".smart-3d-chart-range-selector")&&e.querySelector(".smart-3d-chart-range-selector").parentNode.removeChild(e.querySelector(".smart-3d-chart-range-selector")),e.xAxis.rangeSelector.visible){const t=e._getAxisLabels();let a=e._createRangeSelector(t);e.querySelector(".smart-3d-chart-footer").appendChild(a),e._updateResizeHandlers()}}_getRangeChartCoordinates(){const e=this;let t=e._getObjectsByIndexes(0,0).map((e=>{const t=e.userData;return{xAxisValue:t.xAxisField,value:t.value,itemIndex:t.itemIndex,serieIndex:t.serieIndex,groupIndex:t.groupIndex}}));e._rangeSelector.dataPoints=t;const a=e._grid.userData.gridProps.maxValue,r=[];return t.forEach((e=>{r.push({x:e.itemIndex/(t.length-1)*100,y:100-e.value/a*100,xAxisValue:e.xAxisValue})})),r}_initDragElement(e,t){const a=this;var r=0,n=0;function i(i){(i=i||window.event).preventDefault(),r=n-i.clientX,n=i.clientX;let o=t.getBoundingClientRect(),l=e.getBoundingClientRect();l.left-r>o.left&&l.right-r<o.right&&(e.style.left=e.offsetLeft-r+"px",e.classList.contains("smart-3d-chart-range-selector-rect")?a._updateResizeHandlers():a._updateDragRectangle(),a.xAxis.rangeSelector.dynamic&&(clearTimeout(a.dragTimeout),a.dragTimeout=setTimeout((()=>{a._updateRange()}),20)))}function o(){document.onmouseup=null,document.onmousemove=null,a._updateRange()}e.onmousedown=function(e){(e=e||window.event).preventDefault(),n=e.clientX,document.onmousemove=i,document.onmouseup=o}}_setRangeValues(e=!0){const t=this,a=t.xAxis.minValue||t._rangeSelector.dataPoints[0].xAxisValue,r=t.xAxis.maxValue||t._rangeSelector.dataPoints[t._rangeSelector.dataPoints.length-1].xAxisValue;t._rangeSelector.minIndex=t._rangeSelector.dataPoints.findIndex((e=>e.xAxisValue===a)),t._rangeSelector.maxIndex=t._rangeSelector.dataPoints.findIndex((e=>e.xAxisValue===r));const n=t._rangeSelector.rangeSelector.getBoundingClientRect();t._rangeSelector.sliders[0].style.left=t._rangeSelector.minIndex/(t._rangeSelector.dataPoints.length-1)*n.width+"px",t._rangeSelector.sliders[1].style.left=t._rangeSelector.maxIndex/(t._rangeSelector.dataPoints.length-1)*n.width+"px",t._updateDragRectangle(),e&&t.update()}_updateRange(){const e=this,t=e._rangeSelector.rangeSelector.getBoundingClientRect(),a=e._rangeSelector.rangeSelectorRect.getBoundingClientRect(),r=(a.left-t.left)/t.width,n=(a.left-t.left+a.width)/t.width,i=e._rangeSelector.dataPoints[Math.round(r*(e._rangeSelector.dataPoints.length-1))].xAxisValue,o=e._rangeSelector.dataPoints[Math.round(n*(e._rangeSelector.dataPoints.length-1))].xAxisValue;e.$.fireEvent("rangeSelectionChanging",{minValue:i,maxValue:o,oldMinValue:e.xAxis.minValue,oldMaxValue:e.xAxis.maxValue}).defaultPrevented?e._setRangeValues(!1):(e._rangeSelector.minIndex=Math.round(r*(e._rangeSelector.dataPoints.length-1)),e._rangeSelector.maxIndex=Math.round(n*(e._rangeSelector.dataPoints.length-1)),e.xAxis.minValue=e._rangeSelector.dataPoints[Math.round(r*(e._rangeSelector.dataPoints.length-1))].xAxisValue,e.xAxis.maxValue=e._rangeSelector.dataPoints[Math.round(n*(e._rangeSelector.dataPoints.length-1))].xAxisValue,e.$.fireEvent("rangeSelectionChanged",{minValue:e.xAxis.minValue,maxValue:e.xAxis.maxValue}),e.update())}_updateDragRectangle(){const e=this._rangeSelector.rangeSelectorRect,t=this._rangeSelector.sliders,a=parseFloat(t[0].style.left)>parseFloat(t[1].style.left)?t[1]:t[0],r=parseFloat(t[0].style.left)>parseFloat(t[1].style.left)?t[0]:t[1];e.style.left=a.style.left,e.style.width=parseFloat(r.style.left)-parseFloat(a.style.left)+"px"}_initResizeElement(e,t){const a=this,r=document.createElement("div");r.classList.add("smart-3d-chart-range-selector-slider");const n=document.createElement("div");n.classList.add("smart-3d-chart-range-selector-slider"),t.appendChild(r),t.appendChild(n),a._rangeSelector.sliders=[r,n],a._initDragElement(r,t),a._initDragElement(n,t)}_updateResizeHandlers(){const e=this,t=e._rangeSelector.rangeSelectorRect,a=t.getBoundingClientRect();e._rangeSelector.sliders[0].style.left=t.style.left,e._rangeSelector.sliders[1].style.left=parseFloat(t.style.left)+a.width+"px"}_createRangeSelector(){const e=this,t=document.createElement("div");t.classList.add("smart-3d-chart-range-selector-container"),t.style.height="70px",t.style.width="95%",t.style.margin="10px auto";const a=document.createElement("div");a.classList.add("smart-3d-chart-range-selector"),t.appendChild(a),e._rangeSelector.rangeSelector=a;const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("viewBox","0 0 100 100"),r.setAttribute("preserveAspectRatio","none");const n=document.createElementNS("http://www.w3.org/2000/svg","svg");n.setAttribute("width","100%"),n.setAttribute("height","20%"),r.setAttribute("viewBox","0 0 100 100"),r.setAttribute("preserveAspectRatio","none"),n.style.overflow="visible";const i=document.createElementNS("http://www.w3.org/2000/svg","polygon"),o=e._getRangeChartCoordinates();let l="";l+="0,100 ",o.forEach((e=>{l+=`${e.x},${e.y} `})),l+="100,100",i.setAttribute("points",l);let s=e.xAxis.rangeSelector.color||e._getColorFromScheme(e.colorScheme,0),d=e.xAxis.rangeSelector.opacity||.8;i.setAttribute("fill",s),i.setAttribute("opacity",d),r.appendChild(i),a.appendChild(r);let u=e.xAxis.rangeSelector.labels.step||Math.round(o.length/20);for(let e=0;e<o.length;e+=u){const t=document.createElementNS("http://www.w3.org/2000/svg","text");t.setAttribute("x",o[e].x+.2+"%"),t.setAttribute("y","10"),t.setAttribute("font-size","10px"),t.setAttribute("fill","gray"),t.setAttribute("text-anchor","middle"),t.setAttribute("alignment-baseline","middle"),t.innerHTML=o[e].xAxisValue,n.appendChild(t);const a=document.createElementNS("http://www.w3.org/2000/svg","line");a.setAttribute("x1",o[e].x+.2+"%"),a.setAttribute("y1","0"),a.setAttribute("x2",o[e].x+.2+"%"),a.setAttribute("y2","2"),a.setAttribute("stroke","gray"),a.setAttribute("stroke-width","1"),a.style.position="absolute",n.appendChild(a)}t.appendChild(n);const c=document.createElement("div");return c.classList.add("smart-3d-chart-range-selector-rect"),c.style.left="0px",e._rangeSelector.rangeSelectorRect=c,a.appendChild(c),e._initDragElement(c,a),e._initResizeElement(c,a),t}ready(){super.ready()}beginUpdate(){this._updating=!0}endUpdate(e=!1){const t=this;t._updating=!1,e?t.refresh():t._setChart()}setCameraPosition(e,t,a,r=!0){const n=this;r?n._inMotionQueue.push({obj:n._camera,target:{x:e,y:t,z:a},type:"camera"}):n._camera.position.set(e,t,a)}setCameraZoom(e,t=!0){const a=this,r=a._camera.position,n={x:r.x/e,y:r.y/e,z:r.z/e};t?a.setCameraPosition(n.x,n.y,n.z):a._camera.position.set(n.x,n.y,n.z)}saveAsJPEG(e="chart",t=!0,a=!0){this._saveAsImage(e,"jpeg",t,a)}saveAsPNG(e="chart",t=!0,a=!0){this._saveAsImage(e,"png",t,a)}saveAsPDF(e="chart",t=!0,a=!0){this._saveAsImage(e,"pdf",t,a)}_saveAsImage(e,t,a,r){const n=this,i=n.querySelector(".smart-3d-chart-legend"),o=n.querySelector(".smart-3d-chart-caption");if(!a&&i&&(i.style.display="none"),!r&&o&&(o.style.display="none"),"undefined"!=typeof html2canvas){const a=n.querySelector(".smart-3d-chart-container").getBoundingClientRect();html2canvas(n.querySelector(".smart-3d-chart-container"),{allowTaint:!0,useCORS:!0,logging:!1,width:a.width,height:a.height}).then((function(a){let r;if("jpeg"===t&&(r=a.toDataURL("image/jpeg")),"png"===t&&(r=a.toDataURL("image/png")),"pdf"===t){r=a.toDataURL("application/jpeg");const t={content:{image:r,width:Math.min(a.width/1.35,515)},pageOrientation:"portait"};try{pdfMake.createPdf(t).download(e)}catch(e){n.error(n.localize("missingReference",{files:"pdfmake.min.js"}))}}if(r&&"pdf"!==t){const a=document.createElement("a");a.download=e+"."+t,a.href=r,a.click()}}))}else{const a=n.querySelector("canvas");if(a){let r;if("jpeg"===t&&(r=a.toDataURL("image/jpeg")),"png"===t&&(r=a.toDataURL("image/png")),"pdf"===t){r=a.toDataURL("application/jpeg");const t={content:{image:r,width:Math.min(a.width/1.35,515)},pageOrientation:"portait"};try{pdfMake.createPdf(t).download(e)}catch(e){n.error(n.localize("missingReference",{files:"pdfmake.min.js"}))}}r&&"pdf"!==t&&(document.createElement("a").download=e+"."+t)}}!a&&i&&(i.style.display="block"),!r&&o&&(o.style.display="block")}_getLabelPoint(e,t=0,a=1.5){const r=new window.THREE.Vector3;return e.geometry.computeBoundingBox(),e.geometry.boundingBox.getCenter(r),r.x*=t,r.y+=a,r.z*=t,r}_createDonutSlice(e,t={x:0,y:0,z:0}){const a={curveItems:32,steps:1,curveSegments:32,depth:e.height,bevelEnabled:!1},r=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let n=new window.THREE.Shape;n.absarc(t.x,t.z,e.radius,e.angleStart,e.angleEnd,!1),n.absarc(t.x,t.z,e.radius-e.width,e.angleEnd,e.angleStart,!0);let i=new window.THREE.ExtrudeGeometry(n,a);return i.rotateX(-Math.PI/2),new window.THREE.Mesh(i,r)}_createPieSlice(e,t={x:0,y:0,z:0}){const a={curveItems:32,steps:1,curveSegments:32,depth:e.height,bevelEnabled:!1},r=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let n=new window.THREE.Shape;n.moveTo(t.x,t.z),n.absarc(t.x,t.z,e.radius,e.angleStart,e.angleEnd,!1),n.lineTo(t.x,t.z);let i=new window.THREE.ExtrudeGeometry(n,a);return i.rotateX(-Math.PI/2),new window.THREE.Mesh(i,r)}_getItemColor(e,t,a,r,n,i){const o=this.seriesGroups[n],l=o.series[r],s=this._getColorFromScheme(e,t);return o.colorFunction?o.colorFunction(i,a,r,n,s):l.colorFunction?l.colorFunction(i,a,r,n,s):s}_getColorFromScheme(e,t){const a=this;null!=e&&""!==e||(e=this.colorSchemes[0].name);const r=a.colorSchemes.find((t=>t.name===e));if(null==r){const e=a.colorSchemes[0].colors;return e[t%e.length]}{const e=r.colors;return e[t%e.length]}}_clearScene(){const e=this;e._chartObjects.forEach((t=>{t.remove(t.userData.labelObject),e._grid?e._grid.remove(t):e._scene.remove(t)})),e._chartObjects=[],e._grid&&(e._scaledLabels.forEach((t=>{e._grid.remove(t)})),e._scene.remove(e._grid))}_getBaseLog(e,t){return Math.log(t)/Math.log(e)}_getLogValue(e,t){const a=this;return t||(t=a.valueAxis),t.logarithmicScaleBase?a._getBaseLog(t.logarithmicScaleBase,e):Math.log(e)}getValueAxisLabels(){return this.valueAxis._labels}getXAxisLabels(){return this.xAxis._labels}getZAxisLabels(){return this.zAxis._labels}_createCandlestick(e,t,a){const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=new window.THREE.BoxGeometry(.2,Math.abs(t.high-t.low),.2),i=new window.THREE.Mesh(n,r);i.position.set(e.low.x,e.low.y,e.low.z);const o=new window.THREE.BoxGeometry(.4,Math.abs(t.open-t.close),.4),l=new window.THREE.Mesh(o,r);return l.position.set(0,t.open-(t.high+t.low)/2,0),i.add(l),i}_createOHLC(e,t,a){const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=.2,i=new window.THREE.BoxGeometry(n,Math.abs(t.high-t.low),n),o=new window.THREE.Mesh(i,r);o.position.set(e.low.x,e.low.y,e.low.z);const l=.4,s=new window.THREE.BoxGeometry(l,.1,.1),d=new window.THREE.Mesh(s,r);d.position.set(l,t.open-(t.high+t.low)/2,0),o.add(d);const u=new window.THREE.BoxGeometry(l,.1,.1),c=new window.THREE.Mesh(u,r);return c.position.set(-.4,t.low-(t.high+t.low)/2,0),o.add(c),o}_createColumn(e,t,a){"number"!=typeof t&&(t=t.to-t.from);const r=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),n=new window.THREE.BoxGeometry(a.width,Math.abs(t),a.depth),i=new window.THREE.Mesh(n,r);if(i.position.set(e.x,e.y+t/2,e.z),a.showOutlineColor){const r=new window.THREE.MeshBasicMaterial({color:a.outlineColor||a.color,transparent:!0,opacity:a.outlineOpacity||a.opacity}),o=new window.THREE.Mesh(n,r);o.position.set(e.x,e.y+t/2,e.z),o.scale.multiplyScalar(1+(a.outlineWidth||.1)),i.add(o)}return i}_createCustomModel(e,t,a,r){const n=this;return(new window.THREE.GLTFLoader).load(e,(function(e){let r=e.scene.children[0];const i=(new window.THREE.Box3).setFromObject(r).getSize(new window.THREE.Vector3);let o=a/i.y;r.scale.set(o,o,o),r.position.set(t.x,t.y,t.z),n._grid.add(r)})),r.opacity=0,this._createColumn(t,a,r)}_createBar(e,t,a){"number"!=typeof t&&(t=t.to-t.from);const r=new window.THREE.CylinderGeometry(a.width,a.width,Math.abs(t),64),n=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0,opacity:a.opacity}),i=new window.THREE.Mesh(r,n);if(i.position.set(e.x,e.y+t/2,e.z),a.showOutlineColor){const n=new window.THREE.MeshBasicMaterial({color:a.outlineColor||a.color,transparent:!0,opacity:a.outlineOpacity||a.opacity}),o=new window.THREE.Mesh(r,n);o.position.set(e.x,e.y+t/2,e.z),o.scale.multiplyScalar(1+(a.outlineWidth||.1)),i.add(o)}return i}_createAreaSlice(e,t,a,r=1){const n=a=>t[a]+(e[a]-t[a])*r,i=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let o={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1},l=new window.THREE.Shape;l.moveTo(t.x,Math.max(t.y,t.bottomY)),l.lineTo(n("x"),Math.max(n("y"),n("bottomY"))),l.lineTo(n("x"),Math.min(n("y"),n("bottomY"))),l.lineTo(t.x,Math.min(t.y,t.bottomY));let s=new window.THREE.ExtrudeGeometry(l,o),d=new window.THREE.Mesh(s,i);return d.position.set(0,0,e.z-a.depth/2),d}_createStepAreaSlice(e,t,a){const r=(a,r=1)=>t[a]+(e[a]-t[a])*r,n=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let i={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1},o=new window.THREE.Shape;o.moveTo(t.x,t.y),o.lineTo(r("x",.5),t.y),o.lineTo(r("x",.5),r("y")),o.lineTo(r("x"),r("y")),o.lineTo(r("x"),r("bottomY")),o.lineTo(r("x",.5)-.5,r("bottomY")),o.lineTo(r("x",.5)-.5,t.bottomY),o.lineTo(t.x,t.bottomY);let l=new window.THREE.ExtrudeGeometry(o,i),s=new window.THREE.Mesh(l,n);return s.position.set(0,0,e.z),s}_createSplineAreaSlice(e,t,a,r=1){const n=a=>t[a]+(e[a]-t[a])*r,i=new window.THREE.MeshLambertMaterial({color:a.color,transparent:!0});let o={curveItems:32,steps:1,depth:a.depth,bevelEnabled:!1};const l=a.nextPosition,s=new window.THREE.SplineCurve([new window.THREE.Vector3(t.x,t.y),new window.THREE.Vector3(n("x"),n("y")),new window.THREE.Vector3(l.x,l.y)]),d=new window.THREE.SplineCurve([new window.THREE.Vector3(t.x,t.bottomY),new window.THREE.Vector3(n("x"),n("bottomY")),new window.THREE.Vector3(l.x,l.bottomY)]),u=s.getPoints(32),c=d.getPoints(32);let p=new window.THREE.Shape;p.moveTo(...u[0]);for(let e=1;e<u.length/2;e++)p.lineTo(...u[e]);for(let e=(c.length-1)/2;e>=0;e--)p.lineTo(...c[e]);let m=new window.THREE.ExtrudeGeometry(p,o),g=new window.THREE.Mesh(m,i);return g.position.set(0,0,e.z),g}_createCube(e,t,a,r,n){const i=new window.THREE.BoxGeometry(t,t,t),o=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),l=new window.THREE.Mesh(i,o);return l.position.set(e.x,e.y+a+t/2,e.z),"diamond"===n&&l.rotateZ(Math.PI/4),l}_createTriangle(e,t,a,r,n){const i=new window.THREE.ConeGeometry(t,t,3),o=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),l=new window.THREE.Mesh(i,o);l.position.set(e.x,e.y+a+t/2,e.z);let s=n.slice(n.indexOf("_")+1);return"right"===s&&l.rotateZ(Math.PI/2),"down"===s&&l.rotateZ(Math.PI),"left"===s&&l.rotateZ(-Math.PI/2),l}_createSphere(e,t,a,r){const n=new window.THREE.SphereGeometry(t,32,32),i=new window.THREE.MeshLambertMaterial({color:r,transparent:!0}),o=new window.THREE.Mesh(n,i);return o.position.set(e.x,e.y+a+t/2,e.z),o}_getXAxisLabels(){const e=this;let t=e.dataSource.map(((t,a)=>{if(e.xAxis.dataField){let a=t[e.xAxis.dataField];return"date"!==e.xAxis.type||a instanceof Date||(a=new Date(a)),a}return a}));if(e.rightToLeft&&(t=t.reverse()),e.xAxis.rangeSelector.visible){let a=e._rangeSelector.minIndex||0,r=e._rangeSelector.maxIndex||t.length-1;t=t.slice(a,r+1)}return t}_getZAxisLabels(){const e=this;let t=e.seriesGroups.map((e=>e.displayText));return void 0===t[0]&&(t=[],e.seriesGroups.forEach((e=>{e.series.forEach((e=>t.push(e.displayText)))}))),t}_getAxisLabels(e,t){const a=this;let r={xAxis:a._getXAxisLabels(t),zAxis:a._getZAxisLabels()};return e&&(r.yAxis=e.series.map((e=>e.displayText)),a.seriesGroup.formatFunction&&(r.yAxis=r.yAxis.map((e=>a.seriesGroup.formatFunction(e))))),r}_getSourceValue(e,t,a){return t.includes("ohlc")||t.includes("candlestick")?{open:parseFloat(e[a.dataFieldOpen]),high:parseFloat(e[a.dataFieldHigh]),low:parseFloat(e[a.dataFieldLow]),close:parseFloat(e[a.dataFieldClose])}:t.includes("range")?{from:parseFloat(e[a.dataFieldFrom]),to:parseFloat(e[a.dataFieldTo])}:parseFloat(e[a.dataField])}_getObjectHeight(e,t,a,r){const n=this;let i=e=>(e-this.valueAxis._baseLine)/(a.maxValue-this.valueAxis._baseLine)*(a.height-a.floorHeight);return n.valueAxis.logarithmicScale&&(i=e=>n._getLogValue(e)*(a.height-a.floorHeight)/n._getLogValue(a.maxValue)),t.includes("100")&&(i=e=>0===r?0:e/r*(a.height-a.floorHeight)),t.includes("ohlc")||t.includes("candlestick")?{open:i(e.open),high:i(e.high),low:i(e.low),close:i(e.close)}:t.includes("range")?{from:i(e.from),to:i(e.to)}:i(e)||.1}_getObjectPosition(e,t,a,r,n,i,o,l,s){const d=this.rightToLeft;let u=o.slot.x/2+o.origin.x+(e-(this._rangeSelector.minIndex||0))*o.slot.x,c=(n||0)+o.floorHeight,p=o.origin.z+(t+s)*o.slot.z+o.slot.z/2;return d&&(u=-u),l.includes("stacked")&&(p=o.origin.z+a*o.slot.z+o.slot.z/2),l.includes("waterfall")&&(c+=i),!l.includes("line")&&!l.includes("area")||l.includes("range")||(c+=r),l.includes("ohlc")||l.includes("candlestick")?{open:{x:u,y:c+r.open,z:p},low:{x:u,y:c+r.low,z:p}}:l.includes("range")?l.includes("column")||l.includes("bar")?{x:u,y:c+r.from,bottomY:c+r.from,z:p}:{x:u,y:c+r.to,bottomY:c+r.from,z:p}:{x:u,y:c,z:p,bottomY:l.includes("line")?c:c-r}}_getDimension(e,t,a=""){if(a.includes("bar")&&(t/=1.5),void 0===e||e<=0||""===e)return.5*t;if("string"==typeof e){if(e.includes("%"))return t*(parseFloat(e)/100);e=parseFloat(e)}return Math.min(e,t)}_createBubble(e,t,a,r){const n=this;let i;return i="square"===a||"diamond"===a?n._createCube(e,t,r.height,r.color,a):a.includes("triangle")?n._createTriangle(e,t,r.height,r.color,a):n._createSphere(e,t,r.height,r.color),i}_getDisplayText(e,t){let a=e;return t.formatFunction&&(a=t.formatFunction(e)),t.formatSettings&&t.formatSettings.prefix&&(a=t.formatSettings.prefix+a),t.formatSettings.sufix&&(a+=t.formatSettings.sufix),a}_getFormattedValue(e,t={},a){let r=e;return a?(r=a(e),r):(t.dateFormat&&(r=t.dateFormat(e)),null!==t.decimalPlaces&&void 0!==t.decimalPlaces&&(r=r.toFixed(t.decimalPlaces)),null!==t.decimalSeparator&&void 0!==t.decimalSeparator&&(r=r.toString().replace(".",t.decimalSeparator)),null!==t.thousandsSeparator&&void 0!==t.thousandsSeparator&&(r=r.toString().replace(/\B(?=(\d{3})+(?!\d))/g,t.thousandsSeparator)),t.negativeWithBrackets&&(r=parseFloat(r)<0?"("+r+")":r),t.prefix&&(r=t.prefix+r),t.sufix&&(r+=t.sufix),r)}_createPieLabel(e,t,a){let r=t.labelRadius;const n=document.createElement("div");n.className="smart-3d-chart-label",n.style.marginTop="-1em",n.innerHTML=e.value;const i=new window.THREE.CSS2DObject(n);r||(r=.8*e.pieRadius);const o=Math.cos(e.radians)*r,l=-Math.sin(e.radians)*r;if(i.position.set(o,e.height,l),r>e.pieRadius){const t={x:Math.cos(e.radians)*e.pieRadius,y:e.height/2,z:-Math.sin(e.radians)*e.pieRadius},r=.1;let n;t.x+=t.x>0?r:-r,t.z+=t.z>0?r:-r,n=(new window.THREE.BufferGeometry).setFromPoints([new window.THREE.Vector3(t.x,t.y,t.z),new window.THREE.Vector3(i.position.x,t.y,i.position.z),new window.THREE.Vector3(i.position.x,i.position.y,i.position.z)]);const o=new window.THREE.LineBasicMaterial({color:e.color,transparent:!0}),l=new window.THREE.Line(n,o);a.add(l)}a.add(i),a.userData.labelObject=i}_setPieChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=a.dataSource?a.dataSource:t.dataSource,i=a.colorScheme?a.colorScheme:t.colorScheme,o="none"===t.animation||t._drawComplete?100:0,l=!("none"!==t.animation&&!t._drawComplete);for(let s=0;s<r.length;s++){const d=r[s],u=d.dataField,c=n.filter(((a,r)=>!t._objectIsHidden(r,s,e))),p=d.variableHeightField,m=n.reduce(((e,t)=>e+t[u]),0),g=c.reduce(((e,t)=>e+t[u]),0)||.1,h=(a.endAngle||360)/180*Math.PI;let y=(d.initialAngle||0)/180*Math.PI;for(let r=0;r<n.length;r++){const c=n[r],b=c[u],x=t._getItemColor(i,r,r,s,e,b),w=y,_=y+b/g*h||w;t._objectIsHidden(r,s,e)||(y=_);let v,f=d.height||3;d.variableHeight&&(f*=c[p]/t._getMinimumValue(n,p));let E={radius:d.radius||30,color:x,angleStart:w,angleEnd:_,height:f,width:d.width,opacity:a.objectOpacity||1},D={dataField:u,displayText:t._getFormattedValue(c[d.displayText],a.formatSettings,a.formatFunction),displayedValue:t._getFormattedValue(b,d.formatSettings,d.formatFunction),value:b,percentage:b/m*100,visiblePercentage:b/g*100,type:a.type,itemIndex:r,serieIndex:s,groupIndex:e,drawComplete:l,drawProgress:o,hidden:t._objectIsHidden(r,s,e),color:x,labelProps:{}};Object.assign(D,E);let S={text:D.displayText,color:D.color,value:D.displayedValue,radians:(D.angleStart+D.angleEnd)/2,height:D.height,pieRadius:D.radius};D.labelProps=S,"pie"===a.type?v=t._createPieSlice(E):"donut"===a.type&&(v=t._createDonutSlice(E)),a.showLabels&&t._createPieLabel(D.labelProps,d,v),t._setPieItemProperties(v,D),t._chartObjects.push(v),t._drawComplete&&!D.hidden&&t._scene.add(v)}}}_getTotalItemValue(e,t,a,r){const n=this;let i=0;for(let o=0;o<r.series.length;o++)this._objectIsHidden(t,o,a)||(i+=n._getSourceValue(e[t][r.dataField],r.type,r.series[o]));return i}_setBands(e){const t=this;t.seriesGroups[e].bands.forEach((e=>{let a={from:e.minValue,to:e.maxValue};const r=t._getObjectHeight(a,"range",t._grid.userData.gridProps);r.from===r.to&&(r.from-=e.lineWidth/2,r.to+=e.lineWidth/2);const n=t._grid.userData.gridProps,i=t._grid.userData.gridWalls.back,o=t._grid.userData.gridWalls.side,l=new window.THREE.LineBasicMaterial({color:e.color,side:window.THREE.DoubleSide,opacity:e.opacity,transparent:!0}),s=new window.THREE.PlaneGeometry(n.width,Math.abs(r.from-r.to)),d=new window.THREE.Mesh(s,l);d.position.set(0,r.from,-n.depthWidth/2),i.add(d);const u=new window.THREE.PlaneGeometry(n.depthWidth,Math.abs(r.from-r.to)),c=new window.THREE.Mesh(u,l);c.position.set(-n.width/2,r.from,0),c.rotation.set(0,Math.PI/2,0),o.add(c)}))}_createBand(e,t,a,r){const n=new window.THREE.MeshLambertMaterial({color:e.color,transparent:!0,opacity:e.opacity});let i=new window.THREE.Shape;i.moveTo(r.position.x-a/2,t.to),i.lineTo(r.position.x+a/2,t.from);let o=new window.THREE.ExtrudeGeometry(i,{curveItems:32,steps:1,depth:.1,bevelEnabled:!1}),l=new window.THREE.Mesh(o,n);return l.position.set(0,0,0),r.add(l),l}_setGridChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=a.dataField,i=t.xAxis.dataField,o=t._grid.userData.gridProps,l=a.colorScheme?a.colorScheme:t.colorScheme;let s=a.dataSource?a.dataSource:t.dataSource;const d=s;t.rightToLeft&&(s=s.slice().reverse());let u=0;if(e>0)for(let a=0;a<e;a++)u+=t.seriesGroups[a].series.length;const c="none"===t.animation||t._drawComplete?100:0,p=!("none"!==t.animation&&!t._drawComplete);let m=new Array(s.length).fill(0);for(let g=0;g<r.length;g++){let h=0,y=0;for(let b=0;b<s.length;b++){let x,w,_,v,f,E,D,S,T,I=s[b],L=b>0?s[b-1]:null,C=s[b+1];n&&(I=I[n],L=b>0?L[n]:null,C=C?C[n]:null);let F=t._getSourceValue(I,a.type,r[g]);a.type.includes("waterfall")&&(b===s.length-1?(F=y,h=0):y+=F),a.type.includes("100")&&(x=t._getTotalItemValue(s,b,e,a));let A=t._getObjectHeight(F,a.type,o,x),R=t._getObjectPosition(b,g,e,A,Math.max(m[b],0),h,o,a.type,u);a.type.includes("waterfall")&&(b===s.length-1?h=0:h+=A),(a.type.includes("line")||a.type.includes("area"))&&(L&&b-(t._rangeSelector.minIndex||0)!=0?(b===s.length-1&&(R.x+=o.slot.x/2*.9),a.type.includes("100")&&(f=t._getTotalItemValue(s,b-1,e,a)),w=t._getSourceValue(L,a.type,r[g]),_=t._getObjectHeight(w,a.type,o,f),v=t._getObjectPosition(b-1,g,e,_,Math.max(m[b-1]-_,0),h,o,a.type,u)):(w=F,_=A,v={x:R.x,y:R.y,z:R.z,bottomY:R.bottomY},v.x-=o.slot.x/2*.9),C&&b-(t._rangeSelector.minIndex||0)!=s.length-1?(a.type.includes("100")&&(T=t._getTotalItemValue(s,b+1,e,a)),E=t._getSourceValue(C,a.type,r[g]),D=t._getObjectHeight(E,a.type,o,T),S=t._getObjectPosition(b+1,g,e,D,Math.max(m[b+1]-D,0),h,o,a.type,u)):(E=F,D=A,S={x:R.x,y:R.y,z:R.z,bottomY:R.bottomY},S.x+=o.slot.x/2*.9));let M=g;!a.type.includes("column")&&!a.type.includes("bar")||a.type.includes("stacked")||1!==a.series.length||(M=b),"serie"===a.colorIndex?M=g:"item"===a.colorIndex&&(M=b);const P=t._getItemColor(l,M,b,g,e,F);let j,H=a.type;"waterfall"===a.type&&(H="column"),["column","bar"].includes(a.objectType)&&(H=a.objectType);let V,z=t.customModels.findIndex((t=>t.groupIndex===e&&t.serieIndex===g&&t.itemIndex===b));-1!==z&&(j=t.customModels[z].model);let O={color:P,width:t._getDimension(a.width,o.slot.x,H),depth:t._getDimension(a.depth,o.slot.z,H),verticalWidth:a.verticalWidth?a.verticalWidth:2,opacity:a.opacity?a.opacity:1,object3DType:H,customModel:j,position:R,height:A,prevHeight:_,nextPosition:S,nextHeight:D},B=d[b][i]||b;"date"!==t.xAxis.type||B instanceof Date||(B=new Date(B)),B=t._getFormattedValue(B,t.xAxis.formatSettings,t.xAxis.formatFunction);let G={groupDisplayText:a.displayText,serieDisplayText:r[g].displayText||"",displayTextFrom:r[g].displayTextFrom||"",displayTextTo:r[g].displayTextTo||"",displayTextOpen:r[g].displayTextOpen||"",displayTextClose:r[g].displayTextClose||"",displayTextHigh:r[g].displayTextHigh||"",displayTextLow:r[g].displayTextLow||"",xAxisField:B,value:F,displayedValue:t._getFormattedValue(F,r[g].formatSettings,r[g].formatFunction),type:a.type,itemIndex:b,serieIndex:g,groupIndex:e,drawComplete:p,drawProgress:j?1:c,hidden:t._objectIsHidden(b,g,e),isStacked:a.type.includes("stacked")};if(Object.assign(G,O),H.includes("column")||H.includes("waterfall")||H.includes("bar"))V=j?t._createCustomModel(j,R,A,G):H.includes("bar")?t._createBar(R,A,O):t._createColumn(R,A,O),t._setColumnProperties(V,G);else if(H.includes("line")||H.includes("area"))H.includes("line")&&(R.bottomY-=O.verticalWidth,v.bottomY-=O.verticalWidth),V=H.includes("spline")?t._createSplineAreaSlice(R,v,O):H.includes("step")?t._createStepAreaSlice(R,v,O):t._createAreaSlice(R,v,O),G.prevObjectPosition=v,t._setAreaProperties(V,G);else if(H.includes("bubble")){const e=r[g].symbolType?r[g].symbolType:"circle",a=t._getDimension(r[g].maxRadius||0,Math.min(o.slot.z,o.slot.x)),n=Math.min(t._getDimension(r[g].minRadius||0,Math.min(o.slot.z,o.slot.x)),3),i=a/t._getMaximumValue(s,r[g].radiusDataField)||1,l=Math.max((I[r[g].radiusDataField]||n)*i,n);G.radius=l,G.symbolType=e,V=t._createBubble(R,l,e,O),t._setBubbleProperties(V,G)}else H.includes("ohlc")?(V=t._createOHLC(R,A,O),t._setFinancialProperties(V,G)):H.includes("candlestick")&&(V=t._createCandlestick(R,A,O),t._setFinancialProperties(V,G));a.type.includes("stacked")&&!G.hidden&&(m[b]+=A),V&&(t._chartObjects.push(V),!G.hidden&&p&&t._validRange(b,s.length-1)&&t._grid.add(V))}}}_setScatterChartData(e){const t=this,a=t.seriesGroups[e],r=a.series,n=t._grid.userData.gridProps,i=a.colorScheme?a.colorScheme:t.colorScheme;let o=a.dataSource?a.dataSource:t.dataSource;t.rightToLeft&&(o=o.slice().reverse());let l=(e,t,a,r)=>(e-t)*r/(a-t);t.valueAxis.logarithmicScale&&(l=(e,a,r,n)=>t._getLogValue(e)*n/t._getLogValue(r));for(let s=0;s<o.length;s++){let d,u=t._getItemColor(i,e,0,0,e,o[s]),c={x:o[s][t.xAxis.dataField],y:o[s][a.series[0].dataField],z:o[s][t.zAxis.dataField]},p={x:l(c.x,t.xAxis._minValue,t.xAxis._maxValue,n.width)-n.width/2,y:l(c.y,t.valueAxis._minValue,t.valueAxis._maxValue,n.height