highstock-rails 2.1.10 → 5.0.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (91) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/css/highcharts.css +760 -0
  3. data/app/assets/javascripts/highstock.js +511 -419
  4. data/app/assets/javascripts/highstock/highstock.js +472 -0
  5. data/app/assets/javascripts/highstock/highstock.js.map +8 -0
  6. data/app/assets/javascripts/highstock/highstock.src.js +28809 -0
  7. data/app/assets/javascripts/highstock/modules/accessibility.js +48 -0
  8. data/app/assets/javascripts/highstock/modules/accessibility.js.map +8 -0
  9. data/app/assets/javascripts/highstock/modules/accessibility.src.js +1131 -0
  10. data/app/assets/javascripts/highstock/modules/annotations.js +14 -0
  11. data/app/assets/javascripts/highstock/modules/annotations.js.map +8 -0
  12. data/app/assets/javascripts/highstock/modules/annotations.src.js +407 -0
  13. data/app/assets/javascripts/highstock/modules/boost-canvas.js +23 -0
  14. data/app/assets/javascripts/highstock/modules/boost-canvas.js.map +8 -0
  15. data/app/assets/javascripts/highstock/modules/boost-canvas.src.js +771 -0
  16. data/app/assets/javascripts/highstock/modules/boost.js +51 -12
  17. data/app/assets/javascripts/highstock/modules/boost.js.map +8 -0
  18. data/app/assets/javascripts/highstock/modules/boost.src.js +2580 -492
  19. data/app/assets/javascripts/highstock/modules/broken-axis.js.map +8 -0
  20. data/app/assets/javascripts/highstock/modules/canvasrenderer.experimental.js.map +8 -0
  21. data/app/assets/javascripts/highstock/modules/data.js +19 -19
  22. data/app/assets/javascripts/highstock/modules/data.js.map +8 -0
  23. data/app/assets/javascripts/highstock/modules/data.src.js +974 -950
  24. data/app/assets/javascripts/highstock/modules/drilldown.js +25 -17
  25. data/app/assets/javascripts/highstock/modules/drilldown.js.map +8 -0
  26. data/app/assets/javascripts/highstock/modules/drilldown.src.js +790 -709
  27. data/app/assets/javascripts/highstock/modules/export-data.js +17 -0
  28. data/app/assets/javascripts/highstock/modules/export-data.js.map +8 -0
  29. data/app/assets/javascripts/highstock/modules/export-data.src.js +417 -0
  30. data/app/assets/javascripts/highstock/modules/exporting.js +21 -18
  31. data/app/assets/javascripts/highstock/modules/exporting.js.map +8 -0
  32. data/app/assets/javascripts/highstock/modules/exporting.src.js +1013 -768
  33. data/app/assets/javascripts/highstock/modules/funnel.js +6 -7
  34. data/app/assets/javascripts/highstock/modules/funnel.js.map +8 -0
  35. data/app/assets/javascripts/highstock/modules/funnel.src.js +284 -308
  36. data/app/assets/javascripts/highstock/modules/gantt.js +24 -0
  37. data/app/assets/javascripts/highstock/modules/gantt.js.map +8 -0
  38. data/app/assets/javascripts/highstock/modules/gantt.src.js +793 -0
  39. data/app/assets/javascripts/highstock/modules/grid-axis.js +19 -0
  40. data/app/assets/javascripts/highstock/modules/grid-axis.js.map +8 -0
  41. data/app/assets/javascripts/highstock/modules/grid-axis.src.js +545 -0
  42. data/app/assets/javascripts/highstock/modules/heatmap.js +20 -18
  43. data/app/assets/javascripts/highstock/modules/heatmap.js.map +8 -0
  44. data/app/assets/javascripts/highstock/modules/heatmap.src.js +738 -633
  45. data/app/assets/javascripts/highstock/modules/map-parser.js.map +8 -0
  46. data/app/assets/javascripts/highstock/modules/map.js.map +8 -0
  47. data/app/assets/javascripts/highstock/modules/no-data-to-display.js +5 -5
  48. data/app/assets/javascripts/highstock/modules/no-data-to-display.js.map +8 -0
  49. data/app/assets/javascripts/highstock/modules/no-data-to-display.src.js +140 -133
  50. data/app/assets/javascripts/highstock/modules/offline-exporting.js +12 -7
  51. data/app/assets/javascripts/highstock/modules/offline-exporting.js.map +8 -0
  52. data/app/assets/javascripts/highstock/modules/offline-exporting.src.js +543 -270
  53. data/app/assets/javascripts/highstock/modules/overlapping-datalabels.js +10 -0
  54. data/app/assets/javascripts/highstock/modules/overlapping-datalabels.js.map +8 -0
  55. data/app/assets/javascripts/highstock/modules/overlapping-datalabels.src.js +187 -0
  56. data/app/assets/javascripts/highstock/modules/series-label.js +19 -0
  57. data/app/assets/javascripts/highstock/modules/series-label.js.map +8 -0
  58. data/app/assets/javascripts/highstock/modules/series-label.src.js +606 -0
  59. data/app/assets/javascripts/highstock/modules/solid-gauge.js +9 -8
  60. data/app/assets/javascripts/highstock/modules/solid-gauge.js.map +8 -0
  61. data/app/assets/javascripts/highstock/modules/solid-gauge.src.js +334 -266
  62. data/app/assets/javascripts/highstock/modules/static-scale.js +12 -0
  63. data/app/assets/javascripts/highstock/modules/static-scale.js.map +8 -0
  64. data/app/assets/javascripts/highstock/modules/static-scale.src.js +64 -0
  65. data/app/assets/javascripts/highstock/modules/stock.js +123 -0
  66. data/app/assets/javascripts/highstock/modules/stock.js.map +8 -0
  67. data/app/assets/javascripts/highstock/modules/stock.src.js +6247 -0
  68. data/app/assets/javascripts/highstock/modules/treemap.js +22 -23
  69. data/app/assets/javascripts/highstock/modules/treemap.js.map +8 -0
  70. data/app/assets/javascripts/highstock/modules/treemap.src.js +884 -859
  71. data/app/assets/javascripts/highstock/modules/xrange-series.js +15 -0
  72. data/app/assets/javascripts/highstock/modules/xrange-series.js.map +8 -0
  73. data/app/assets/javascripts/highstock/modules/xrange-series.src.js +258 -0
  74. data/app/assets/javascripts/highstock/themes/dark-blue.js +307 -244
  75. data/app/assets/javascripts/highstock/themes/dark-green.js +303 -244
  76. data/app/assets/javascripts/highstock/themes/dark-unica.js +231 -201
  77. data/app/assets/javascripts/highstock/themes/gray.js +314 -245
  78. data/app/assets/javascripts/highstock/themes/grid-light.js +91 -66
  79. data/app/assets/javascripts/highstock/themes/grid.js +124 -96
  80. data/app/assets/javascripts/highstock/themes/sand-signika.js +119 -94
  81. data/app/assets/javascripts/highstock/themes/skies.js +108 -85
  82. data/lib/highstock/rails/version.rb +1 -1
  83. metadata +54 -11
  84. data/app/assets/javascripts/highstock/adapters/standalone-framework.js +0 -18
  85. data/app/assets/javascripts/highstock/adapters/standalone-framework.src.js +0 -635
  86. data/app/assets/javascripts/highstock/highcharts-3d.js +0 -48
  87. data/app/assets/javascripts/highstock/highcharts-3d.src.js +0 -1711
  88. data/app/assets/javascripts/highstock/highcharts-more.js +0 -55
  89. data/app/assets/javascripts/highstock/highstock-all.js +0 -637
  90. data/app/assets/javascripts/highstock/modules/canvas-tools.js +0 -133
  91. data/app/assets/javascripts/highstock/modules/canvas-tools.src.js +0 -3114
