7 lines
44 KiB
JavaScript
7 lines
44 KiB
JavaScript
|
!/**
|
||
|
* Highcharts JS v11.4.1 (2024-04-04)
|
||
|
*
|
||
|
* 3D features for Highcharts JS
|
||
|
*
|
||
|
* License: www.highcharts.com/license
|
||
|
*/function(t){"object"==typeof module&&module.exports?(t.default=t,module.exports=t):"function"==typeof define&&define.amd?define("highcharts/highcharts-3d",["highcharts"],function(e){return t(e),t.Highcharts=e,t}):t("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(t){"use strict";var e=t?t._modules:{};function i(t,e,i,s){t.hasOwnProperty(e)||(t[e]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:e,module:t[e]}})))}i(e,"Core/Math3D.js",[e["Core/Globals.js"],e["Core/Utilities.js"]],function(t,e){let{deg2rad:i}=t,{pick:s}=e;function o(t,e,o,a){let n=e.options.chart.options3d,l=s(a,!!o&&e.inverted),h={x:e.plotWidth/2,y:e.plotHeight/2,z:n.depth/2,vd:s(n.depth,1)*s(n.viewDistance,0)},p=e.scale3d||1,c=i*n.beta*(l?-1:1),d=i*n.alpha*(l?-1:1),x={cosA:Math.cos(d),cosB:Math.cos(-c),sinA:Math.sin(d),sinB:Math.sin(-c)};return o||(h.x+=e.plotLeft,h.y+=e.plotTop),t.map(function(t){var e,i,s;let o=(e=(l?t.y:t.x)-h.x,i=(l?t.x:t.y)-h.y,s=(t.z||0)-h.z,{x:x.cosB*e-x.sinB*s,y:-x.sinA*x.sinB*e+x.cosA*i-x.cosB*x.sinA*s,z:x.cosA*x.sinB*e+x.sinA*i+x.cosA*x.cosB*s}),a=r(o,h,h.vd);return a.x=a.x*p+h.x,a.y=a.y*p+h.y,a.z=o.z*p+h.z,{x:l?a.y:a.x,y:l?a.x:a.y,z:a.z}})}function r(t,e,i){let s=i>0&&i<Number.POSITIVE_INFINITY?i/(t.z+e.z+i):1;return{x:t.x*s,y:t.y*s}}function a(t){let e=0,i,s;for(i=0;i<t.length;i++)s=(i+1)%t.length,e+=t[i].x*t[s].y-t[s].x*t[i].y;return e/2}return{perspective:o,perspective3D:r,pointCameraDistance:function(t,e){let i=e.options.chart.options3d,o={x:e.plotWidth/2,y:e.plotHeight/2,z:s(i.depth,1)*s(i.viewDistance,0)+i.depth};return Math.sqrt(Math.pow(o.x-s(t.plotX,t.x),2)+Math.pow(o.y-s(t.plotY,t.y),2)+Math.pow(o.z-s(t.plotZ,t.z),2))},shapeArea:a,shapeArea3D:function(t,e,i){return a(o(t,e,i))}}}),i(e,"Core/Chart/Chart3D.js",[e["Core/Color/Color.js"],e["Core/Defaults.js"],e["Core/Math3D.js"],e["Core/Utilities.js"]],function(t,e,i,s){var o;let{parse:r}=t,{defaultOptions:a}=e,{perspective:n,shapeArea3D:l}=i,{addEvent:h,isArray:p,merge:c,pick:d,wrap:x}=s;return function(t){function e(t){this.is3d()&&"scatter"===t.options.type&&(t.options.type="scatter3d")}function i(){if(this.chart3d&&this.is3d()){let t=this.renderer,e=this.options.chart.options3d,i=this.chart3d.get3dFrame(),s=this.plotLeft,o=this.plotLeft+this.plotWidth,a=this.plotTop,n=this.plotTop+this.plotHeight,l=e.depth,h=s-(i.left.visible?i.left.size:0),p=o+(i.right.visible?i.right.size:0),c=a-(i.top.visible?i.top.size:0),d=n+(i.bottom.visible?i.bottom.size:0),x=0-(i.front.visible?i.front.size:0),y=l+(i.back.visible?i.back.size:0),f=this.hasRendered?"animate":"attr";this.chart3d.frame3d=i,this.frameShapes||(this.frameShapes={bottom:t.polyhedron().add(),top:t.polyhedron().add(),left:t.polyhedron().add(),right:t.polyhedron().add(),back:t.polyhedron().add(),front:t.polyhedron().add()}),this.frameShapes.bottom[f]({class:"highcharts-3d-frame highcharts-3d-frame-bottom",zIndex:i.bottom.frontFacing?-1e3:1e3,faces:[{fill:r(i.bottom.color).brighten(.1).get(),vertexes:[{x:h,y:d,z:x},{x:p,y:d,z:x},{x:p,y:d,z:y},{x:h,y:d,z:y}],enabled:i.bottom.visible},{fill:r(i.bottom.color).brighten(.1).get(),vertexes:[{x:s,y:n,z:l},{x:o,y:n,z:l},{x:o,y:n,z:0},{x:s,y:n,z:0}],enabled:i.bottom.visible},{fill:r(i.bottom.color).brighten(-.1).get(),vertexes:[{x:h,y:d,z:x},{x:h,y:d,z:y},{x:s,y:n,z:l},{x:s,y:n,z:0}],enabled:i.bottom.visible&&!i.left.visible},{fill:r(i.bottom.color).brighten(-.1).get(),vertexes:[{x:p,y:d,z:y},{x:p,y:d,z:x},{x:o,y:n,z:0},{x:o,y:n,z:l}],enabled:i.bottom.visible&&!i.right.visible},{fill:r(i.bottom.color).get(),vertexes:[{x:p,y:d,z:x},{x:h,y:d,z:x},{x:s,y:n,z:0},{x:o,y:n,z:0}],enabled:i.bottom.visible&&!i.front.visible},{fill:r(i.bottom.color).get(),vertexes:[{x:h,y:d,z:y},{x:p,y:d,z:y},{x:o,y:n,z:l},{x:s,y:n,z:l}],enabled:i.bottom.visible&&!i.back.visible}]}),this.frameShapes.top[f]({class:"highcharts-3d-frame highcharts-3d-frame-top",zIndex:i.top.frontFacing?-1e3:1e3,faces:[{fill:r(i.top.color).brighten(.1).get(),vertexes:[{x:h,y:c,z:y},{x:p,y:c,z:y},{x:p,y:c,z:x},{x:h,y:c,z:x}],enabled:i.top.v
|