corrade-nucleus-nucleons – Blame information for rev

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /**
2 * @license Highcharts JS v5.0.10 (2017-03-31)
3 * Boost module
4 *
5 * (c) 2010-2017 Highsoft AS
6 * Author: Torstein Honsi
7 *
8 * License: www.highcharts.com/license
9 */
10 'use strict';
11 (function(factory) {
12 if (typeof module === 'object' && module.exports) {
13 module.exports = factory;
14 } else {
15 factory(Highcharts);
16 }
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, Image */
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 );
298 }
299  
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);
329 }
330  
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 }
563  
564 function uloc(n) {
565 return gl.getUniformLocation(shaderProgram, n);
566 }
567  
568 shaderProgram = gl.createProgram();
569  
570 gl.attachShader(shaderProgram, v);
571 gl.attachShader(shaderProgram, f);
572 gl.linkProgram(shaderProgram);
573  
574 gl.useProgram(shaderProgram);
575  
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;
590 }
591  
592 /*
593 * Destroy the shader
594 */
595 function destroy() {
596 if (gl && shaderProgram) {
597 gl.deleteProgram(shaderProgram);
598 }
599 }
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);
608 }
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 }
621  
622 /*
623 * Set the active texture
624 * @param texture - the texture
625 */
626 function setTexture() {
627 gl.uniform1i(uSamplerUniform, 0);
628 }
629  
630 /*
631 * Set if inversion state
632 * @flag is the state
633 */
634 function setInverted(flag) {
635 gl.uniform1i(isInverted, flag);
636 }
637  
638 ////////////////////////////////////////////////////////////////////////////
639  
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);
653 }
654  
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);
686 }
687 }
688  
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
771 */
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 }
787  
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;
802 }
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;
823 }
824  
825 /*
826 * Bind the buffer
827 */
828 function bind() {
829 if (!buffer) {
830 return false;
831 }
832  
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 }
839  
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 }
852  
853 if (!length) {
854 return false;
855 }
856  
857 if (!from || from > length || from < 0) {
858 < 0) { from = 0;
859 < 0) { }
860  
861 < 0) { if (!to || to > length) {
862 < 0) { to = length;
863 < 0) { }
864  
865 < 0) { drawMode = drawMode || 'points';
866  
867 < 0) { gl.drawArrays(
868 < 0) { gl[drawMode.toUpperCase()],
869 < 0) { from / components,
870 < 0) { (to - from) / components
871 < 0) { );
872  
873 < 0) { return true;
874 < 0) { }
875  
876 < 0) { function push(x, y, a, b) {
877 < 0) { if (preAllocated) { // && iterator <= preAllocated.length - 4) {
878 < 0) {<= preAllocated.length - 4) { preAllocated[++iterator] = x;
879 < 0) {<= preAllocated.length - 4) { preAllocated[++iterator] = y;
880 < 0) {<= preAllocated.length - 4) { preAllocated[++iterator] = a;
881 < 0) {<= preAllocated.length - 4) { preAllocated[++iterator] = b;
882 < 0) {<= preAllocated.length - 4) { }
883 < 0) {<= preAllocated.length - 4) { }
884  
885 < 0) {<= preAllocated.length - 4) { /*
886 < 0) {<= preAllocated.length - 4) { * Note about pre-allocated buffers:
887 < 0) {<= preAllocated.length - 4) { * - This is slower for charts with many series
888 < 0) {<= preAllocated.length - 4) { */
889 < 0) {<= preAllocated.length - 4) { function allocate(size) {
890 < 0) {<= preAllocated.length - 4) { size *= 4;
891 < 0) {<= preAllocated.length - 4) { iterator = -1;
892  
893 < 0) {<= preAllocated.length - 4) { //if (!preAllocated || (preAllocated && preAllocated.length !== size)) {
894 < 0) {<= preAllocated.length - 4) { preAllocated = new Float32Array(size);
895 < 0) {<= preAllocated.length - 4) { //}
896 < 0) {<= preAllocated.length - 4) { }
897  
898 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////
899 < 0) {<= preAllocated.length - 4) { return {
900 < 0) {<= preAllocated.length - 4) { destroy: destroy,
901 < 0) {<= preAllocated.length - 4) { bind: bind,
902 < 0) {<= preAllocated.length - 4) { data: data,
903 < 0) {<= preAllocated.length - 4) { build: build,
904 < 0) {<= preAllocated.length - 4) { render: render,
905 < 0) {<= preAllocated.length - 4) { allocate: allocate,
906 < 0) {<= preAllocated.length - 4) { push: push
907 < 0) {<= preAllocated.length - 4) { };
908 < 0) {<= preAllocated.length - 4) { }
909  
910 < 0) {<= preAllocated.length - 4) { /* Main renderer. Used to render series.
911 < 0) {<= preAllocated.length - 4) { * Notes to self:
912 < 0) {<= preAllocated.length - 4) { * - May be able to build a point map by rendering to a separate canvas
913 < 0) {<= preAllocated.length - 4) { * and encoding values in the color data.
914 < 0) {<= preAllocated.length - 4) { * - Need to figure out a way to transform the data quicker
915 < 0) {<= preAllocated.length - 4) { */
916 < 0) {<= preAllocated.length - 4) { function GLRenderer(postRenderCallback) {
917 < 0) {<= preAllocated.length - 4) { var // Shader
918 < 0) {<= preAllocated.length - 4) { shader = false,
919 < 0) {<= preAllocated.length - 4) { // Vertex buffers - keyed on shader attribute name
920 < 0) {<= preAllocated.length - 4) { vbuffer = false,
921 < 0) {<= preAllocated.length - 4) { // Opengl context
922 < 0) {<= preAllocated.length - 4) { gl = false,
923 < 0) {<= preAllocated.length - 4) { // Width of our viewport in pixels
924 < 0) {<= preAllocated.length - 4) { width = 0,
925 < 0) {<= preAllocated.length - 4) { // Height of our viewport in pixels
926 < 0) {<= preAllocated.length - 4) { height = 0,
927 < 0) {<= preAllocated.length - 4) { // The data to render - array of coordinates
928 < 0) {<= preAllocated.length - 4) { data = false,
929 < 0) {<= preAllocated.length - 4) { // The marker data
930 < 0) {<= preAllocated.length - 4) { markerData = false,
931 < 0) {<= preAllocated.length - 4) { // Is the texture ready?
932 < 0) {<= preAllocated.length - 4) { textureIsReady = false,
933 < 0) {<= preAllocated.length - 4) { // Exports
934 < 0) {<= preAllocated.length - 4) { exports = {},
935 < 0) {<= preAllocated.length - 4) { // Is it inited?
936 < 0) {<= preAllocated.length - 4) { isInited = false,
937 < 0) {<= preAllocated.length - 4) { // The series stack
938 < 0) {<= preAllocated.length - 4) { series = [],
939 < 0) {<= preAllocated.length - 4) { // Texture for circles
940 < 0) {<= preAllocated.length - 4) { circleTexture = doc.createElement('canvas'),
941 < 0) {<= preAllocated.length - 4) { // Context for circle texture
942 < 0) {<= preAllocated.length - 4) { circleCtx = circleTexture.getContext('2d'),
943 < 0) {<= preAllocated.length - 4) { // Handle for the circle texture
944 < 0) {<= preAllocated.length - 4) { circleTextureHandle,
945 < 0) {<= preAllocated.length - 4) { // Things to draw as "rectangles" (i.e lines)
946 < 0) {<= preAllocated.length - 4) { asBar = {
947 < 0) {<= preAllocated.length - 4) { 'column': true,
948 < 0) {<= preAllocated.length - 4) { 'area': true
949 < 0) {<= preAllocated.length - 4) { },
950 < 0) {<= preAllocated.length - 4) { asCircle = {
951 < 0) {<= preAllocated.length - 4) { 'scatter': true,
952 < 0) {<= preAllocated.length - 4) { 'bubble': true
953 < 0) {<= preAllocated.length - 4) { },
954 < 0) {<= preAllocated.length - 4) { //Render settings
955 < 0) {<= preAllocated.length - 4) { settings = {
956 < 0) {<= preAllocated.length - 4) { pointSize: 1,
957 < 0) {<= preAllocated.length - 4) { lineWidth: 3,
958 < 0) {<= preAllocated.length - 4) { fillColor: '#AA00AA',
959 < 0) {<= preAllocated.length - 4) { useAlpha: true,
960 < 0) {<= preAllocated.length - 4) { usePreallocated: false,
961 < 0) {<= preAllocated.length - 4) { useGPUTranslations: false,
962 < 0) {<= preAllocated.length - 4) { timeRendering: false,
963 < 0) {<= preAllocated.length - 4) { timeSeriesProcessing: false,
964 < 0) {<= preAllocated.length - 4) { timeSetup: false
965 < 0) {<= preAllocated.length - 4) { };
966  
967 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////
968  
969 < 0) {<= preAllocated.length - 4) { function setOptions(options) {
970 < 0) {<= preAllocated.length - 4) { merge(true, settings, options);
971 < 0) {<= preAllocated.length - 4) { }
972  
973 < 0) {<= preAllocated.length - 4) { function seriesPointCount(series) {
974 < 0) {<= preAllocated.length - 4) { var isStacked,
975 < 0) {<= preAllocated.length - 4) { xData,
976 < 0) {<= preAllocated.length - 4) { s;
977  
978 < 0) {<= preAllocated.length - 4) { if (isSeriesBoosting(series)) {
979 < 0) {<= preAllocated.length - 4) { isStacked = !!series.options.stacking;
980 < 0) {<= preAllocated.length - 4) { xData = series.xData || series.options.xData || series.processedXData;
981 < 0) {<= preAllocated.length - 4) { s = (isStacked ? series.data : (xData || series.options.data)).length;
982  
983 < 0) {<= preAllocated.length - 4) { if (series.type === 'treemap') {
984 < 0) {<= preAllocated.length - 4) { s *= 12;
985 < 0) {<= preAllocated.length - 4) { } else if (series.type === 'heatmap') {
986 < 0) {<= preAllocated.length - 4) { s *= 6;
987 < 0) {<= preAllocated.length - 4) { } else if (asBar[series.type]) {
988 < 0) {<= preAllocated.length - 4) { s *= 2;
989 < 0) {<= preAllocated.length - 4) { }
990  
991 < 0) {<= preAllocated.length - 4) { return s;
992 < 0) {<= preAllocated.length - 4) { }
993  
994 < 0) {<= preAllocated.length - 4) { return 0;
995 < 0) {<= preAllocated.length - 4) { }
996  
997 < 0) {<= preAllocated.length - 4) { /* Allocate a float buffer to fit all series */
998 < 0) {<= preAllocated.length - 4) { function allocateBuffer(chart) {
999 < 0) {<= preAllocated.length - 4) { var s = 0;
1000  
1001 < 0) {<= preAllocated.length - 4) { if (!settings.usePreallocated) {
1002 < 0) {<= preAllocated.length - 4) { return;
1003 < 0) {<= preAllocated.length - 4) { }
1004  
1005 < 0) {<= preAllocated.length - 4) { each(chart.series, function(series) {
1006 < 0) {<= preAllocated.length - 4) { if (isSeriesBoosting(series)) {
1007 < 0) {<= preAllocated.length - 4) { s += seriesPointCount(series);
1008 < 0) {<= preAllocated.length - 4) { }
1009 < 0) {<= preAllocated.length - 4) { });
1010  
1011 < 0) {<= preAllocated.length - 4) { vbuffer.allocate(s);
1012 < 0) {<= preAllocated.length - 4) { }
1013  
1014 < 0) {<= preAllocated.length - 4) { function allocateBufferForSingleSeries(series) {
1015 < 0) {<= preAllocated.length - 4) { var s = 0;
1016  
1017 < 0) {<= preAllocated.length - 4) { if (!settings.usePreallocated) {
1018 < 0) {<= preAllocated.length - 4) { return;
1019 < 0) {<= preAllocated.length - 4) { }
1020  
1021 < 0) {<= preAllocated.length - 4) { if (isSeriesBoosting(series)) {
1022 < 0) {<= preAllocated.length - 4) { s = seriesPointCount(series);
1023 < 0) {<= preAllocated.length - 4) { }
1024  
1025 < 0) {<= preAllocated.length - 4) { vbuffer.allocate(s);
1026 < 0) {<= preAllocated.length - 4) { }
1027  
1028 < 0) {<= preAllocated.length - 4) { /*
1029 < 0) {<= preAllocated.length - 4) { * Returns an orthographic perspective matrix
1030 < 0) {<= preAllocated.length - 4) { * @param {number} width - the width of the viewport in pixels
1031 < 0) {<= preAllocated.length - 4) { * @param {number} height - the height of the viewport in pixels
1032 < 0) {<= preAllocated.length - 4) { */
1033 < 0) {<= preAllocated.length - 4) { function orthoMatrix(width, height) {
1034 < 0) {<= preAllocated.length - 4) { var near = 0,
1035 < 0) {<= preAllocated.length - 4) { far = 1;
1036  
1037 < 0) {<= preAllocated.length - 4) { return [
1038 < 0) {<= preAllocated.length - 4) { 2 / width, 0, 0, 0,
1039 < 0) {<= preAllocated.length - 4) { 0, -(2 / height), 0, 0,
1040 < 0) {<= preAllocated.length - 4) { 0, 0, -2 / (far - near), 0, -1, 1, -(far + near) / (far - near), 1
1041 < 0) {<= preAllocated.length - 4) { ];
1042 < 0) {<= preAllocated.length - 4) { }
1043  
1044 < 0) {<= preAllocated.length - 4) { /*
1045 < 0) {<= preAllocated.length - 4) { * Clear the depth and color buffer
1046 < 0) {<= preAllocated.length - 4) { */
1047 < 0) {<= preAllocated.length - 4) { function clear() {
1048 < 0) {<= preAllocated.length - 4) { gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
1049 < 0) {<= preAllocated.length - 4) { }
1050  
1051 < 0) {<= preAllocated.length - 4) { /*
1052 < 0) {<= preAllocated.length - 4) { * Get the WebGL context
1053 < 0) {<= preAllocated.length - 4) { * @returns {WebGLContext} - the context
1054 < 0) {<= preAllocated.length - 4) { */
1055 < 0) {<= preAllocated.length - 4) { function getGL() {
1056 < 0) {<= preAllocated.length - 4) { return gl;
1057 < 0) {<= preAllocated.length - 4) { }
1058  
1059 < 0) {<= preAllocated.length - 4) { /*
1060 < 0) {<= preAllocated.length - 4) { * Push data for a single series
1061 < 0) {<= preAllocated.length - 4) { * This calculates additional vertices and transforms the data to be
1062 < 0) {<= preAllocated.length - 4) { * aligned correctly in memory
1063 < 0) {<= preAllocated.length - 4) { */
1064 < 0) {<= preAllocated.length - 4) { function pushSeriesData(series, inst) {
1065 < 0) {<= preAllocated.length - 4) { var isRange = series.pointArrayMap &&
1066 < 0) {<= preAllocated.length - 4) { series.pointArrayMap.join(',') === 'low,high',
1067 < 0) {<= preAllocated.length - 4) { chart = series.chart,
1068 < 0) {<= preAllocated.length - 4) { options = series.options,
1069 < 0) {<= preAllocated.length - 4) { isStacked = !!options.stacking,
1070 < 0) {<= preAllocated.length - 4) { rawData = options.data,
1071 < 0) {<= preAllocated.length - 4) { xExtremes = series.xAxis.getExtremes(),
1072 < 0) {<= preAllocated.length - 4) { xMin = xExtremes.min,
1073 < 0) {<= preAllocated.length - 4) { xMax = xExtremes.max,
1074 < 0) {<= preAllocated.length - 4) { yExtremes = series.yAxis.getExtremes(),
1075 < 0) {<= preAllocated.length - 4) { yMin = yExtremes.min,
1076 < 0) {<= preAllocated.length - 4) { yMax = yExtremes.max,
1077 < 0) {<= preAllocated.length - 4) { xData = series.xData || options.xData || series.processedXData,
1078 < 0) {<= preAllocated.length - 4) { yData = series.yData || options.yData || series.processedYData,
1079 < 0) {<= preAllocated.length - 4) { zData = series.zData || options.zData || series.processedZData,
1080 < 0) {<= preAllocated.length - 4) { yAxis = series.yAxis,
1081 < 0) {<= preAllocated.length - 4) { xAxis = series.xAxis,
1082 < 0) {<= preAllocated.length - 4) { useRaw = !xData || xData.length === 0,
1083 < 0) {<= preAllocated.length - 4) { // threshold = options.threshold,
1084 < 0) {<= preAllocated.length - 4) { // yBottom = chart.yAxis[0].getThreshold(threshold),
1085 < 0) {<= preAllocated.length - 4) { // hasThreshold = isNumber(threshold),
1086 < 0) {<= preAllocated.length - 4) { // colorByPoint = series.options.colorByPoint,
1087 < 0) {<= preAllocated.length - 4) { // This is required for color by point, so make sure this is
1088 < 0) {<= preAllocated.length - 4) { // uncommented if enabling that
1089 < 0) {<= preAllocated.length - 4) { // colorIndex = 0,
1090 < 0) {<= preAllocated.length - 4) { // Required for color axis support
1091 < 0) {<= preAllocated.length - 4) { // caxis,
1092 < 0) {<= preAllocated.length - 4) { // connectNulls = options.connectNulls,
1093 < 0) {<= preAllocated.length - 4) { // For some reason eslint doesn't pick up that this is actually used
1094 < 0) {<= preAllocated.length - 4) { maxVal, //eslint-disable-line no-unused-vars
1095 < 0) {<= preAllocated.length - 4) { points = series.points || false,
1096 < 0) {<= preAllocated.length - 4) { lastX = false,
1097 < 0) {<= preAllocated.length - 4) { minVal,
1098 < 0) {<= preAllocated.length - 4) { color,
1099 < 0) {<= preAllocated.length - 4) { scolor,
1100 < 0) {<= preAllocated.length - 4) { sdata = isStacked ? series.data : (xData || rawData);
1101  
1102 < 0) {<= preAllocated.length - 4) { if (options.boostData && options.boostData.length > 0) {
1103 < 0) {<= preAllocated.length - 4) { return;
1104 < 0) {<= preAllocated.length - 4) { }
1105  
1106 < 0) {<= preAllocated.length - 4) { series.closestPointRangePx = Number.MAX_VALUE;
1107  
1108 < 0) {<= preAllocated.length - 4) { // Push color to color buffer - need to do this per. vertex
1109 < 0) {<= preAllocated.length - 4) { function pushColor(color) {
1110 < 0) {<= preAllocated.length - 4) { if (color) {
1111 < 0) {<= preAllocated.length - 4) { inst.colorData.push(color[0]);
1112 < 0) {<= preAllocated.length - 4) { inst.colorData.push(color[1]);
1113 < 0) {<= preAllocated.length - 4) { inst.colorData.push(color[2]);
1114 < 0) {<= preAllocated.length - 4) { inst.colorData.push(color[3]);
1115 < 0) {<= preAllocated.length - 4) { }
1116 < 0) {<= preAllocated.length - 4) { }
1117  
1118 < 0) {<= preAllocated.length - 4) { //Push a vertice to the data buffer
1119 < 0) {<= preAllocated.length - 4) { function vertice(x, y, checkTreshold, pointSize, color) {
1120 < 0) {<= preAllocated.length - 4) { pushColor(color);
1121 < 0) {<= preAllocated.length - 4) { if (settings.usePreallocated) {
1122 < 0) {<= preAllocated.length - 4) { vbuffer.push(x, y, checkTreshold ? 1 : 0, pointSize || 1);
1123 < 0) {<= preAllocated.length - 4) { } else {
1124 < 0) {<= preAllocated.length - 4) { data.push(x);
1125 < 0) {<= preAllocated.length - 4) { data.push(y);
1126 < 0) {<= preAllocated.length - 4) { data.push(checkTreshold ? 1 : 0);
1127 < 0) {<= preAllocated.length - 4) { data.push(pointSize || 1);
1128 < 0) {<= preAllocated.length - 4) { }
1129 < 0) {<= preAllocated.length - 4) { }
1130  
1131 < 0) {<= preAllocated.length - 4) { // Push a rectangle to the data buffer
1132 < 0) {<= preAllocated.length - 4) { function pushRect(x, y, w, h, color) {
1133 < 0) {<= preAllocated.length - 4) { pushColor(color);
1134 < 0) {<= preAllocated.length - 4) { vertice(x + w, y);
1135 < 0) {<= preAllocated.length - 4) { pushColor(color);
1136 < 0) {<= preAllocated.length - 4) { vertice(x, y);
1137 < 0) {<= preAllocated.length - 4) { pushColor(color);
1138 < 0) {<= preAllocated.length - 4) { vertice(x, y + h);
1139  
1140 < 0) {<= preAllocated.length - 4) { pushColor(color);
1141 < 0) {<= preAllocated.length - 4) { vertice(x, y + h);
1142 < 0) {<= preAllocated.length - 4) { pushColor(color);
1143 < 0) {<= preAllocated.length - 4) { vertice(x + w, y + h);
1144 < 0) {<= preAllocated.length - 4) { pushColor(color);
1145 < 0) {<= preAllocated.length - 4) { vertice(x + w, y);
1146 < 0) {<= preAllocated.length - 4) { }
1147  
1148 < 0) {<= preAllocated.length - 4) { // Special case for point shapes
1149 < 0) {<= preAllocated.length - 4) { if (points && points.length > 0) {
1150  
1151 < 0) {<= preAllocated.length - 4) { // If we're doing points, we assume that the points are already
1152 < 0) {<= preAllocated.length - 4) { // translated, so we skip the shader translation.
1153 < 0) {<= preAllocated.length - 4) { inst.skipTranslation = true;
1154 < 0) {<= preAllocated.length - 4) { // Force triangle draw mode
1155 < 0) {<= preAllocated.length - 4) { inst.drawMode = 'triangles';
1156  
1157 < 0) {<= preAllocated.length - 4) { // We don't have a z component in the shader, so we need to sort.
1158 < 0) {<= preAllocated.length - 4) { if (points[0].node && points[0].node.levelDynamic) {
1159 < 0) {<= preAllocated.length - 4) { points.sort(function(a, b) {
1160 < 0) {<= preAllocated.length - 4) { if (a.node) {
1161 < 0) {<= preAllocated.length - 4) { if (a.node.levelDynamic > b.node.levelDynamic) {
1162 < 0) {<= preAllocated.length - 4) { return 1;
1163 < 0) {<= preAllocated.length - 4) { } else if (a.node.levelDynamic < b.node.levelDynamic) {
1164 < 0) {<= preAllocated.length - 4) { return -1;
1165 < 0) {<= preAllocated.length - 4) { }
1166 < 0) {<= preAllocated.length - 4) { }
1167 < 0) {<= preAllocated.length - 4) { return 0;
1168 < 0) {<= preAllocated.length - 4) { });
1169 < 0) {<= preAllocated.length - 4) { }
1170  
1171 < 0) {<= preAllocated.length - 4) { each(points, function(point) {
1172 < 0) {<= preAllocated.length - 4) { var plotY = point.plotY,
1173 < 0) {<= preAllocated.length - 4) { shapeArgs,
1174 < 0) {<= preAllocated.length - 4) { swidth,
1175 < 0) {<= preAllocated.length - 4) { pointAttr;
1176  
1177 < 0) {<= preAllocated.length - 4) { if (plotY !== undefined && !isNaN(plotY) && point.y !== null) {
1178 < 0) {<= preAllocated.length - 4) { shapeArgs = point.shapeArgs;
1179 < 0) {<= preAllocated.length - 4) { pointAttr = (point.pointAttr && point.pointAttr['']) ||
1180 < 0) {<= preAllocated.length - 4) { point.series.pointAttribs(point);
1181 < 0) {<= preAllocated.length - 4) { swidth = pointAttr['stroke-width'];
1182  
1183 < 0) {<= preAllocated.length - 4) { // Handle point colors
1184 < 0) {<= preAllocated.length - 4) { color = H.color(pointAttr.fill).rgba;
1185 < 0) {<= preAllocated.length - 4) { color[0] /= 255.0;
1186 < 0) {<= preAllocated.length - 4) { color[1] /= 255.0;
1187 < 0) {<= preAllocated.length - 4) { color[2] /= 255.0;
1188  
1189 < 0) {<= preAllocated.length - 4) { // So there are two ways of doing this. Either we can
1190 < 0) {<= preAllocated.length - 4) { // create a rectangle of two triangles, or we can do a
1191 < 0) {<= preAllocated.length - 4) { // point and use point size. Latter is faster, but
1192 < 0) {<= preAllocated.length - 4) { // only supports squares. So we're doing triangles.
1193 < 0) {<= preAllocated.length - 4) { // We could also use one color per. vertice to get
1194 < 0) {<= preAllocated.length - 4) { // better color interpolation.
1195  
1196 < 0) {<= preAllocated.length - 4) { // If there's stroking, we do an additional rect
1197 < 0) {<= preAllocated.length - 4) { //if (pointAttr.stroke !== 'none' && swidth && swidth > 0) {
1198 < 0) {<= preAllocated.length - 4) { if (series.type === 'treemap') {
1199 < 0) {<= preAllocated.length - 4) { swidth = swidth || 1;
1200 < 0) {<= preAllocated.length - 4) { scolor = H.color(pointAttr.stroke).rgba;
1201  
1202 < 0) {<= preAllocated.length - 4) { scolor[0] /= 255.0;
1203 < 0) {<= preAllocated.length - 4) { scolor[1] /= 255.0;
1204 < 0) {<= preAllocated.length - 4) { scolor[2] /= 255.0;
1205  
1206 < 0) {<= preAllocated.length - 4) { pushRect(
1207 < 0) {<= preAllocated.length - 4) { shapeArgs.x,
1208 < 0) {<= preAllocated.length - 4) { shapeArgs.y,
1209 < 0) {<= preAllocated.length - 4) { shapeArgs.width,
1210 < 0) {<= preAllocated.length - 4) { shapeArgs.height,
1211 < 0) {<= preAllocated.length - 4) { scolor
1212 < 0) {<= preAllocated.length - 4) { );
1213  
1214 < 0) {<= preAllocated.length - 4) { swidth /= 2;
1215 < 0) {<= preAllocated.length - 4) { }
1216 < 0) {<= preAllocated.length - 4) { // } else {
1217 < 0) {<= preAllocated.length - 4) { // swidth = 0;
1218 < 0) {<= preAllocated.length - 4) { // }
1219  
1220 < 0) {<= preAllocated.length - 4) { pushRect(
1221 < 0) {<= preAllocated.length - 4) { shapeArgs.x + swidth,
1222 < 0) {<= preAllocated.length - 4) { shapeArgs.y + swidth,
1223 < 0) {<= preAllocated.length - 4) { shapeArgs.width - (swidth * 2),
1224 < 0) {<= preAllocated.length - 4) { shapeArgs.height - (swidth * 2),
1225 < 0) {<= preAllocated.length - 4) { color
1226 < 0) {<= preAllocated.length - 4) { );
1227 < 0) {<= preAllocated.length - 4) { }
1228 < 0) {<= preAllocated.length - 4) { });
1229  
1230 < 0) {<= preAllocated.length - 4) { return;
1231 < 0) {<= preAllocated.length - 4) { }
1232  
1233 < 0) {<= preAllocated.length - 4) { // Extract color axis
1234 < 0) {<= preAllocated.length - 4) { // each(chart.axes || [], function (a) {
1235 < 0) {<= preAllocated.length - 4) { // if (H.ColorAxis && a instanceof H.ColorAxis) {
1236 < 0) {<= preAllocated.length - 4) { // caxis = a;
1237 < 0) {<= preAllocated.length - 4) { // }
1238 < 0) {<= preAllocated.length - 4) { // });
1239  
1240 < 0) {<= preAllocated.length - 4) { each(sdata, function(d, i) {
1241 < 0) {<= preAllocated.length - 4) { var x,
1242 < 0) {<= preAllocated.length - 4) { y,
1243 < 0) {<= preAllocated.length - 4) { z,
1244 < 0) {<= preAllocated.length - 4) { px = false,
1245 < 0) {<= preAllocated.length - 4) { nx = false,
1246 < 0) {<= preAllocated.length - 4) { // This is in fact used.
1247 < 0) {<= preAllocated.length - 4) { low, //eslint-disable-line no-unused-vars
1248 < 0) {<= preAllocated.length - 4) { chartDestroyed = typeof chart.index === 'undefined',
1249 < 0) {<= preAllocated.length - 4) { nextInside = false,
1250 < 0) {<= preAllocated.length - 4) { prevInside = false,
1251 < 0) {<= preAllocated.length - 4) { pcolor = false,
1252 < 0) {<= preAllocated.length - 4) { drawAsBar = asBar[series.type],
1253 < 0) {<= preAllocated.length - 4) { isXInside = false,
1254 < 0) {<= preAllocated.length - 4) { isYInside = true;
1255  
1256 < 0) {<= preAllocated.length - 4) { if (chartDestroyed) {
1257 < 0) {<= preAllocated.length - 4) { return false;
1258 < 0) {<= preAllocated.length - 4) { }
1259  
1260 < 0) {<= preAllocated.length - 4) { // Uncomment this to enable color by point.
1261 < 0) {<= preAllocated.length - 4) { // This currently left disabled as the charts look really ugly
1262 < 0) {<= preAllocated.length - 4) { // when enabled and there's a lot of points.
1263 < 0) {<= preAllocated.length - 4) { // Leaving in for the future (tm).
1264 < 0) {<= preAllocated.length - 4) { // if (colorByPoint) {
1265 < 0) {<= preAllocated.length - 4) { // colorIndex = ++colorIndex % series.chart.options.colors.length;
1266 < 0) {<= preAllocated.length - 4) { // pcolor = toRGBAFast(series.chart.options.colors[colorIndex]);
1267 < 0) {<= preAllocated.length - 4) { // pcolor[0] /= 255.0;
1268 < 0) {<= preAllocated.length - 4) { // pcolor[1] /= 255.0;
1269 < 0) {<= preAllocated.length - 4) { // pcolor[2] /= 255.0;
1270 < 0) {<= preAllocated.length - 4) { // }
1271  
1272 < 0) {<= preAllocated.length - 4) { if (useRaw) {
1273 < 0) {<= preAllocated.length - 4) { x = d[0];
1274 < 0) {<= preAllocated.length - 4) { y = d[1];
1275  
1276 < 0) {<= preAllocated.length - 4) { if (sdata[i + 1]) {
1277 < 0) {<= preAllocated.length - 4) { nx = sdata[i + 1][0];
1278 < 0) {<= preAllocated.length - 4) { }
1279  
1280 < 0) {<= preAllocated.length - 4) { if (sdata[i - 1]) {
1281 < 0) {<= preAllocated.length - 4) { px = sdata[i - 1][0];
1282 < 0) {<= preAllocated.length - 4) { }
1283  
1284 < 0) {<= preAllocated.length - 4) { if (d.length >= 3) {
1285 < 0) {<= preAllocated.length - 4) { z = d[2];
1286  
1287 < 0) {<= preAllocated.length - 4) { if (d[2] > inst.zMax) {
1288 < 0) {<= preAllocated.length - 4) { inst.zMax = d[2];
1289 < 0) {<= preAllocated.length - 4) { }
1290  
1291 < 0) {<= preAllocated.length - 4) { if (d[2] < inst.zMin) {
1292 < 0) {<= preAllocated.length - 4) { inst.zMin = d[2];
1293 < 0) {<= preAllocated.length - 4) { }
1294 < 0) {<= preAllocated.length - 4) { }
1295  
1296 < 0) {<= preAllocated.length - 4) { } else {
1297 < 0) {<= preAllocated.length - 4) { x = d;
1298 < 0) {<= preAllocated.length - 4) { y = yData[i];
1299  
1300 < 0) {<= preAllocated.length - 4) { if (sdata[i + 1]) {
1301 < 0) {<= preAllocated.length - 4) { nx = sdata[i + 1];
1302 < 0) {<= preAllocated.length - 4) { }
1303  
1304 < 0) {<= preAllocated.length - 4) { if (sdata[i - 1]) {
1305 < 0) {<= preAllocated.length - 4) { px = sdata[i - 1];
1306 < 0) {<= preAllocated.length - 4) { }
1307  
1308 < 0) {<= preAllocated.length - 4) { if (zData && zData.length) {
1309 < 0) {<= preAllocated.length - 4) { z = zData[i];
1310  
1311 < 0) {<= preAllocated.length - 4) { if (zData[i] > inst.zMax) {
1312 < 0) {<= preAllocated.length - 4) { inst.zMax = zData[i];
1313 < 0) {<= preAllocated.length - 4) { }
1314  
1315 < 0) {<= preAllocated.length - 4) { if (zData[i] < inst.zMin) {
1316 < 0) {<= preAllocated.length - 4) { inst.zMin = zData[i];
1317 < 0) {<= preAllocated.length - 4) { }
1318 < 0) {<= preAllocated.length - 4) { }
1319 < 0) {<= preAllocated.length - 4) { }
1320  
1321 < 0) {<= preAllocated.length - 4) { if (nx && nx >= xMin && nx <= xMax) {
1322 < 0) {<= preAllocated.length - 4) { nextInside = true;
1323 < 0) {<= preAllocated.length - 4) { }
1324  
1325 < 0) {<= preAllocated.length - 4) { if (px && px >= xMin && px <= xMax) {
1326 < 0) {<= preAllocated.length - 4) { prevInside = true;
1327 < 0) {<= preAllocated.length - 4) { }
1328  
1329 < 0) {<= preAllocated.length - 4) { if (isRange) {
1330 < 0) {<= preAllocated.length - 4) { if (useRaw) {
1331 < 0) {<= preAllocated.length - 4) { y = d.slice(1, 3);
1332 < 0) {<= preAllocated.length - 4) { }
1333  
1334 < 0) {<= preAllocated.length - 4) { low = y[0];
1335 < 0) {<= preAllocated.length - 4) { y = y[1];
1336  
1337 < 0) {<= preAllocated.length - 4) { } else if (isStacked) {
1338 < 0) {<= preAllocated.length - 4) { x = d.x;
1339 < 0) {<= preAllocated.length - 4) { y = d.stackY;
1340 < 0) {<= preAllocated.length - 4) { low = y - d.y;
1341 < 0) {<= preAllocated.length - 4) { }
1342  
1343 < 0) {<= preAllocated.length - 4) { if (!series.requireSorting) {
1344 < 0) {<= preAllocated.length - 4) { isYInside = y >= yMin && y <= yMax;
1345 < 0) {<= preAllocated.length - 4) { }
1346  
1347 < 0) {<= preAllocated.length - 4) { if ((!y || !isYInside)) {
1348 < 0) {<= preAllocated.length - 4) { return;
1349 < 0) {<= preAllocated.length - 4) { }
1350  
1351 < 0) {<= preAllocated.length - 4) { if (x >= xMin && x <= xMax) {
1352 < 0) {<= preAllocated.length - 4) { isXInside = true;
1353 < 0) {<= preAllocated.length - 4) { }
1354  
1355 < 0) {<= preAllocated.length - 4) { if (!isXInside && !nextInside && !prevInside) {
1356 < 0) {<= preAllocated.length - 4) { return;
1357 < 0) {<= preAllocated.length - 4) { }
1358  
1359 < 0) {<= preAllocated.length - 4) { // Skip translations - temporary floating point fix
1360 < 0) {<= preAllocated.length - 4) { if (!settings.useGPUTranslations) {
1361 < 0) {<= preAllocated.length - 4) { inst.skipTranslation = true;
1362 < 0) {<= preAllocated.length - 4) { x = xAxis.toPixels(x, true);
1363 < 0) {<= preAllocated.length - 4) { y = yAxis.toPixels(y, true);
1364 < 0) {<= preAllocated.length - 4) { }
1365  
1366 < 0) {<= preAllocated.length - 4) { if (drawAsBar) {
1367  
1368 < 0) {<= preAllocated.length - 4) { maxVal = y;
1369 < 0) {<= preAllocated.length - 4) { minVal = 0;
1370  
1371 < 0) {<= preAllocated.length - 4) { if (y < 0) {
1372 < 0) {<= preAllocated.length - 4) { minVal = y;
1373 < 0) {<= preAllocated.length - 4) { y = 0;
1374 < 0) {<= preAllocated.length - 4) { }
1375  
1376 < 0) {<= preAllocated.length - 4) { if (!settings.useGPUTranslations) {
1377 < 0) {<= preAllocated.length - 4) { minVal = yAxis.toPixels(minVal, true);
1378 < 0) {<= preAllocated.length - 4) { }
1379  
1380 < 0) {<= preAllocated.length - 4) { // Need to add an extra point here
1381 < 0) {<= preAllocated.length - 4) { vertice(x, minVal, 0, 0, pcolor);
1382 < 0) {<= preAllocated.length - 4) { }
1383  
1384 < 0) {<= preAllocated.length - 4) { // No markers on out of bounds things.
1385 < 0) {<= preAllocated.length - 4) { // Out of bound things are shown if and only if the next
1386 < 0) {<= preAllocated.length - 4) { // or previous point is inside the rect.
1387 < 0) {<= preAllocated.length - 4) { if (inst.hasMarkers) { // && isXInside) {
1388 < 0) {<= preAllocated.length - 4) { // x = H.correctFloat(
1389 < 0) {<= preAllocated.length - 4) { // Math.min(Math.max(-1e5, xAxis.translate(
1390 < 0) {<= preAllocated.length - 4) { // x,
1391 < 0) {<= preAllocated.length - 4) { // 0,
1392 < 0) {<= preAllocated.length - 4) { // 0,
1393 < 0) {<= preAllocated.length - 4) { // 0,
1394 < 0) {<= preAllocated.length - 4) { // 1,
1395 < 0) {<= preAllocated.length - 4) { // 0.5,
1396 < 0) {<= preAllocated.length - 4) { // false
1397 < 0) {<= preAllocated.length - 4) { // )), 1e5)
1398 < 0) {<= preAllocated.length - 4) { // );
1399  
1400 < 0) {<= preAllocated.length - 4) { if (lastX !== false) {
1401 < 0) {<= preAllocated.length - 4) { series.closestPointRangePx = Math.min(
1402 < 0) {<= preAllocated.length - 4) { series.closestPointRangePx,
1403 < 0) {<= preAllocated.length - 4) { Math.abs(x - lastX)
1404 < 0) {<= preAllocated.length - 4) { );
1405 < 0) {<= preAllocated.length - 4) { }
1406 < 0) {<= preAllocated.length - 4) { }
1407  
1408 < 0) {<= preAllocated.length - 4) { vertice(
1409 < 0) {<= preAllocated.length - 4) { x,
1410 < 0) {<= preAllocated.length - 4) { y,
1411 < 0) {<= preAllocated.length - 4) { 0,
1412 < 0) {<= preAllocated.length - 4) { series.type === 'bubble' ? (z || 1) : 2,
1413 < 0) {<= preAllocated.length - 4) { pcolor
1414 < 0) {<= preAllocated.length - 4) { );
1415  
1416 < 0) {<= preAllocated.length - 4) { // Uncomment this to support color axis.
1417 < 0) {<= preAllocated.length - 4) { // if (caxis) {
1418 < 0) {<= preAllocated.length - 4) { // color = H.color(caxis.toColor(y)).rgba;
1419  
1420 < 0) {<= preAllocated.length - 4) { // inst.colorData.push(color[0] / 255.0);
1421 < 0) {<= preAllocated.length - 4) { // inst.colorData.push(color[1] / 255.0);
1422 < 0) {<= preAllocated.length - 4) { // inst.colorData.push(color[2] / 255.0);
1423 < 0) {<= preAllocated.length - 4) { // inst.colorData.push(color[3]);
1424 < 0) {<= preAllocated.length - 4) { // }
1425  
1426 < 0) {<= preAllocated.length - 4) { lastX = x;
1427  
1428 < 0) {<= preAllocated.length - 4) { //return true;
1429 < 0) {<= preAllocated.length - 4) { });
1430 < 0) {<= preAllocated.length - 4) { }
1431  
1432 < 0) {<= preAllocated.length - 4) { /*
1433 < 0) {<= preAllocated.length - 4) { * Push a series to the renderer
1434 < 0) {<= preAllocated.length - 4) { * If we render the series immediatly, we don't have to loop later
1435 < 0) {<= preAllocated.length - 4) { * @param s {Highchart.Series} - the series to push
1436 < 0) {<= preAllocated.length - 4) { */
1437 < 0) {<= preAllocated.length - 4) { function pushSeries(s) {
1438 < 0) {<= preAllocated.length - 4) { if (series.length > 0) {
1439 < 0) {<= preAllocated.length - 4) { series[series.length - 1].to = data.length;
1440 < 0) {<= preAllocated.length - 4) { if (series[series.length - 1].hasMarkers) {
1441 < 0) {<= preAllocated.length - 4) { series[series.length - 1].markerTo = markerData.length;
1442 < 0) {<= preAllocated.length - 4) { }
1443 < 0) {<= preAllocated.length - 4) { }
1444  
1445 < 0) {<= preAllocated.length - 4) { if (settings.timeSeriesProcessing) {
1446 < 0) {<= preAllocated.length - 4) { console.time('building ' + s.type + ' series'); //eslint-disable-line no-console
1447 < 0) {<= preAllocated.length - 4) { }
1448  
1449 < 0) {<= preAllocated.length - 4) { series.push({
1450 < 0) {<= preAllocated.length - 4) { from: data.length,
1451 < 0) {<= preAllocated.length - 4) { markerFrom: markerData.length,
1452 < 0) {<= preAllocated.length - 4) { // Push RGBA values to this array to use per. point coloring.
1453 < 0) {<= preAllocated.length - 4) { // It should be 0-padded, so each component should be pushed in
1454 < 0) {<= preAllocated.length - 4) { // succession.
1455 < 0) {<= preAllocated.length - 4) { colorData: [],
1456 < 0) {<= preAllocated.length - 4) { series: s,
1457 < 0) {<= preAllocated.length - 4) { zMin: Number.MAX_VALUE,
1458 < 0) {<= preAllocated.length - 4) { zMax: -Number.MAX_VALUE,
1459 < 0) {<= preAllocated.length - 4) { hasMarkers: s.options.marker ? s.options.marker.enabled !== false : false,
1460 < 0) {<= preAllocated.length - 4) { showMarksers: true,
1461 < 0) {<= preAllocated.length - 4) { drawMode: ({
1462 < 0) {<= preAllocated.length - 4) { 'area': 'lines',
1463 < 0) {<= preAllocated.length - 4) { 'arearange': 'lines',
1464 < 0) {<= preAllocated.length - 4) { 'areaspline': 'line_strip',
1465 < 0) {<= preAllocated.length - 4) { 'column': 'lines',
1466 < 0) {<= preAllocated.length - 4) { 'line': 'line_strip',
1467 < 0) {<= preAllocated.length - 4) { 'scatter': 'points',
1468 < 0) {<= preAllocated.length - 4) { 'heatmap': 'triangles',
1469 < 0) {<= preAllocated.length - 4) { 'treemap': 'triangles',
1470 < 0) {<= preAllocated.length - 4) { 'bubble': 'points'
1471 < 0) {<= preAllocated.length - 4) { })[s.type] || 'line_strip'
1472 < 0) {<= preAllocated.length - 4) { });
1473  
1474 < 0) {<= preAllocated.length - 4) { // Add the series data to our buffer(s)
1475 < 0) {<= preAllocated.length - 4) { pushSeriesData(s, series[series.length - 1]);
1476  
1477 < 0) {<= preAllocated.length - 4) { if (settings.timeSeriesProcessing) {
1478 < 0) {<= preAllocated.length - 4) { console.timeEnd('building ' + s.type + ' series'); //eslint-disable-line no-console
1479 < 0) {<= preAllocated.length - 4) { }
1480 < 0) {<= preAllocated.length - 4) { }
1481  
1482 < 0) {<= preAllocated.length - 4) { /*
1483 < 0) {<= preAllocated.length - 4) { * Flush the renderer.
1484 < 0) {<= preAllocated.length - 4) { * This removes pushed series and vertices.
1485 < 0) {<= preAllocated.length - 4) { * Should be called after clearing and before rendering
1486 < 0) {<= preAllocated.length - 4) { */
1487 < 0) {<= preAllocated.length - 4) { function flush() {
1488 < 0) {<= preAllocated.length - 4) { series = [];
1489 < 0) {<= preAllocated.length - 4) { exports.data = data = [];
1490 < 0) {<= preAllocated.length - 4) { markerData = [];
1491 < 0) {<= preAllocated.length - 4) { }
1492  
1493 < 0) {<= preAllocated.length - 4) { /*
1494 < 0) {<= preAllocated.length - 4) { * Pass x-axis to shader
1495 < 0) {<= preAllocated.length - 4) { * @param axis {Highcharts.Axis} - the x-axis
1496 < 0) {<= preAllocated.length - 4) { */
1497 < 0) {<= preAllocated.length - 4) { function setXAxis(axis) {
1498 < 0) {<= preAllocated.length - 4) { if (!shader) {
1499 < 0) {<= preAllocated.length - 4) { return;
1500 < 0) {<= preAllocated.length - 4) { }
1501  
1502 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisTrans', axis.transA);
1503 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisMin', axis.min);
1504 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisMinPad', axis.minPixelPadding);
1505 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisPointRange', axis.pointRange);
1506 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisLen', axis.len);
1507 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisPos', axis.pos);
1508 < 0) {<= preAllocated.length - 4) { shader.setUniform('xAxisCVSCoord', !axis.horiz);
1509 < 0) {<= preAllocated.length - 4) { }
1510  
1511 < 0) {<= preAllocated.length - 4) { /*
1512 < 0) {<= preAllocated.length - 4) { * Pass y-axis to shader
1513 < 0) {<= preAllocated.length - 4) { * @param axis {Highcharts.Axis} - the y-axis
1514 < 0) {<= preAllocated.length - 4) { */
1515 < 0) {<= preAllocated.length - 4) { function setYAxis(axis) {
1516 < 0) {<= preAllocated.length - 4) { if (!shader) {
1517 < 0) {<= preAllocated.length - 4) { return;
1518 < 0) {<= preAllocated.length - 4) { }
1519  
1520 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisTrans', axis.transA);
1521 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisMin', axis.min);
1522 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisMinPad', axis.minPixelPadding);
1523 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisPointRange', axis.pointRange);
1524 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisLen', axis.len);
1525 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisPos', axis.pos);
1526 < 0) {<= preAllocated.length - 4) { shader.setUniform('yAxisCVSCoord', !axis.horiz);
1527 < 0) {<= preAllocated.length - 4) { }
1528  
1529 < 0) {<= preAllocated.length - 4) { /*
1530 < 0) {<= preAllocated.length - 4) { * Set the translation threshold
1531 < 0) {<= preAllocated.length - 4) { * @param has {boolean} - has threshold flag
1532 < 0) {<= preAllocated.length - 4) { * @param translation {Float} - the threshold
1533 < 0) {<= preAllocated.length - 4) { */
1534 < 0) {<= preAllocated.length - 4) { function setThreshold(has, translation) {
1535 < 0) {<= preAllocated.length - 4) { shader.setUniform('hasThreshold', has);
1536 < 0) {<= preAllocated.length - 4) { shader.setUniform('translatedThreshold', translation);
1537 < 0) {<= preAllocated.length - 4) { }
1538  
1539 < 0) {<= preAllocated.length - 4) { /*
1540 < 0) {<= preAllocated.length - 4) { * Render the data
1541 < 0) {<= preAllocated.length - 4) { * This renders all pushed series.
1542 < 0) {<= preAllocated.length - 4) { */
1543 < 0) {<= preAllocated.length - 4) { function render(chart) {
1544  
1545 < 0) {<= preAllocated.length - 4) { if (chart) {
1546 < 0) {<= preAllocated.length - 4) { if (!chart.chartHeight || !chart.chartWidth) {
1547 < 0) {<= preAllocated.length - 4) { //chart.setChartSize();
1548 < 0) {<= preAllocated.length - 4) { }
1549  
1550 < 0) {<= preAllocated.length - 4) { width = chart.chartWidth || 800;
1551 < 0) {<= preAllocated.length - 4) { height = chart.chartHeight || 400;
1552 < 0) {<= preAllocated.length - 4) { } else {
1553 < 0) {<= preAllocated.length - 4) { return false;
1554 < 0) {<= preAllocated.length - 4) { }
1555  
1556 < 0) {<= preAllocated.length - 4) { if (!gl || !width || !height) {
1557 < 0) {<= preAllocated.length - 4) { return false;
1558 < 0) {<= preAllocated.length - 4) { }
1559  
1560 < 0) {<= preAllocated.length - 4) { if (settings.timeRendering) {
1561 < 0) {<= preAllocated.length - 4) { console.time('gl rendering'); //eslint-disable-line no-console
1562 < 0) {<= preAllocated.length - 4) { }
1563  
1564 < 0) {<= preAllocated.length - 4) { shader.bind();
1565  
1566 < 0) {<= preAllocated.length - 4) { gl.viewport(0, 0, width, height);
1567 < 0) {<= preAllocated.length - 4) { shader.setPMatrix(orthoMatrix(width, height));
1568  
1569 < 0) {<= preAllocated.length - 4) { gl.lineWidth(settings.lineWidth);
1570  
1571 < 0) {<= preAllocated.length - 4) { vbuffer.build(exports.data, 'aVertexPosition', 4);
1572 < 0) {<= preAllocated.length - 4) { vbuffer.bind();
1573  
1574 < 0) {<= preAllocated.length - 4) { if (textureIsReady) {
1575 < 0) {<= preAllocated.length - 4) { gl.bindTexture(gl.TEXTURE_2D, circleTextureHandle);
1576 < 0) {<= preAllocated.length - 4) { shader.setTexture(circleTextureHandle);
1577 < 0) {<= preAllocated.length - 4) { }
1578  
1579 < 0) {<= preAllocated.length - 4) { shader.setInverted(chart.options.chart ? chart.options.chart.inverted : false);
1580  
1581 < 0) {<= preAllocated.length - 4) { // Render the series
1582 < 0) {<= preAllocated.length - 4) { each(series, function(s, si) {
1583 < 0) {<= preAllocated.length - 4) { var options = s.series.options,
1584 < 0) {<= preAllocated.length - 4) { threshold = options.threshold,
1585 < 0) {<= preAllocated.length - 4) { hasThreshold = isNumber(threshold),
1586 < 0) {<= preAllocated.length - 4) { yBottom = s.series.yAxis.getThreshold(threshold),
1587 < 0) {<= preAllocated.length - 4) { translatedThreshold = yBottom,
1588 < 0) {<= preAllocated.length - 4) { cbuffer,
1589 < 0) {<= preAllocated.length - 4) { showMarkers = pick(
1590 < 0) {<= preAllocated.length - 4) { options.marker ? options.marker.enabled : null,
1591 < 0) {<= preAllocated.length - 4) { s.series.xAxis.isRadial ? true : null,
1592 < 0) {<= preAllocated.length - 4) { s.series.closestPointRangePx >
1593 < 0) {<= preAllocated.length - 4) { 2 * ((
1594 < 0) {<= preAllocated.length - 4) { options.marker ?
1595 < 0) {<= preAllocated.length - 4) { options.marker.radius :
1596 < 0) {<= preAllocated.length - 4) { 10
1597 < 0) {<= preAllocated.length - 4) { ) || 10)
1598 < 0) {<= preAllocated.length - 4) { ),
1599 < 0) {<= preAllocated.length - 4) { fillColor = s.series.fillOpacity ?
1600 < 0) {<= preAllocated.length - 4) { new Color(s.series.color).setOpacity(
1601 < 0) {<= preAllocated.length - 4) { pick(options.fillOpacity, 0.85)
1602 < 0) {<= preAllocated.length - 4) { ).get() :
1603 < 0) {<= preAllocated.length - 4) { s.series.color,
1604 < 0) {<= preAllocated.length - 4) { color;
1605  
1606 < 0) {<= preAllocated.length - 4) { vbuffer.bind();
1607  
1608 < 0) {<= preAllocated.length - 4) { if (options.colorByPoint) {
1609 < 0) {<= preAllocated.length - 4) { fillColor = s.series.chart.options.colors[si];
1610 < 0) {<= preAllocated.length - 4) { }
1611  
1612 < 0) {<= preAllocated.length - 4) { color = H.color(fillColor).rgba;
1613  
1614 < 0) {<= preAllocated.length - 4) { if (!settings.useAlpha) {
1615 < 0) {<= preAllocated.length - 4) { color[3] = 1.0;
1616 < 0) {<= preAllocated.length - 4) { }
1617  
1618 < 0) {<= preAllocated.length - 4) { //Blending
1619 < 0) {<= preAllocated.length - 4) { if (options.boostBlending === 'add') { // docs
1620 < 0) {<= preAllocated.length - 4) { gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
1621 < 0) {<= preAllocated.length - 4) { gl.blendEquation(gl.FUNC_ADD);
1622  
1623 < 0) {<= preAllocated.length - 4) { } else if (options.boostBlending === 'mult') {
1624 < 0) {<= preAllocated.length - 4) { gl.blendFunc(gl.DST_COLOR, gl.ZERO);
1625  
1626 < 0) {<= preAllocated.length - 4) { } else if (options.boostBlending === 'darken') {
1627 < 0) {<= preAllocated.length - 4) { gl.blendFunc(gl.ONE, gl.ONE);
1628 < 0) {<= preAllocated.length - 4) { gl.blendEquation(gl.FUNC_MIN);
1629  
1630 < 0) {<= preAllocated.length - 4) { } else {
1631 < 0) {<= preAllocated.length - 4) { gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); //, gl.ONE, gl.ZERO);
1632 < 0) {<= preAllocated.length - 4) { gl.blendEquation(gl.FUNC_ADD);
1633 < 0) {<= preAllocated.length - 4) { }
1634  
1635 < 0) {<= preAllocated.length - 4) { shader.reset();
1636  
1637 < 0) {<= preAllocated.length - 4) { // If there are entries in the colorData buffer, build and bind it.
1638 < 0) {<= preAllocated.length - 4) { if (s.colorData.length > 0) {
1639 < 0) {<= preAllocated.length - 4) { shader.setUniform('hasColor', 1.0);
1640 < 0) {<= preAllocated.length - 4) { cbuffer = GLVertexBuffer(gl, shader); //eslint-disable-line new-cap
1641 < 0) {<= preAllocated.length - 4) { cbuffer.build(s.colorData, 'aColor', 4);
1642 < 0) {<= preAllocated.length - 4) { cbuffer.bind();
1643 < 0) {<= preAllocated.length - 4) { }
1644  
1645 < 0) {<= preAllocated.length - 4) { // Set series specific uniforms
1646 < 0) {<= preAllocated.length - 4) { shader.setColor(color);
1647 < 0) {<= preAllocated.length - 4) { setXAxis(s.series.xAxis);
1648 < 0) {<= preAllocated.length - 4) { setYAxis(s.series.yAxis);
1649 < 0) {<= preAllocated.length - 4) { setThreshold(hasThreshold, translatedThreshold);
1650  
1651 < 0) {<= preAllocated.length - 4) { if (s.drawMode === 'points') {
1652 < 0) {<= preAllocated.length - 4) { if (options.marker && options.marker.radius) {
1653 < 0) {<= preAllocated.length - 4) { shader.setPointSize(options.marker.radius * 2.0);
1654 < 0) {<= preAllocated.length - 4) { } else {
1655 < 0) {<= preAllocated.length - 4) { shader.setPointSize(1);
1656 < 0) {<= preAllocated.length - 4) { }
1657 < 0) {<= preAllocated.length - 4) { }
1658  
1659 < 0) {<= preAllocated.length - 4) { // If set to true, the toPixels translations in the shader
1660 < 0) {<= preAllocated.length - 4) { // is skipped, i.e it's assumed that the value is a pixel coord.
1661 < 0) {<= preAllocated.length - 4) { shader.setSkipTranslation(s.skipTranslation);
1662  
1663 < 0) {<= preAllocated.length - 4) { if (s.series.type === 'bubble') {
1664 < 0) {<= preAllocated.length - 4) { shader.setBubbleUniforms(s.series, s.zMin, s.zMax);
1665 < 0) {<= preAllocated.length - 4) { }
1666  
1667 < 0) {<= preAllocated.length - 4) { shader.setDrawAsCircle((asCircle[s.series.type] && textureIsReady) || false);
1668  
1669 < 0) {<= preAllocated.length - 4) { // Do the actual rendering
1670 < 0) {<= preAllocated.length - 4) { vbuffer.render(s.from, s.to, s.drawMode);
1671  
1672 < 0) {<= preAllocated.length - 4) { if (s.hasMarkers && showMarkers) {
1673 < 0) {<= preAllocated.length - 4) { if (options.marker && options.marker.radius) {
1674 < 0) {<= preAllocated.length - 4) { shader.setPointSize(options.marker.radius * 2.0);
1675 < 0) {<= preAllocated.length - 4) { } else {
1676 < 0) {<= preAllocated.length - 4) { shader.setPointSize(10);
1677 < 0) {<= preAllocated.length - 4) { }
1678 < 0) {<= preAllocated.length - 4) { shader.setDrawAsCircle(true);
1679 < 0) {<= preAllocated.length - 4) { vbuffer.render(s.from, s.to, 'POINTS');
1680 < 0) {<= preAllocated.length - 4) { }
1681 < 0) {<= preAllocated.length - 4) { });
1682  
1683 < 0) {<= preAllocated.length - 4) { vbuffer.destroy();
1684  
1685 < 0) {<= preAllocated.length - 4) { if (settings.timeRendering) {
1686 < 0) {<= preAllocated.length - 4) { console.timeEnd('gl rendering'); //eslint-disable-line no-console
1687 < 0) {<= preAllocated.length - 4) { }
1688  
1689 < 0) {<= preAllocated.length - 4) { flush();
1690  
1691 < 0) {<= preAllocated.length - 4) { if (postRenderCallback) {
1692 < 0) {<= preAllocated.length - 4) { postRenderCallback();
1693 < 0) {<= preAllocated.length - 4) { }
1694 < 0) {<= preAllocated.length - 4) { }
1695  
1696 < 0) {<= preAllocated.length - 4) { /*
1697 < 0) {<= preAllocated.length - 4) { * Render the data when ready
1698 < 0) {<= preAllocated.length - 4) { */
1699 < 0) {<= preAllocated.length - 4) { function renderWhenReady(chart) {
1700 < 0) {<= preAllocated.length - 4) { clear();
1701  
1702 < 0) {<= preAllocated.length - 4) { if (chart.renderer.forExport) {
1703 < 0) {<= preAllocated.length - 4) { return render(chart);
1704 < 0) {<= preAllocated.length - 4) { }
1705  
1706 < 0) {<= preAllocated.length - 4) { if (isInited) {
1707 < 0) {<= preAllocated.length - 4) { render(chart);
1708 < 0) {<= preAllocated.length - 4) { } else {
1709 < 0) {<= preAllocated.length - 4) { setTimeout(function() {
1710 < 0) {<= preAllocated.length - 4) { renderWhenReady(chart);
1711 < 0) {<= preAllocated.length - 4) { }, 1);
1712 < 0) {<= preAllocated.length - 4) { }
1713 < 0) {<= preAllocated.length - 4) { }
1714  
1715 < 0) {<= preAllocated.length - 4) { /*
1716 < 0) {<= preAllocated.length - 4) { * Set the viewport size in pixels
1717 < 0) {<= preAllocated.length - 4) { * Creates an orthographic perspective matrix and applies it.
1718 < 0) {<= preAllocated.length - 4) { * @param w {Integer} - the width of the viewport
1719 < 0) {<= preAllocated.length - 4) { * @param h {Integer} - the height of the viewport
1720 < 0) {<= preAllocated.length - 4) { */
1721 < 0) {<= preAllocated.length - 4) { function setSize(w, h) {
1722 < 0) {<= preAllocated.length - 4) { // Skip if there's no change
1723 < 0) {<= preAllocated.length - 4) { if (width === w && h === h) {
1724 < 0) {<= preAllocated.length - 4) { return;
1725 < 0) {<= preAllocated.length - 4) { }
1726  
1727 < 0) {<= preAllocated.length - 4) { width = w;
1728 < 0) {<= preAllocated.length - 4) { height = h;
1729  
1730 < 0) {<= preAllocated.length - 4) { shader.bind();
1731 < 0) {<= preAllocated.length - 4) { shader.setPMatrix(orthoMatrix(width, height));
1732 < 0) {<= preAllocated.length - 4) { }
1733  
1734 < 0) {<= preAllocated.length - 4) { /*
1735 < 0) {<= preAllocated.length - 4) { * Init OpenGL
1736 < 0) {<= preAllocated.length - 4) { * @param canvas {HTMLCanvas} - the canvas to render to
1737 < 0) {<= preAllocated.length - 4) { */
1738 < 0) {<= preAllocated.length - 4) { function init(canvas, noFlush) {
1739 < 0) {<= preAllocated.length - 4) { var i = 0,
1740 < 0) {<= preAllocated.length - 4) { activeContext,
1741 < 0) {<= preAllocated.length - 4) { contexts = [
1742 < 0) {<= preAllocated.length - 4) { 'webgl',
1743 < 0) {<= preAllocated.length - 4) { 'experimental-webgl',
1744 < 0) {<= preAllocated.length - 4) { 'moz-webgl',
1745 < 0) {<= preAllocated.length - 4) { 'webkit-3d'
1746 < 0) {<= preAllocated.length - 4) { ];
1747  
1748 < 0) {<= preAllocated.length - 4) { isInited = false;
1749  
1750 < 0) {<= preAllocated.length - 4) { if (!canvas) {
1751 < 0) {<= preAllocated.length - 4) { return false;
1752 < 0) {<= preAllocated.length - 4) { }
1753  
1754 < 0) {<= preAllocated.length - 4) { if (settings.timeSetup) {
1755 < 0) {<= preAllocated.length - 4) { console.time('gl setup'); //eslint-disable-line no-console
1756 < 0) {<= preAllocated.length - 4) { }
1757  
1758 < 0) {<= preAllocated.length - 4) { for (; i < contexts.length; i++) {
1759 < 0) {<= preAllocated.length - 4) { gl = canvas.getContext(contexts[i]);
1760 < 0) {<= preAllocated.length - 4) { if (gl) {
1761 < 0) {<= preAllocated.length - 4) { activeContext = contexts[i];
1762 < 0) {<= preAllocated.length - 4) { break;
1763 < 0) {<= preAllocated.length - 4) { }
1764 < 0) {<= preAllocated.length - 4) { }
1765  
1766 < 0) {<= preAllocated.length - 4) { if (gl) {
1767 < 0) {<= preAllocated.length - 4) { if (!noFlush) {
1768 < 0) {<= preAllocated.length - 4) { flush();
1769 < 0) {<= preAllocated.length - 4) { }
1770 < 0) {<= preAllocated.length - 4) { } else {
1771 < 0) {<= preAllocated.length - 4) { return false;
1772 < 0) {<= preAllocated.length - 4) { }
1773  
1774 < 0) {<= preAllocated.length - 4) { gl.enable(gl.BLEND);
1775 < 0) {<= preAllocated.length - 4) { // gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
1776 < 0) {<= preAllocated.length - 4) { gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
1777 < 0) {<= preAllocated.length - 4) { gl.disable(gl.DEPTH_TEST);
1778 < 0) {<= preAllocated.length - 4) { gl.depthMask(gl.FALSE);
1779  
1780 < 0) {<= preAllocated.length - 4) { shader = GLShader(gl); //eslint-disable-line new-cap
1781 < 0) {<= preAllocated.length - 4) { vbuffer = GLVertexBuffer(gl, shader); //eslint-disable-line new-cap
1782  
1783 < 0) {<= preAllocated.length - 4) { textureIsReady = false;
1784  
1785 < 0) {<= preAllocated.length - 4) { // Set up the circle texture used for bubbles
1786 < 0) {<= preAllocated.length - 4) { circleTextureHandle = gl.createTexture();
1787  
1788 < 0) {<= preAllocated.length - 4) { // Draw the circle
1789 < 0) {<= preAllocated.length - 4) { circleTexture.width = 512;
1790 < 0) {<= preAllocated.length - 4) { circleTexture.height = 512;
1791  
1792 < 0) {<= preAllocated.length - 4) { circleCtx.fillStyle = '#FFF';
1793 < 0) {<= preAllocated.length - 4) { circleCtx.beginPath();
1794 < 0) {<= preAllocated.length - 4) { circleCtx.arc(256, 256, 256, 0, 2 * Math.PI);
1795 < 0) {<= preAllocated.length - 4) { circleCtx.fill();
1796  
1797 < 0) {<= preAllocated.length - 4) { try {
1798  
1799 < 0) {<= preAllocated.length - 4) { gl.bindTexture(gl.TEXTURE_2D, circleTextureHandle);
1800  
1801 < 0) {<= preAllocated.length - 4) { gl.texImage2D(
1802 < 0) {<= preAllocated.length - 4) { gl.TEXTURE_2D,
1803 < 0) {<= preAllocated.length - 4) { 0,
1804 < 0) {<= preAllocated.length - 4) { gl.RGBA,
1805 < 0) {<= preAllocated.length - 4) { gl.RGBA,
1806 < 0) {<= preAllocated.length - 4) { gl.UNSIGNED_BYTE,
1807 < 0) {<= preAllocated.length - 4) { circleTexture
1808 < 0) {<= preAllocated.length - 4) { );
1809  
1810 < 0) {<= preAllocated.length - 4) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
1811 < 0) {<= preAllocated.length - 4) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
1812 < 0) {<= preAllocated.length - 4) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
1813 < 0) {<= preAllocated.length - 4) { gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR_MIPMAP_LINEAR);
1814  
1815 < 0) {<= preAllocated.length - 4) { gl.generateMipmap(gl.TEXTURE_2D);
1816  
1817 < 0) {<= preAllocated.length - 4) { gl.bindTexture(gl.TEXTURE_2D, null);
1818  
1819 < 0) {<= preAllocated.length - 4) { textureIsReady = true;
1820 < 0) {<= preAllocated.length - 4) { } catch (e) {}
1821  
1822 < 0) {<= preAllocated.length - 4) { isInited = true;
1823  
1824 < 0) {<= preAllocated.length - 4) { if (settings.timeSetup) {
1825 < 0) {<= preAllocated.length - 4) { console.timeEnd('gl setup'); //eslint-disable-line no-console
1826 < 0) {<= preAllocated.length - 4) { }
1827  
1828 < 0) {<= preAllocated.length - 4) { return true;
1829 < 0) {<= preAllocated.length - 4) { }
1830  
1831 < 0) {<= preAllocated.length - 4) { /*
1832 < 0) {<= preAllocated.length - 4) { * Check if we have a valid OGL context
1833 < 0) {<= preAllocated.length - 4) { * @returns {Boolean} - true if the context is valid
1834 < 0) {<= preAllocated.length - 4) { */
1835 < 0) {<= preAllocated.length - 4) { function valid() {
1836 < 0) {<= preAllocated.length - 4) { return gl !== false;
1837 < 0) {<= preAllocated.length - 4) { }
1838  
1839 < 0) {<= preAllocated.length - 4) { /*
1840 < 0) {<= preAllocated.length - 4) { * Check if the renderer has been initialized
1841 < 0) {<= preAllocated.length - 4) { * @returns {Boolean} - true if it has, false if not
1842 < 0) {<= preAllocated.length - 4) { */
1843 < 0) {<= preAllocated.length - 4) { function inited() {
1844 < 0) {<= preAllocated.length - 4) { return isInited;
1845 < 0) {<= preAllocated.length - 4) { }
1846  
1847 < 0) {<= preAllocated.length - 4) { function destroy() {
1848 < 0) {<= preAllocated.length - 4) { vbuffer.destroy();
1849 < 0) {<= preAllocated.length - 4) { shader.destroy();
1850 < 0) {<= preAllocated.length - 4) { if (gl) {
1851 < 0) {<= preAllocated.length - 4) { //gl.deleteTexture(circleTextureHandle);
1852 < 0) {<= preAllocated.length - 4) { }
1853 < 0) {<= preAllocated.length - 4) { }
1854  
1855 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////
1856 < 0) {<= preAllocated.length - 4) { exports = {
1857 < 0) {<= preAllocated.length - 4) { allocateBufferForSingleSeries: allocateBufferForSingleSeries,
1858 < 0) {<= preAllocated.length - 4) { pushSeries: pushSeries,
1859 < 0) {<= preAllocated.length - 4) { setSize: setSize,
1860 < 0) {<= preAllocated.length - 4) { inited: inited,
1861 < 0) {<= preAllocated.length - 4) { setThreshold: setThreshold,
1862 < 0) {<= preAllocated.length - 4) { init: init,
1863 < 0) {<= preAllocated.length - 4) { render: renderWhenReady,
1864 < 0) {<= preAllocated.length - 4) { settings: settings,
1865 < 0) {<= preAllocated.length - 4) { valid: valid,
1866 < 0) {<= preAllocated.length - 4) { clear: clear,
1867 < 0) {<= preAllocated.length - 4) { flush: flush,
1868 < 0) {<= preAllocated.length - 4) { setXAxis: setXAxis,
1869 < 0) {<= preAllocated.length - 4) { setYAxis: setYAxis,
1870 < 0) {<= preAllocated.length - 4) { data: data,
1871 < 0) {<= preAllocated.length - 4) { gl: getGL,
1872 < 0) {<= preAllocated.length - 4) { allocateBuffer: allocateBuffer,
1873 < 0) {<= preAllocated.length - 4) { destroy: destroy,
1874 < 0) {<= preAllocated.length - 4) { setOptions: setOptions
1875 < 0) {<= preAllocated.length - 4) { };
1876  
1877 < 0) {<= preAllocated.length - 4) { return exports;
1878 < 0) {<= preAllocated.length - 4) { }
1879  
1880 < 0) {<= preAllocated.length - 4) { // END OF WEBGL ABSTRACTIONS
1881 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////////
1882  
1883 < 0) {<= preAllocated.length - 4) { /*
1884 < 0) {<= preAllocated.length - 4) { * Create a canvas + context and attach it to the target
1885 < 0) {<= preAllocated.length - 4) { * @param target {Highcharts.Chart|Highcharts.Series} - the canvas target
1886 < 0) {<= preAllocated.length - 4) { * @param chart {Highcharts.Chart} - the chart
1887 < 0) {<= preAllocated.length - 4) { */
1888 < 0) {<= preAllocated.length - 4) { function createAndAttachRenderer(chart, series) {
1889 < 0) {<= preAllocated.length - 4) { var width = chart.chartWidth,
1890 < 0) {<= preAllocated.length - 4) { height = chart.chartHeight,
1891 < 0) {<= preAllocated.length - 4) { target = chart,
1892 < 0) {<= preAllocated.length - 4) { targetGroup = chart.seriesGroup || series.group,
1893 < 0) {<= preAllocated.length - 4) { swapXY = function(proceed, x, y, a, b, c, d) {
1894 < 0) {<= preAllocated.length - 4) { proceed.call(series, y, x, a, b, c, d);
1895 < 0) {<= preAllocated.length - 4) { };
1896  
1897 < 0) {<= preAllocated.length - 4) { if (isChartSeriesBoosting(chart)) {
1898 < 0) {<= preAllocated.length - 4) { target = chart;
1899 < 0) {<= preAllocated.length - 4) { } else {
1900 < 0) {<= preAllocated.length - 4) { target = series;
1901 < 0) {<= preAllocated.length - 4) { }
1902  
1903 < 0) {<= preAllocated.length - 4) { if (target.ogl) {
1904 < 0) {<= preAllocated.length - 4) { //target.ogl.destroy();
1905 < 0) {<= preAllocated.length - 4) { }
1906  
1907 < 0) {<= preAllocated.length - 4) { if (!target.image) {
1908 < 0) {<= preAllocated.length - 4) { target.canvas = doc.createElement('canvas');
1909  
1910 < 0) {<= preAllocated.length - 4) { target.image = chart.renderer.image(
1911 < 0) {<= preAllocated.length - 4) { '',
1912 < 0) {<= preAllocated.length - 4) { 0,
1913 < 0) {<= preAllocated.length - 4) { 0,
1914 < 0) {<= preAllocated.length - 4) { width,
1915 < 0) {<= preAllocated.length - 4) { height
1916 < 0) {<= preAllocated.length - 4) { ).add(targetGroup);
1917  
1918 < 0) {<= preAllocated.length - 4) { target.boostClipRect = chart.renderer.clipRect(
1919 < 0) {<= preAllocated.length - 4) { chart.plotLeft,
1920 < 0) {<= preAllocated.length - 4) { chart.plotTop,
1921 < 0) {<= preAllocated.length - 4) { chart.plotWidth,
1922 < 0) {<= preAllocated.length - 4) { chart.chartHeight
1923 < 0) {<= preAllocated.length - 4) { );
1924  
1925 < 0) {<= preAllocated.length - 4) { target.image.clip(target.boostClipRect);
1926  
1927 < 0) {<= preAllocated.length - 4) { if (target.inverted) {
1928 < 0) {<= preAllocated.length - 4) { each(['moveTo', 'lineTo', 'rect', 'arc'], function(fn) {
1929 < 0) {<= preAllocated.length - 4) { wrap(false, fn, swapXY);
1930 < 0) {<= preAllocated.length - 4) { });
1931 < 0) {<= preAllocated.length - 4) { }
1932  
1933 < 0) {<= preAllocated.length - 4) { if (target instanceof H.Chart) {
1934 < 0) {<= preAllocated.length - 4) { target.markerGroup = target.renderer.g().add(targetGroup);
1935  
1936 < 0) {<= preAllocated.length - 4) { target.markerGroup.translate(series.xAxis.pos, series.yAxis.pos);
1937 < 0) {<= preAllocated.length - 4) { }
1938 < 0) {<= preAllocated.length - 4) { }
1939  
1940 < 0) {<= preAllocated.length - 4) { target.canvas.width = width;
1941 < 0) {<= preAllocated.length - 4) { target.canvas.height = height;
1942  
1943 < 0) {<= preAllocated.length - 4) { target.image.attr({
1944 < 0) {<= preAllocated.length - 4) { x: 0,
1945 < 0) {<= preAllocated.length - 4) { y: 0,
1946 < 0) {<= preAllocated.length - 4) { width: width,
1947 < 0) {<= preAllocated.length - 4) { height: height,
1948 < 0) {<= preAllocated.length - 4) { style: 'pointer-events: none'
1949 < 0) {<= preAllocated.length - 4) { });
1950  
1951 < 0) {<= preAllocated.length - 4) { target.boostClipRect.attr({
1952 < 0) {<= preAllocated.length - 4) { x: chart.plotLeft,
1953 < 0) {<= preAllocated.length - 4) { y: chart.plotTop,
1954 < 0) {<= preAllocated.length - 4) { width: chart.plotWidth,
1955 < 0) {<= preAllocated.length - 4) { height: chart.chartHeight
1956 < 0) {<= preAllocated.length - 4) { });
1957  
1958 < 0) {<= preAllocated.length - 4) { if (!target.ogl) {
1959  
1960  
1961 < 0) {<= preAllocated.length - 4) { target.ogl = GLRenderer(function() { // eslint-disable-line new-cap
1962 < 0) {<= preAllocated.length - 4) { target.image.attr({
1963 < 0) {<= preAllocated.length - 4) { href: target.canvas.toDataURL('image/png')
1964 < 0) {<= preAllocated.length - 4) { });
1965 < 0) {<= preAllocated.length - 4) { }); //eslint-disable-line new-cap
1966  
1967 < 0) {<= preAllocated.length - 4) { target.ogl.init(target.canvas);
1968 < 0) {<= preAllocated.length - 4) { // target.ogl.clear();
1969 < 0) {<= preAllocated.length - 4) { target.ogl.setOptions(chart.options.boost || {});
1970  
1971 < 0) {<= preAllocated.length - 4) { if (target instanceof H.Chart) {
1972 < 0) {<= preAllocated.length - 4) { target.ogl.allocateBuffer(chart);
1973 < 0) {<= preAllocated.length - 4) { }
1974 < 0) {<= preAllocated.length - 4) { }
1975  
1976 < 0) {<= preAllocated.length - 4) { target.ogl.setSize(width, height);
1977  
1978 < 0) {<= preAllocated.length - 4) { return target.ogl;
1979 < 0) {<= preAllocated.length - 4) { }
1980  
1981 < 0) {<= preAllocated.length - 4) { /*
1982 < 0) {<= preAllocated.length - 4) { * Performs the actual render if the renderer is
1983 < 0) {<= preAllocated.length - 4) { * attached to the series.
1984 < 0) {<= preAllocated.length - 4) { * @param renderer {OGLRenderer} - the renderer
1985 < 0) {<= preAllocated.length - 4) { * @param series {Highcharts.Series} - the series
1986 < 0) {<= preAllocated.length - 4) { */
1987 < 0) {<= preAllocated.length - 4) { function renderIfNotSeriesBoosting(renderer, series, chart) {
1988 < 0) {<= preAllocated.length - 4) { if (renderer &&
1989 < 0) {<= preAllocated.length - 4) { series.image &&
1990 < 0) {<= preAllocated.length - 4) { series.canvas &&
1991 < 0) {<= preAllocated.length - 4) { !isChartSeriesBoosting(chart || series.chart)
1992 < 0) {<= preAllocated.length - 4) { ) {
1993 < 0) {<= preAllocated.length - 4) { renderer.render(chart || series.chart);
1994 < 0) {<= preAllocated.length - 4) { }
1995 < 0) {<= preAllocated.length - 4) { }
1996  
1997 < 0) {<= preAllocated.length - 4) { function allocateIfNotSeriesBoosting(renderer, series) {
1998 < 0) {<= preAllocated.length - 4) { if (renderer &&
1999 < 0) {<= preAllocated.length - 4) { series.image &&
2000 < 0) {<= preAllocated.length - 4) { series.canvas &&
2001 < 0) {<= preAllocated.length - 4) { !isChartSeriesBoosting(series.chart)
2002 < 0) {<= preAllocated.length - 4) { ) {
2003 < 0) {<= preAllocated.length - 4) { renderer.allocateBufferForSingleSeries(series);
2004 < 0) {<= preAllocated.length - 4) { }
2005 < 0) {<= preAllocated.length - 4) { }
2006  
2007 < 0) {<= preAllocated.length - 4) { /*
2008 < 0) {<= preAllocated.length - 4) { * An "async" foreach loop.
2009 < 0) {<= preAllocated.length - 4) { * Uses a setTimeout to keep the loop from blocking the UI thread
2010 < 0) {<= preAllocated.length - 4) { * @param arr {Array} - the array to loop through
2011 < 0) {<= preAllocated.length - 4) { * @param fn {Function} - the callback to call for each item
2012 < 0) {<= preAllocated.length - 4) { * @param finalFunc {Function} - the callback to call when done
2013 < 0) {<= preAllocated.length - 4) { * @param chunkSize {Number} - the number of iterations per. timeout
2014 < 0) {<= preAllocated.length - 4) { * @param i {Number} - the current index
2015 < 0) {<= preAllocated.length - 4) { * @param noTimeout {Boolean} - set to true to skip timeouts
2016 < 0) {<= preAllocated.length - 4) { */
2017 < 0) {<= preAllocated.length - 4) { function eachAsync(arr, fn, finalFunc, chunkSize, i, noTimeout) {
2018 < 0) {<= preAllocated.length - 4) { i = i || 0;
2019 < 0) {<= preAllocated.length - 4) { chunkSize = chunkSize || CHUNK_SIZE;
2020  
2021 < 0) {<= preAllocated.length - 4) { var threshold = i + chunkSize,
2022 < 0) {<= preAllocated.length - 4) { proceed = true;
2023  
2024 < 0) {<= preAllocated.length - 4) { while (proceed && i < threshold && i < arr.length) {
2025 < 0) {<= preAllocated.length - 4) { proceed = fn(arr[i], i);
2026 < 0) {<= preAllocated.length - 4) { ++i;
2027 < 0) {<= preAllocated.length - 4) { }
2028 < 0) {<= preAllocated.length - 4) { if (proceed) {
2029 < 0) {<= preAllocated.length - 4) { if (i < arr.length) {
2030  
2031 < 0) {<= preAllocated.length - 4) { if (noTimeout) {
2032 < 0) {<= preAllocated.length - 4) { eachAsync(arr, fn, finalFunc, chunkSize, i, noTimeout);
2033 < 0) {<= preAllocated.length - 4) { } else if (win.requestAnimationFrame) {
2034 < 0) {<= preAllocated.length - 4) { //If available, do requestAnimationFrame - shaves off a few ms
2035 < 0) {<= preAllocated.length - 4) { win.requestAnimationFrame(function() {
2036 < 0) {<= preAllocated.length - 4) { eachAsync(arr, fn, finalFunc, chunkSize, i);
2037 < 0) {<= preAllocated.length - 4) { });
2038 < 0) {<= preAllocated.length - 4) { } else {
2039 < 0) {<= preAllocated.length - 4) { setTimeout(function() {
2040 < 0) {<= preAllocated.length - 4) { eachAsync(arr, fn, finalFunc, chunkSize, i);
2041 < 0) {<= preAllocated.length - 4) { });
2042 < 0) {<= preAllocated.length - 4) { }
2043  
2044 < 0) {<= preAllocated.length - 4) { } else if (finalFunc) {
2045 < 0) {<= preAllocated.length - 4) { finalFunc();
2046 < 0) {<= preAllocated.length - 4) { }
2047 < 0) {<= preAllocated.length - 4) { }
2048 < 0) {<= preAllocated.length - 4) { }
2049  
2050 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////////
2051 < 0) {<= preAllocated.length - 4) { // Following is the parts of the boost that's common between OGL/Legacy
2052  
2053 < 0) {<= preAllocated.length - 4) { /**
2054 < 0) {<= preAllocated.length - 4) { * Return a full Point object based on the index.
2055 < 0) {<= preAllocated.length - 4) { * The boost module uses stripped point objects for performance reasons.
2056 < 0) {<= preAllocated.length - 4) { * @param {Number} boostPoint A stripped-down point object
2057 < 0) {<= preAllocated.length - 4) { * @returns {Object} A Point object as per http://api.highcharts.com/highcharts#Point
2058 < 0) {<= preAllocated.length - 4) { */
2059 < 0) {<= preAllocated.length - 4) { Series.prototype.getPoint = function(boostPoint) {
2060 < 0) {<= preAllocated.length - 4) { var point = boostPoint,
2061 < 0) {<= preAllocated.length - 4) { xData = this.xData || this.options.xData || this.processedXData || false;
2062  
2063 < 0) {<= preAllocated.length - 4) { if (boostPoint && !(boostPoint instanceof this.pointClass)) {
2064 < 0) {<= preAllocated.length - 4) { point = (new this.pointClass()).init( // eslint-disable-line new-cap
2065 < 0) {<= preAllocated.length - 4) { this,
2066 < 0) {<= preAllocated.length - 4) { this.options.data[boostPoint.i],
2067 < 0) {<= preAllocated.length - 4) { xData ? xData[boostPoint.i] : undefined
2068 < 0) {<= preAllocated.length - 4) { );
2069  
2070 < 0) {<= preAllocated.length - 4) { point.category = point.x;
2071  
2072 < 0) {<= preAllocated.length - 4) { point.dist = boostPoint.dist;
2073 < 0) {<= preAllocated.length - 4) { point.distX = boostPoint.distX;
2074 < 0) {<= preAllocated.length - 4) { point.plotX = boostPoint.plotX;
2075 < 0) {<= preAllocated.length - 4) { point.plotY = boostPoint.plotY;
2076 < 0) {<= preAllocated.length - 4) { point.index = boostPoint.i;
2077 < 0) {<= preAllocated.length - 4) { }
2078  
2079 < 0) {<= preAllocated.length - 4) { return point;
2080 < 0) {<= preAllocated.length - 4) { };
2081  
2082 < 0) {<= preAllocated.length - 4) { /**
2083 < 0) {<= preAllocated.length - 4) { * Return a point instance from the k-d-tree
2084 < 0) {<= preAllocated.length - 4) { */
2085 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, 'searchPoint', function(proceed) {
2086 < 0) {<= preAllocated.length - 4) { return this.getPoint(
2087 < 0) {<= preAllocated.length - 4) { proceed.apply(this, [].slice.call(arguments, 1))
2088 < 0) {<= preAllocated.length - 4) { );
2089 < 0) {<= preAllocated.length - 4) { });
2090  
2091 < 0) {<= preAllocated.length - 4) { /**
2092 < 0) {<= preAllocated.length - 4) { * Extend series.destroy to also remove the fake k-d-tree points (#5137).
2093 < 0) {<= preAllocated.length - 4) { * Normally this is handled by Series.destroy that calls Point.destroy,
2094 < 0) {<= preAllocated.length - 4) { * but the fake search points are not registered like that.
2095 < 0) {<= preAllocated.length - 4) { */
2096 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, 'destroy', function(proceed) {
2097 < 0) {<= preAllocated.length - 4) { var series = this,
2098 < 0) {<= preAllocated.length - 4) { chart = series.chart;
2099  
2100 < 0) {<= preAllocated.length - 4) { if (chart.markerGroup === series.markerGroup) {
2101 < 0) {<= preAllocated.length - 4) { series.markerGroup = null;
2102 < 0) {<= preAllocated.length - 4) { }
2103  
2104 < 0) {<= preAllocated.length - 4) { if (chart.hoverPoints) {
2105 < 0) {<= preAllocated.length - 4) { chart.hoverPoints = grep(chart.hoverPoints, function(point) {
2106 < 0) {<= preAllocated.length - 4) { return point.series === series;
2107 < 0) {<= preAllocated.length - 4) { });
2108 < 0) {<= preAllocated.length - 4) { }
2109  
2110 < 0) {<= preAllocated.length - 4) { if (chart.hoverPoint && chart.hoverPoint.series === series) {
2111 < 0) {<= preAllocated.length - 4) { chart.hoverPoint = null;
2112 < 0) {<= preAllocated.length - 4) { }
2113  
2114 < 0) {<= preAllocated.length - 4) { proceed.call(this);
2115 < 0) {<= preAllocated.length - 4) { });
2116  
2117 < 0) {<= preAllocated.length - 4) { /**
2118 < 0) {<= preAllocated.length - 4) { * Do not compute extremes when min and max are set.
2119 < 0) {<= preAllocated.length - 4) { * If we use this in the core, we can add the hook
2120 < 0) {<= preAllocated.length - 4) { * to hasExtremes to the methods directly.
2121 < 0) {<= preAllocated.length - 4) { */
2122 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, 'getExtremes', function(proceed) {
2123 < 0) {<= preAllocated.length - 4) { if (!isSeriesBoosting(this) || (!this.hasExtremes || !this.hasExtremes())) {
2124 < 0) {<= preAllocated.length - 4) { return proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2125 < 0) {<= preAllocated.length - 4) { }
2126 < 0) {<= preAllocated.length - 4) { });
2127  
2128 < 0) {<= preAllocated.length - 4) { // Set default options
2129 < 0) {<= preAllocated.length - 4) { each([
2130 < 0) {<= preAllocated.length - 4) { 'area',
2131 < 0) {<= preAllocated.length - 4) { 'arearange',
2132 < 0) {<= preAllocated.length - 4) { 'column',
2133 < 0) {<= preAllocated.length - 4) { 'line',
2134 < 0) {<= preAllocated.length - 4) { 'scatter',
2135 < 0) {<= preAllocated.length - 4) { 'heatmap',
2136 < 0) {<= preAllocated.length - 4) { 'bubble',
2137 < 0) {<= preAllocated.length - 4) { 'treemap',
2138 < 0) {<= preAllocated.length - 4) { 'heatmap'
2139 < 0) {<= preAllocated.length - 4) { ],
2140 < 0) {<= preAllocated.length - 4) { function(type) {
2141 < 0) {<= preAllocated.length - 4) { if (plotOptions[type]) {
2142 < 0) {<= preAllocated.length - 4) { plotOptions[type].boostThreshold = 5000;
2143 < 0) {<= preAllocated.length - 4) { plotOptions[type].boostData = [];
2144 < 0) {<= preAllocated.length - 4) { }
2145 < 0) {<= preAllocated.length - 4) { }
2146 < 0) {<= preAllocated.length - 4) { );
2147  
2148 < 0) {<= preAllocated.length - 4) { /**
2149 < 0) {<= preAllocated.length - 4) { * Override a bunch of methods the same way. If the number of points is
2150 < 0) {<= preAllocated.length - 4) { * below the threshold, run the original method. If not, check for a
2151 < 0) {<= preAllocated.length - 4) { * canvas version or do nothing.
2152 < 0) {<= preAllocated.length - 4) { *
2153 < 0) {<= preAllocated.length - 4) { * Note that we're not overriding any of these for heatmaps.
2154 < 0) {<= preAllocated.length - 4) { */
2155 < 0) {<= preAllocated.length - 4) { each([
2156 < 0) {<= preAllocated.length - 4) { 'translate',
2157 < 0) {<= preAllocated.length - 4) { 'generatePoints',
2158 < 0) {<= preAllocated.length - 4) { 'drawTracker',
2159 < 0) {<= preAllocated.length - 4) { 'drawPoints',
2160 < 0) {<= preAllocated.length - 4) { 'render'
2161 < 0) {<= preAllocated.length - 4) { ], function(method) {
2162 < 0) {<= preAllocated.length - 4) { function branch(proceed) {
2163 < 0) {<= preAllocated.length - 4) { var letItPass = this.options.stacking &&
2164 < 0) {<= preAllocated.length - 4) { (method === 'translate' || method === 'generatePoints');
2165  
2166 < 0) {<= preAllocated.length - 4) { if (!isSeriesBoosting(this) ||
2167 < 0) {<= preAllocated.length - 4) { letItPass ||
2168 < 0) {<= preAllocated.length - 4) { this.type === 'heatmap' ||
2169 < 0) {<= preAllocated.length - 4) { this.type === 'treemap'
2170 < 0) {<= preAllocated.length - 4) { ) {
2171  
2172 < 0) {<= preAllocated.length - 4) { // Clear image
2173 < 0) {<= preAllocated.length - 4) { if (method === 'render' && this.image && !isChartSeriesBoosting(this.chart)) {
2174 < 0) {<= preAllocated.length - 4) { this.image.attr({
2175 < 0) {<= preAllocated.length - 4) { href: ''
2176 < 0) {<= preAllocated.length - 4) { });
2177 < 0) {<= preAllocated.length - 4) { this.animate = null; // We're zooming in, don't run animation
2178 < 0) {<= preAllocated.length - 4) { }
2179  
2180 < 0) {<= preAllocated.length - 4) { proceed.call(this);
2181  
2182 < 0) {<= preAllocated.length - 4) { // If a canvas version of the method exists, like renderCanvas(), run
2183 < 0) {<= preAllocated.length - 4) { } else if (this[method + 'Canvas']) {
2184 < 0) {<= preAllocated.length - 4) { this[method + 'Canvas']();
2185 < 0) {<= preAllocated.length - 4) { }
2186 < 0) {<= preAllocated.length - 4) { }
2187  
2188 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, method, branch);
2189  
2190 < 0) {<= preAllocated.length - 4) { // A special case for some types - their translate method is already wrapped
2191 < 0) {<= preAllocated.length - 4) { if (method === 'translate') {
2192 < 0) {<= preAllocated.length - 4) { if (seriesTypes.column) {
2193 < 0) {<= preAllocated.length - 4) { wrap(seriesTypes.column.prototype, method, branch);
2194 < 0) {<= preAllocated.length - 4) { }
2195  
2196 < 0) {<= preAllocated.length - 4) { if (seriesTypes.arearange) {
2197 < 0) {<= preAllocated.length - 4) { wrap(seriesTypes.arearange.prototype, method, branch);
2198 < 0) {<= preAllocated.length - 4) { }
2199  
2200 < 0) {<= preAllocated.length - 4) { if (seriesTypes.treemap) {
2201 < 0) {<= preAllocated.length - 4) { wrap(seriesTypes.treemap.prototype, method, branch);
2202 < 0) {<= preAllocated.length - 4) { }
2203 < 0) {<= preAllocated.length - 4) { }
2204 < 0) {<= preAllocated.length - 4) { });
2205  
2206 < 0) {<= preAllocated.length - 4) { /*
2207 < 0) {<= preAllocated.length - 4) { * Returns true if the current browser supports webgl
2208 < 0) {<= preAllocated.length - 4) { */
2209 < 0) {<= preAllocated.length - 4) { function hasWebGLSupport() {
2210 < 0) {<= preAllocated.length - 4) { var i = 0,
2211 < 0) {<= preAllocated.length - 4) { canvas,
2212 < 0) {<= preAllocated.length - 4) { contexts = ['webgl', 'experimental-webgl', 'moz-webgl', 'webkit-3d'],
2213 < 0) {<= preAllocated.length - 4) { context = false;
2214  
2215 < 0) {<= preAllocated.length - 4) { if (typeof win.WebGLRenderingContext !== 'undefined') {
2216 < 0) {<= preAllocated.length - 4) { canvas = doc.createElement('canvas');
2217  
2218 < 0) {<= preAllocated.length - 4) { for (; i < contexts.length; i++) {
2219 < 0) {<= preAllocated.length - 4) { try {
2220 < 0) {<= preAllocated.length - 4) { context = canvas.getContext(contexts[i]);
2221 < 0) {<= preAllocated.length - 4) { if (typeof context !== 'undefined' && context !== null) {
2222 < 0) {<= preAllocated.length - 4) { return true;
2223 < 0) {<= preAllocated.length - 4) { }
2224 < 0) {<= preAllocated.length - 4) { } catch (e) {
2225  
2226 < 0) {<= preAllocated.length - 4) { }
2227 < 0) {<= preAllocated.length - 4) { }
2228 < 0) {<= preAllocated.length - 4) { }
2229  
2230 < 0) {<= preAllocated.length - 4) { return false;
2231 < 0) {<= preAllocated.length - 4) { }
2232  
2233 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////////
2234 < 0) {<= preAllocated.length - 4) { // We're wrapped in a closure, so just return if there's no webgl support
2235  
2236 < 0) {<= preAllocated.length - 4) { if (!hasWebGLSupport()) {
2237 < 0) {<= preAllocated.length - 4) { if (typeof H.initCanvasBoost !== 'undefined') {
2238 < 0) {<= preAllocated.length - 4) { // Fallback to canvas boost
2239 < 0) {<= preAllocated.length - 4) { H.initCanvasBoost();
2240 < 0) {<= preAllocated.length - 4) { } else {
2241 < 0) {<= preAllocated.length - 4) { H.error(26);
2242 < 0) {<= preAllocated.length - 4) { }
2243 < 0) {<= preAllocated.length - 4) { //eslint-disable
2244 < 0) {<= preAllocated.length - 4) { return;
2245 < 0) {<= preAllocated.length - 4) { //eslint-enable
2246 < 0) {<= preAllocated.length - 4) { }
2247  
2248 < 0) {<= preAllocated.length - 4) { ////////////////////////////////////////////////////////////////////////////////
2249 < 0) {<= preAllocated.length - 4) { // GL-SPECIFIC WRAPPINGS FOLLOWS
2250  
2251 < 0) {<= preAllocated.length - 4) { /** If the series is a heatmap or treemap, or if the series is not boosting
2252 < 0) {<= preAllocated.length - 4) { * do the default behaviour. Otherwise, process if the series has no
2253 < 0) {<= preAllocated.length - 4) { * extremes.
2254 < 0) {<= preAllocated.length - 4) { */
2255 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, 'processData', function(proceed) {
2256 < 0) {<= preAllocated.length - 4) { // If this is a heatmap, do default behaviour
2257 < 0) {<= preAllocated.length - 4) { if (!isSeriesBoosting(this) ||
2258 < 0) {<= preAllocated.length - 4) { this.type === 'heatmap' ||
2259 < 0) {<= preAllocated.length - 4) { this.type === 'treemap') {
2260 < 0) {<= preAllocated.length - 4) { proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2261 < 0) {<= preAllocated.length - 4) { }
2262  
2263 < 0) {<= preAllocated.length - 4) { if (!this.hasExtremes || !this.hasExtremes(true)) {
2264 < 0) {<= preAllocated.length - 4) { proceed.apply(this, Array.prototype.slice.call(arguments, 1));
2265 < 0) {<= preAllocated.length - 4) { }
2266 < 0) {<= preAllocated.length - 4) { });
2267  
2268 < 0) {<= preAllocated.length - 4) { H.extend(Series.prototype, {
2269 < 0) {<= preAllocated.length - 4) { pointRange: 0,
2270 < 0) {<= preAllocated.length - 4) { directTouch: false,
2271 < 0) {<= preAllocated.length - 4) { allowDG: false, // No data grouping, let boost handle large data
2272 < 0) {<= preAllocated.length - 4) { hasExtremes: function(checkX) {
2273 < 0) {<= preAllocated.length - 4) { var options = this.options,
2274 < 0) {<= preAllocated.length - 4) { data = options.data,
2275 < 0) {<= preAllocated.length - 4) { xAxis = this.xAxis && this.xAxis.options,
2276 < 0) {<= preAllocated.length - 4) { yAxis = this.yAxis && this.yAxis.options;
2277  
2278 < 0) {<= preAllocated.length - 4) { return data.length > (options.boostThreshold || Number.MAX_VALUE) &&
2279 < 0) {<= preAllocated.length - 4) { isNumber(yAxis.min) && isNumber(yAxis.max) &&
2280 < 0) {<= preAllocated.length - 4) { (!checkX || (isNumber(xAxis.min) && isNumber(xAxis.max)));
2281 < 0) {<= preAllocated.length - 4) { },
2282  
2283 < 0) {<= preAllocated.length - 4) { /**
2284 < 0) {<= preAllocated.length - 4) { * If implemented in the core, parts of this can probably be
2285 < 0) {<= preAllocated.length - 4) { * shared with other similar methods in Highcharts.
2286 < 0) {<= preAllocated.length - 4) { */
2287 < 0) {<= preAllocated.length - 4) { destroyGraphics: function() {
2288 < 0) {<= preAllocated.length - 4) { var series = this,
2289 < 0) {<= preAllocated.length - 4) { points = this.points,
2290 < 0) {<= preAllocated.length - 4) { point,
2291 < 0) {<= preAllocated.length - 4) { i;
2292  
2293 < 0) {<= preAllocated.length - 4) { if (points) {
2294 < 0) {<= preAllocated.length - 4) { for (i = 0; i < points.length; i = i + 1) {
2295 < 0) {<= preAllocated.length - 4) { point = points[i];
2296 < 0) {<= preAllocated.length - 4) { if (point && point.graphic) {
2297 < 0) {<= preAllocated.length - 4) { point.graphic = point.graphic.destroy();
2298 < 0) {<= preAllocated.length - 4) { }
2299 < 0) {<= preAllocated.length - 4) { }
2300 < 0) {<= preAllocated.length - 4) { }
2301  
2302 < 0) {<= preAllocated.length - 4) { each(['graph', 'area', 'tracker'], function(prop) {
2303 < 0) {<= preAllocated.length - 4) { if (series[prop]) {
2304 < 0) {<= preAllocated.length - 4) { series[prop] = series[prop].destroy();
2305 < 0) {<= preAllocated.length - 4) { }
2306 < 0) {<= preAllocated.length - 4) { });
2307 < 0) {<= preAllocated.length - 4) { },
2308  
2309 < 0) {<= preAllocated.length - 4) { renderCanvas: function() {
2310 < 0) {<= preAllocated.length - 4) { var series = this,
2311 < 0) {<= preAllocated.length - 4) { options = series.options || {},
2312 < 0) {<= preAllocated.length - 4) { renderer = false,
2313 < 0) {<= preAllocated.length - 4) { chart = series.chart,
2314 < 0) {<= preAllocated.length - 4) { xAxis = this.xAxis,
2315 < 0) {<= preAllocated.length - 4) { yAxis = this.yAxis,
2316 < 0) {<= preAllocated.length - 4) { //ctx,
2317 < 0) {<= preAllocated.length - 4) { //c = 0,
2318 < 0) {<= preAllocated.length - 4) { xData = options.xData || series.processedXData,
2319 < 0) {<= preAllocated.length - 4) { yData = options.yData || series.processedYData,
2320  
2321 < 0) {<= preAllocated.length - 4) { rawData = options.data,
2322 < 0) {<= preAllocated.length - 4) { xExtremes = xAxis.getExtremes(),
2323 < 0) {<= preAllocated.length - 4) { xMin = xExtremes.min,
2324 < 0) {<= preAllocated.length - 4) { xMax = xExtremes.max,
2325 < 0) {<= preAllocated.length - 4) { yExtremes = yAxis.getExtremes(),
2326 < 0) {<= preAllocated.length - 4) { yMin = yExtremes.min,
2327 < 0) {<= preAllocated.length - 4) { yMax = yExtremes.max,
2328 < 0) {<= preAllocated.length - 4) { pointTaken = {},
2329 < 0) {<= preAllocated.length - 4) { lastClientX,
2330 < 0) {<= preAllocated.length - 4) { sampling = !!series.sampling,
2331 < 0) {<= preAllocated.length - 4) { points,
2332 < 0) {<= preAllocated.length - 4) { // r = options.marker && options.marker.radius,
2333 < 0) {<= preAllocated.length - 4) { // cvsDrawPoint = this.cvsDrawPoint,
2334 < 0) {<= preAllocated.length - 4) { // cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
2335 < 0) {<= preAllocated.length - 4) { // cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
2336 < 0) {<= preAllocated.length - 4) { enableMouseTracking = options.enableMouseTracking !== false,
2337 < 0) {<= preAllocated.length - 4) { // lastPoint,
2338 < 0) {<= preAllocated.length - 4) { threshold = options.threshold,
2339 < 0) {<= preAllocated.length - 4) { yBottom = yAxis.getThreshold(threshold),
2340 < 0) {<= preAllocated.length - 4) { hasThreshold = isNumber(threshold),
2341 < 0) {<= preAllocated.length - 4) { // translatedThreshold = yBottom,
2342 < 0) {<= preAllocated.length - 4) { // doFill = this.fill,
2343 < 0) {<= preAllocated.length - 4) { isRange = series.pointArrayMap &&
2344 < 0) {<= preAllocated.length - 4) { series.pointArrayMap.join(',') === 'low,high',
2345 < 0) {<= preAllocated.length - 4) { isStacked = !!options.stacking,
2346 < 0) {<= preAllocated.length - 4) { cropStart = series.cropStart || 0,
2347 < 0) {<= preAllocated.length - 4) { requireSorting = series.requireSorting,
2348 < 0) {<= preAllocated.length - 4) { wasNull,
2349 < 0) {<= preAllocated.length - 4) { connectNulls = options.connectNulls,
2350 < 0) {<= preAllocated.length - 4) { useRaw = !xData,
2351 < 0) {<= preAllocated.length - 4) { minVal,
2352 < 0) {<= preAllocated.length - 4) { maxVal,
2353 < 0) {<= preAllocated.length - 4) { minI,
2354 < 0) {<= preAllocated.length - 4) { maxI,
2355 < 0) {<= preAllocated.length - 4) { // fillColor = series.fillOpacity ?
2356 < 0) {<= preAllocated.length - 4) { // new Color(series.color).setOpacity(
2357 < 0) {<= preAllocated.length - 4) { // pick(options.fillOpacity, 0.75)
2358 < 0) {<= preAllocated.length - 4) { // ).get() : series.color,
2359  
2360 < 0) {<= preAllocated.length - 4) { addKDPoint = function(clientX, plotY, i) {
2361 < 0) {<= preAllocated.length - 4) { //Shaves off about 60ms compared to repeated concatination
2362 < 0) {<= preAllocated.length - 4) { index = clientX + ',' + plotY;
2363  
2364 < 0) {<= preAllocated.length - 4) { // The k-d tree requires series points.
2365 < 0) {<= preAllocated.length - 4) { // Reduce the amount of points, since the time to build the
2366 < 0) {<= preAllocated.length - 4) { // tree increases exponentially.
2367 < 0) {<= preAllocated.length - 4) { if (enableMouseTracking && !pointTaken[index]) {
2368 < 0) {<= preAllocated.length - 4) { pointTaken[index] = true;
2369  
2370 < 0) {<= preAllocated.length - 4) { if (chart.inverted) {
2371 < 0) {<= preAllocated.length - 4) { clientX = xAxis.len - clientX;
2372 < 0) {<= preAllocated.length - 4) { plotY = yAxis.len - plotY;
2373 < 0) {<= preAllocated.length - 4) { }
2374  
2375 < 0) {<= preAllocated.length - 4) { points.push({
2376 < 0) {<= preAllocated.length - 4) { clientX: clientX,
2377 < 0) {<= preAllocated.length - 4) { plotX: clientX,
2378 < 0) {<= preAllocated.length - 4) { plotY: plotY,
2379 < 0) {<= preAllocated.length - 4) { i: cropStart + i
2380 < 0) {<= preAllocated.length - 4) { });
2381 < 0) {<= preAllocated.length - 4) { }
2382 < 0) {<= preAllocated.length - 4) { };
2383  
2384 < 0) {<= preAllocated.length - 4) { // Get or create the renderer
2385 < 0) {<= preAllocated.length - 4) { renderer = createAndAttachRenderer(chart, series);
2386  
2387 < 0) {<= preAllocated.length - 4) { if (!this.visible) {
2388 < 0) {<= preAllocated.length - 4) { if (!isChartSeriesBoosting(chart) && renderer) {
2389 < 0) {<= preAllocated.length - 4) { renderer.clear();
2390 < 0) {<= preAllocated.length - 4) { this.image.attr({
2391 < 0) {<= preAllocated.length - 4) { href: ''
2392 < 0) {<= preAllocated.length - 4) { });
2393 < 0) {<= preAllocated.length - 4) { }
2394 < 0) {<= preAllocated.length - 4) { return;
2395 < 0) {<= preAllocated.length - 4) { }
2396  
2397 < 0) {<= preAllocated.length - 4) { // If we are zooming out from SVG mode, destroy the graphics
2398 < 0) {<= preAllocated.length - 4) { if (this.points || this.graph) {
2399 < 0) {<= preAllocated.length - 4) { this.destroyGraphics();
2400 < 0) {<= preAllocated.length - 4) { }
2401  
2402 < 0) {<= preAllocated.length - 4) { // If we're rendering per. series we should create the marker groups
2403 < 0) {<= preAllocated.length - 4) { // as usual.
2404 < 0) {<= preAllocated.length - 4) { if (!isChartSeriesBoosting(chart)) {
2405 < 0) {<= preAllocated.length - 4) { this.markerGroup = series.plotGroup(
2406 < 0) {<= preAllocated.length - 4) { 'markerGroup',
2407 < 0) {<= preAllocated.length - 4) { 'markers',
2408 < 0) {<= preAllocated.length - 4) { true,
2409 < 0) {<= preAllocated.length - 4) { 1,
2410 < 0) {<= preAllocated.length - 4) { chart.seriesGroup
2411 < 0) {<= preAllocated.length - 4) { );
2412 < 0) {<= preAllocated.length - 4) { } else {
2413 < 0) {<= preAllocated.length - 4) { //Use a single group for the markers
2414 < 0) {<= preAllocated.length - 4) { this.markerGroup = chart.markerGroup;
2415 < 0) {<= preAllocated.length - 4) { }
2416  
2417 < 0) {<= preAllocated.length - 4) { points = this.points = [];
2418  
2419 < 0) {<= preAllocated.length - 4) { // Do not start building while drawing
2420 < 0) {<= preAllocated.length - 4) { series.buildKDTree = noop;
2421  
2422 < 0) {<= preAllocated.length - 4) { if (renderer) {
2423 < 0) {<= preAllocated.length - 4) { allocateIfNotSeriesBoosting(renderer, this);
2424 < 0) {<= preAllocated.length - 4) { renderer.pushSeries(series);
2425 < 0) {<= preAllocated.length - 4) { // Perform the actual renderer if we're on series level
2426 < 0) {<= preAllocated.length - 4) { renderIfNotSeriesBoosting(renderer, this, chart);
2427 < 0) {<= preAllocated.length - 4) { //console.log(series, chart);
2428 < 0) {<= preAllocated.length - 4) { }
2429  
2430 < 0) {<= preAllocated.length - 4) { /* This builds the KD-tree */
2431 < 0) {<= preAllocated.length - 4) { function processPoint(d, i) {
2432 < 0) {<= preAllocated.length - 4) { var x,
2433 < 0) {<= preAllocated.length - 4) { y,
2434 < 0) {<= preAllocated.length - 4) { clientX,
2435 < 0) {<= preAllocated.length - 4) { plotY,
2436 < 0) {<= preAllocated.length - 4) { isNull,
2437 < 0) {<= preAllocated.length - 4) { low,
2438 < 0) {<= preAllocated.length - 4) { chartDestroyed = typeof chart.index === 'undefined',
2439 < 0) {<= preAllocated.length - 4) { isYInside = true;
2440  
2441 < 0) {<= preAllocated.length - 4) { if (!chartDestroyed) {
2442 < 0) {<= preAllocated.length - 4) { if (useRaw) {
2443 < 0) {<= preAllocated.length - 4) { x = d[0];
2444 < 0) {<= preAllocated.length - 4) { y = d[1];
2445 < 0) {<= preAllocated.length - 4) { } else {
2446 < 0) {<= preAllocated.length - 4) { x = d;
2447 < 0) {<= preAllocated.length - 4) { y = yData[i];
2448 < 0) {<= preAllocated.length - 4) { }
2449  
2450 < 0) {<= preAllocated.length - 4) { // Resolve low and high for range series
2451 < 0) {<= preAllocated.length - 4) { if (isRange) {
2452 < 0) {<= preAllocated.length - 4) { if (useRaw) {
2453 < 0) {<= preAllocated.length - 4) { y = d.slice(1, 3);
2454 < 0) {<= preAllocated.length - 4) { }
2455 < 0) {<= preAllocated.length - 4) { low = y[0];
2456 < 0) {<= preAllocated.length - 4) { y = y[1];
2457 < 0) {<= preAllocated.length - 4) { } else if (isStacked) {
2458 < 0) {<= preAllocated.length - 4) { x = d.x;
2459 < 0) {<= preAllocated.length - 4) { y = d.stackY;
2460 < 0) {<= preAllocated.length - 4) { low = y - d.y;
2461 < 0) {<= preAllocated.length - 4) { }
2462  
2463 < 0) {<= preAllocated.length - 4) { isNull = y === null;
2464  
2465 < 0) {<= preAllocated.length - 4) { // Optimize for scatter zooming
2466 < 0) {<= preAllocated.length - 4) { if (!requireSorting) {
2467 < 0) {<= preAllocated.length - 4) { isYInside = y >= yMin && y <= yMax;
2468 < 0) {<= preAllocated.length - 4) { }
2469  
2470 < 0) {<= preAllocated.length - 4) { if (!isNull && x >= xMin && x <= xMax && isYInside) {
2471  
2472 < 0) {<= preAllocated.length - 4) { // We use ceil to allow the KD tree to work with sub pixels,
2473 < 0) {<= preAllocated.length - 4) { // which can be used in boost to space pixels
2474 < 0) {<= preAllocated.length - 4) { clientX = Math.ceil(xAxis.toPixels(x, true));
2475  
2476 < 0) {<= preAllocated.length - 4) { if (sampling) {
2477 < 0) {<= preAllocated.length - 4) { if (minI === undefined || clientX === lastClientX) {
2478 < 0) {<= preAllocated.length - 4) { if (!isRange) {
2479 < 0) {<= preAllocated.length - 4) { low = y;
2480 < 0) {<= preAllocated.length - 4) { }
2481 < 0) {<= preAllocated.length - 4) { if (maxI === undefined || y > maxVal) {
2482 < 0) {<= preAllocated.length - 4) { maxVal = y;
2483 < 0) {<= preAllocated.length - 4) { maxI = i;
2484 < 0) {<= preAllocated.length - 4) { }
2485 < 0) {<= preAllocated.length - 4) { if (minI === undefined || low < minVal) {
2486 < 0) {<= preAllocated.length - 4) { minVal = low;
2487 < 0) {<= preAllocated.length - 4) { minI = i;
2488 < 0) {<= preAllocated.length - 4) { }
2489  
2490 < 0) {<= preAllocated.length - 4) { }
2491 < 0) {<= preAllocated.length - 4) { if (clientX !== lastClientX) { // Add points and reset
2492 < 0) {<= preAllocated.length - 4) { if (minI !== undefined) { // then maxI is also a number
2493 < 0) {<= preAllocated.length - 4) { plotY = yAxis.toPixels(maxVal, true);
2494 < 0) {<= preAllocated.length - 4) { yBottom = yAxis.toPixels(minVal, true);
2495  
2496 < 0) {<= preAllocated.length - 4) { addKDPoint(clientX, plotY, maxI);
2497 < 0) {<= preAllocated.length - 4) { if (yBottom !== plotY) {
2498 < 0) {<= preAllocated.length - 4) { addKDPoint(clientX, yBottom, minI);
2499 < 0) {<= preAllocated.length - 4) { }
2500 < 0) {<= preAllocated.length - 4) { }
2501  
2502 < 0) {<= preAllocated.length - 4) { minI = maxI = undefined;
2503 < 0) {<= preAllocated.length - 4) { lastClientX = clientX;
2504 < 0) {<= preAllocated.length - 4) { }
2505 < 0) {<= preAllocated.length - 4) { } else {
2506 < 0) {<= preAllocated.length - 4) { plotY = Math.ceil(yAxis.toPixels(y, true));
2507 < 0) {<= preAllocated.length - 4) { addKDPoint(clientX, plotY, i);
2508 < 0) {<= preAllocated.length - 4) { }
2509 < 0) {<= preAllocated.length - 4) { }
2510 < 0) {<= preAllocated.length - 4) { wasNull = isNull && !connectNulls;
2511 < 0) {<= preAllocated.length - 4) { }
2512  
2513 < 0) {<= preAllocated.length - 4) { return !chartDestroyed;
2514 < 0) {<= preAllocated.length - 4) { }
2515  
2516 < 0) {<= preAllocated.length - 4) { function doneProcessing() {
2517 < 0) {<= preAllocated.length - 4) { fireEvent(series, 'renderedCanvas');
2518 < 0) {<= preAllocated.length - 4) { // Pass tests in Pointer.
2519 < 0) {<= preAllocated.length - 4) { // Replace this with a single property, and replace when zooming in
2520 < 0) {<= preAllocated.length - 4) { // below boostThreshold.
2521 < 0) {<= preAllocated.length - 4) { series.directTouch = false;
2522 < 0) {<= preAllocated.length - 4) { series.options.stickyTracking = true;
2523  
2524 < 0) {<= preAllocated.length - 4) { delete series.buildKDTree; // Go back to prototype, ready to build
2525 < 0) {<= preAllocated.length - 4) { series.buildKDTree();
2526 < 0) {<= preAllocated.length - 4) { }
2527  
2528 < 0) {<= preAllocated.length - 4) { // Loop over the points to build the k-d tree
2529 < 0) {<= preAllocated.length - 4) { eachAsync(
2530 < 0) {<= preAllocated.length - 4) { isStacked ? series.data : (xData || rawData),
2531 < 0) {<= preAllocated.length - 4) { processPoint,
2532 < 0) {<= preAllocated.length - 4) { doneProcessing,
2533 < 0) {<= preAllocated.length - 4) { chart.renderer.forExport ? Number.MAX_VALUE : undefined
2534 < 0) {<= preAllocated.length - 4) { );
2535 < 0) {<= preAllocated.length - 4) { }
2536 < 0) {<= preAllocated.length - 4) { });
2537  
2538 < 0) {<= preAllocated.length - 4) { /* Used for treemap|heatmap.drawPoints */
2539 < 0) {<= preAllocated.length - 4) { function pointDrawHandler(proceed) {
2540 < 0) {<= preAllocated.length - 4) { if (!isSeriesBoosting(this)) {
2541 < 0) {<= preAllocated.length - 4) { return proceed.call(this);
2542 < 0) {<= preAllocated.length - 4) { }
2543  
2544 < 0) {<= preAllocated.length - 4) { //Make sure we have a valid OGL context
2545 < 0) {<= preAllocated.length - 4) { var renderer = createAndAttachRenderer(this.chart, this);
2546  
2547 < 0) {<= preAllocated.length - 4) { if (renderer) {
2548 < 0) {<= preAllocated.length - 4) { allocateIfNotSeriesBoosting(renderer, this);
2549 < 0) {<= preAllocated.length - 4) { renderer.pushSeries(this);
2550 < 0) {<= preAllocated.length - 4) { }
2551  
2552 < 0) {<= preAllocated.length - 4) { renderIfNotSeriesBoosting(renderer, this);
2553 < 0) {<= preAllocated.length - 4) { }
2554  
2555 < 0) {<= preAllocated.length - 4) { /*
2556 < 0) {<= preAllocated.length - 4) { * We need to handle heatmaps separatly, since we can't perform the size/color
2557 < 0) {<= preAllocated.length - 4) { * calculations in the shader easily.
2558 < 0) {<= preAllocated.length - 4) { *
2559 < 0) {<= preAllocated.length - 4) { * This likely needs future optimization.
2560 < 0) {<= preAllocated.length - 4) { *
2561 < 0) {<= preAllocated.length - 4) { */
2562 < 0) {<= preAllocated.length - 4) { each(['heatmap', 'treemap'],
2563 < 0) {<= preAllocated.length - 4) { function(t) {
2564 < 0) {<= preAllocated.length - 4) { if (seriesTypes[t]) {
2565 < 0) {<= preAllocated.length - 4) { wrap(seriesTypes[t].prototype, 'drawPoints', pointDrawHandler);
2566 < 0) {<= preAllocated.length - 4) { seriesTypes[t].prototype.directTouch = false; // Use k-d-tree
2567 < 0) {<= preAllocated.length - 4) { }
2568 < 0) {<= preAllocated.length - 4) { }
2569 < 0) {<= preAllocated.length - 4) { );
2570  
2571 < 0) {<= preAllocated.length - 4) { if (seriesTypes.bubble) {
2572 < 0) {<= preAllocated.length - 4) { // By default, the bubble series does not use the KD-tree, so force it to.
2573 < 0) {<= preAllocated.length - 4) { delete seriesTypes.bubble.prototype.buildKDTree;
2574 < 0) {<= preAllocated.length - 4) { seriesTypes.bubble.prototype.directTouch = false;
2575  
2576 < 0) {<= preAllocated.length - 4) { // Needed for markers to work correctly
2577 < 0) {<= preAllocated.length - 4) { wrap(seriesTypes.bubble.prototype, 'markerAttribs', function(proceed) {
2578 < 0) {<= preAllocated.length - 4) { if (isSeriesBoosting(this)) {
2579 < 0) {<= preAllocated.length - 4) { return false;
2580 < 0) {<= preAllocated.length - 4) { }
2581 < 0) {<= preAllocated.length - 4) { return proceed.apply(this, [].slice.call(arguments, 1));
2582 < 0) {<= preAllocated.length - 4) { });
2583 < 0) {<= preAllocated.length - 4) { }
2584  
2585 < 0) {<= preAllocated.length - 4) { seriesTypes.scatter.prototype.fill = true;
2586  
2587 < 0) {<= preAllocated.length - 4) { extend(seriesTypes.area.prototype, {
2588 < 0) {<= preAllocated.length - 4) { fill: true,
2589 < 0) {<= preAllocated.length - 4) { fillOpacity: true,
2590 < 0) {<= preAllocated.length - 4) { sampling: true
2591 < 0) {<= preAllocated.length - 4) { });
2592  
2593 < 0) {<= preAllocated.length - 4) { extend(seriesTypes.column.prototype, {
2594 < 0) {<= preAllocated.length - 4) { fill: true,
2595 < 0) {<= preAllocated.length - 4) { sampling: true
2596 < 0) {<= preAllocated.length - 4) { });
2597  
2598 < 0) {<= preAllocated.length - 4) { wrap(Series.prototype, 'setVisible', function(proceed, vis) {
2599 < 0) {<= preAllocated.length - 4) { proceed.call(this, vis, false);
2600 < 0) {<= preAllocated.length - 4) { if (this.visible === false && this.ogl && this.canvas && this.image) {
2601 < 0) {<= preAllocated.length - 4) { this.ogl.clear();
2602 < 0) {<= preAllocated.length - 4) { this.image.attr({
2603 < 0) {<= preAllocated.length - 4) { href: ''
2604 < 0) {<= preAllocated.length - 4) { });
2605 < 0) {<= preAllocated.length - 4) { } else {
2606 < 0) {<= preAllocated.length - 4) { this.chart.redraw();
2607 < 0) {<= preAllocated.length - 4) { }
2608 < 0) {<= preAllocated.length - 4) { });
2609  
2610 < 0) {<= preAllocated.length - 4) { /**
2611 < 0) {<= preAllocated.length - 4) { * Take care of the canvas blitting
2612 < 0) {<= preAllocated.length - 4) { */
2613 < 0) {<= preAllocated.length - 4) { H.Chart.prototype.callbacks.push(function(chart) {
2614  
2615 < 0) {<= preAllocated.length - 4) { /* Convert chart-level canvas to image */
2616 < 0) {<= preAllocated.length - 4) { function canvasToSVG() {
2617 < 0) {<= preAllocated.length - 4) { if (chart.ogl && isChartSeriesBoosting(chart)) {
2618 < 0) {<= preAllocated.length - 4) { chart.ogl.render(chart);
2619 < 0) {<= preAllocated.length - 4) { }
2620 < 0) {<= preAllocated.length - 4) { }
2621  
2622 < 0) {<= preAllocated.length - 4) { /* Clear chart-level canvas */
2623 < 0) {<= preAllocated.length - 4) { function preRender() {
2624 < 0) {<= preAllocated.length - 4) { if (chart.canvas && chart.ogl && isChartSeriesBoosting(chart)) {
2625 < 0) {<= preAllocated.length - 4) { // Allocate
2626 < 0) {<= preAllocated.length - 4) { chart.ogl.allocateBuffer(chart);
2627 < 0) {<= preAllocated.length - 4) { }
2628  
2629 < 0) {<= preAllocated.length - 4) { //see #6518
2630 < 0) {<= preAllocated.length - 4) { if (chart.markerGroup) {
2631 < 0) {<= preAllocated.length - 4) { chart.markerGroup.translate(
2632 < 0) {<= preAllocated.length - 4) { chart.xAxis[0].pos,
2633 < 0) {<= preAllocated.length - 4) { chart.yAxis[0].pos
2634 < 0) {<= preAllocated.length - 4) { );
2635 < 0) {<= preAllocated.length - 4) { }
2636 < 0) {<= preAllocated.length - 4) { }
2637  
2638 < 0) {<= preAllocated.length - 4) { addEvent(chart, 'predraw', preRender);
2639 < 0) {<= preAllocated.length - 4) { addEvent(chart, 'render', canvasToSVG);
2640 < 0) {<= preAllocated.length - 4) { });
2641  
2642 < 0) {<= preAllocated.length - 4) { }(Highcharts));
2643 < 0) {<= preAllocated.length - 4) { }));