@@ -1,12 +1,51 @@
1
- (function(c){typeof module==="object"&&module.exports?module.exports=c:c(Highcharts)})(function(c){function u(a,b,d,e,f){f=f||0;e=e||v;k(a.slice(f,f+e),b);f+e<a.length?setTimeout(function(){u(a,b,d,e,f+e)}):d&&d()}var L=function(){},M=c.Color,j=c.Series,h=c.seriesTypes,k=c.each,p=c.extend,N=c.addEvent,O=c.fireEvent,P=c.merge,Q=c.pick,g=c.wrap,n=c.getOptions().plotOptions,v=5E4;k(["area","arearange","column","line","scatter"],function(a){if(n[a])n[a].boostThreshold=5E3});k(["translate","generatePoints",
2
- "drawTracker","drawPoints","render"],function(a){function b(b){var e=this.options.stacking&&(a==="translate"||a==="generatePoints");if((this.processedXData||this.options.data).length<(this.options.boostThreshold||Number.MAX_VALUE)||e){if(a==="render"&&this.image)this.image.attr({href:""}),this.animate=null;b.call(this)}else if(this[a+"Canvas"])this[a+"Canvas"]()}g(j.prototype,a,b);a==="translate"&&(h.column&&g(h.column.prototype,a,b),h.arearange&&g(h.arearange.prototype,a,b))});g(j.prototype,"getExtremes",
3
- function(a){this.hasExtremes()||a.apply(this,Array.prototype.slice.call(arguments,1))});g(j.prototype,"setData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});g(j.prototype,"processData",function(a){this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))});c.extend(j.prototype,{pointRange:0,hasExtremes:function(a){var b=this.options,d=this.xAxis&&this.xAxis.options,e=this.yAxis&&this.yAxis.options;return b.data.length>(b.boostThreshold||
4
- Number.MAX_VALUE)&&typeof e.min==="number"&&typeof e.max==="number"&&(!a||typeof d.min==="number"&&typeof d.max==="number")},destroyGraphics:function(){var a=this,b=this.points,d,e;if(b)for(e=0;e<b.length;e+=1)if((d=b[e])&&d.graphic)d.graphic=d.graphic.destroy();k(["graph","area","tracker"],function(b){a[b]&&(a[b]=a[b].destroy())})},getContext:function(){var a=this.chart,b=a.plotWidth,d=a.plotHeight,e=this.ctx,f=function(a,b,d,e,f,c,i){a.call(this,d,b,e,f,c,i)};this.canvas?e.clearRect(0,0,b,d):(this.canvas=
5
- document.createElement("canvas"),this.image=a.renderer.image("",0,0,b,d).add(this.group),this.ctx=e=this.canvas.getContext("2d"),a.inverted&&k(["moveTo","lineTo","rect","arc"],function(a){g(e,a,f)}));this.canvas.setAttribute("width",b);this.canvas.setAttribute("height",d);this.image.attr({width:b,height:d});return e},canvasToSVG:function(){this.image.attr({href:this.canvas.toDataURL("image/png")})},cvsLineTo:function(a,b,d){a.lineTo(b,d)},renderCanvas:function(){var a=this,b=a.options,d=a.chart,e=
6
- this.xAxis,f=this.yAxis,c,h,g=0,j=a.processedXData,k=a.processedYData,n=b.data,i=e.getExtremes(),R=i.min,S=i.max,i=f.getExtremes(),T=i.min,U=i.max,w={},q,V=!!a.sampling,x,y=b.marker&&b.marker.radius,z=this.cvsDrawPoint,A=b.lineWidth?this.cvsLineTo:!1,B=y<=1?this.cvsMarkerSquare:this.cvsMarkerCircle,W=b.enableMouseTracking!==!1,C,i=b.threshold,l=f.getThreshold(i),D=typeof i==="number",E=l,X=this.fill,F=a.pointArrayMap&&a.pointArrayMap.join(",")==="low,high",G=!!b.stacking,Y=a.cropStart||0,i=d.options.loading,
7
- Z=a.requireSorting,H,$=b.connectNulls,I=!j,r,s,m,o,aa=a.fillOpacity?(new M(a.color)).setOpacity(Q(b.fillOpacity,0.75)).get():a.color,J=function(){X?(c.fillStyle=aa,c.fill()):(c.strokeStyle=a.color,c.lineWidth=b.lineWidth,c.stroke())},K=function(a,b,d){g===0&&c.beginPath();H?c.moveTo(a,b):z?z(c,a,b,d,C):A?A(c,a,b):B&&B(c,a,b,y);g+=1;g===1E3&&(J(),g=0);C={clientX:a,plotY:b,yBottom:d}},t=function(a,b,c){W&&!w[a+","+b]&&(w[a+","+b]=!0,d.inverted&&(a=e.len-a,b=f.len-b),x.push({clientX:a,plotX:a,plotY:b,
8
- i:Y+c}))};(this.points||this.graph)&&this.destroyGraphics();a.plotGroup("group","series",a.visible?"visible":"hidden",b.zIndex,d.seriesGroup);a.getAttribs();a.markerGroup=a.group;N(a,"destroy",function(){a.markerGroup=null});x=this.points=[];c=this.getContext();a.buildKDTree=L;if(n.length>99999)d.options.loading=P(i,{labelStyle:{backgroundColor:"rgba(255,255,255,0.75)",padding:"1em",borderRadius:"0.5em"},style:{backgroundColor:"none",opacity:1}}),d.showLoading("Drawing..."),d.options.loading=i,d.loadingShown===
9
- !0?d.loadingShown=1:d.loadingShown+=1;h=0;u(G?a.data:j||n,function(b){var d,c,g,i=!0;I?(d=b[0],c=b[1]):(d=b,c=k[h]);if(F)I&&(c=b.slice(1,3)),g=c[0],c=c[1];else if(G)d=b.x,c=b.stackY,g=c-b.y;b=c===null;Z||(i=c>=T&&c<=U);if(!b&&d>=R&&d<=S&&i)if(d=Math.round(e.toPixels(d,!0)),V){if(m===void 0||d===q){F||(g=c);if(o===void 0||c>s)s=c,o=h;if(m===void 0||g<r)r=g,m=h}d!==q&&(m!==void 0&&(c=f.toPixels(s,!0),l=f.toPixels(r,!0),K(d,D?Math.min(c,E):c,D?Math.max(l,E):l),t(d,c,o),l!==c&&t(d,l,m)),m=o=void 0,q=
10
- d)}else c=Math.round(f.toPixels(c,!0)),K(d,c,l),t(d,c,h);H=b&&!$;h+=1;h%v===0&&a.canvasToSVG()},function(){var b=d.loadingDiv,c=+d.loadingShown;J();a.canvasToSVG();O(a,"renderedCanvas");if(c===1)p(b.style,{transition:"opacity 250ms",opacity:0}),d.loadingShown=!1,setTimeout(function(){b.parentNode&&b.parentNode.removeChild(b);d.loadingDiv=d.loadingSpan=null},250);if(c)d.loadingShown=c-1;a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},d.renderer.forExport?Number.MAX_VALUE:
11
- void 0)}});h.scatter.prototype.cvsMarkerCircle=function(a,b,d,c){a.moveTo(b,d);a.arc(b,d,c,0,2*Math.PI,!1)};h.scatter.prototype.cvsMarkerSquare=function(a,b,d,c){a.moveTo(b,d);a.rect(b-c,d-c,c*2,c*2)};h.scatter.prototype.fill=!0;p(h.area.prototype,{cvsDrawPoint:function(a,b,d,c,f){f&&b!==f.clientX&&(a.moveTo(f.clientX,f.yBottom),a.lineTo(f.clientX,f.plotY),a.lineTo(b,d),a.lineTo(b,c))},fill:!0,fillOpacity:!0,sampling:!0});p(h.column.prototype,{cvsDrawPoint:function(a,b,c,e){a.rect(b-1,c,1,e-c)},fill:!0,
12
- sampling:!0});j.prototype.getPoint=function(a){var b=a;if(a&&!(a instanceof this.pointClass))b=(new this.pointClass).init(this,this.options.data[a.i]),b.dist=a.dist,b.category=b.x,b.plotX=a.plotX,b.plotY=a.plotY;return b};g(j.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,[].slice.call(arguments,1)))})});
1
+ /*
2
+ Highcharts JS v5.0.11 (2017-05-04)
3
+ Boost module
4
+
5
+ (c) 2010-2017 Highsoft AS
6
+ Author: Torstein Honsi
7
+
8
+ License: www.highcharts.com/license
9
+ */
10
+ (function(A){"object"===typeof module&&module.exports?module.exports=A:A(Highcharts)})(function(A){(function(h){function z(a){return a.series.length>=G(a.options.boost&&a.options.boost.seriesThreshold,10)}function B(a){function c(){var a=Array.prototype.slice.call(arguments),c=-Number.MAX_VALUE;C(a,function(a){if("undefined"!==typeof a&&"undefined"!==typeof a.length&&0<a.length)return c=a.length,!0});return c}return z(a.chart)||c(a.processedXData,a.options.data,a.points)>=(a.options.boostThreshold||
11
+ Number.MAX_VALUE)}function A(a){function c(b,c){c=a.createShader("vertex"===c?a.VERTEX_SHADER:a.FRAGMENT_SHADER);a.shaderSource(c,b);a.compileShader(c);return a.getShaderParameter(c,a.COMPILE_STATUS)?c:!1}function d(){function e(b){return a.getUniformLocation(l,b)}var d=c("#version 100\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;\nuniform float xAxisLen;\nuniform bool xAxisPostTranslate;\nuniform float xAxisOrdinalSlope;\nuniform float xAxisOrdinalOffset;\nuniform float xAxisPos;\nuniform bool xAxisCVSCoord;\nuniform float yAxisTrans;\nuniform float yAxisMin;\nuniform float yAxisMinPad;\nuniform float yAxisPointRange;\nuniform float yAxisLen;\nuniform bool yAxisPostTranslate;\nuniform float yAxisOrdinalSlope;\nuniform float yAxisOrdinalOffset;\nuniform float yAxisPos;\nuniform bool yAxisCVSCoord;\nuniform bool isBubble;\nuniform bool bubbleSizeByArea;\nuniform float bubbleZMin;\nuniform float bubbleZMax;\nuniform float bubbleZThreshold;\nuniform float bubbleMinSize;\nuniform float bubbleMaxSize;\nuniform bool bubbleSizeAbs;\nuniform bool isInverted;\nfloat bubbleRadius(){\nfloat value \x3d aVertexPosition.w;\nfloat zMax \x3d bubbleZMax;\nfloat zMin \x3d bubbleZMin;\nfloat radius \x3d 0.0;\nfloat pos \x3d 0.0;\nfloat zRange \x3d zMax - zMin;\nif (bubbleSizeAbs){\nvalue \x3d value - bubbleZThreshold;\nzMax \x3d max(zMax - bubbleZThreshold, zMin - bubbleZThreshold);\nzMin \x3d 0.0;\n}\nif (value \x3c zMin){\nradius \x3d bubbleZMin / 2.0 - 1.0;\n} else {\npos \x3d zRange \x3e 0.0 ? (value - zMin) / zRange : 0.5;\nif (bubbleSizeByArea \x26\x26 pos \x3e 0.0){\npos \x3d sqrt(pos);\n}\nradius \x3d ceil(bubbleMinSize + pos * (bubbleMaxSize - bubbleMinSize)) / 2.0;\n}\nreturn radius * 2.0;\n}\nfloat translate(float val,\nfloat pointPlacement,\nfloat localA,\nfloat localMin,\nfloat minPixelPadding,\nfloat pointRange,\nfloat len,\nbool cvsCoord\n){\nfloat sign \x3d 1.0;\nfloat cvsOffset \x3d 0.0;\nif (cvsCoord) {\nsign *\x3d -1.0;\ncvsOffset \x3d len;\n}\nreturn sign * (val - localMin) * localA + cvsOffset + \n(sign * minPixelPadding);\n}\nfloat xToPixels(float value){\nif (skipTranslation){\nreturn value;// + xAxisPos;\n}\nreturn translate(value, 0.0, xAxisTrans, xAxisMin, xAxisMinPad, xAxisPointRange, xAxisLen, xAxisCVSCoord);// + xAxisPos;\n}\nfloat yToPixels(float value, float checkTreshold){\nfloat v;\nif (skipTranslation){\nv \x3d value;// + yAxisPos;\n} else {\nv \x3d translate(value, 0.0, yAxisTrans, yAxisMin, yAxisMinPad, yAxisPointRange, yAxisLen, yAxisCVSCoord);// + yAxisPos;\n}\nif (checkTreshold \x3e 0.0 \x26\x26 hasThreshold) {\nv \x3d min(v, translatedThreshold);\n}\nreturn v;\n}\nvoid main(void) {\nif (isBubble){\ngl_PointSize \x3d bubbleRadius();\n} else {\ngl_PointSize \x3d pSize;\n}\nvColor \x3d aColor;\nif (isInverted) {\ngl_Position \x3d uPMatrix * vec4(xToPixels(aVertexPosition.y) + yAxisPos, yToPixels(aVertexPosition.x, aVertexPosition.z) + xAxisPos, 0.0, 1.0);\n} else {\ngl_Position \x3d uPMatrix * vec4(xToPixels(aVertexPosition.x) + xAxisPos, yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, 0.0, 1.0);\n}\n}",
12
+ "vertex"),f=c("precision highp float;\nuniform vec4 fillColor;\nvarying highp vec2 position;\nvarying highp vec4 vColor;\nuniform sampler2D uSampler;\nuniform bool isCircle;\nuniform bool hasColor;\nvoid main(void) {\nvec4 col \x3d fillColor;\nif (hasColor) {\ncol \x3d vColor;\n}\nif (isCircle) {\ngl_FragColor \x3d col * texture2D(uSampler, gl_PointCoord.st);\n} else {\ngl_FragColor \x3d col;\n}\n}","fragment");if(!d||!f)return l=!1;l=a.createProgram();a.attachShader(l,d);a.attachShader(l,f);a.linkProgram(l);
13
+ a.useProgram(l);a.bindAttribLocation(l,0,"aVertexPosition");h=e("uPMatrix");n=e("pSize");I=e("fillColor");y=e("isBubble");k=e("bubbleSizeAbs");t=e("bubbleSizeByArea");D=e("uSampler");b=e("skipTranslation");p=e("isCircle");g=e("isInverted");return!0}function f(b,c){b=e[b]=e[b]||a.getUniformLocation(l,b);a.uniform1f(b,c)}var e={},l,h,n,I,y,k,t,b,p,g,D;a&&d();return{psUniform:function(){return n},pUniform:function(){return h},fillColorUniform:function(){return I},setBubbleUniforms:function(b,c,e){var d=
14
+ b.options,l=Number.MAX_VALUE,h=-Number.MAX_VALUE;"bubble"===b.type&&(l=G(d.zMin,Math.min(l,Math.max(c,!1===d.displayNegative?d.zThreshold:-Number.MAX_VALUE))),h=G(d.zMax,Math.max(h,e)),a.uniform1i(y,1),a.uniform1i(p,1),a.uniform1i(t,"width"!==b.options.sizeBy),a.uniform1i(k,b.options.sizeByAbsoluteValue),f("bubbleZMin",l),f("bubbleZMax",h),f("bubbleZThreshold",b.options.zThreshold),f("bubbleMinSize",b.minPxSize),f("bubbleMaxSize",b.maxPxSize))},bind:function(){a.useProgram(l)},program:function(){return l},
15
+ create:d,setUniform:f,setPMatrix:function(b){a.uniformMatrix4fv(h,!1,b)},setColor:function(b){a.uniform4f(I,b[0]/255,b[1]/255,b[2]/255,b[3])},setPointSize:function(b){a.uniform1f(n,b)},setSkipTranslation:function(c){a.uniform1i(b,!0===c?1:0)},setTexture:function(){a.uniform1i(D,0)},setDrawAsCircle:function(b){a.uniform1i(p,b?1:0)},reset:function(){a.uniform1i(y,0);a.uniform1i(p,0)},setInverted:function(b){a.uniform1i(g,b)},destroy:function(){a&&l&&a.deleteProgram(l)}}}function X(a,c,d){var f=!1,e=
16
+ !1,l=d||2,h=!1,n=0,g;return{destroy:function(){f&&a.deleteBuffer(f)},bind:function(){if(!f)return!1;a.vertexAttribPointer(e,l,a.FLOAT,!1,0,0)},data:g,build:function(d,k,t){g=d||[];if(!(g&&0!==g.length||h))return f=!1;l=t||l;f&&a.deleteBuffer(f);f=a.createBuffer();a.bindBuffer(a.ARRAY_BUFFER,f);a.bufferData(a.ARRAY_BUFFER,h||new Float32Array(g),a.STATIC_DRAW);e=a.getAttribLocation(c.program(),k);a.enableVertexAttribArray(e);return!0},render:function(c,e,d){var b=h?h.length:g.length;if(!f||!b)return!1;
17
+ if(!c||c>b||0>c)c=0;if(!e||e>b)e=b;a.drawArrays(a[(d||"points").toUpperCase()],c/l,(e-c)/l);return!0},allocate:function(a){n=-1;h=new Float32Array(4*a)},push:function(a,c,e,b){h&&(h[++n]=a,h[++n]=c,h[++n]=e,h[++n]=b)}}}function fa(a){function c(a){var b,c;return B(a)?(b=!!a.options.stacking,c=a.xData||a.options.xData||a.processedXData,b=(b?a.data:c||a.options.data).length,"treemap"===a.type?b*=12:"heatmap"===a.type?b*=6:N[a.type]&&(b*=2),b):0}function d(){b.clear(b.COLOR_BUFFER_BIT|b.DEPTH_BUFFER_BIT)}
18
+ function f(a,b){function c(a){a&&(b.colorData.push(a[0]),b.colorData.push(a[1]),b.colorData.push(a[2]),b.colorData.push(a[3]))}function e(a,b,e,d,f){c(f);q.usePreallocated?t.push(a,b,e?1:0,d||1):(D.push(a),D.push(b),D.push(e?1:0),D.push(d||1))}function d(a,b,d,f,v){c(v);e(a+d,b);c(v);e(a,b);c(v);e(a,b+f);c(v);e(a,b+f);c(v);e(a+d,b+f);c(v);e(a+d,b)}function f(a){q.useGPUTranslations||(b.skipTranslation=!0,a.x=B.toPixels(a.x,!0),a.y=F.toPixels(a.y,!0));e(a.x,a.y,0,2)}var v=a.pointArrayMap&&"low,high"===
19
+ a.pointArrayMap.join(","),k=a.chart,m=a.options,l=!!m.stacking,g=m.data,n=a.xAxis.getExtremes(),p=n.min,u=n.max,n=a.yAxis.getExtremes(),r=n.min,z=n.max,n=a.xData||m.xData||a.processedXData,w=a.yData||m.yData||a.processedYData,y=a.zData||m.zData||a.processedZData,F=a.yAxis,B=a.xAxis,L=!n||0===n.length,x=a.points||!1,I=!1,E,J,K,H=l?a.data:n||g,A={x:Number.MIN_VALUE,y:0},R={x:Number.MIN_VALUE,y:0};m.boostData&&0<m.boostData.length||(a.closestPointRangePx=Number.MAX_VALUE,x&&0<x.length?(b.skipTranslation=
20
+ !0,b.drawMode="triangles",x[0].node&&x[0].node.levelDynamic&&x.sort(function(a,b){if(a.node){if(a.node.levelDynamic>b.node.levelDynamic)return 1;if(a.node.levelDynamic<b.node.levelDynamic)return-1}return 0}),C(x,function(b){var c=b.plotY,e;void 0===c||isNaN(c)||null===b.y||(c=b.shapeArgs,e=b.series.colorAttribs(b),b=e["stroke-width"]||0,J=h.color(e.fill).rgba,J[0]/=255,J[1]/=255,J[2]/=255,"treemap"===a.type&&(b=b||1,K=h.color(e.stroke).rgba,K[0]/=255,K[1]/=255,K[2]/=255,d(c.x,c.y,c.width,c.height,
21
+ K),b/=2),d(c.x+b,c.y+b,c.width-2*b,c.height-2*b,J))})):(C(H,function(c,d){var f,m,h,n=!1,P=!1,g=!1,Y=!1,ga=N[a.type],t=!1,x=!0;if("undefined"===typeof k.index)return!1;L?(f=c[0],m=c[1],H[d+1]&&(P=H[d+1][0]),H[d-1]&&(n=H[d-1][0]),3<=c.length&&(h=c[2],c[2]>b.zMax&&(b.zMax=c[2]),c[2]<b.zMin&&(b.zMin=c[2]))):(f=c,m=w[d],H[d+1]&&(P=H[d+1]),H[d-1]&&(n=H[d-1]),y&&y.length&&(h=y[d],y[d]>b.zMax&&(b.zMax=y[d]),y[d]<b.zMin&&(b.zMin=y[d])));P&&P>=p&&P<=u&&(g=!0);n&&n>=p&&n<=u&&(Y=!0);v?(L&&(m=c.slice(1,3)),m=
22
+ m[1]):l&&(f=c.x,m=c.stackY);a.requireSorting||(x=m>=r&&m<=z);f>u&&R.x<u&&(R.x=f,R.y=m);f<p&&A.x<p&&(A.x=f,A.y=m);if(0===m||m&&x)if(f>=p&&f<=u&&(t=!0),t||g||Y)q.useGPUTranslations||(b.skipTranslation=!0,f=B.toPixels(f,!0),m=F.toPixels(m,!0)),ga&&(E=0,0>m&&(E=m,m=0),q.useGPUTranslations||(E=F.toPixels(E,!0)),e(f,E,0,0,!1)),b.hasMarkers&&!1!==I&&(a.closestPointRangePx=Math.min(a.closestPointRangePx,Math.abs(f-I))),e(f,m,0,"bubble"===a.type?h||1:2,!1),I=f}),I||(f(A),f(R))))}function e(){u=[];x.data=D=
23
+ [];z=[]}function l(a){k&&(k.setUniform("xAxisTrans",a.transA),k.setUniform("xAxisMin",a.min),k.setUniform("xAxisMinPad",a.minPixelPadding),k.setUniform("xAxisPointRange",a.pointRange),k.setUniform("xAxisLen",a.len),k.setUniform("xAxisPos",a.pos),k.setUniform("xAxisCVSCoord",!a.horiz))}function g(a){k&&(k.setUniform("yAxisTrans",a.transA),k.setUniform("yAxisMin",a.min),k.setUniform("yAxisMinPad",a.minPixelPadding),k.setUniform("yAxisPointRange",a.pointRange),k.setUniform("yAxisLen",a.len),k.setUniform("yAxisPos",
24
+ a.pos),k.setUniform("yAxisCVSCoord",!a.horiz))}function n(a,b){k.setUniform("hasThreshold",a);k.setUniform("translatedThreshold",b)}function r(c){if(c)p=c.chartWidth||800,F=c.chartHeight||400;else return!1;if(!b||!p||!F)return!1;q.timeRendering&&console.time("gl rendering");k.bind();b.viewport(0,0,p,F);k.setPMatrix([2/p,0,0,0,0,-(2/F),0,0,0,0,-2,0,-1,1,-1,1]);1<q.lineWidth&&!h.isMS&&b.lineWidth(q.lineWidth);t.build(x.data,"aVertexPosition",4);t.bind();w&&(b.bindTexture(b.TEXTURE_2D,E),k.setTexture(E));
25
+ k.setInverted(c.options.chart?c.options.chart.inverted:!1);C(u,function(a,c){var e=a.series.options,d=e.threshold,f=Q(d),d=a.series.yAxis.getThreshold(d),m=G(e.marker?e.marker.enabled:null,a.series.xAxis.isRadial?!0:null,a.series.closestPointRangePx>2*((e.marker?e.marker.radius:10)||10)),v=a.series.fillOpacity?(new Z(a.series.color)).setOpacity(G(e.fillOpacity,.85)).get():a.series.color;t.bind();e.colorByPoint&&(v=a.series.chart.options.colors[c]);v=h.color(v).rgba;q.useAlpha||(v[3]=1);"add"===e.boostBlending?
26
+ (b.blendFunc(b.SRC_ALPHA,b.ONE),b.blendEquation(b.FUNC_ADD)):"mult"===e.boostBlending?b.blendFunc(b.DST_COLOR,b.ZERO):"darken"===e.boostBlending?(b.blendFunc(b.ONE,b.ONE),b.blendEquation(b.FUNC_MIN)):b.blendFuncSeparate(b.SRC_ALPHA,b.ONE_MINUS_SRC_ALPHA,b.ONE,b.ONE_MINUS_SRC_ALPHA);k.reset();0<a.colorData.length&&(k.setUniform("hasColor",1),c=X(b,k),c.build(a.colorData,"aColor",4),c.bind());k.setColor(v);l(a.series.xAxis);g(a.series.yAxis);n(f,d);"points"===a.drawMode&&(e.marker&&e.marker.radius?
27
+ k.setPointSize(2*e.marker.radius):k.setPointSize(1));k.setSkipTranslation(a.skipTranslation);"bubble"===a.series.type&&k.setBubbleUniforms(a.series,a.zMin,a.zMax);k.setDrawAsCircle(ha[a.series.type]&&w||!1);t.render(a.from,a.to,a.drawMode);a.hasMarkers&&m&&(e.marker&&e.marker.radius?k.setPointSize(2*e.marker.radius):k.setPointSize(10),k.setDrawAsCircle(!0),t.render(a.from,a.to,"POINTS"))});t.destroy();q.timeRendering&&console.timeEnd("gl rendering");e();a&&a()}function y(a){d();if(a.renderer.forExport)return r(a);
28
+ L?r(a):setTimeout(function(){y(a)},1)}var k=!1,t=!1,b=!1,p=0,F=0,D=!1,z=!1,w=!1,x={},L=!1,u=[],M=U.createElement("canvas"),O=M.getContext("2d"),E,N={column:!0,area:!0},ha={scatter:!0,bubble:!0},q={pointSize:1,lineWidth:3,fillColor:"#AA00AA",useAlpha:!0,usePreallocated:!1,useGPUTranslations:!1,timeRendering:!1,timeSeriesProcessing:!1,timeSetup:!1};return x={allocateBufferForSingleSeries:function(a){var b=0;q.usePreallocated&&(B(a)&&(b=c(a)),t.allocate(b))},pushSeries:function(a){0<u.length&&(u[u.length-
29
+ 1].to=D.length,u[u.length-1].hasMarkers&&(u[u.length-1].markerTo=z.length));q.timeSeriesProcessing&&console.time("building "+a.type+" series");u.push({from:D.length,markerFrom:z.length,colorData:[],series:a,zMin:Number.MAX_VALUE,zMax:-Number.MAX_VALUE,hasMarkers:a.options.marker?!1!==a.options.marker.enabled:!1,showMarksers:!0,drawMode:{area:"lines",arearange:"lines",areaspline:"line_strip",column:"lines",line:"line_strip",scatter:"points",heatmap:"triangles",treemap:"triangles",bubble:"points"}[a.type]||
30
+ "line_strip"});f(a,u[u.length-1]);q.timeSeriesProcessing&&console.timeEnd("building "+a.type+" series")},setSize:function(a,b){if(p!==a||b!==b)p=a,F=b,k.bind(),k.setPMatrix([2/p,0,0,0,0,-(2/F),0,0,0,0,-2,0,-1,1,-1,1])},inited:function(){return L},setThreshold:n,init:function(a,c){var d=0,f=["webgl","experimental-webgl","moz-webgl","webkit-3d"];L=!1;if(!a)return!1;for(q.timeSetup&&console.time("gl setup");d<f.length&&!(b=a.getContext(f[d]));d++);if(b)c||e();else return!1;b.enable(b.BLEND);b.blendFunc(b.SRC_ALPHA,
31
+ b.ONE_MINUS_SRC_ALPHA);b.disable(b.DEPTH_TEST);b.depthMask(b.FALSE);k=A(b);t=X(b,k);w=!1;E=b.createTexture();M.width=512;M.height=512;O.fillStyle="#FFF";O.beginPath();O.arc(256,256,256,0,2*Math.PI);O.fill();try{b.bindTexture(b.TEXTURE_2D,E),b.texImage2D(b.TEXTURE_2D,0,b.RGBA,b.RGBA,b.UNSIGNED_BYTE,M),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_S,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_WRAP_T,b.CLAMP_TO_EDGE),b.texParameteri(b.TEXTURE_2D,b.TEXTURE_MAG_FILTER,b.LINEAR),b.texParameteri(b.TEXTURE_2D,
32
+ b.TEXTURE_MIN_FILTER,b.LINEAR_MIPMAP_LINEAR),b.generateMipmap(b.TEXTURE_2D),b.bindTexture(b.TEXTURE_2D,null),w=!0}catch(na){}L=!0;q.timeSetup&&console.timeEnd("gl setup");return!0},render:y,settings:q,valid:function(){return!1!==b},clear:d,flush:e,setXAxis:l,setYAxis:g,data:D,gl:function(){return b},allocateBuffer:function(a){var b=0;q.usePreallocated&&(C(a.series,function(a){B(a)&&(b+=c(a))}),t.allocate(b))},destroy:function(){t.destroy();k.destroy()},setOptions:function(a){ia(!0,q,a)}}}function aa(a,
33
+ c){var d=a.chartWidth,f=a.chartHeight,e=a,l=a.seriesGroup||c.group,g=function(a,e,d,f,h,b,l){a.call(c,d,e,f,h,b,l)},e=z(a)?a:c;e.image||(e.canvas=U.createElement("canvas"),e.image=a.renderer.image("",0,0,d,f).add(l),e.boostClipRect=a.renderer.clipRect(a.plotLeft,a.plotTop,a.plotWidth,a.chartHeight),e.image.clip(e.boostClipRect),e.inverted&&C(["moveTo","lineTo","rect","arc"],function(a){r(!1,a,g)}),e instanceof h.Chart&&(e.markerGroup=e.renderer.g().add(l),e.markerGroup.translate(c.xAxis.pos,c.yAxis.pos)));
34
+ e.canvas.width=d;e.canvas.height=f;e.image.attr({x:0,y:0,width:d,height:f,style:"pointer-events: none"});e.boostClipRect.attr({x:a.plotLeft,y:a.plotTop,width:a.plotWidth,height:a.chartHeight});e.ogl||(e.ogl=fa(function(){e.image.attr({href:e.canvas.toDataURL("image/png")})}),e.ogl.init(e.canvas),e.ogl.setOptions(a.options.boost||{}),e instanceof h.Chart&&e.ogl.allocateBuffer(a));e.ogl.setSize(d,f);return e.ogl}function ba(a,c,d){a&&c.image&&c.canvas&&!z(d||c.chart)&&a.render(d||c.chart)}function ca(a,
35
+ c){a&&c.image&&c.canvas&&!z(c.chart)&&a.allocateBufferForSingleSeries(c)}function S(a,c,d,f,e,h){e=e||0;f=f||5E4;for(var l=e+f,g=!0;g&&e<l&&e<a.length;)g=c(a[e],e),++e;g&&(e<a.length?h?S(a,c,d,f,e,h):T.requestAnimationFrame?T.requestAnimationFrame(function(){S(a,c,d,f,e)}):setTimeout(function(){S(a,c,d,f,e)}):d&&d())}function ja(a){if(!B(this))return a.call(this);if(a=aa(this.chart,this))ca(a,this),a.pushSeries(this);ba(a,this)}var T=h.win,U=T.document,ka=function(){},Z=h.Color,w=h.Series,g=h.seriesTypes,
36
+ C=h.each,da=h.extend,ea=h.addEvent,la=h.fireEvent,ma=h.grep,Q=h.isNumber,ia=h.merge,G=h.pick,r=h.wrap,V=h.getOptions().plotOptions,W;Z.prototype.names={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",
37
+ crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",feldspar:"#d19275",firebrick:"#b22222",
38
+ floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",
39
+ lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslateblue:"#8470ff",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",
40
+ mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",
41
+ sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",violetred:"#d02090",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};w.prototype.getPoint=function(a){var c=a,d=this.xData||this.options.xData||this.processedXData||
42
+ !1;!a||a instanceof this.pointClass||(c=(new this.pointClass).init(this,this.options.data[a.i],d?d[a.i]:void 0),c.category=c.x,c.dist=a.dist,c.distX=a.distX,c.plotX=a.plotX,c.plotY=a.plotY,c.index=a.i);return c};r(w.prototype,"searchPoint",function(a){return this.getPoint(a.apply(this,[].slice.call(arguments,1)))});r(w.prototype,"destroy",function(a){var c=this,d=c.chart;d.markerGroup===c.markerGroup&&(c.markerGroup=null);d.hoverPoints&&(d.hoverPoints=ma(d.hoverPoints,function(a){return a.series===
43
+ c}));d.hoverPoint&&d.hoverPoint.series===c&&(d.hoverPoint=null);a.call(this)});r(w.prototype,"getExtremes",function(a){if(!B(this)||!this.hasExtremes||!this.hasExtremes())return a.apply(this,Array.prototype.slice.call(arguments,1))});C("area arearange column line scatter heatmap bubble treemap heatmap".split(" "),function(a){V[a]&&(V[a].boostThreshold=5E3,V[a].boostData=[])});C(["translate","generatePoints","drawTracker","drawPoints","render"],function(a){function c(c){var d=this.options.stacking&&
44
+ ("translate"===a||"generatePoints"===a);if(!B(this)||d||"heatmap"===this.type||"treemap"===this.type)"render"===a&&this.image&&!z(this.chart)&&(this.image.attr({href:""}),this.animate=null),c.call(this);else if(this[a+"Canvas"])this[a+"Canvas"]()}r(w.prototype,a,c);"translate"===a&&(g.column&&r(g.column.prototype,a,c),g.arearange&&r(g.arearange.prototype,a,c),g.treemap&&r(g.treemap.prototype,a,c))});(function(){var a=0,c,d=["webgl","experimental-webgl","moz-webgl","webkit-3d"],f=!1;if("undefined"!==
45
+ typeof T.WebGLRenderingContext)for(c=U.createElement("canvas");a<d.length;a++)try{if(f=c.getContext(d[a]),"undefined"!==typeof f&&null!==f)return!0}catch(e){}return!1})()?(r(w.prototype,"processData",function(a){B(this)&&"heatmap"!==this.type&&"treemap"!==this.type||a.apply(this,Array.prototype.slice.call(arguments,1));this.hasExtremes&&this.hasExtremes(!0)||a.apply(this,Array.prototype.slice.call(arguments,1))}),h.extend(w.prototype,{pointRange:0,directTouch:!1,allowDG:!1,hasExtremes:function(a){var c=
46
+ this.options,d=this.xAxis&&this.xAxis.options,f=this.yAxis&&this.yAxis.options;return c.data.length>(c.boostThreshold||Number.MAX_VALUE)&&Q(f.min)&&Q(f.max)&&(!a||Q(d.min)&&Q(d.max))},destroyGraphics:function(){var a=this,c=this.points,d,f;if(c)for(f=0;f<c.length;f+=1)(d=c[f])&&d.graphic&&(d.graphic=d.graphic.destroy());C(["graph","area","tracker"],function(c){a[c]&&(a[c]=a[c].destroy())})},renderCanvas:function(){var a=this,c=a.options||{},d=!1,f=a.chart,e=this.xAxis,h=this.yAxis,g=c.xData||a.processedXData,
47
+ n=c.yData||a.processedYData,r=c.data,d=e.getExtremes(),y=d.min,k=d.max,d=h.getExtremes(),t=d.min,b=d.max,p={},w,D=!!a.sampling,A,B=!1!==c.enableMouseTracking,x=h.getThreshold(c.threshold),C=a.pointArrayMap&&"low,high"===a.pointArrayMap.join(","),u=!!c.stacking,M=a.cropStart||0,O=a.requireSorting,E=!g,N,G,q,v,m=function(a,b,c){W=a+","+b;B&&!p[W]&&(p[W]=!0,f.inverted&&(a=e.len-a,b=h.len-b),A.push({clientX:a,plotX:a,plotY:b,i:M+c}))},d=aa(f,a);this.visible?((this.points||this.graph)&&this.destroyGraphics(),
48
+ z(f)?this.markerGroup=f.markerGroup:this.markerGroup=a.plotGroup("markerGroup","markers",!0,1,f.seriesGroup),A=this.points=[],a.buildKDTree=ka,d&&(ca(d,this),d.pushSeries(a),ba(d,this,f)),S(u?a.data:g||r,function(a,c){var d,g,l,p="undefined"===typeof f.index,r=!0;if(!p&&(E?(d=a[0],g=a[1]):(d=a,g=n[c]),C?(E&&(g=a.slice(1,3)),l=g[0],g=g[1]):u&&(d=a.x,g=a.stackY,l=g-a.y),O||(r=g>=t&&g<=b),null!==g&&d>=y&&d<=k&&r))if(a=Math.ceil(e.toPixels(d,!0)),D){if(void 0===q||a===w){C||(l=g);if(void 0===v||g>G)G=
49
+ g,v=c;if(void 0===q||l<N)N=l,q=c}a!==w&&(void 0!==q&&(g=h.toPixels(G,!0),x=h.toPixels(N,!0),m(a,g,v),x!==g&&m(a,x,q)),q=v=void 0,w=a)}else g=Math.ceil(h.toPixels(g,!0)),m(a,g,c);return!p},function(){la(a,"renderedCanvas");a.directTouch=!1;a.options.stickyTracking=!0;delete a.buildKDTree;a.buildKDTree()},f.renderer.forExport?Number.MAX_VALUE:void 0)):!z(f)&&d&&(d.clear(),this.image.attr({href:""}))}}),C(["heatmap","treemap"],function(a){g[a]&&(r(g[a].prototype,"drawPoints",ja),g[a].prototype.directTouch=
50
+ !1)}),g.bubble&&(delete g.bubble.prototype.buildKDTree,g.bubble.prototype.directTouch=!1,r(g.bubble.prototype,"markerAttribs",function(a){return B(this)?!1:a.apply(this,[].slice.call(arguments,1))})),g.scatter.prototype.fill=!0,da(g.area.prototype,{fill:!0,fillOpacity:!0,sampling:!0}),da(g.column.prototype,{fill:!0,sampling:!0}),r(w.prototype,"setVisible",function(a,c){a.call(this,c,!1);!1===this.visible&&this.ogl&&this.canvas&&this.image?(this.ogl.clear(),this.image.attr({href:""})):this.chart.redraw()}),
51
+ h.Chart.prototype.callbacks.push(function(a){ea(a,"predraw",function(){a.canvas&&a.ogl&&z(a)&&a.ogl.allocateBuffer(a);a.markerGroup&&a.markerGroup.translate(a.xAxis[0].pos,a.yAxis[0].pos)});ea(a,"render",function(){a.ogl&&z(a)&&a.ogl.render(a)})})):"undefined"!==typeof h.initCanvasBoost?h.initCanvasBoost():h.error(26)})(A)});
@@ -0,0 +1,8 @@
1
+ {
2
+ "version":3,
3
+ "file":"",
4
+ "lineCount":51,
5
+ "mappings":"A;;;;;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,CAArB,GAAI,IAAAb,QAAJ,EAA8B,IAAA/M,IAA9B,EAA0C,IAAAxD,OAA1C,EAAyD,IAAAwC,MAAzD,EACI,IAAAgB,IAAAxN,MAAA,EACA,CAAA,IAAAwM,MAAAc,KAAA,CAAgB,CACZG,KAAM,EADM,CAAhB,CAFJ,EAMI,IAAAzW,MAAAqkB,OAAA,EARoD,CAA5D,CAeA;AAAAvkB,CAAAoW,MAAAvV,UAAA2jB,UAAAnc,KAAA,CAAiC,QAAQ,CAACnI,CAAD,CAAQ,CAyB7C2X,EAAA,CAAS3X,CAAT,CAAgB,SAAhB,CAfAukB,QAAkB,EAAG,CACbvkB,CAAAgT,OAAJ,EAAoBhT,CAAAwW,IAApB,EAAiCzW,CAAA,CAAsBC,CAAtB,CAAjC,EAEIA,CAAAwW,IAAA3B,eAAA,CAAyB7U,CAAzB,CAIAA,EAAAmW,YAAJ,EACInW,CAAAmW,YAAAE,UAAA,CACIrW,CAAAoK,MAAA,CAAY,CAAZ,CAAAmE,IADJ,CAEIvO,CAAAsK,MAAA,CAAY,CAAZ,CAAAiE,IAFJ,CARa,CAerB,CACAoJ,GAAA,CAAS3X,CAAT,CAAgB,QAAhB,CAvBAwkB,QAAoB,EAAG,CACfxkB,CAAAwW,IAAJ,EAAiBzW,CAAA,CAAsBC,CAAtB,CAAjB,EACIA,CAAAwW,IAAA7O,OAAA,CAAiB3H,CAAjB,CAFe,CAuBvB,CA1B6C,CAAjD,CA5VJ,EACqC,WAAjC,GAAI,MAAOF,EAAA2kB,gBAAX,CAEI3kB,CAAA2kB,gBAAA,EAFJ,CAII3kB,CAAA4kB,MAAA,CAAQ,EAAR,CA/uEC,CAAZ,CAAA,CAomFC7kB,CApmFD,CADkB,CANtB;",
6
+ "sources":["Input_0"],
7
+ "names":["factory","module","exports","Highcharts","H","isChartSeriesBoosting","chart","series","length","pick","options","boost","seriesThreshold","isSeriesBoosting","patientMax","args","Array","prototype","slice","call","arguments","r","Number","MAX_VALUE","each","t","processedXData","data","points","boostThreshold","GLShader","gl","stringToProgram","str","type","shader","createShader","VERTEX_SHADER","FRAGMENT_SHADER","shaderSource","compileShader","getShaderParameter","COMPILE_STATUS","uloc","n","getUniformLocation","shaderProgram","v","vertShade","f","fragShade","createProgram","attachShader","linkProgram","useProgram","bindAttribLocation","pUniform","psUniform","fillColorUniform","isBubbleUniform","bubbleSizeAbsUniform","bubbleSizeAreaUniform","uSamplerUniform","skipTranslationUniform","isCircleUniform","isInverted","setUniform","name","val","u","uLocations","uniform1f","setBubbleUniforms","zCalcMin","zCalcMax","seriesOptions","zMin","zMax","Math","min","max","displayNegative","zThreshold","uniform1i","sizeBy","sizeByAbsoluteValue","minPxSize","maxPxSize","bind","program","getProgram","create","setPMatrix","m","uniformMatrix4fv","setColor","color","uniform4f","setPointSize","p","setSkipTranslation","flag","setTexture","setDrawAsCircle","reset","setInverted","destroy","deleteProgram","GLVertexBuffer","dataComponents","buffer","vertAttribute","components","preAllocated","iterator","deleteBuffer","vertexAttribPointer","FLOAT","build","dataIn","attrib","createBuffer","bindBuffer","ARRAY_BUFFER","bufferData","Float32Array","STATIC_DRAW","getAttribLocation","enableVertexAttribArray","render","from","to","drawMode","drawArrays","toUpperCase","allocate","size","push","x","y","a","b","GLRenderer","postRenderCallback","seriesPointCount","isStacked","xData","s","stacking","asBar","clear","COLOR_BUFFER_BIT","DEPTH_BUFFER_BIT","pushSeriesData","inst","pushColor","colorData","vertice","checkTreshold","pointSize","settings","usePreallocated","vbuffer","pushRect","w","h","pushSupplementPoint","point","useGPUTranslations","skipTranslation","xAxis","toPixels","yAxis","isRange","pointArrayMap","join","rawData","xExtremes","getExtremes","xMin","xMax","yExtremes","yMin","yMax","yData","processedYData","zData","processedZData","useRaw","lastX","minVal","scolor","sdata","closestLeft","MIN_VALUE","closestRight","boostData","closestPointRangePx","node","levelDynamic","sort","plotY","pointAttr","undefined","isNaN","shapeArgs","colorAttribs","swidth","fill","rgba","stroke","width","height","d","i","z","px","nx","nextInside","prevInside","drawAsBar","isXInside","isYInside","index","stackY","requireSorting","pcolor","hasMarkers","abs","flush","markerData","setXAxis","axis","transA","minPixelPadding","pointRange","len","pos","horiz","setYAxis","setThreshold","has","translation","chartWidth","chartHeight","timeRendering","console","time","viewport","lineWidth","isMS","textureIsReady","bindTexture","TEXTURE_2D","circleTextureHandle","inverted","si","threshold","hasThreshold","isNumber","translatedThreshold","getThreshold","yBottom","showMarkers","marker","enabled","isRadial","radius","fillColor","fillOpacity","setOpacity","Color","get","colorByPoint","colors","useAlpha","boostBlending","blendFunc","SRC_ALPHA","ONE","blendEquation","FUNC_ADD","DST_COLOR","ZERO","FUNC_MIN","blendFuncSeparate","ONE_MINUS_SRC_ALPHA","cbuffer","asCircle","timeEnd","renderWhenReady","renderer","forExport","isInited","setTimeout","circleTexture","doc","createElement","circleCtx","getContext","timeSeriesProcessing","timeSetup","allocateBufferForSingleSeries","pushSeries","markerTo","markerFrom","showMarksers","setSize","inited","init","canvas","noFlush","contexts","enable","BLEND","disable","DEPTH_TEST","depthMask","FALSE","createTexture","fillStyle","beginPath","arc","PI","texImage2D","RGBA","UNSIGNED_BYTE","texParameteri","TEXTURE_WRAP_S","CLAMP_TO_EDGE","TEXTURE_WRAP_T","TEXTURE_MAG_FILTER","LINEAR","TEXTURE_MIN_FILTER","LINEAR_MIPMAP_LINEAR","generateMipmap","e","valid","getGL","allocateBuffer","setOptions","merge","createAndAttachRenderer","target","targetGroup","seriesGroup","group","swapXY","proceed","c","image","add","boostClipRect","clipRect","plotLeft","plotTop","plotWidth","clip","fn","wrap","Chart","markerGroup","g","translate","attr","style","ogl","href","toDataURL","renderIfNotSeriesBoosting","allocateIfNotSeriesBoosting","eachAsync","arr","finalFunc","chunkSize","noTimeout","CHUNK_SIZE","win","requestAnimationFrame","pointDrawHandler","document","noop","Series","seriesTypes","extend","addEvent","fireEvent","grep","plotOptions","getOptions","names","aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","feldspar","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgrey","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslateblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","violetred","wheat","white","whitesmoke","yellow","yellowgreen","getPoint","Series.prototype.getPoint","boostPoint","pointClass","category","dist","distX","plotX","apply","hoverPoints","hoverPoint","hasExtremes","method","branch","letItPass","animate","column","arearange","treemap","hasWebGLSupport","context","WebGLRenderingContext","directTouch","allowDG","checkX","destroyGraphics","graphic","prop","renderCanvas","pointTaken","lastClientX","sampling","enableMouseTracking","cropStart","maxVal","minI","maxI","addKDPoint","clientX","visible","graph","plotGroup","buildKDTree","processPoint","low","chartDestroyed","ceil","doneProcessing","stickyTracking","bubble","scatter","area","vis","redraw","callbacks","preRender","canvasToSVG","initCanvasBoost","error"]
8
+ }
@@ -1,591 +1,2679 @@
1
1
  /**
2
- * This is an experimental Highcharts module that draws long data series on a canvas
3
- * in order to increase performance of the initial load time and tooltip responsiveness.
4
- *
5
- * Compatible with HTML5 canvas compatible browsers (not IE < 9).
2
+ * @license Highcharts JS v5.0.11 (2017-05-04)
3
+ * Boost module
6
4
  *
5
+ * (c) 2010-2017 Highsoft AS
7
6
  * Author: Torstein Honsi
8
7
  *
9
- *
10
- * Development plan
11
- * - Column range.
12
- * - Heatmap.
13
- * - Treemap.
14
- * - Check how it works with Highstock and data grouping.
15
- * - Check inverted charts.
16
- * - Check reversed axes.
17
- * - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
18
- that with initial series animation).
19
- * - Cache full-size image so we don't have to redraw on hide/show and zoom up. But k-d-tree still
20
- * needs to be built.
21
- * - Test IE9 and IE10.
22
- * - Stacking is not perhaps not correct since it doesn't use the translation given in
23
- * the translate method. If this gets to complicated, a possible way out would be to
24
- * have a simplified renderCanvas method that simply draws the areaPath on a canvas.
25
- *
26
- * If this module is taken in as part of the core
27
- * - All the loading logic should be merged with core. Update styles in the core.
28
- * - Most of the method wraps should probably be added directly in parent methods.
29
- *
30
- * Notes for boost mode
31
- * - Area lines are not drawn
32
- * - Point markers are not drawn
33
- * - Zones and negativeColor don't work
34
- * - Columns are always one pixel wide. Don't set the threshold too low.
35
- *
36
- * Optimizing tips for users
37
- * - For scatter plots, use a marker.radius of 1 or less. It results in a rectangle being drawn, which is
38
- * considerably faster than a circle.
39
- * - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
40
- * - Set enableMouseTracking to false on the series to improve total rendering time.
41
- * - The default threshold is set based on one series. If you have multiple, dense series, the combined
42
- * number of points drawn gets higher, and you may want to set the threshold lower in order to
43
- * use optimizations.
8
+ * License: www.highcharts.com/license
44
9
  */
