11 lines
40 KiB
JavaScript
11 lines
40 KiB
JavaScript
|
!/**
|
||
|
* Highcharts JS v11.4.1 (2024-04-04)
|
||
|
*
|
||
|
* Boost module
|
||
|
*
|
||
|
* (c) 2010-2024 Highsoft AS
|
||
|
* Author: Torstein Honsi
|
||
|
*
|
||
|
* License: www.highcharts.com/license
|
||
|
*
|
||
|
* */function(e){"object"==typeof module&&module.exports?(e.default=e,module.exports=e):"function"==typeof define&&define.amd?define("highcharts/modules/boost",["highcharts"],function(t){return e(t),e.Highcharts=t,e}):e("undefined"!=typeof Highcharts?Highcharts:void 0)}(function(e){"use strict";var t=e?e._modules:{};function i(e,t,i,s){e.hasOwnProperty(t)||(e[t]=s.apply(null,i),"function"==typeof CustomEvent&&window.dispatchEvent(new CustomEvent("HighchartsModuleLoaded",{detail:{path:t,module:e[t]}})))}i(t,"Extensions/Boost/Boostables.js",[],function(){return["area","areaspline","arearange","column","columnrange","bar","line","scatter","heatmap","bubble","treemap"]}),i(t,"Extensions/Boost/BoostableMap.js",[t["Extensions/Boost/Boostables.js"]],function(e){let t={};return e.forEach(e=>{t[e]=!0}),t}),i(t,"Extensions/Boost/BoostChart.js",[t["Extensions/Boost/BoostableMap.js"],t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t,i){let{composed:s}=t,{addEvent:o,pick:r,pushUnique:n}=i;function a(t){let i=t.series,s=t.boost=t.boost||{},o=t.options.boost||{},n=r(o.seriesThreshold,50);if(i.length>=n)return!0;if(1===i.length)return!1;let a=o.allowForce;if(void 0===a){for(let e of(a=!0,t.xAxis))if(r(e.min,-1/0)>r(e.dataMin,-1/0)||r(e.max,1/0)<r(e.dataMax,1/0)){a=!1;break}}if(void 0!==s.forceChartBoost){if(a)return s.forceChartBoost;s.forceChartBoost=void 0}let l=0,h=0,f;for(let t of i)0!==(f=t.options).boostThreshold&&!1!==t.visible&&"heatmap"!==t.type&&(e[t.type]&&++l,function(...e){let t=-Number.MAX_VALUE;return e.forEach(function(e){if(null!=e&&void 0!==e.length&&e.length>0)return t=e.length,!0}),t}(t.processedXData,f.data,t.points)>=(f.boostThreshold||Number.MAX_VALUE)&&++h);return s.forceChartBoost=a&&(l===i.length&&h===l||h>5),s.forceChartBoost}function l(e){function t(){e.boost&&e.boost.wgl&&a(e)&&e.boost.wgl.render(e)}o(e,"predraw",function(){e.boost=e.boost||{},e.boost.forceChartBoost=void 0,e.boosted=!1,e.axes.some(e=>e.isPanning)||e.boost.clear?.(),e.boost.canvas&&e.boost.wgl&&a(e)&&e.boost.wgl.allocateBuffer(e),e.boost.markerGroup&&e.xAxis&&e.xAxis.length>0&&e.yAxis&&e.yAxis.length>0&&e.boost.markerGroup.translate(e.xAxis[0].pos,e.yAxis[0].pos)}),o(e,"load",t,{order:-1}),o(e,"redraw",t);let i=-1,s=-1;o(e.pointer,"afterGetHoverData",()=>{let t=e.hoverSeries;if(e.boost=e.boost||{},e.boost.markerGroup&&t){let o=e.inverted?t.yAxis:t.xAxis,r=e.inverted?t.xAxis:t.yAxis;(o&&o.pos!==i||r&&r.pos!==s)&&(e.boost.markerGroup.translate(o.pos,r.pos),i=o.pos,s=r.pos)}})}return{compose:function(e,t){return t&&n(s,"Boost.Chart")&&e.prototype.callbacks.push(l),e},getBoostClipRect:function(e,t){let i={x:e.plotLeft,y:e.plotTop,width:e.plotWidth,height:e.navigator?e.navigator.top+e.navigator.height-e.plotTop:e.plotHeight};if(t.getClipBox){let{xAxis:s,yAxis:o}=t;if(i=t.getClipBox(),e.inverted){let e=i.width;i.width=i.height,i.height=e,i.x=o.pos,i.y=s.pos}else i.x=s.pos,i.y=o.pos}if(t===e){let t=e.inverted?e.xAxis:e.yAxis;t.length<=1&&(i.y=Math.min(t[0].pos,i.y),i.height=t[0].pos-e.plotTop+t[0].len)}return i},isChartSeriesBoosting:a}}),i(t,"Extensions/Boost/WGLDrawMode.js",[],function(){return{area:"LINES",arearange:"LINES",areaspline:"LINES",column:"LINES",columnrange:"LINES",bar:"LINES",line:"LINE_STRIP",scatter:"POINTS",heatmap:"TRIANGLES",treemap:"TRIANGLES",bubble:"POINTS"}}),i(t,"Extensions/Boost/WGLShader.js",[t["Core/Utilities.js"]],function(e){let{clamp:t,error:i,pick:s}=e;return class{constructor(e){if(this.errors=[],this.uLocations={},this.gl=e,e&&!this.createShader())return}bind(){this.gl&&this.shaderProgram&&this.gl.useProgram(this.shaderProgram)}createShader(){let e=this.stringToProgram("#version 100\n#define LN10 2.302585092994046\nprecision highp float;\nattribute vec4 aVertexPosition;\nattribute vec4 aColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform mat4 uPMatrix;\nuniform float pSize;\nuniform float translatedThreshold;\nuniform bool hasThreshold;\nuniform bool skipTranslation;\nuniform float xAxisTrans;\nuniform float xAxisMin;\nuniform float xAxisMinPad;\nuniform float xAxisPointRange;\nunifo
|