45
-
46
- /* eslint indent: [2, 4] */
47
- (function (factory) {
10
+ 'use strict';
11
+ (function(factory) {
48
12
  if (typeof module === 'object' && module.exports) {
49
13
  module.exports = factory;
50
14
  } else {
51
15
  factory(Highcharts);
52
16
  }
53
- }(function (H) {
54
-
55
- 'use strict';
56
-
57
- var noop = function () {},
58
- Color = H.Color,
59
- Series = H.Series,
60
- seriesTypes = H.seriesTypes,
61
- each = H.each,
62
- extend = H.extend,
63
- addEvent = H.addEvent,
64
- fireEvent = H.fireEvent,
65
- merge = H.merge,
66
- pick = H.pick,
67
- wrap = H.wrap,
68
- plotOptions = H.getOptions().plotOptions,
69
- CHUNK_SIZE = 50000;
70
-
71
- function eachAsync(arr, fn, finalFunc, chunkSize, i) {
72
- i = i || 0;
73
- chunkSize = chunkSize || CHUNK_SIZE;
74
- each(arr.slice(i, i + chunkSize), fn);
75
- if (i + chunkSize < arr.length) {
76
- setTimeout(function () {
77
- eachAsync(arr, fn, finalFunc, chunkSize, i + chunkSize);
78
- });
79
- } else if (finalFunc) {
80
- finalFunc();
17
+ }(function(Highcharts) {
18
+ (function(H) {
19
+ /**
20
+ * License: www.highcharts.com/license
21
+ * Author: Christer Vasseng, Torstein Honsi
22
+ *
23
+ * This is an experimental Highcharts module that draws long data series on a canvas
24
+ * in order to increase performance of the initial load time and tooltip responsiveness.
25
+ *
26
+ * Compatible with WebGL compatible browsers (not IE < 11).
27
+ *
28
+ * Development plan
29
+ * - Column range.
30
+ * - Check how it works with Highstock and data grouping. Currently it only works when navigator.adaptToUpdatedData
31
+ * is false. It is also recommended to set scrollbar.liveRedraw to false.
32
+ * - Check inverted charts.
33
+ * - Chart callback should be async after last series is drawn. (But not necessarily, we don't do
34
+ that with initial series animation).
35
+ *
36
+ * If this module is taken in as part of the core
37
+ * - All the loading logic should be merged with core. Update styles in the core.
38
+ * - Most of the method wraps should probably be added directly in parent methods.
39
+ *
40
+ * Notes for boost mode
41
+ * - Area lines are not drawn
42
+ * - Lines are not drawn on scatter charts
43
+ * - Zones and negativeColor don't work
44
+ * - Columns are always one pixel wide. Don't set the threshold too low.
45
+ * - Disable animations
46
+ * - Marker shapes are not supported: markers will always be circles
47
+ *
48
+ * Optimizing tips for users
49
+ * - Set extremes (min, max) explicitly on the axes in order for Highcharts to avoid computing extremes.
50
+ * - Set enableMouseTracking to false on the series to improve total rendering time.
51
+ * - The default threshold is set based on one series. If you have multiple, dense series, the combined
52
+ * number of points drawn gets higher, and you may want to set the threshold lower in order to
53
+ * use optimizations.
54
+ * - If drawing large scatter charts, it's beneficial to set the marker radius to a value
55
+ * less than 1. This is to add additional spacing to make the chart more readable.
56
+ * - If the value increments on both the X and Y axis aren't small, consider setting
57
+ * useGPUTranslations to true on the boost settings object. If you do this and
58
+ * the increments are small (e.g. datetime axis with small time increments)
59
+ * it may cause rendering issues due to floating point rounding errors,
60
+ * so your millage may vary.
61
+ *
62
+ * Settings
63
+ * There are two ways of setting the boost threshold:
64
+ * - Per. series: boost based on number of points in individual series
65
+ * - Per. chart: boost based on the number of series
66
+ *
67
+ * To set the series boost threshold, set seriesBoostThreshold on the chart object.
68
+ * To set the series-specific threshold, set boostThreshold on the series object.
69
+ *
70
+ * In addition, the following can be set in the boost object:
71
+ * {
72
+ * //Wether or not to use alpha blending
73
+ * useAlpha: boolean - default: true
74
+ * //Set to true to perform translations on the GPU.
75
+ * //Much faster, but may cause rendering issues
76
+ * //when using values far from 0 due to floating point
77
+ * //rounding issues
78
+ * useGPUTranslations: boolean - default: false
79
+ * //Use pre-allocated buffers, much faster,
80
+ * //but may cause rendering issues with some data sets
81
+ * usePreallocated: boolean - default: false
82
+ * //Output rendering time in console
83
+ * timeRendering: boolean - default: false
84
+ * //Output processing time in console
85
+ * timeSeriesProcessing: boolean - default: false
86
+ * //Output setup time in console
87
+ * timeSetup: boolean - default: false
88
+ * }
89
+ */
90
+
91
+ /**
92
+ * Set the series threshold for when the boost should kick in globally.
93
+ *
94
+ * Setting to e.g. 20 will cause the whole chart to enter boost mode
95
+ * if there are 20 or more series active. When the chart is in boost mode,
96
+ * every series in it will be rendered to a common canvas. This offers
97
+ * a significant speed improvment in charts with a very high
98
+ * amount of series.
99
+ *
100
+ * Note: only available when including the boost module.
101
+ *
102
+ * @default null
103
+ * @apioption boost.seriesThreshold
104
+ */
105
+
106
+ /**
107
+ * Set the point threshold for when a series should enter boost mode.
108
+ *
109
+ * Setting it to e.g. 2000 will cause the series to enter boost mode
110
+ * when there are 2000 or more points in the series.
111
+ *
112
+ * Note: only available when including the boost module.
113
+ *
114
+ * @default 5000
115
+ * @apioption series.boostThreshold
116
+ */
117
+
118
+ /* global Float32Array */
119
+
120
+
121
+ var win = H.win,
122
+ doc = win.document,
123
+ noop = function() {},
124
+ Color = H.Color,
125
+ Series = H.Series,
126
+ seriesTypes = H.seriesTypes,
127
+ each = H.each,
128
+ extend = H.extend,
129
+ addEvent = H.addEvent,
130
+ fireEvent = H.fireEvent,
131
+ grep = H.grep,
132
+ isNumber = H.isNumber,
133
+ merge = H.merge,
134
+ pick = H.pick,
135
+ wrap = H.wrap,
136
+ plotOptions = H.getOptions().plotOptions,
137
+ CHUNK_SIZE = 50000,
138
+ index;
139
+
140
+ // Register color names since GL can't render those directly.
141
+ Color.prototype.names = {
142
+ aliceblue: '#f0f8ff',
143
+ antiquewhite: '#faebd7',
144
+ aqua: '#00ffff',
145
+ aquamarine: '#7fffd4',
146
+ azure: '#f0ffff',
147
+ beige: '#f5f5dc',
148
+ bisque: '#ffe4c4',
149
+ black: '#000000',
150
+ blanchedalmond: '#ffebcd',
151
+ blue: '#0000ff',
152
+ blueviolet: '#8a2be2',
153
+ brown: '#a52a2a',
154
+ burlywood: '#deb887',
155
+ cadetblue: '#5f9ea0',
156
+ chartreuse: '#7fff00',
157
+ chocolate: '#d2691e',
158
+ coral: '#ff7f50',
159
+ cornflowerblue: '#6495ed',
160
+ cornsilk: '#fff8dc',
161
+ crimson: '#dc143c',
162
+ cyan: '#00ffff',
163
+ darkblue: '#00008b',
164
+ darkcyan: '#008b8b',
165
+ darkgoldenrod: '#b8860b',
166
+ darkgray: '#a9a9a9',
167
+ darkgreen: '#006400',
168
+ darkkhaki: '#bdb76b',
169
+ darkmagenta: '#8b008b',
170
+ darkolivegreen: '#556b2f',
171
+ darkorange: '#ff8c00',
172
+ darkorchid: '#9932cc',
173
+ darkred: '#8b0000',
174
+ darksalmon: '#e9967a',
175
+ darkseagreen: '#8fbc8f',
176
+ darkslateblue: '#483d8b',
177
+ darkslategray: '#2f4f4f',
178
+ darkturquoise: '#00ced1',
179
+ darkviolet: '#9400d3',
180
+ deeppink: '#ff1493',
181
+ deepskyblue: '#00bfff',
182
+ dimgray: '#696969',
183
+ dodgerblue: '#1e90ff',
184
+ feldspar: '#d19275',
185
+ firebrick: '#b22222',
186
+ floralwhite: '#fffaf0',
187
+ forestgreen: '#228b22',
188
+ fuchsia: '#ff00ff',
189
+ gainsboro: '#dcdcdc',
190
+ ghostwhite: '#f8f8ff',
191
+ gold: '#ffd700',
192
+ goldenrod: '#daa520',
193
+ gray: '#808080',
194
+ green: '#008000',
195
+ greenyellow: '#adff2f',
196
+ honeydew: '#f0fff0',
197
+ hotpink: '#ff69b4',
198
+ indianred: '#cd5c5c',
199
+ indigo: '#4b0082',
200
+ ivory: '#fffff0',
201
+ khaki: '#f0e68c',
202
+ lavender: '#e6e6fa',
203
+ lavenderblush: '#fff0f5',
204
+ lawngreen: '#7cfc00',
205
+ lemonchiffon: '#fffacd',
206
+ lightblue: '#add8e6',
207
+ lightcoral: '#f08080',
208
+ lightcyan: '#e0ffff',
209
+ lightgoldenrodyellow: '#fafad2',
210
+ lightgrey: '#d3d3d3',
211
+ lightgreen: '#90ee90',
212
+ lightpink: '#ffb6c1',
213
+ lightsalmon: '#ffa07a',
214
+ lightseagreen: '#20b2aa',
215
+ lightskyblue: '#87cefa',
216
+ lightslateblue: '#8470ff',
217
+ lightslategray: '#778899',
218
+ lightsteelblue: '#b0c4de',
219
+ lightyellow: '#ffffe0',
220
+ lime: '#00ff00',
221
+ limegreen: '#32cd32',
222
+ linen: '#faf0e6',
223
+ magenta: '#ff00ff',
224
+ maroon: '#800000',
225
+ mediumaquamarine: '#66cdaa',
226
+ mediumblue: '#0000cd',
227
+ mediumorchid: '#ba55d3',
228
+ mediumpurple: '#9370d8',
229
+ mediumseagreen: '#3cb371',
230
+ mediumslateblue: '#7b68ee',
231
+ mediumspringgreen: '#00fa9a',
232
+ mediumturquoise: '#48d1cc',
233
+ mediumvioletred: '#c71585',
234
+ midnightblue: '#191970',
235
+ mintcream: '#f5fffa',
236
+ mistyrose: '#ffe4e1',
237
+ moccasin: '#ffe4b5',
238
+ navajowhite: '#ffdead',
239
+ navy: '#000080',
240
+ oldlace: '#fdf5e6',
241
+ olive: '#808000',
242
+ olivedrab: '#6b8e23',
243
+ orange: '#ffa500',
244
+ orangered: '#ff4500',
245
+ orchid: '#da70d6',
246
+ palegoldenrod: '#eee8aa',
247
+ palegreen: '#98fb98',
248
+ paleturquoise: '#afeeee',
249
+ palevioletred: '#d87093',
250
+ papayawhip: '#ffefd5',
251
+ peachpuff: '#ffdab9',
252
+ peru: '#cd853f',
253
+ pink: '#ffc0cb',
254
+ plum: '#dda0dd',
255
+ powderblue: '#b0e0e6',
256
+ purple: '#800080',
257
+ red: '#ff0000',
258
+ rosybrown: '#bc8f8f',
259
+ royalblue: '#4169e1',
260
+ saddlebrown: '#8b4513',
261
+ salmon: '#fa8072',
262
+ sandybrown: '#f4a460',
263
+ seagreen: '#2e8b57',
264
+ seashell: '#fff5ee',
265
+ sienna: '#a0522d',
266
+ silver: '#c0c0c0',
267
+ skyblue: '#87ceeb',
268
+ slateblue: '#6a5acd',
269
+ slategray: '#708090',
270
+ snow: '#fffafa',
271
+ springgreen: '#00ff7f',
272
+ steelblue: '#4682b4',
273
+ tan: '#d2b48c',
274
+ teal: '#008080',
275
+ thistle: '#d8bfd8',
276
+ tomato: '#ff6347',
277
+ turquoise: '#40e0d0',
278
+ violet: '#ee82ee',
279
+ violetred: '#d02090',
280
+ wheat: '#f5deb3',
281
+ white: '#ffffff',
282
+ whitesmoke: '#f5f5f5',
283
+ yellow: '#ffff00',
284
+ yellowgreen: '#9acd32'
285
+ };
286
+
287
+
288
+ /*
289
+ * Returns true if the chart is in series boost mode
290
+ * @param chart {Highchart.Chart} - the chart to check
291
+ * @returns {Boolean} - true if the chart is in series boost mode
292
+ */
293
+ function isChartSeriesBoosting(chart) {
294
+ return chart.series.length >= pick(
295
+ chart.options.boost && chart.options.boost.seriesThreshold, // docs
296
+ 10
297
+ );
81
298
  }
82
- }
83
299
 
84
- // Set default options
85
- each(['area', 'arearange', 'column', 'line', 'scatter'], function (type) {
86
- if (plotOptions[type]) {
87
- plotOptions[type].boostThreshold = 5000;
300
+ /*
301
+ * Returns true if the series is in boost mode
302
+ * @param series {Highchart.Series} - the series to check
303
+ * @returns {boolean} - true if the series is in boost mode
304
+ */
305
+ function isSeriesBoosting(series) {
306
+ function patientMax() {
307
+ var args = Array.prototype.slice.call(arguments),
308
+ r = -Number.MAX_VALUE;
309
+
310
+ each(args, function(t) {
311
+ if (typeof t !== 'undefined' && typeof t.length !== 'undefined') {
312
+ //r = r < t.length ? t.length : r;
313
+ if (t.length > 0) {
314
+ r = t.length;
315
+ return true;
316
+ }
317
+ }
318
+ });
319
+
320
+ return r;
321
+ }
322
+
323
+ return isChartSeriesBoosting(series.chart) ||
324
+ patientMax(
325
+ series.processedXData,
326
+ series.options.data,
327
+ series.points
328
+ ) >= (series.options.boostThreshold || Number.MAX_VALUE);
88
329
  }
89
- });
90
330
 
91
- /**
92
- * Override a bunch of methods the same way. If the number of points is below the threshold,
93
- * run the original method. If not, check for a canvas version or do nothing.
94
- */
95
- each(['translate', 'generatePoints', 'drawTracker', 'drawPoints', 'render'], function (method) {
96
- function branch(proceed) {
97
- var letItPass = this.options.stacking && (method === 'translate' || method === 'generatePoints');
98
- if ((this.processedXData || this.options.data).length < (this.options.boostThreshold || Number.MAX_VALUE) ||
99
- letItPass) {
331
+ ////////////////////////////////////////////////////////////////////////////////
332
+ // START OF WEBGL ABSTRACTIONS
333
+
334
+ /*
335
+ * A static shader mimicing axis translation functions found in parts/Axis
336
+ * @param gl {WebGLContext} - the context in which the shader is active
337
+ */
338
+ function GLShader(gl) {
339
+ var vertShade = [
340
+ /* eslint-disable */
341
+ '#version 100',
342
+ 'precision highp float;',
343
+
344
+ 'attribute vec4 aVertexPosition;',
345
+ 'attribute vec4 aColor;',
346
+
347
+ 'varying highp vec2 position;',
348
+ 'varying highp vec4 vColor;',
349
+
350
+ 'uniform mat4 uPMatrix;',
351
+ 'uniform float pSize;',
352
+
353
+ 'uniform float translatedThreshold;',
354
+ 'uniform bool hasThreshold;',
355
+
356
+ 'uniform bool skipTranslation;',
357
+
358
+ 'uniform float xAxisTrans;',
359
+ 'uniform float xAxisMin;',
360
+ 'uniform float xAxisMinPad;',
361
+ 'uniform float xAxisPointRange;',
362
+ 'uniform float xAxisLen;',
363
+ 'uniform bool xAxisPostTranslate;',
364
+ 'uniform float xAxisOrdinalSlope;',
365
+ 'uniform float xAxisOrdinalOffset;',
366
+ 'uniform float xAxisPos;',
367
+ 'uniform bool xAxisCVSCoord;',
368
+
369
+ 'uniform float yAxisTrans;',
370
+ 'uniform float yAxisMin;',
371
+ 'uniform float yAxisMinPad;',
372
+ 'uniform float yAxisPointRange;',
373
+ 'uniform float yAxisLen;',
374
+ 'uniform bool yAxisPostTranslate;',
375
+ 'uniform float yAxisOrdinalSlope;',
376
+ 'uniform float yAxisOrdinalOffset;',
377
+ 'uniform float yAxisPos;',
378
+ 'uniform bool yAxisCVSCoord;',
379
+
380
+ 'uniform bool isBubble;',
381
+ 'uniform bool bubbleSizeByArea;',
382
+ 'uniform float bubbleZMin;',
383
+ 'uniform float bubbleZMax;',
384
+ 'uniform float bubbleZThreshold;',
385
+ 'uniform float bubbleMinSize;',
386
+ 'uniform float bubbleMaxSize;',
387
+ 'uniform bool bubbleSizeAbs;',
388
+ 'uniform bool isInverted;',
389
+
390
+ 'float bubbleRadius(){',
391
+ 'float value = aVertexPosition.w;',
392
+ 'float zMax = bubbleZMax;',
393
+ 'float zMin = bubbleZMin;',
394
+ 'float radius = 0.0;',
395
+ 'float pos = 0.0;',
396
+ 'float zRange = zMax - zMin;',
397
+
398
+ 'if (bubbleSizeAbs){',
399
+ 'value = value - bubbleZThreshold;',
400
+ 'zMax = max(zMax - bubbleZThreshold, zMin - bubbleZThreshold);',
401
+ 'zMin = 0.0;',
402
+ '}',
403
+
404
+ 'if (value < zMin){',
405
+ 'radius = bubbleZMin / 2.0 - 1.0;',
406
+ '} else {',
407
+ 'pos = zRange > 0.0 ? (value - zMin) / zRange : 0.5;',
408
+ 'if (bubbleSizeByArea && pos > 0.0){',
409
+ 'pos = sqrt(pos);',
410
+ '}',
411
+ 'radius = ceil(bubbleMinSize + pos * (bubbleMaxSize - bubbleMinSize)) / 2.0;',
412
+ '}',
413
+
414
+ 'return radius * 2.0;',
415
+ '}',
416
+
417
+ 'float translate(float val,',
418
+ 'float pointPlacement,',
419
+ 'float localA,',
420
+ 'float localMin,',
421
+ 'float minPixelPadding,',
422
+ 'float pointRange,',
423
+ 'float len,',
424
+ 'bool cvsCoord',
425
+ '){',
426
+
427
+ 'float sign = 1.0;',
428
+ 'float cvsOffset = 0.0;',
429
+
430
+ 'if (cvsCoord) {',
431
+ 'sign *= -1.0;',
432
+ 'cvsOffset = len;',
433
+ '}',
434
+
435
+ 'return sign * (val - localMin) * localA + cvsOffset + ',
436
+ '(sign * minPixelPadding);', //' + localA * pointPlacement * pointRange;',
437
+ '}',
438
+
439
+ 'float xToPixels(float value){',
440
+ 'if (skipTranslation){',
441
+ 'return value;// + xAxisPos;',
442
+ '}',
443
+
444
+ 'return translate(value, 0.0, xAxisTrans, xAxisMin, xAxisMinPad, xAxisPointRange, xAxisLen, xAxisCVSCoord);// + xAxisPos;',
445
+ '}',
446
+
447
+ 'float yToPixels(float value, float checkTreshold){',
448
+ 'float v;',
449
+ 'if (skipTranslation){',
450
+ 'v = value;// + yAxisPos;',
451
+ '} else {',
452
+ 'v = translate(value, 0.0, yAxisTrans, yAxisMin, yAxisMinPad, yAxisPointRange, yAxisLen, yAxisCVSCoord);// + yAxisPos;',
453
+ '}',
454
+ 'if (checkTreshold > 0.0 && hasThreshold) {',
455
+ 'v = min(v, translatedThreshold);',
456
+ '}',
457
+ 'return v;',
458
+ '}',
459
+
460
+ 'void main(void) {',
461
+ 'if (isBubble){',
462
+ 'gl_PointSize = bubbleRadius();',
463
+ '} else {',
464
+ 'gl_PointSize = pSize;',
465
+ '}',
466
+ //'gl_PointSize = 10.0;',
467
+ 'vColor = aColor;',
468
+
469
+ 'if (isInverted) {',
470
+ 'gl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.y) + yAxisPos, yToPixels(aVertexPosition.x, aVertexPosition.z) + xAxisPos, 0.0, 1.0);',
471
+ '} else {',
472
+ 'gl_Position = uPMatrix * vec4(xToPixels(aVertexPosition.x) + xAxisPos, yToPixels(aVertexPosition.y, aVertexPosition.z) + yAxisPos, 0.0, 1.0);',
473
+ '}',
474
+ //'gl_Position = uPMatrix * vec4(aVertexPosition.x, aVertexPosition.y, 0.0, 1.0);',
475
+ '}'
476
+ /* eslint-enable */
477
+ ].join('\n'),
478
+ //Fragment shader source
479
+ fragShade = [
480
+ /* eslint-disable */
481
+ 'precision highp float;',
482
+ 'uniform vec4 fillColor;',
483
+ 'varying highp vec2 position;',
484
+ 'varying highp vec4 vColor;',
485
+ 'uniform sampler2D uSampler;',
486
+ 'uniform bool isCircle;',
487
+ 'uniform bool hasColor;',
488
+
489
+ // 'vec4 toColor(float value, vec2 point) {',
490
+ // 'return vec4(0.0, 0.0, 0.0, 0.0);',
491
+ // '}',
492
+
493
+ 'void main(void) {',
494
+ 'vec4 col = fillColor;',
495
+
496
+ 'if (hasColor) {',
497
+ 'col = vColor;',
498
+ '}',
499
+
500
+ 'if (isCircle) {',
501
+ 'gl_FragColor = col * texture2D(uSampler, gl_PointCoord.st);',
502
+ '} else {',
503
+ 'gl_FragColor = col;',
504
+ '}',
505
+ '}'
506
+ /* eslint-enable */
507
+ ].join('\n'),
508
+ uLocations = {},
509
+ //The shader program
510
+ shaderProgram,
511
+ //Uniform handle to the perspective matrix
512
+ pUniform,
513
+ //Uniform for point size
514
+ psUniform,
515
+ //Uniform for fill color
516
+ fillColorUniform,
517
+ //Uniform for isBubble
518
+ isBubbleUniform,
519
+ //Uniform for bubble abs sizing
520
+ bubbleSizeAbsUniform,
521
+ bubbleSizeAreaUniform,
522
+ //Skip translation uniform
523
+ skipTranslationUniform,
524
+ //Set to 1 if circle
525
+ isCircleUniform,
526
+ //Uniform for invertion
527
+ isInverted,
528
+ //Texture uniform
529
+ uSamplerUniform;
530
+
531
+ /* String to shader program
532
+ * @param {string} str - the program source
533
+ * @param {string} type - the program type: either `vertex` or `fragment`
534
+ * @returns {bool|shader}
535
+ */
536
+ function stringToProgram(str, type) {
537
+ var t = type === 'vertex' ? gl.VERTEX_SHADER : gl.FRAGMENT_SHADER,
538
+ shader = gl.createShader(t);
539
+
540
+ gl.shaderSource(shader, str);
541
+ gl.compileShader(shader);
542
+
543
+ if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {
544
+ //console.error('shader error:', gl.getShaderInfoLog(shader));
545
+ return false;
546
+ }
547
+ return shader;
548
+ }
549
+
550
+ /*
551
+ * Create the shader.
552
+ * Loads the shader program statically defined above
553
+ */
554
+ function createShader() {
555
+ var v = stringToProgram(vertShade, 'vertex'),
556
+ f = stringToProgram(fragShade, 'fragment');
557
+
558
+ if (!v || !f) {
559
+ shaderProgram = false;
560
+ //console.error('error creating shader program');
561
+ return false;
562
+ }
100
563
 
101
- // Clear image
102
- if (method === 'render' && this.image) {
103
- this.image.attr({ href: '' });
104
- this.animate = null; // We're zooming in, don't run animation
564
+ function uloc(n) {
565
+ return gl.getUniformLocation(shaderProgram, n);
105
566
  }
106
567
 
107
- proceed.call(this);
568
+ shaderProgram = gl.createProgram();
569
+
570
+ gl.attachShader(shaderProgram, v);
571
+ gl.attachShader(shaderProgram, f);
572
+ gl.linkProgram(shaderProgram);
108
573
 
109
- // If a canvas version of the method exists, like renderCanvas(), run
110
- } else if (this[method + 'Canvas']) {
574
+ gl.useProgram(shaderProgram);
111
575
 
112
- this[method + 'Canvas']();
576
+ gl.bindAttribLocation(shaderProgram, 0, 'aVertexPosition');
577
+
578
+ pUniform = uloc('uPMatrix');
579
+ psUniform = uloc('pSize');
580
+ fillColorUniform = uloc('fillColor');
581
+ isBubbleUniform = uloc('isBubble');
582
+ bubbleSizeAbsUniform = uloc('bubbleSizeAbs');
583
+ bubbleSizeAreaUniform = uloc('bubbleSizeByArea');
584
+ uSamplerUniform = uloc('uSampler');
585
+ skipTranslationUniform = uloc('skipTranslation');
586
+ isCircleUniform = uloc('isCircle');
587
+ isInverted = uloc('isInverted');
588
+
589
+ return true;
113
590
  }
114
- }
115
- wrap(Series.prototype, method, branch);
116
591
 
117
- // A special case for some types - its translate method is already wrapped
118
- if (method === 'translate') {
119
- if (seriesTypes.column) {
120
- wrap(seriesTypes.column.prototype, method, branch);
592
+ /*
593
+ * Destroy the shader
594
+ */
595
+ function destroy() {
596
+ if (gl && shaderProgram) {
597
+ gl.deleteProgram(shaderProgram);
598
+ }
121
599
  }
122
- if (seriesTypes.arearange) {
123
- wrap(seriesTypes.arearange.prototype, method, branch);
600
+
601
+ /*
602
+ * Bind the shader.
603
+ * This makes the shader the active one until another one is bound,
604
+ * or until 0 is bound.
605
+ */
606
+ function bind() {
607
+ gl.useProgram(shaderProgram);
124
608
  }
125
- }
126
- });
127
-
128
- /**
129
- * Do not compute extremes when min and max are set.
130
- * If we use this in the core, we can add the hook to hasExtremes to the methods directly.
131
- */
132
- wrap(Series.prototype, 'getExtremes', function (proceed) {
133
- if (!this.hasExtremes()) {
134
- proceed.apply(this, Array.prototype.slice.call(arguments, 1));
135
- }
136
- });
137
- wrap(Series.prototype, 'setData', function (proceed) {
138
- if (!this.hasExtremes(true)) {
139
- proceed.apply(this, Array.prototype.slice.call(arguments, 1));
140
- }
141
- });
142
- wrap(Series.prototype, 'processData', function (proceed) {
143
- if (!this.hasExtremes(true)) {
144
- proceed.apply(this, Array.prototype.slice.call(arguments, 1));
145
- }
146
- });
147
609
 
610
+ /*
611
+ * Set a uniform value.
612
+ * This uses a hash map to cache uniform locations.
613
+ * @param name {string} - the name of the uniform to set
614
+ * @param val {float} - the value to set
615
+ */
616
+ function setUniform(name, val) {
617
+ var u = uLocations[name] = uLocations[name] ||
618
+ gl.getUniformLocation(shaderProgram, name);
619
+ gl.uniform1f(u, val);
620
+ }
148
621
 
149
- H.extend(Series.prototype, {
150
- pointRange: 0,
622
+ /*
623
+ * Set the active texture
624
+ * @param texture - the texture
625
+ */
626
+ function setTexture() {
627
+ gl.uniform1i(uSamplerUniform, 0);
628
+ }
151
629
 
152
- hasExtremes: function (checkX) {
153
- var options = this.options,
154
- data = options.data,
155
- xAxis = this.xAxis && this.xAxis.options,
156
- yAxis = this.yAxis && this.yAxis.options;
157
- return data.length > (options.boostThreshold || Number.MAX_VALUE) && typeof yAxis.min === 'number' && typeof yAxis.max === 'number' &&
158
- (!checkX || (typeof xAxis.min === 'number' && typeof xAxis.max === 'number'));
159
- },
630
+ /*
631
+ * Set if inversion state
632
+ * @flag is the state
633
+ */
634
+ function setInverted(flag) {
635
+ gl.uniform1i(isInverted, flag);
636
+ }
160
637
 
161
- /**
162
- * If implemented in the core, parts of this can probably be shared with other similar
163
- * methods in Highcharts.
164
- */
165
- destroyGraphics: function () {
166
- var series = this,
167
- points = this.points,
168
- point,
169
- i;
638
+ ////////////////////////////////////////////////////////////////////////////
170
639
 
171
- if (points) {
172
- for (i = 0; i < points.length; i = i + 1) {
173
- point = points[i];
174
- if (point && point.graphic) {
175
- point.graphic = point.graphic.destroy();
176
- }
177
- }
640
+ /*
641
+ * Enable/disable circle drawing
642
+ */
643
+ function setDrawAsCircle(flag) {
644
+ gl.uniform1i(isCircleUniform, flag ? 1 : 0);
645
+ }
646
+
647
+ /*
648
+ * Flush
649
+ */
650
+ function reset() {
651
+ gl.uniform1i(isBubbleUniform, 0);
652
+ gl.uniform1i(isCircleUniform, 0);
178
653
  }
179
654
 
180
- each(['graph', 'area', 'tracker'], function (prop) {
181
- if (series[prop]) {
182
- series[prop] = series[prop].destroy();
655
+ /*
656
+ * Set bubble uniforms
657
+ * @param series {Highcharts.Series} - the series to use
658
+ */
659
+ function setBubbleUniforms(series, zCalcMin, zCalcMax) {
660
+ var seriesOptions = series.options,
661
+ zMin = Number.MAX_VALUE,
662
+ zMax = -Number.MAX_VALUE;
663
+
664
+ if (series.type === 'bubble') {
665
+ zMin = pick(seriesOptions.zMin, Math.min(
666
+ zMin,
667
+ Math.max(
668
+ zCalcMin,
669
+ seriesOptions.displayNegative === false ?
670
+ seriesOptions.zThreshold : -Number.MAX_VALUE
671
+ )
672
+ ));
673
+
674
+ zMax = pick(seriesOptions.zMax, Math.max(zMax, zCalcMax));
675
+
676
+ gl.uniform1i(isBubbleUniform, 1);
677
+ gl.uniform1i(isCircleUniform, 1);
678
+ gl.uniform1i(bubbleSizeAreaUniform, series.options.sizeBy !== 'width');
679
+ gl.uniform1i(bubbleSizeAbsUniform, series.options.sizeByAbsoluteValue);
680
+
681
+ setUniform('bubbleZMin', zMin);
682
+ setUniform('bubbleZMax', zMax);
683
+ setUniform('bubbleZThreshold', series.options.zThreshold);
684
+ setUniform('bubbleMinSize', series.minPxSize);
685
+ setUniform('bubbleMaxSize', series.maxPxSize);
183
686
  }
184
- });
185
- },
687
+ }
186
688
 
187
- /**
188
- * Create a hidden canvas to draw the graph on. The contents is later copied over
189
- * to an SVG image element.
689
+ /*
690
+ * Set the Color uniform.
691
+ * @param color {Array<float>} - an array with RGBA values
692
+ */
693
+ function setColor(color) {
694
+ gl.uniform4f(
695
+ fillColorUniform,
696
+ color[0] / 255.0,
697
+ color[1] / 255.0,
698
+ color[2] / 255.0,
699
+ color[3]
700
+ );
701
+ }
702
+
703
+ /*
704
+ * Set skip translation
705
+ */
706
+ function setSkipTranslation(flag) {
707
+ gl.uniform1i(skipTranslationUniform, flag === true ? 1 : 0);
708
+ }
709
+
710
+ /*
711
+ * Set the perspective matrix
712
+ * @param m {Matrix4x4} - the matrix
713
+ */
714
+ function setPMatrix(m) {
715
+ gl.uniformMatrix4fv(pUniform, false, m);
716
+ }
717
+
718
+ /*
719
+ * Set the point size.
720
+ * @param p {float} - point size
721
+ */
722
+ function setPointSize(p) {
723
+ gl.uniform1f(psUniform, p);
724
+ }
725
+
726
+ /*
727
+ * Get the shader program handle
728
+ * @returns {GLInt} - the handle for the program
729
+ */
730
+ function getProgram() {
731
+ return shaderProgram;
732
+ }
733
+
734
+ if (gl) {
735
+ createShader();
736
+ }
737
+
738
+ return {
739
+ psUniform: function() {
740
+ return psUniform;
741
+ },
742
+ pUniform: function() {
743
+ return pUniform;
744
+ },
745
+ fillColorUniform: function() {
746
+ return fillColorUniform;
747
+ },
748
+ setBubbleUniforms: setBubbleUniforms,
749
+ bind: bind,
750
+ program: getProgram,
751
+ create: createShader,
752
+ setUniform: setUniform,
753
+ setPMatrix: setPMatrix,
754
+ setColor: setColor,
755
+ setPointSize: setPointSize,
756
+ setSkipTranslation: setSkipTranslation,
757
+ setTexture: setTexture,
758
+ setDrawAsCircle: setDrawAsCircle,
759
+ reset: reset,
760
+ setInverted: setInverted,
761
+ destroy: destroy
762
+ };
763
+ }
764
+
765
+ /*
766
+ * Vertex Buffer abstraction
767
+ * A vertex buffer is a set of vertices which are passed to the GPU
768
+ * in a single call.
769
+ * @param gl {WebGLContext} - the context in which to create the buffer
770
+ * @param shader {GLShader} - the shader to use
190
771
  */
191
- getContext: function () {
192
- var chart = this.chart,
193
- width = chart.plotWidth,
194
- height = chart.plotHeight,
195
- ctx = this.ctx,
196
- swapXY = function (proceed, x, y, a, b, c, d) {
197
- proceed.call(this, y, x, a, b, c, d);
198
- };
772
+ function GLVertexBuffer(gl, shader, dataComponents /*, type */ ) {
773
+ var buffer = false,
774
+ vertAttribute = false,
775
+ components = dataComponents || 2,
776
+ preAllocated = false,
777
+ iterator = 0,
778
+ data;
779
+
780
+ // type = type || 'float';
781
+
782
+ function destroy() {
783
+ if (buffer) {
784
+ gl.deleteBuffer(buffer);
785
+ }
786
+ }
199
787
 
200
- if (!this.canvas) {
201
- this.canvas = document.createElement('canvas');
202
- this.image = chart.renderer.image('', 0, 0, width, height).add(this.group);
203
- this.ctx = ctx = this.canvas.getContext('2d');
204
- if (chart.inverted) {
205
- each(['moveTo', 'lineTo', 'rect', 'arc'], function (fn) {
206
- wrap(ctx, fn, swapXY);
207
- });
788
+ /*
789
+ * Build the buffer
790
+ * @param dataIn {Array<float>} - a 0 padded array of indices
791
+ * @param attrib {String} - the name of the Attribute to bind the buffer to
792
+ * @param dataComponents {Integer} - the number of components per. indice
793
+ */
794
+ function build(dataIn, attrib, dataComponents) {
795
+
796
+ data = dataIn || [];
797
+
798
+ if ((!data || data.length === 0) && !preAllocated) {
799
+ //console.error('trying to render empty vbuffer');
800
+ buffer = false;
801
+ return false;
208
802
  }
209
- } else {
210
- ctx.clearRect(0, 0, width, height);
803
+
804
+ components = dataComponents || components;
805
+
806
+ if (buffer) {
807
+ gl.deleteBuffer(buffer);
808
+ }
809
+
810
+ buffer = gl.createBuffer();
811
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
812
+ gl.bufferData(
813
+ gl.ARRAY_BUFFER,
814
+ preAllocated || new Float32Array(data),
815
+ gl.STATIC_DRAW
816
+ );
817
+
818
+ // gl.bindAttribLocation(shader.program(), 0, 'aVertexPosition');
819
+ vertAttribute = gl.getAttribLocation(shader.program(), attrib);
820
+ gl.enableVertexAttribArray(vertAttribute);
821
+
822
+ return true;
211
823
  }
212
824
 
213
- this.canvas.setAttribute('width', width);
214
- this.canvas.setAttribute('height', height);
215
- this.image.attr({
216
- width: width,
217
- height: height
218
- });
825
+ /*
826
+ * Bind the buffer
827
+ */
828
+ function bind() {
829
+ if (!buffer) {
830
+ return false;
831
+ }
219
832
 
220
- return ctx;
221
- },
833
+ // gl.bindAttribLocation(shader.program(), 0, 'aVertexPosition');
834
+ //gl.enableVertexAttribArray(vertAttribute);
835
+ //gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
836
+ gl.vertexAttribPointer(vertAttribute, components, gl.FLOAT, false, 0, 0);
837
+ //gl.enableVertexAttribArray(vertAttribute);
838
+ }
222
839
 
223
- /**
224
- * Draw the canvas image inside an SVG image
225
- */
226
- canvasToSVG: function () {
227
- this.image.attr({ href: this.canvas.toDataURL('image/png') });
228
- },
840
+ /*
841
+ * Render the buffer
842
+ * @param from {Integer} - the start indice
843
+ * @param to {Integer} - the end indice
844
+ * @param drawMode {String} - the draw mode
845
+ */
846
+ function render(from, to, drawMode) {
847
+ var length = preAllocated ? preAllocated.length : data.length;
848
+
849
+ if (!buffer) {
850
+ return false;
851
+ }
229
852
 
230
- cvsLineTo: function (ctx, clientX, plotY) {
231
- ctx.lineTo(clientX, plotY);
232
- },
853
+ if (!length) {
854
+ return false;
855
+ }
233
856
 
234
- renderCanvas: function () {
235
- var series = this,
236
- options = series.options,
237
- chart = series.chart,
238
- xAxis = this.xAxis,
239
- yAxis = this.yAxis,
240
- ctx,
241
- i,
242
- c = 0,
243
- xData = series.processedXData,
244
- yData = series.processedYData,
245
- rawData = options.data,
246
- xExtremes = xAxis.getExtremes(),
247
- xMin = xExtremes.min,
248
- xMax = xExtremes.max,
249
- yExtremes = yAxis.getExtremes(),
250
- yMin = yExtremes.min,
251
- yMax = yExtremes.max,
252
- pointTaken = {},
253
- lastClientX,
254
- sampling = !!series.sampling,
255
- points,
256
- r = options.marker && options.marker.radius,
257
- cvsDrawPoint = this.cvsDrawPoint,
258
- cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
259
- cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
260
- enableMouseTracking = options.enableMouseTracking !== false,
261
- lastPoint,
262
- threshold = options.threshold,
263
- yBottom = yAxis.getThreshold(threshold),
264
- hasThreshold = typeof threshold === 'number',
265
- translatedThreshold = yBottom,
266
- doFill = this.fill,
267
- isRange = series.pointArrayMap && series.pointArrayMap.join(',') === 'low,high',
268
- isStacked = !!options.stacking,
269
- cropStart = series.cropStart || 0,
270
- loadingOptions = chart.options.loading,
271
- requireSorting = series.requireSorting,
272
- wasNull,
273
- connectNulls = options.connectNulls,
274
- useRaw = !xData,
275
- minVal,
276
- maxVal,
277
- minI,
278
- maxI,
279
- fillColor = series.fillOpacity ?
280
- new Color(series.color).setOpacity(pick(options.fillOpacity, 0.75)).get() :
281
- series.color,
282
- stroke = function () {
283
- if (doFill) {
284
- ctx.fillStyle = fillColor;
285
- ctx.fill();
286
- } else {
287
- ctx.strokeStyle = series.color;
288
- ctx.lineWidth = options.lineWidth;
289
- ctx.stroke();
290
- }
291
- },
292
- drawPoint = function (clientX, plotY, yBottom) {
293
- if (c === 0) {
294
- ctx.beginPath();
295
- }
857
+ if (!from || from > length || from < 0) {
858
+ from = 0;
859
+ }
296
860
 
297
- if (wasNull) {
298
- ctx.moveTo(clientX, plotY);
299
- } else {
300
- if (cvsDrawPoint) {
301
- cvsDrawPoint(ctx, clientX, plotY, yBottom, lastPoint);
302
- } else if (cvsLineTo) {
303
- cvsLineTo(ctx, clientX, plotY);
304
- } else if (cvsMarker) {
305
- cvsMarker(ctx, clientX, plotY, r);
306
- }
307
- }
861
+ if (!to || to > length) {
862
+ to = length;
863
+ }
308
864
 
309
- // We need to stroke the line for every 1000 pixels. It will crash the browser
310
- // memory use if we stroke too infrequently.
311
- c = c + 1;
312
- if (c === 1000) {
313
- stroke();
314
- c = 0;
315
- }
865
+ drawMode = drawMode || 'points';
316
866
 
317
- // Area charts need to keep track of the last point
318
- lastPoint = {
319
- clientX: clientX,
320
- plotY: plotY,
321
- yBottom: yBottom
322
- };
323
- },
867
+ gl.drawArrays(
868
+ gl[drawMode.toUpperCase()],
869
+ from / components,
870
+ (to - from) / components
871
+ );
324
872
 
325
- addKDPoint = function (clientX, plotY, i) {
873
+ return true;
874
+ }
326
875
 
327
- // The k-d tree requires series points. Reduce the amount of points, since the time to build the
328
- // tree increases exponentially.
329
- if (enableMouseTracking && !pointTaken[clientX + ',' + plotY]) {
330
- pointTaken[clientX + ',' + plotY] = true;
876
+ function push(x, y, a, b) {
877
+ if (preAllocated) { // && iterator <= preAllocated.length - 4) {
878
+ preAllocated[++iterator] = x;
879
+ preAllocated[++iterator] = y;
880
+ preAllocated[++iterator] = a;
881
+ preAllocated[++iterator] = b;
882
+ }
883
+ }
331
884
 
332
- if (chart.inverted) {
333
- clientX = xAxis.len - clientX;
334
- plotY = yAxis.len - plotY;
335
- }
885
+ /*
886
+ * Note about pre-allocated buffers:
887
+ * - This is slower for charts with many series
888
+ */
889
+ function allocate(size) {
890
+ size *= 4;
891
+ iterator = -1;
892
+
893
+ //if (!preAllocated || (preAllocated && preAllocated.length !== size)) {
894
+ preAllocated = new Float32Array(size);
895
+ //}
896
+ }
336
897
 
337
- points.push({
338
- clientX: clientX,
339
- plotX: clientX,
340
- plotY: plotY,
341
- i: cropStart + i
342
- });
343
- }
898
+ ////////////////////////////////////////////////////////////////////////////
899
+ return {
900
+ destroy: destroy,
901
+ bind: bind,
902
+ data: data,
903
+ build: build,
904
+ render: render,
905
+ allocate: allocate,
906
+ push: push
907
+ };
908
+ }
909
+
910
+ /* Main renderer. Used to render series.
911
+ * Notes to self:
912
+ * - May be able to build a point map by rendering to a separate canvas
913
+ * and encoding values in the color data.
914
+ * - Need to figure out a way to transform the data quicker
915
+ */
916
+ function GLRenderer(postRenderCallback) {
917
+ var // Shader
918
+ shader = false,
919
+ // Vertex buffers - keyed on shader attribute name
920
+ vbuffer = false,
921
+ // Opengl context
922
+ gl = false,
923
+ // Width of our viewport in pixels
924
+ width = 0,
925
+ // Height of our viewport in pixels
926
+ height = 0,
927
+ // The data to render - array of coordinates
928
+ data = false,
929
+ // The marker data
930
+ markerData = false,
931
+ // Is the texture ready?
932
+ textureIsReady = false,
933
+ // Exports
934
+ exports = {},
935
+ // Is it inited?
936
+ isInited = false,
937
+ // The series stack
938
+ series = [],
939
+ // Texture for circles
940
+ circleTexture = doc.createElement('canvas'),
941
+ // Context for circle texture
942
+ circleCtx = circleTexture.getContext('2d'),
943
+ // Handle for the circle texture
944
+ circleTextureHandle,
945
+ // Things to draw as "rectangles" (i.e lines)
946
+ asBar = {
947
+ 'column': true,
948
+ 'area': true
949
+ },
950
+ asCircle = {
951
+ 'scatter': true,
952
+ 'bubble': true
953
+ },
954
+ //Render settings
955
+ settings = {
956
+ pointSize: 1,
957
+ lineWidth: 3,
958
+ fillColor: '#AA00AA',
959
+ useAlpha: true,
960
+ usePreallocated: false,
961
+ useGPUTranslations: false,
962
+ timeRendering: false,
963
+ timeSeriesProcessing: false,
964
+ timeSetup: false
344
965
  };
345
966
 
346
- // If we are zooming out from SVG mode, destroy the graphics
347
- if (this.points || this.graph) {
348
- this.destroyGraphics();
967
+ ////////////////////////////////////////////////////////////////////////////
968
+
969
+ function setOptions(options) {
970
+ merge(true, settings, options);
349
971
  }
350
972
 
351
- // The group
352
- series.plotGroup(
353
- 'group',
354
- 'series',
355
- series.visible ? 'visible' : 'hidden',
356
- options.zIndex,
357
- chart.seriesGroup
358
- );
973
+ function seriesPointCount(series) {
974
+ var isStacked,
975
+ xData,
976
+ s;
977
+
978
+ if (isSeriesBoosting(series)) {
979
+ isStacked = !!series.options.stacking;
980
+ xData = series.xData || series.options.xData || series.processedXData;
981
+ s = (isStacked ? series.data : (xData || series.options.data)).length;
982
+
983
+ if (series.type === 'treemap') {
984
+ s *= 12;
985
+ } else if (series.type === 'heatmap') {
986
+ s *= 6;
987
+ } else if (asBar[series.type]) {
988
+ s *= 2;
989
+ }
359
990
 
360
- series.getAttribs();
361
- series.markerGroup = series.group;
362
- addEvent(series, 'destroy', function () {
363
- series.markerGroup = null;
364
- });
991
+ return s;
992
+ }
365
993
 
366
- points = this.points = [];
367
- ctx = this.getContext();
368
- series.buildKDTree = noop; // Do not start building while drawing
369
-
370
- // Display a loading indicator
371
- if (rawData.length > 99999) {
372
- chart.options.loading = merge(loadingOptions, {
373
- labelStyle: {
374
- backgroundColor: 'rgba(255,255,255,0.75)',
375
- padding: '1em',
376
- borderRadius: '0.5em'
377
- },
378
- style: {
379
- backgroundColor: 'none',
380
- opacity: 1
994
+ return 0;
995
+ }
996
+
997
+ /* Allocate a float buffer to fit all series */
998
+ function allocateBuffer(chart) {
999
+ var s = 0;
1000
+
1001
+ if (!settings.usePreallocated) {
1002
+ return;
1003
+ }
1004
+
1005
+ each(chart.series, function(series) {
1006
+ if (isSeriesBoosting(series)) {
1007
+ s += seriesPointCount(series);
381
1008
  }
382
1009
  });
383
- chart.showLoading('Drawing...');
384
- chart.options.loading = loadingOptions; // reset
385
- if (chart.loadingShown === true) {
386
- chart.loadingShown = 1;
387
- } else {
388
- chart.loadingShown = chart.loadingShown + 1;
1010
+
1011
+ vbuffer.allocate(s);
1012
+ }
1013
+
1014
+ function allocateBufferForSingleSeries(series) {
1015
+ var s = 0;
1016
+
1017
+ if (!settings.usePreallocated) {
1018
+ return;
1019
+ }
1020
+
1021
+ if (isSeriesBoosting(series)) {
1022
+ s = seriesPointCount(series);
389
1023
  }
1024
+
1025
+ vbuffer.allocate(s);
390
1026
  }
391
1027
 
392
- // Loop over the points
393
- i = 0;
394
- eachAsync(isStacked ? series.data : (xData || rawData), function (d) {
1028
+ /*
1029
+ * Returns an orthographic perspective matrix
1030
+ * @param {number} width - the width of the viewport in pixels
1031
+ * @param {number} height - the height of the viewport in pixels
1032
+ */
1033
+ function orthoMatrix(width, height) {
1034
+ var near = 0,
1035
+ far = 1;
1036
+
1037
+ return [
1038
+ 2 / width, 0, 0, 0,
1039
+ 0, -(2 / height), 0, 0,
1040
+ 0, 0, -2 / (far - near), 0, -1, 1, -(far + near) / (far - near), 1
1041
+ ];
1042
+ }
395
1043
 
396
- var x,
397
- y,
398
- clientX,
399
- plotY,
400
- isNull,
401
- low,
402
- isYInside = true;
1044
+ /*
1045
+ * Clear the depth and color buffer
1046
+ */
1047
+ function clear() {
1048
+ gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
1049
+ }
403
1050
 
404
- if (useRaw) {
405
- x = d[0];
406
- y = d[1];
407
- } else {
408
- x = d;
409
- y = yData[i];
1051
+ /*
1052
+ * Get the WebGL context
1053
+ * @returns {WebGLContext} - the context
1054
+ */
1055
+ function getGL() {
1056
+ return gl;
1057
+ }
1058
+
1059
+ /*
1060
+ * Push data for a single series
1061
+ * This calculates additional vertices and transforms the data to be
1062
+ * aligned correctly in memory
1063
+ */
1064
+ function pushSeriesData(series, inst) {
1065
+ var isRange = series.pointArrayMap &&
1066
+ series.pointArrayMap.join(',') === 'low,high',
1067
+ chart = series.chart,
1068
+ options = series.options,
1069
+ isStacked = !!options.stacking,
1070
+ rawData = options.data,
1071
+ xExtremes = series.xAxis.getExtremes(),
1072
+ xMin = xExtremes.min,
1073
+ xMax = xExtremes.max,
1074
+ yExtremes = series.yAxis.getExtremes(),
1075
+ yMin = yExtremes.min,
1076
+ yMax = yExtremes.max,
1077
+ xData = series.xData || options.xData || series.processedXData,
1078
+ yData = series.yData || options.yData || series.processedYData,
1079
+ zData = series.zData || options.zData || series.processedZData,
1080
+ yAxis = series.yAxis,
1081
+ xAxis = series.xAxis,
1082
+ useRaw = !xData || xData.length === 0,
1083
+ // threshold = options.threshold,
1084
+ // yBottom = chart.yAxis[0].getThreshold(threshold),
1085
+ // hasThreshold = isNumber(threshold),
1086
+ // colorByPoint = series.options.colorByPoint,
1087
+ // This is required for color by point, so make sure this is
1088
+ // uncommented if enabling that
1089
+ // colorIndex = 0,
1090
+ // Required for color axis support
1091
+ // caxis,
1092
+ // connectNulls = options.connectNulls,
1093
+ // For some reason eslint doesn't pick up that this is actually used
1094
+ maxVal, //eslint-disable-line no-unused-vars
1095
+ points = series.points || false,
1096
+ lastX = false,
1097
+ minVal,
1098
+ color,
1099
+ scolor,
1100
+ sdata = isStacked ? series.data : (xData || rawData),
1101
+ closestLeft = {
1102
+ x: Number.MIN_VALUE,
1103
+ y: 0
1104
+ },
1105
+ closestRight = {
1106
+ x: Number.MIN_VALUE,
1107
+ y: 0
1108
+ };
1109
+
1110
+ if (options.boostData && options.boostData.length > 0) {
1111
+ return;
410
1112
  }
411
1113
 
412
- // Resolve low and high for range series
413
- if (isRange) {
414
- if (useRaw) {
415
- y = d.slice(1, 3);
1114
+ series.closestPointRangePx = Number.MAX_VALUE;
1115
+
1116
+ // Push color to color buffer - need to do this per. vertex
1117
+ function pushColor(color) {
1118
+ if (color) {
1119
+ inst.colorData.push(color[0]);
1120
+ inst.colorData.push(color[1]);
1121
+ inst.colorData.push(color[2]);
1122
+ inst.colorData.push(color[3]);
416
1123
  }
417
- low = y[0];
418
- y = y[1];
419
- } else if (isStacked) {
420
- x = d.x;
421
- y = d.stackY;
422
- low = y - d.y;
423
1124
  }
424
1125
 
425
- isNull = y === null;
1126
+ //Push a vertice to the data buffer
1127
+ function vertice(x, y, checkTreshold, pointSize, color) {
1128
+ pushColor(color);
1129
+ if (settings.usePreallocated) {
1130
+ vbuffer.push(x, y, checkTreshold ? 1 : 0, pointSize || 1);
1131
+ } else {
1132
+ data.push(x);
1133
+ data.push(y);
1134
+ data.push(checkTreshold ? 1 : 0);
1135
+ data.push(pointSize || 1);
1136
+ }
1137
+ }
426
1138
 
427
- // Optimize for scatter zooming
428
- if (!requireSorting) {
429
- isYInside = y >= yMin && y <= yMax;
1139
+ // Push a rectangle to the data buffer
1140
+ function pushRect(x, y, w, h, color) {
1141
+ pushColor(color);
1142
+ vertice(x + w, y);
1143
+ pushColor(color);
1144
+ vertice(x, y);
1145
+ pushColor(color);
1146
+ vertice(x, y + h);
1147
+
1148
+ pushColor(color);
1149
+ vertice(x, y + h);
1150
+ pushColor(color);
1151
+ vertice(x + w, y + h);
1152
+ pushColor(color);
1153
+ vertice(x + w, y);
430
1154
  }
431
1155
 
432
- if (!isNull && x >= xMin && x <= xMax && isYInside) {
1156
+ // Special case for point shapes
1157
+ if (points && points.length > 0) {
1158
+
1159
+ // If we're doing points, we assume that the points are already
1160
+ // translated, so we skip the shader translation.
1161
+ inst.skipTranslation = true;
1162
+ // Force triangle draw mode
1163
+ inst.drawMode = 'triangles';
1164
+
1165
+ // We don't have a z component in the shader, so we need to sort.
1166
+ if (points[0].node && points[0].node.levelDynamic) {
1167
+ points.sort(function(a, b) {
1168
+ if (a.node) {
1169
+ if (a.node.levelDynamic > b.node.levelDynamic) {
1170
+ return 1;
1171
+ } else if (a.node.levelDynamic < b.node.levelDynamic) {
1172
+ return -1;
1173
+ }
1174
+ }
1175
+ return 0;
1176
+ });
1177
+ }
433
1178
 
434
- clientX = Math.round(xAxis.toPixels(x, true));
1179
+ each(points, function(point) {
1180
+ var plotY = point.plotY,
1181
+ shapeArgs,
1182
+ swidth,
1183
+ pointAttr;
1184
+
1185
+ if (plotY !== undefined && !isNaN(plotY) && point.y !== null) {
1186
+ shapeArgs = point.shapeArgs;
1187
+
1188
+
1189
+ pointAttr = point.series.colorAttribs(point);
1190
+
1191
+ swidth = pointAttr['stroke-width'] || 0;
1192
+
1193
+ // Handle point colors
1194
+ color = H.color(pointAttr.fill).rgba;
1195
+ color[0] /= 255.0;
1196
+ color[1] /= 255.0;
1197
+ color[2] /= 255.0;
1198
+
1199
+ // So there are two ways of doing this. Either we can
1200
+ // create a rectangle of two triangles, or we can do a
1201
+ // point and use point size. Latter is faster, but
1202
+ // only supports squares. So we're doing triangles.
1203
+ // We could also use one color per. vertice to get
1204
+ // better color interpolation.
1205
+
1206
+ // If there's stroking, we do an additional rect
1207
+ //if (pointAttr.stroke !== 'none' && swidth && swidth > 0) {
1208
+ if (series.type === 'treemap') {
1209
+ swidth = swidth || 1;
1210
+ scolor = H.color(pointAttr.stroke).rgba;
1211
+
1212
+ scolor[0] /= 255.0;
1213
+ scolor[1] /= 255.0;
1214
+ scolor[2] /= 255.0;
1215
+
1216
+ pushRect(
1217
+ shapeArgs.x,
1218
+ shapeArgs.y,
1219
+ shapeArgs.width,
1220
+ shapeArgs.height,
1221
+ scolor
1222
+ );
435
1223
 
436
- if (sampling) {
437
- if (minI === undefined || clientX === lastClientX) {
438
- if (!isRange) {
439
- low = y;
1224
+ swidth /= 2;
440
1225
  }
441
- if (maxI === undefined || y > maxVal) {
442
- maxVal = y;
443
- maxI = i;
1226
+ // } else {
1227
+ // swidth = 0;
1228
+ // }
1229
+
1230
+ pushRect(
1231
+ shapeArgs.x + swidth,
1232
+ shapeArgs.y + swidth,
1233
+ shapeArgs.width - (swidth * 2),
1234
+ shapeArgs.height - (swidth * 2),
1235
+ color
1236
+ );
1237
+ }
1238
+ });
1239
+
1240
+ return;
1241
+ }
1242
+
1243
+ // Extract color axis
1244
+ // each(chart.axes || [], function (a) {
1245
+ // if (H.ColorAxis && a instanceof H.ColorAxis) {
1246
+ // caxis = a;
1247
+ // }
1248
+ // });
1249
+
1250
+ each(sdata, function(d, i) {
1251
+ var x,
1252
+ y,
1253
+ z,
1254
+ px = false,
1255
+ nx = false,
1256
+ // This is in fact used.
1257
+ low, //eslint-disable-line no-unused-vars
1258
+ chartDestroyed = typeof chart.index === 'undefined',
1259
+ nextInside = false,
1260
+ prevInside = false,
1261
+ pcolor = false,
1262
+ drawAsBar = asBar[series.type],
1263
+ isXInside = false,
1264
+ isYInside = true;
1265
+
1266
+ if (chartDestroyed) {
1267
+ return false;
1268
+ }
1269
+
1270
+ // Uncomment this to enable color by point.
1271
+ // This currently left disabled as the charts look really ugly
1272
+ // when enabled and there's a lot of points.
1273
+ // Leaving in for the future (tm).
1274
+ // if (colorByPoint) {
1275
+ // colorIndex = ++colorIndex % series.chart.options.colors.length;
1276
+ // pcolor = toRGBAFast(series.chart.options.colors[colorIndex]);
1277
+ // pcolor[0] /= 255.0;
1278
+ // pcolor[1] /= 255.0;
1279
+ // pcolor[2] /= 255.0;
1280
+ // }
1281
+
1282
+ if (useRaw) {
1283
+ x = d[0];
1284
+ y = d[1];
1285
+
1286
+ if (sdata[i + 1]) {
1287
+ nx = sdata[i + 1][0];
1288
+ }
1289
+
1290
+ if (sdata[i - 1]) {
1291
+ px = sdata[i - 1][0];
1292
+ }
1293
+
1294
+ if (d.length >= 3) {
1295
+ z = d[2];
1296
+
1297
+ if (d[2] > inst.zMax) {
1298
+ inst.zMax = d[2];
444
1299
  }
445
- if (minI === undefined || low < minVal) {
446
- minVal = low;
447
- minI = i;
1300
+
1301
+ if (d[2] < inst.zMin) {
1302
+ inst.zMin = d[2];
448
1303
  }
1304
+ }
1305
+
1306
+ } else {
1307
+ x = d;
1308
+ y = yData[i];
449
1309
 
1310
+ if (sdata[i + 1]) {
1311
+ nx = sdata[i + 1];
450
1312
  }
451
- if (clientX !== lastClientX) { // Add points and reset
452
- if (minI !== undefined) { // then maxI is also a number
453
- plotY = yAxis.toPixels(maxVal, true);
454
- yBottom = yAxis.toPixels(minVal, true);
455
- drawPoint(
456
- clientX,
457
- hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
458
- hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
459
- );
460
- addKDPoint(clientX, plotY, maxI);
461
- if (yBottom !== plotY) {
462
- addKDPoint(clientX, yBottom, minI);
463
- }
1313
+
1314
+ if (sdata[i - 1]) {
1315
+ px = sdata[i - 1];
1316
+ }
1317
+
1318
+ if (zData && zData.length) {
1319
+ z = zData[i];
1320
+
1321
+ if (zData[i] > inst.zMax) {
1322
+ inst.zMax = zData[i];
1323
+ }
1324
+
1325
+ if (zData[i] < inst.zMin) {
1326
+ inst.zMin = zData[i];
464
1327
  }
1328
+ }
1329
+ }
1330
+
1331
+ if (nx && nx >= xMin && nx <= xMax) {
1332
+ nextInside = true;
1333
+ }
465
1334
 
1335
+ if (px && px >= xMin && px <= xMax) {
1336
+ prevInside = true;
1337
+ }
466
1338
 
467
- minI = maxI = undefined;
468
- lastClientX = clientX;
1339
+ if (isRange) {
1340
+ if (useRaw) {
1341
+ y = d.slice(1, 3);
469
1342
  }
470
- } else {
471
- plotY = Math.round(yAxis.toPixels(y, true));
472
- drawPoint(clientX, plotY, yBottom);
473
- addKDPoint(clientX, plotY, i);
1343
+
1344
+ low = y[0];
1345
+ y = y[1];
1346
+
1347
+ } else if (isStacked) {
1348
+ x = d.x;
1349
+ y = d.stackY;
1350
+ low = y - d.y;
1351
+ }
1352
+
1353
+ if (!series.requireSorting) {
1354
+ isYInside = y >= yMin && y <= yMax;
1355
+ }
1356
+
1357
+ if (x > xMax && closestRight.x < xMax) {
1358
+ closestRight.x = x;
1359
+ closestRight.y = y;
1360
+ }
1361
+
1362
+ if (x < xMin && closestLeft.x < xMin) {
1363
+ closestLeft.x = x;
1364
+ closestLeft.y = y;
1365
+ }
1366
+
1367
+ if (y !== 0 && (!y || !isYInside)) {
1368
+ return;
1369
+ }
1370
+
1371
+ if (x >= xMin && x <= xMax) {
1372
+ isXInside = true;
1373
+ }
1374
+
1375
+ if (!isXInside && !nextInside && !prevInside) {
1376
+ return;
1377
+ }
1378
+
1379
+ // Skip translations - temporary floating point fix
1380
+ if (!settings.useGPUTranslations) {
1381
+ inst.skipTranslation = true;
1382
+ x = xAxis.toPixels(x, true);
1383
+ y = yAxis.toPixels(y, true);
1384
+ }
1385
+
1386
+ if (drawAsBar) {
1387
+
1388
+ maxVal = y;
1389
+ minVal = 0;
1390
+
1391
+ if (y < 0) {
1392
+ minVal = y;
1393
+ y = 0;
1394
+ }
1395
+
1396
+ if (!settings.useGPUTranslations) {
1397
+ minVal = yAxis.toPixels(minVal, true);
1398
+ }
1399
+
1400
+ // Need to add an extra point here
1401
+ vertice(x, minVal, 0, 0, pcolor);
1402
+ }
1403
+
1404
+ // No markers on out of bounds things.
1405
+ // Out of bound things are shown if and only if the next
1406
+ // or previous point is inside the rect.
1407
+ if (inst.hasMarkers) { // && isXInside) {
1408
+ // x = H.correctFloat(
1409
+ // Math.min(Math.max(-1e5, xAxis.translate(
1410
+ // x,
1411
+ // 0,
1412
+ // 0,
1413
+ // 0,
1414
+ // 1,
1415
+ // 0.5,
1416
+ // false
1417
+ // )), 1e5)
1418
+ // );
1419
+
1420
+ if (lastX !== false) {
1421
+ series.closestPointRangePx = Math.min(
1422
+ series.closestPointRangePx,
1423
+ Math.abs(x - lastX)
1424
+ );
1425
+ }
1426
+ }
1427
+
1428
+ vertice(
1429
+ x,
1430
+ y,
1431
+ 0,
1432
+ series.type === 'bubble' ? (z || 1) : 2,
1433
+ pcolor
1434
+ );
1435
+
1436
+ // Uncomment this to support color axis.
1437
+ // if (caxis) {
1438
+ // color = H.color(caxis.toColor(y)).rgba;
1439
+
1440
+ // inst.colorData.push(color[0] / 255.0);
1441
+ // inst.colorData.push(color[1] / 255.0);
1442
+ // inst.colorData.push(color[2] / 255.0);
1443
+ // inst.colorData.push(color[3]);
1444
+ // }
1445
+
1446
+ lastX = x;
1447
+
1448
+ //return true;
1449
+ });
1450
+
1451
+ function pushSupplementPoint(point) {
1452
+ if (!settings.useGPUTranslations) {
1453
+ inst.skipTranslation = true;
1454
+ point.x = xAxis.toPixels(point.x, true);
1455
+ point.y = yAxis.toPixels(point.y, true);
1456
+ }
1457
+
1458
+ // We should only do this for lines, and we should ignore markers
1459
+ // since there's no point here that would have a marker.
1460
+
1461
+ vertice(
1462
+ point.x,
1463
+ point.y,
1464
+ 0,
1465
+ 2
1466
+ );
1467
+ }
1468
+
1469
+ if (!lastX) {
1470
+ // There are no points within the selected range
1471
+ pushSupplementPoint(closestLeft);
1472
+ pushSupplementPoint(closestRight);
1473
+ }
1474
+ }
1475
+
1476
+ /*
1477
+ * Push a series to the renderer
1478
+ * If we render the series immediatly, we don't have to loop later
1479
+ * @param s {Highchart.Series} - the series to push
1480
+ */
1481
+ function pushSeries(s) {
1482
+ if (series.length > 0) {
1483
+ series[series.length - 1].to = data.length;
1484
+ if (series[series.length - 1].hasMarkers) {
1485
+ series[series.length - 1].markerTo = markerData.length;
474
1486
  }
475
1487
  }
476
- wasNull = isNull && !connectNulls;
477
1488
 
478
- i = i + 1;
1489
+ if (settings.timeSeriesProcessing) {
1490
+ console.time('building ' + s.type + ' series'); //eslint-disable-line no-console
1491
+ }
1492
+
1493
+ series.push({
1494
+ from: data.length,
1495
+ markerFrom: markerData.length,
1496
+ // Push RGBA values to this array to use per. point coloring.
1497
+ // It should be 0-padded, so each component should be pushed in
1498
+ // succession.
1499
+ colorData: [],
1500
+ series: s,
1501
+ zMin: Number.MAX_VALUE,
1502
+ zMax: -Number.MAX_VALUE,
1503
+ hasMarkers: s.options.marker ? s.options.marker.enabled !== false : false,
1504
+ showMarksers: true,
1505
+ drawMode: ({
1506
+ 'area': 'lines',
1507
+ 'arearange': 'lines',
1508
+ 'areaspline': 'line_strip',
1509
+ 'column': 'lines',
1510
+ 'line': 'line_strip',
1511
+ 'scatter': 'points',
1512
+ 'heatmap': 'triangles',
1513
+ 'treemap': 'triangles',
1514
+ 'bubble': 'points'
1515
+ })[s.type] || 'line_strip'
1516
+ });
1517
+
1518
+ // Add the series data to our buffer(s)
1519
+ pushSeriesData(s, series[series.length - 1]);
479
1520
 
480
- if (i % CHUNK_SIZE === 0) {
481
- series.canvasToSVG();
1521
+ if (settings.timeSeriesProcessing) {
1522
+ console.timeEnd('building ' + s.type + ' series'); //eslint-disable-line no-console
482
1523
  }
1524
+ }
483
1525
 
484
- }, function () {
1526
+ /*
1527
+ * Flush the renderer.
1528
+ * This removes pushed series and vertices.
1529
+ * Should be called after clearing and before rendering
1530
+ */
1531
+ function flush() {
1532
+ series = [];
1533
+ exports.data = data = [];
1534
+ markerData = [];
1535
+ }
485
1536
 
486
- var loadingDiv = chart.loadingDiv,
487
- loadingShown = +chart.loadingShown;
1537
+ /*
1538
+ * Pass x-axis to shader
1539
+ * @param axis {Highcharts.Axis} - the x-axis
1540
+ */
1541
+ function setXAxis(axis) {
1542
+ if (!shader) {
1543
+ return;
1544
+ }
488
1545
 
489
- stroke();
490
- series.canvasToSVG();
1546
+ shader.setUniform('xAxisTrans', axis.transA);
1547
+ shader.setUniform('xAxisMin', axis.min);
1548
+ shader.setUniform('xAxisMinPad', axis.minPixelPadding);
1549
+ shader.setUniform('xAxisPointRange', axis.pointRange);
1550
+ shader.setUniform('xAxisLen', axis.len);
1551
+ shader.setUniform('xAxisPos', axis.pos);
1552
+ shader.setUniform('xAxisCVSCoord', !axis.horiz);
1553
+ }
491
1554
 
492
- fireEvent(series, 'renderedCanvas');
1555
+ /*
1556
+ * Pass y-axis to shader
1557
+ * @param axis {Highcharts.Axis} - the y-axis
1558
+ */
1559
+ function setYAxis(axis) {
1560
+ if (!shader) {
1561
+ return;
1562
+ }
493
1563
 
494
- // Do not use chart.hideLoading, as it runs JS animation and will be blocked by buildKDTree.
495
- // CSS animation looks good, but then it must be deleted in timeout. If we add the module to core,
496
- // change hideLoading so we can skip this block.
497
- if (loadingShown === 1) {
498
- extend(loadingDiv.style, {
499
- transition: 'opacity 250ms',
500
- opacity: 0
501
- });
1564
+ shader.setUniform('yAxisTrans', axis.transA);
1565
+ shader.setUniform('yAxisMin', axis.min);
1566
+ shader.setUniform('yAxisMinPad', axis.minPixelPadding);
1567
+ shader.setUniform('yAxisPointRange', axis.pointRange);
1568
+ shader.setUniform('yAxisLen', axis.len);
1569
+ shader.setUniform('yAxisPos', axis.pos);
1570
+ shader.setUniform('yAxisCVSCoord', !axis.horiz);
1571
+ }
502
1572
 
503
- chart.loadingShown = false;
504
- setTimeout(function () {
505
- if (loadingDiv.parentNode) { // In exporting it is falsy
506
- loadingDiv.parentNode.removeChild(loadingDiv);
507
- }
508
- chart.loadingDiv = chart.loadingSpan = null;
509
- }, 250);
1573
+ /*
1574
+ * Set the translation threshold
1575
+ * @param has {boolean} - has threshold flag
1576
+ * @param translation {Float} - the threshold
1577
+ */
1578
+ function setThreshold(has, translation) {
1579
+ shader.setUniform('hasThreshold', has);
1580
+ shader.setUniform('translatedThreshold', translation);
1581
+ }
1582
+
1583
+ /*
1584
+ * Render the data
1585
+ * This renders all pushed series.
1586
+ */
1587
+ function render(chart) {
1588
+
1589
+ if (chart) {
1590
+ if (!chart.chartHeight || !chart.chartWidth) {
1591
+ //chart.setChartSize();
1592
+ }
1593
+
1594
+ width = chart.chartWidth || 800;
1595
+ height = chart.chartHeight || 400;
1596
+ } else {
1597
+ return false;
510
1598
  }
511
- if (loadingShown) {
512
- chart.loadingShown = loadingShown - 1;
1599
+
1600
+ if (!gl || !width || !height) {
1601
+ return false;
513
1602
  }
514
1603
 
515
- // Pass tests in Pointer.
516
- // Replace this with a single property, and replace when zooming in
517
- // below boostThreshold.
518
- series.directTouch = false;
519
- series.options.stickyTracking = true;
1604
+ if (settings.timeRendering) {
1605
+ console.time('gl rendering'); //eslint-disable-line no-console
1606
+ }
520
1607
 
521
- delete series.buildKDTree; // Go back to prototype, ready to build
522
- series.buildKDTree();
1608
+ shader.bind();
523
1609
 
524
- // Don't do async on export, the exportChart, getSVGForExport and getSVG methods are not chained for it.
525
- }, chart.renderer.forExport ? Number.MAX_VALUE : undefined);
526
- }
527
- });
528
-
529
- seriesTypes.scatter.prototype.cvsMarkerCircle = function (ctx, clientX, plotY, r) {
530
- ctx.moveTo(clientX, plotY);
531
- ctx.arc(clientX, plotY, r, 0, 2 * Math.PI, false);
532
- };
533
-
534
- // Rect is twice as fast as arc, should be used for small markers
535
- seriesTypes.scatter.prototype.cvsMarkerSquare = function (ctx, clientX, plotY, r) {
536
- ctx.moveTo(clientX, plotY);
537
- ctx.rect(clientX - r, plotY - r, r * 2, r * 2);
538
- };
539
- seriesTypes.scatter.prototype.fill = true;
540
-
541
- extend(seriesTypes.area.prototype, {
542
- cvsDrawPoint: function (ctx, clientX, plotY, yBottom, lastPoint) {
543
- if (lastPoint && clientX !== lastPoint.clientX) {
544
- ctx.moveTo(lastPoint.clientX, lastPoint.yBottom);
545
- ctx.lineTo(lastPoint.clientX, lastPoint.plotY);
546
- ctx.lineTo(clientX, plotY);
547
- ctx.lineTo(clientX, yBottom);
548
- }
549
- },
550
- fill: true,
551
- fillOpacity: true,
552
- sampling: true
553
- });
554
-
555
- extend(seriesTypes.column.prototype, {
556
- cvsDrawPoint: function (ctx, clientX, plotY, yBottom) {
557
- ctx.rect(clientX - 1, plotY, 1, yBottom - plotY);
558
- },
559
- fill: true,
560
- sampling: true
561
- });
562
-
563
- /**
564
- * Return a full Point object based on the index. The boost module uses stripped point objects
565
- * for performance reasons.
566
- * @param {Number} boostPoint A stripped-down point object
567
- * @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
568
- */
569
- Series.prototype.getPoint = function (boostPoint) {
570
- var point = boostPoint;
571
-
572
- if (boostPoint && !(boostPoint instanceof this.pointClass)) {
573
- point = (new this.pointClass()).init(this, this.options.data[boostPoint.i]);
574
- point.dist = boostPoint.dist;
575
- point.category = point.x;
576
- point.plotX = boostPoint.plotX;
577
- point.plotY = boostPoint.plotY;
578
- }
1610
+ gl.viewport(0, 0, width, height);
1611
+ shader.setPMatrix(orthoMatrix(width, height));
579
1612
 
580
- return point;
581
- };
1613
+ if (settings.lineWidth > 1 && !H.isMS) {
1614
+ gl.lineWidth(settings.lineWidth);
1615
+ }
582
1616
 
583
- /**
584
- * Return a point instance from the k-d-tree
585
- */
586
- wrap(Series.prototype, 'searchPoint', function (proceed) {
587
- return this.getPoint(
588
- proceed.apply(this, [].slice.call(arguments, 1))
589
- );
590
- });
1617
+ vbuffer.build(exports.data, 'aVertexPosition', 4);
1618
+ vbuffer.bind();
1619
+
1620
+ if (textureIsReady) {
1621
+ gl.bindTexture(gl.TEXTURE_2D, circleTextureHandle);
1622
+ shader.setTexture(circleTextureHandle);
1623
+ }
1624
+
1625
+ shader.setInverted(chart.options.chart ? chart.options.chart.inverted : false);
1626
+
1627
+ // Render the series
1628
+ each(series, function(s, si) {
1629
+ var options = s.series.options,
1630
+ threshold = options.threshold,
1631
+ hasThreshold = isNumber(threshold),
1632
+ yBottom = s.series.yAxis.getThreshold(threshold),
1633
+ translatedThreshold = yBottom,
1634
+ cbuffer,
1635
+ showMarkers = pick(
1636
+ options.marker ? options.marker.enabled : null,
1637
+ s.series.xAxis.isRadial ? true : null,
1638
+ s.series.closestPointRangePx >
1639
+ 2 * ((
1640
+ options.marker ?
1641
+ options.marker.radius :
1642
+ 10
1643
+ ) || 10)
1644
+ ),
1645
+ fillColor = s.series.fillOpacity ?
1646
+ new Color(s.series.color).setOpacity(
1647
+ pick(options.fillOpacity, 0.85)
1648
+ ).get() :
1649
+ s.series.color,
1650
+ color;
1651
+
1652
+ vbuffer.bind();
1653
+
1654
+ if (options.colorByPoint) {
1655
+ fillColor = s.series.chart.options.colors[si];
1656
+ }
1657
+
1658
+ color = H.color(fillColor).rgba;
1659
+
1660
+ if (!settings.useAlpha) {
1661
+ color[3] = 1.0;
1662
+ }
1663
+
1664
+ //Blending
1665
+ if (options.boostBlending === 'add') { // docs
1666
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
1667
+ gl.blendEquation(gl.FUNC_ADD);
1668
+
1669
+ } else if (options.boostBlending === 'mult') {
1670
+ gl.blendFunc(gl.DST_COLOR, gl.ZERO);
1671
+
1672
+ } else if (options.boostBlending === 'darken') {
1673
+ gl.blendFunc(gl.ONE, gl.ONE);
1674
+ gl.blendEquation(gl.FUNC_MIN);
1675
+
1676
+ } else {
1677
+ //gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);//, gl.ONE, gl.ZERO);
1678
+ //gl.blendEquation(gl.FUNC_ADD);
1679
+ gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA);
1680
+ }
1681
+
1682
+ shader.reset();
1683
+
1684
+ // If there are entries in the colorData buffer, build and bind it.
1685
+ if (s.colorData.length > 0) {
1686
+ shader.setUniform('hasColor', 1.0);
1687
+ cbuffer = GLVertexBuffer(gl, shader); //eslint-disable-line new-cap
1688
+ cbuffer.build(s.colorData, 'aColor', 4);
1689
+ cbuffer.bind();
1690
+ }
1691
+
1692
+ // Set series specific uniforms
1693
+ shader.setColor(color);
1694
+ setXAxis(s.series.xAxis);
1695
+ setYAxis(s.series.yAxis);
1696
+ setThreshold(hasThreshold, translatedThreshold);
1697
+
1698
+ if (s.drawMode === 'points') {
1699
+ if (options.marker && options.marker.radius) {
1700
+ shader.setPointSize(options.marker.radius * 2.0);
1701
+ } else {
1702
+ shader.setPointSize(1);
1703
+ }
1704
+ }
1705
+
1706
+ // If set to true, the toPixels translations in the shader
1707
+ // is skipped, i.e it's assumed that the value is a pixel coord.
1708
+ shader.setSkipTranslation(s.skipTranslation);
1709
+
1710
+ if (s.series.type === 'bubble') {
1711
+ shader.setBubbleUniforms(s.series, s.zMin, s.zMax);
1712
+ }
1713
+
1714
+ shader.setDrawAsCircle((asCircle[s.series.type] && textureIsReady) || false);
1715
+
1716
+ // Do the actual rendering
1717
+ vbuffer.render(s.from, s.to, s.drawMode);
1718
+
1719
+ if (s.hasMarkers && showMarkers) {
1720
+ if (options.marker && options.marker.radius) {
1721
+ shader.setPointSize(options.marker.radius * 2.0);
1722
+ } else {
1723
+ shader.setPointSize(10);
1724
+ }
1725
+ shader.setDrawAsCircle(true);
1726
+ vbuffer.render(s.from, s.to, 'POINTS');
1727
+ }
1728
+ });
1729
+
1730
+ vbuffer.destroy();
1731
+
1732
+ if (settings.timeRendering) {
1733
+ console.timeEnd('gl rendering'); //eslint-disable-line no-console
1734
+ }
1735
+
1736
+ flush();
1737
+
1738
+ if (postRenderCallback) {
1739
+ postRenderCallback();
1740
+ }
1741
+ }
1742
+
1743
+ /*
1744
+ * Render the data when ready
1745
+ */
1746
+ function renderWhenReady(chart) {
1747
+ clear();
1748
+
1749
+ if (chart.renderer.forExport) {
1750
+ return render(chart);
1751
+ }
1752
+
1753
+ if (isInited) {
1754
+ render(chart);
1755
+ } else {
1756
+ setTimeout(function() {
1757
+ renderWhenReady(chart);
1758
+ }, 1);
1759
+ }
1760
+ }
1761
+
1762
+ /*
1763
+ * Set the viewport size in pixels
1764
+ * Creates an orthographic perspective matrix and applies it.
1765
+ * @param w {Integer} - the width of the viewport
1766
+ * @param h {Integer} - the height of the viewport
1767
+ */
1768
+ function setSize(w, h) {
1769
+ // Skip if there's no change
1770
+ if (width === w && h === h) {
1771
+ return;
1772
+ }
1773
+
1774
+ width = w;
1775
+ height = h;
1776
+
1777
+ shader.bind();
1778
+ shader.setPMatrix(orthoMatrix(width, height));
1779
+ }
1780
+
1781
+ /*
1782
+ * Init OpenGL
1783
+ * @param canvas {HTMLCanvas} - the canvas to render to
1784
+ */
1785
+ function init(canvas, noFlush) {
1786
+ var i = 0,
1787
+ contexts = [
1788
+ 'webgl',
1789
+ 'experimental-webgl',
1790
+ 'moz-webgl',
1791
+ 'webkit-3d'
1792
+ ];
1793
+
1794
+ isInited = false;
1795
+
1796
+ if (!canvas) {
1797
+ return false;
1798
+ }
1799
+
1800
+ if (settings.timeSetup) {
1801
+ console.time('gl setup'); //eslint-disable-line no-console
1802
+ }
1803
+
1804
+ for (; i < contexts.length; i++) {
1805
+ gl = canvas.getContext(contexts[i]);
1806
+ if (gl) {
1807
+ break;
1808
+ }
1809
+ }
1810
+
1811
+ if (gl) {
1812
+ if (!noFlush) {
1813
+ flush();
1814
+ }
1815
+ } else {
1816
+ return false;
1817
+ }
1818
+
1819
+ gl.enable(gl.BLEND);
1820
+ // gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
1821
+ gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
1822
+ gl.disable(gl.DEPTH_TEST);
1823
+ gl.depthMask(gl.FALSE);
1824
+
1825
+ shader = GLShader(gl); //eslint-disable-line new-cap
1826
+ vbuffer = GLVertexBuffer(gl, shader); //eslint-disable-line new-cap
1827
+
1828
+ textureIsReady = false;
1829
+
1830
+ // Set up the circle texture used for bubbles
1831
+ circleTextureHandle = gl.createTexture();
1832
+
1833
+ // Draw the circle
1834
+ circleTexture.width = 512;
1835
+ circleTexture.height = 512;
1836
+
1837
+ circleCtx.fillStyle = '#FFF';
1838
+ circleCtx.beginPath();
1839
+ circleCtx.arc(256, 256, 256, 0, 2 * Math.PI);
1840
+ circleCtx.fill();
1841
+
1842
+ try {
1843
+
1844
+ gl.bindTexture(gl.TEXTURE_2D, circleTextureHandle);
1845
+
1846
+ gl.texImage2D(
1847
+ gl.TEXTURE_2D,
1848
+ 0,
1849
+ gl.RGBA,
1850
+ gl.RGBA,
1851
+ gl.UNSIGNED_BYTE,
1852
+ circleTexture
1853
+ );
1854
+
1855
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1856
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1857
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
1858
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
1859
+
1860
+ gl.generateMipmap(gl.TEXTURE_2D);
1861
+
1862
+ gl.bindTexture(gl.TEXTURE_2D, null);
1863
+
1864
+ textureIsReady = true;
1865
+ } catch (e) {}
1866
+
1867
+ isInited = true;
1868
+
1869
+ if (settings.timeSetup) {
1870
+ console.timeEnd('gl setup'); //eslint-disable-line no-console
1871
+ }
1872
+
1873
+ return true;
1874
+ }
1875
+
1876
+ /*
1877
+ * Check if we have a valid OGL context
1878
+ * @returns {Boolean} - true if the context is valid
1879
+ */
1880
+ function valid() {
1881
+ return gl !== false;
1882
+ }
1883
+
1884
+ /*
1885
+ * Check if the renderer has been initialized
1886
+ * @returns {Boolean} - true if it has, false if not
1887
+ */
1888
+ function inited() {
1889
+ return isInited;
1890
+ }
1891
+
1892
+ function destroy() {
1893
+ vbuffer.destroy();
1894
+ shader.destroy();
1895
+ if (gl) {
1896
+ //gl.deleteTexture(circleTextureHandle);
1897
+ }
1898
+ }
1899
+
1900
+ ////////////////////////////////////////////////////////////////////////////
1901
+ exports = {
1902
+ allocateBufferForSingleSeries: allocateBufferForSingleSeries,
1903
+ pushSeries: pushSeries,
1904
+ setSize: setSize,
1905
+ inited: inited,
1906
+ setThreshold: setThreshold,
1907
+ init: init,
1908
+ render: renderWhenReady,
1909
+ settings: settings,
1910
+ valid: valid,
1911
+ clear: clear,
1912
+ flush: flush,
1913
+ setXAxis: setXAxis,
1914
+ setYAxis: setYAxis,
1915
+ data: data,
1916
+ gl: getGL,
1917
+ allocateBuffer: allocateBuffer,
1918
+ destroy: destroy,
1919
+ setOptions: setOptions
1920
+ };
1921
+
1922
+ return exports;
1923
+ }
1924
+
1925
+ // END OF WEBGL ABSTRACTIONS
1926
+ ////////////////////////////////////////////////////////////////////////////////
1927
+
1928
+ /*
1929
+ * Create a canvas + context and attach it to the target
1930
+ * @param target {Highcharts.Chart|Highcharts.Series} - the canvas target
1931
+ * @param chart {Highcharts.Chart} - the chart
1932
+ */
1933
+ function createAndAttachRenderer(chart, series) {
1934
+ var width = chart.chartWidth,
1935
+ height = chart.chartHeight,
1936
+ target = chart,
1937
+ targetGroup = chart.seriesGroup || series.group,
1938
+ swapXY = function(proceed, x, y, a, b, c, d) {
1939
+ proceed.call(series, y, x, a, b, c, d);
1940
+ };
1941
+
1942
+ if (isChartSeriesBoosting(chart)) {
1943
+ target = chart;
1944
+ } else {
1945
+ target = series;
1946
+ }
1947
+
1948
+ if (target.ogl) {
1949
+ //target.ogl.destroy();
1950
+ }
1951
+
1952
+ if (!target.image) {
1953
+ target.canvas = doc.createElement('canvas');
1954
+
1955
+ target.image = chart.renderer.image(
1956
+ '',
1957
+ 0,
1958
+ 0,
1959
+ width,
1960
+ height
1961
+ ).add(targetGroup);
1962
+
1963
+ target.boostClipRect = chart.renderer.clipRect(
1964
+ chart.plotLeft,
1965
+ chart.plotTop,
1966
+ chart.plotWidth,
1967
+ chart.chartHeight
1968
+ );
1969
+
1970
+ target.image.clip(target.boostClipRect);
1971
+
1972
+ if (target.inverted) {
1973
+ each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
1974
+ wrap(false, fn, swapXY);
1975
+ });
1976
+ }
1977
+
1978
+ if (target instanceof H.Chart) {
1979
+ target.markerGroup = target.renderer.g().add(targetGroup);
1980
+
1981
+ target.markerGroup.translate(series.xAxis.pos, series.yAxis.pos);
1982
+ }
1983
+ }
1984
+
1985
+ target.canvas.width = width;
1986
+ target.canvas.height = height;
1987
+
1988
+ target.image.attr({
1989
+ x: 0,
1990
+ y: 0,
1991
+ width: width,
1992
+ height: height,
1993
+ style: 'pointer-events: none'
1994
+ });
1995
+
1996
+ target.boostClipRect.attr({
1997
+ x: chart.plotLeft,
1998
+ y: chart.plotTop,
1999
+ width: chart.plotWidth,
2000
+ height: chart.chartHeight
2001
+ });
2002
+
2003
+ if (!target.ogl) {
2004
+
2005
+
2006
+ target.ogl = GLRenderer(function() { // eslint-disable-line new-cap
2007
+ target.image.attr({
2008
+ href: target.canvas.toDataURL('image/png')
2009
+ });
2010
+ }); //eslint-disable-line new-cap
2011
+
2012
+ target.ogl.init(target.canvas);
2013
+ // target.ogl.clear();
2014
+ target.ogl.setOptions(chart.options.boost || {});
2015
+
2016
+ if (target instanceof H.Chart) {
2017
+ target.ogl.allocateBuffer(chart);
2018
+ }
2019
+ }
2020
+
2021
+ target.ogl.setSize(width, height);
2022
+
2023
+ return target.ogl;
2024
+ }
2025
+
2026
+ /*
2027
+ * Performs the actual render if the renderer is
2028
+ * attached to the series.
2029
+ * @param renderer {OGLRenderer} - the renderer
2030
+ * @param series {Highcharts.Series} - the series
2031
+ */
2032
+ function renderIfNotSeriesBoosting(renderer, series, chart) {
2033
+ if (renderer &&
2034
+ series.image &&
2035
+ series.canvas &&
2036
+ !isChartSeriesBoosting(chart || series.chart)
2037
+ ) {
2038
+ renderer.render(chart || series.chart);
2039
+ }
2040
+ }
2041
+
2042
+ function allocateIfNotSeriesBoosting(renderer, series) {
2043
+ if (renderer &&
2044
+ series.image &&
2045
+ series.canvas &&
2046
+ !isChartSeriesBoosting(series.chart)
2047
+ ) {
2048
+ renderer.allocateBufferForSingleSeries(series);
2049
+ }
2050
+ }
2051
+
2052
+ /*
2053
+ * An "async" foreach loop.
2054
+ * Uses a setTimeout to keep the loop from blocking the UI thread
2055
+ * @param arr {Array} - the array to loop through
2056
+ * @param fn {Function} - the callback to call for each item
2057
+ * @param finalFunc {Function} - the callback to call when done
2058
+ * @param chunkSize {Number} - the number of iterations per. timeout
2059
+ * @param i {Number} - the current index
2060
+ * @param noTimeout {Boolean} - set to true to skip timeouts
2061
+ */
2062
+ function eachAsync(arr, fn, finalFunc, chunkSize, i, noTimeout) {
2063
+ i = i || 0;
2064
+ chunkSize = chunkSize || CHUNK_SIZE;
2065
+
2066
+ var threshold = i + chunkSize,
2067
+ proceed = true;
2068
+
2069
+ while (proceed && i < threshold && i < arr.length) {
2070
+ proceed = fn(arr[i], i);
2071
+ ++i;
2072
+ }
2073
+ if (proceed) {
2074
+ if (i < arr.length) {
2075
+
2076
+ if (noTimeout) {
2077
+ eachAsync(arr, fn, finalFunc, chunkSize, i, noTimeout);
2078
+ } else if (win.requestAnimationFrame) {
2079
+ //If available, do requestAnimationFrame - shaves off a few ms
2080
+ win.requestAnimationFrame(function() {
2081
+ eachAsync(arr, fn, finalFunc, chunkSize, i);
2082
+ });
2083
+ } else {
2084
+ setTimeout(function() {
2085
+ eachAsync(arr, fn, finalFunc, chunkSize, i);
2086
+ });
2087
+ }
2088
+
2089
+ } else if (finalFunc) {
2090
+ finalFunc();
2091
+ }
2092
+ }
2093
+ }
2094
+
2095
+ ////////////////////////////////////////////////////////////////////////////////
2096
+ // Following is the parts of the boost that's common between OGL/Legacy
2097
+
2098
+ /**
2099
+ * Return a full Point object based on the index.
2100
+ * The boost module uses stripped point objects for performance reasons.
2101
+ * @param {Number} boostPoint A stripped-down point object
2102
+ * @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
2103
+ */
2104
+ Series.prototype.getPoint = function(boostPoint) {
2105
+ var point = boostPoint,
2106
+ xData = this.xData || this.options.xData || this.processedXData || false;
2107
+
2108
+ if (boostPoint && !(boostPoint instanceof this.pointClass)) {
2109
+ point = (new this.pointClass()).init( // eslint-disable-line new-cap
2110
+ this,
2111
+ this.options.data[boostPoint.i],
2112
+ xData ? xData[boostPoint.i] : undefined
2113
+ );
2114
+
2115
+ point.category = point.x;
2116
+
2117
+ point.dist = boostPoint.dist;
2118
+ point.distX = boostPoint.distX;
2119
+ point.plotX = boostPoint.plotX;
2120
+ point.plotY = boostPoint.plotY;
2121
+ point.index = boostPoint.i;
2122
+ }
2123
+
2124
+ return point;
2125
+ };
2126
+
2127
+ /**
2128
+ * Return a point instance from the k-d-tree
2129
+ */
2130
+ wrap(Series.prototype, 'searchPoint', function(proceed) {
2131
+ return this.getPoint(
2132
+ proceed.apply(this, [].slice.call(arguments, 1))
2133
+ );
2134
+ });
2135
+
2136
+ /**
2137
+ * Extend series.destroy to also remove the fake k-d-tree points (#5137).
2138
+ * Normally this is handled by Series.destroy that calls Point.destroy,
2139
+ * but the fake search points are not registered like that.
2140
+ */
2141
+ wrap(Series.prototype, 'destroy', function(proceed) {
2142
+ var series = this,
2143
+ chart = series.chart;
2144
+
2145
+ if (chart.markerGroup === series.markerGroup) {
2146
+ series.markerGroup = null;
2147
+ }
2148
+
2149
+ if (chart.hoverPoints) {
2150
+ chart.hoverPoints = grep(chart.hoverPoints, function(point) {
2151
+ return point.series === series;
2152
+ });
2153
+ }
2154
+
2155
+ if (chart.hoverPoint && chart.hoverPoint.series === series) {
2156
+ chart.hoverPoint = null;
2157
+ }
2158
+
2159
+ proceed.call(this);
2160
+ });
2161
+
2162
+ /**
2163
+ * Do not compute extremes when min and max are set.
2164
+ * If we use this in the core, we can add the hook
2165
+ * to hasExtremes to the methods directly.
2166
+ */
2167
+ wrap(Series.prototype, 'getExtremes', function(proceed) {
2168
+ if (!isSeriesBoosting(this) || (!this.hasExtremes || !this.hasExtremes())) {
2169
+ return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2170
+ }
2171
+ });
2172
+
2173
+ // Set default options
2174
+ each([
2175
+ 'area',
2176
+ 'arearange',
2177
+ 'column',
2178
+ 'line',
2179
+ 'scatter',
2180
+ 'heatmap',
2181
+ 'bubble',
2182
+ 'treemap',
2183
+ 'heatmap'
2184
+ ],
2185
+ function(type) {
2186
+ if (plotOptions[type]) {
2187
+ plotOptions[type].boostThreshold = 5000;
2188
+ plotOptions[type].boostData = [];
2189
+ }
2190
+ }
2191
+ );
2192
+
2193
+ /**
2194
+ * Override a bunch of methods the same way. If the number of points is
2195
+ * below the threshold, run the original method. If not, check for a
2196
+ * canvas version or do nothing.
2197
+ *
2198
+ * Note that we're not overriding any of these for heatmaps.
2199
+ */
2200
+ each([
2201
+ 'translate',
2202
+ 'generatePoints',
2203
+ 'drawTracker',
2204
+ 'drawPoints',
2205
+ 'render'
2206
+ ], function(method) {
2207
+ function branch(proceed) {
2208
+ var letItPass = this.options.stacking &&
2209
+ (method === 'translate' || method === 'generatePoints');
2210
+
2211
+ if (!isSeriesBoosting(this) ||
2212
+ letItPass ||
2213
+ this.type === 'heatmap' ||
2214
+ this.type === 'treemap'
2215
+ ) {
2216
+
2217
+ // Clear image
2218
+ if (method === 'render' && this.image && !isChartSeriesBoosting(this.chart)) {
2219
+ this.image.attr({
2220
+ href: ''
2221
+ });
2222
+ this.animate = null; // We're zooming in, don't run animation
2223
+ }
2224
+
2225
+ proceed.call(this);
2226
+
2227
+ // If a canvas version of the method exists, like renderCanvas(), run
2228
+ } else if (this[method + 'Canvas']) {
2229
+ this[method + 'Canvas']();
2230
+ }
2231
+ }
2232
+
2233
+ wrap(Series.prototype, method, branch);
2234
+
2235
+ // A special case for some types - their translate method is already wrapped
2236
+ if (method === 'translate') {
2237
+ if (seriesTypes.column) {
2238
+ wrap(seriesTypes.column.prototype, method, branch);
2239
+ }
2240
+
2241
+ if (seriesTypes.arearange) {
2242
+ wrap(seriesTypes.arearange.prototype, method, branch);
2243
+ }
2244
+
2245
+ if (seriesTypes.treemap) {
2246
+ wrap(seriesTypes.treemap.prototype, method, branch);
2247
+ }
2248
+ }
2249
+ });
2250
+
2251
+ /*
2252
+ * Returns true if the current browser supports webgl
2253
+ */
2254
+ function hasWebGLSupport() {
2255
+ var i = 0,
2256
+ canvas,
2257
+ contexts = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'],
2258
+ context = false;
2259
+
2260
+ if (typeof win.WebGLRenderingContext !== 'undefined') {
2261
+ canvas = doc.createElement('canvas');
2262
+
2263
+ for (; i < contexts.length; i++) {
2264
+ try {
2265
+ context = canvas.getContext(contexts[i]);
2266
+ if (typeof context !== 'undefined' && context !== null) {
2267
+ return true;
2268
+ }
2269
+ } catch (e) {
2270
+
2271
+ }
2272
+ }
2273
+ }
2274
+
2275
+ return false;
2276
+ }
2277
+
2278
+ /* Used for treemap|heatmap.drawPoints */
2279
+ function pointDrawHandler(proceed) {
2280
+ if (!isSeriesBoosting(this)) {
2281
+ return proceed.call(this);
2282
+ }
2283
+
2284
+ //Make sure we have a valid OGL context
2285
+ var renderer = createAndAttachRenderer(this.chart, this);
2286
+
2287
+ if (renderer) {
2288
+ allocateIfNotSeriesBoosting(renderer, this);
2289
+ renderer.pushSeries(this);
2290
+ }
2291
+
2292
+ renderIfNotSeriesBoosting(renderer, this);
2293
+ }
2294
+
2295
+
2296
+
2297
+ ////////////////////////////////////////////////////////////////////////////////
2298
+ // We're wrapped in a closure, so just return if there's no webgl support
2299
+
2300
+ if (!hasWebGLSupport()) {
2301
+ if (typeof H.initCanvasBoost !== 'undefined') {
2302
+ // Fallback to canvas boost
2303
+ H.initCanvasBoost();
2304
+ } else {
2305
+ H.error(26);
2306
+ }
2307
+ } else {
2308
+
2309
+ ////////////////////////////////////////////////////////////////////////////
2310
+ // GL-SPECIFIC WRAPPINGS FOLLOWS
2311
+
2312
+ /** If the series is a heatmap or treemap, or if the series is not boosting
2313
+ * do the default behaviour. Otherwise, process if the series has no
2314
+ * extremes.
2315
+ */
2316
+ wrap(Series.prototype, 'processData', function(proceed) {
2317
+ // If this is a heatmap, do default behaviour
2318
+ if (!isSeriesBoosting(this) ||
2319
+ this.type === 'heatmap' ||
2320
+ this.type === 'treemap') {
2321
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2322
+ }
2323
+
2324
+ if (!this.hasExtremes || !this.hasExtremes(true)) {
2325
+ proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2326
+ }
2327
+ });
2328
+
2329
+ H.extend(Series.prototype, {
2330
+ pointRange: 0,
2331
+ directTouch: false,
2332
+ allowDG: false, // No data grouping, let boost handle large data
2333
+ hasExtremes: function(checkX) {
2334
+ var options = this.options,
2335
+ data = options.data,
2336
+ xAxis = this.xAxis && this.xAxis.options,
2337
+ yAxis = this.yAxis && this.yAxis.options;
2338
+
2339
+ return data.length > (options.boostThreshold || Number.MAX_VALUE) &&
2340
+ isNumber(yAxis.min) && isNumber(yAxis.max) &&
2341
+ (!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
2342
+ },
2343
+
2344
+ /**
2345
+ * If implemented in the core, parts of this can probably be
2346
+ * shared with other similar methods in Highcharts.
2347
+ */
2348
+ destroyGraphics: function() {
2349
+ var series = this,
2350
+ points = this.points,
2351
+ point,
2352
+ i;
2353
+
2354
+ if (points) {
2355
+ for (i = 0; i < points.length; i = i + 1) {
2356
+ point = points[i];
2357
+ if (point && point.graphic) {
2358
+ point.graphic = point.graphic.destroy();
2359
+ }
2360
+ }
2361
+ }
2362
+
2363
+ each(['graph', 'area', 'tracker'], function(prop) {
2364
+ if (series[prop]) {
2365
+ series[prop] = series[prop].destroy();
2366
+ }
2367
+ });
2368
+ },
2369
+
2370
+ renderCanvas: function() {
2371
+ var series = this,
2372
+ options = series.options || {},
2373
+ renderer = false,
2374
+ chart = series.chart,
2375
+ xAxis = this.xAxis,
2376
+ yAxis = this.yAxis,
2377
+ //ctx,
2378
+ //c = 0,
2379
+ xData = options.xData || series.processedXData,
2380
+ yData = options.yData || series.processedYData,
2381
+
2382
+ rawData = options.data,
2383
+ xExtremes = xAxis.getExtremes(),
2384
+ xMin = xExtremes.min,
2385
+ xMax = xExtremes.max,
2386
+ yExtremes = yAxis.getExtremes(),
2387
+ yMin = yExtremes.min,
2388
+ yMax = yExtremes.max,
2389
+ pointTaken = {},
2390
+ lastClientX,
2391
+ sampling = !!series.sampling,
2392
+ points,
2393
+ enableMouseTracking = options.enableMouseTracking !== false,
2394
+ threshold = options.threshold,
2395
+ yBottom = yAxis.getThreshold(threshold),
2396
+ isRange = series.pointArrayMap &&
2397
+ series.pointArrayMap.join(',') === 'low,high',
2398
+ isStacked = !!options.stacking,
2399
+ cropStart = series.cropStart || 0,
2400
+ requireSorting = series.requireSorting,
2401
+ useRaw = !xData,
2402
+ minVal,
2403
+ maxVal,
2404
+ minI,
2405
+ maxI,
2406
+
2407
+ addKDPoint = function(clientX, plotY, i) {
2408
+ //Shaves off about 60ms compared to repeated concatination
2409
+ index = clientX + ',' + plotY;
2410
+
2411
+ // The k-d tree requires series points.
2412
+ // Reduce the amount of points, since the time to build the
2413
+ // tree increases exponentially.
2414
+ if (enableMouseTracking && !pointTaken[index]) {
2415
+ pointTaken[index] = true;
2416
+
2417
+ if (chart.inverted) {
2418
+ clientX = xAxis.len - clientX;
2419
+ plotY = yAxis.len - plotY;
2420
+ }
2421
+
2422
+ points.push({
2423
+ clientX: clientX,
2424
+ plotX: clientX,
2425
+ plotY: plotY,
2426
+ i: cropStart + i
2427
+ });
2428
+ }
2429
+ };
2430
+
2431
+ // Get or create the renderer
2432
+ renderer = createAndAttachRenderer(chart, series);
2433
+
2434
+ if (!this.visible) {
2435
+ if (!isChartSeriesBoosting(chart) && renderer) {
2436
+ renderer.clear();
2437
+ this.image.attr({
2438
+ href: ''
2439
+ });
2440
+ }
2441
+ return;
2442
+ }
2443
+
2444
+ // If we are zooming out from SVG mode, destroy the graphics
2445
+ if (this.points || this.graph) {
2446
+ this.destroyGraphics();
2447
+ }
2448
+
2449
+ // If we're rendering per. series we should create the marker groups
2450
+ // as usual.
2451
+ if (!isChartSeriesBoosting(chart)) {
2452
+ this.markerGroup = series.plotGroup(
2453
+ 'markerGroup',
2454
+ 'markers',
2455
+ true,
2456
+ 1,
2457
+ chart.seriesGroup
2458
+ );
2459
+ } else {
2460
+ //Use a single group for the markers
2461
+ this.markerGroup = chart.markerGroup;
2462
+ }
2463
+
2464
+ points = this.points = [];
2465
+
2466
+ // Do not start building while drawing
2467
+ series.buildKDTree = noop;
2468
+
2469
+ if (renderer) {
2470
+ allocateIfNotSeriesBoosting(renderer, this);
2471
+ renderer.pushSeries(series);
2472
+ // Perform the actual renderer if we're on series level
2473
+ renderIfNotSeriesBoosting(renderer, this, chart);
2474
+ //console.log(series, chart);
2475
+ }
2476
+
2477
+ /* This builds the KD-tree */
2478
+ function processPoint(d, i) {
2479
+ var x,
2480
+ y,
2481
+ clientX,
2482
+ plotY,
2483
+ isNull,
2484
+ low,
2485
+ chartDestroyed = typeof chart.index === 'undefined',
2486
+ isYInside = true;
2487
+
2488
+ if (!chartDestroyed) {
2489
+ if (useRaw) {
2490
+ x = d[0];
2491
+ y = d[1];
2492
+ } else {
2493
+ x = d;
2494
+ y = yData[i];
2495
+ }
2496
+
2497
+ // Resolve low and high for range series
2498
+ if (isRange) {
2499
+ if (useRaw) {
2500
+ y = d.slice(1, 3);
2501
+ }
2502
+ low = y[0];
2503
+ y = y[1];
2504
+ } else if (isStacked) {
2505
+ x = d.x;
2506
+ y = d.stackY;
2507
+ low = y - d.y;
2508
+ }
2509
+
2510
+ isNull = y === null;
2511
+
2512
+ // Optimize for scatter zooming
2513
+ if (!requireSorting) {
2514
+ isYInside = y >= yMin && y <= yMax;
2515
+ }
2516
+
2517
+ if (!isNull && x >= xMin && x <= xMax && isYInside) {
2518
+
2519
+ // We use ceil to allow the KD tree to work with sub
2520
+ // pixels, which can be used in boost to space pixels
2521
+ clientX = Math.ceil(xAxis.toPixels(x, true));
2522
+
2523
+ if (sampling) {
2524
+ if (minI === undefined || clientX === lastClientX) {
2525
+ if (!isRange) {
2526
+ low = y;
2527
+ }
2528
+ if (maxI === undefined || y > maxVal) {
2529
+ maxVal = y;
2530
+ maxI = i;
2531
+ }
2532
+ if (minI === undefined || low < minVal) {
2533
+ minVal = low;
2534
+ minI = i;
2535
+ }
2536
+
2537
+ }
2538
+ if (clientX !== lastClientX) { // Add points and reset
2539
+ if (minI !== undefined) { // then maxI is also a number
2540
+ plotY = yAxis.toPixels(maxVal, true);
2541
+ yBottom = yAxis.toPixels(minVal, true);
2542
+
2543
+ addKDPoint(clientX, plotY, maxI);
2544
+ if (yBottom !== plotY) {
2545
+ addKDPoint(clientX, yBottom, minI);
2546
+ }
2547
+ }
2548
+
2549
+ minI = maxI = undefined;
2550
+ lastClientX = clientX;
2551
+ }
2552
+ } else {
2553
+ plotY = Math.ceil(yAxis.toPixels(y, true));
2554
+ addKDPoint(clientX, plotY, i);
2555
+ }
2556
+ }
2557
+ }
2558
+
2559
+ return !chartDestroyed;
2560
+ }
2561
+
2562
+ function doneProcessing() {
2563
+ fireEvent(series, 'renderedCanvas');
2564
+ // Pass tests in Pointer.
2565
+ // Replace this with a single property, and replace when zooming
2566
+ // in below boostThreshold.
2567
+ series.directTouch = false;
2568
+ series.options.stickyTracking = true;
2569
+
2570
+ // Go back to prototype, ready to build
2571
+ delete series.buildKDTree;
2572
+ series.buildKDTree();
2573
+ }
2574
+
2575
+ // Loop over the points to build the k-d tree
2576
+ eachAsync(
2577
+ isStacked ? series.data : (xData || rawData),
2578
+ processPoint,
2579
+ doneProcessing,
2580
+ chart.renderer.forExport ? Number.MAX_VALUE : undefined
2581
+ );
2582
+ }
2583
+ });
2584
+
2585
+ /*
2586
+ * We need to handle heatmaps separatly, since we can't perform the
2587
+ * size/color calculations in the shader easily.
2588
+ *
2589
+ * This likely needs future optimization.
2590
+ *
2591
+ */
2592
+ each(['heatmap', 'treemap'],
2593
+ function(t) {
2594
+ if (seriesTypes[t]) {
2595
+ wrap(seriesTypes[t].prototype, 'drawPoints', pointDrawHandler);
2596
+ seriesTypes[t].prototype.directTouch = false; // Use k-d-tree
2597
+ }
2598
+ }
2599
+ );
2600
+
2601
+ if (seriesTypes.bubble) {
2602
+ // By default, the bubble series does not use the KD-tree, so force it
2603
+ // to.
2604
+ delete seriesTypes.bubble.prototype.buildKDTree;
2605
+ seriesTypes.bubble.prototype.directTouch = false;
2606
+
2607
+ // Needed for markers to work correctly
2608
+ wrap(
2609
+ seriesTypes.bubble.prototype,
2610
+ 'markerAttribs',
2611
+ function(proceed) {
2612
+ if (isSeriesBoosting(this)) {
2613
+ return false;
2614
+ }
2615
+ return proceed.apply(this, [].slice.call(arguments, 1));
2616
+ }
2617
+ );
2618
+ }
2619
+
2620
+ seriesTypes.scatter.prototype.fill = true;
2621
+
2622
+ extend(seriesTypes.area.prototype, {
2623
+ fill: true,
2624
+ fillOpacity: true,
2625
+ sampling: true
2626
+ });
2627
+
2628
+ extend(seriesTypes.column.prototype, {
2629
+ fill: true,
2630
+ sampling: true
2631
+ });
2632
+
2633
+ wrap(Series.prototype, 'setVisible', function(proceed, vis) {
2634
+ proceed.call(this, vis, false);
2635
+ if (this.visible === false && this.ogl && this.canvas && this.image) {
2636
+ this.ogl.clear();
2637
+ this.image.attr({
2638
+ href: ''
2639
+ });
2640
+ } else {
2641
+ this.chart.redraw();
2642
+ }
2643
+ });
2644
+
2645
+ /**
2646
+ * Take care of the canvas blitting
2647
+ */
2648
+ H.Chart.prototype.callbacks.push(function(chart) {
2649
+
2650
+ /* Convert chart-level canvas to image */
2651
+ function canvasToSVG() {
2652
+ if (chart.ogl && isChartSeriesBoosting(chart)) {
2653
+ chart.ogl.render(chart);
2654
+ }
2655
+ }
2656
+
2657
+ /* Clear chart-level canvas */
2658
+ function preRender() {
2659
+ if (chart.canvas && chart.ogl && isChartSeriesBoosting(chart)) {
2660
+ // Allocate
2661
+ chart.ogl.allocateBuffer(chart);
2662
+ }
2663
+
2664
+ //see #6518
2665
+ if (chart.markerGroup) {
2666
+ chart.markerGroup.translate(
2667
+ chart.xAxis[0].pos,
2668
+ chart.yAxis[0].pos
2669
+ );
2670
+ }
2671
+ }
2672
+
2673
+ addEvent(chart, 'predraw', preRender);
2674
+ addEvent(chart, 'render', canvasToSVG);
2675
+ });
2676
+ } // if hasCanvasSupport
2677
+
2678
+ }(Highcharts));
591
2679
  }));