corrade-nucleus-nucleons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 /**
2 * @license Highcharts JS v5.0.10 (2017-03-31)
3 *
4 * (c) 2009-2017 Torstein Honsi
5 *
6 * License: www.highcharts.com/license
7 */
8 'use strict';
9 (function(factory) {
10 if (typeof module === 'object' && module.exports) {
11 module.exports = factory;
12 } else {
13 factory(Highcharts);
14 }
15 }(function(Highcharts) {
16 (function(H) {
17 /**
18 * (c) 2010-2017 Torstein Honsi
19 *
20 * License: www.highcharts.com/license
21 */
22 var Axis = H.Axis,
23 Chart = H.Chart,
24 color = H.color,
25 ColorAxis,
26 each = H.each,
27 extend = H.extend,
28 isNumber = H.isNumber,
29 Legend = H.Legend,
30 LegendSymbolMixin = H.LegendSymbolMixin,
31 noop = H.noop,
32 merge = H.merge,
33 pick = H.pick,
34 wrap = H.wrap;
35  
36 /**
37 * The ColorAxis object for inclusion in gradient legends
38 */
39 ColorAxis = H.ColorAxis = function() {
40 this.init.apply(this, arguments);
41 };
42 extend(ColorAxis.prototype, Axis.prototype);
43 extend(ColorAxis.prototype, {
44 defaultColorAxisOptions: {
45 lineWidth: 0,
46 minPadding: 0,
47 maxPadding: 0,
48 gridLineWidth: 1,
49 tickPixelInterval: 72,
50 startOnTick: true,
51 endOnTick: true,
52 offset: 0,
53 marker: {
54 animation: {
55 duration: 50
56 },
57 width: 0.01
58  
59 },
60 labels: {
61 overflow: 'justify',
62 rotation: 0
63 },
64 minColor: '#e6ebf5',
65 maxColor: '#003399',
66 tickLength: 5,
67 showInLegend: true
68 },
69  
70 // Properties to preserve after destroy, for Axis.update (#5881, #6025)
71 keepProps: [
72 'legendGroup',
73 'legendItemHeight',
74 'legendItemWidth',
75 'legendItem',
76 'legendSymbol'
77 ].concat(Axis.prototype.keepProps),
78  
79 /**
80 * Initialize the color axis
81 */
82 init: function(chart, userOptions) {
83 var horiz = chart.options.legend.layout !== 'vertical',
84 options;
85  
86 this.coll = 'colorAxis';
87  
88 // Build the options
89 options = merge(this.defaultColorAxisOptions, {
90 side: horiz ? 2 : 1,
91 reversed: !horiz
92 }, userOptions, {
93 opposite: !horiz,
94 showEmpty: false,
95 title: null
96 });
97  
98 Axis.prototype.init.call(this, chart, options);
99  
100 // Base init() pushes it to the xAxis array, now pop it again
101 //chart[this.isXAxis ? 'xAxis' : 'yAxis'].pop();
102  
103 // Prepare data classes
104 if (userOptions.dataClasses) {
105 this.initDataClasses(userOptions);
106 }
107 this.initStops(userOptions);
108  
109 // Override original axis properties
110 this.horiz = horiz;
111 this.zoomEnabled = false;
112  
113 // Add default values
114 this.defaultLegendLength = 200;
115 },
116  
117 /*
118 * Return an intermediate color between two colors, according to pos where 0
119 * is the from color and 1 is the to color.
120 * NOTE: Changes here should be copied
121 * to the same function in drilldown.src.js and solid-gauge-src.js.
122 */
123 tweenColors: function(from, to, pos) {
124 // Check for has alpha, because rgba colors perform worse due to lack of
125 // support in WebKit.
126 var hasAlpha,
127 ret;
128  
129 // Unsupported color, return to-color (#3920)
130 if (!to.rgba.length || !from.rgba.length) {
131 ret = to.input || 'none';
132  
133 // Interpolate
134 } else {
135 from = from.rgba;
136 to = to.rgba;
137 hasAlpha = (to[3] !== 1 || from[3] !== 1);
138 ret = (hasAlpha ? 'rgba(' : 'rgb(') +
139 Math.round(to[0] + (from[0] - to[0]) * (1 - pos)) + ',' +
140 Math.round(to[1] + (from[1] - to[1]) * (1 - pos)) + ',' +
141 Math.round(to[2] + (from[2] - to[2]) * (1 - pos)) +
142 (hasAlpha ? (',' + (to[3] + (from[3] - to[3]) * (1 - pos))) : '') + ')';
143 }
144 return ret;
145 },
146  
147 initDataClasses: function(userOptions) {
148 var axis = this,
149 chart = this.chart,
150 dataClasses,
151 colorCounter = 0,
152 colorCount = chart.options.chart.colorCount,
153 options = this.options,
154 len = userOptions.dataClasses.length;
155 this.dataClasses = dataClasses = [];
156 this.legendItems = [];
157  
158 each(userOptions.dataClasses, function(dataClass, i) {
159 var colors;
160  
161 dataClass = merge(dataClass);
162 dataClasses.push(dataClass);
163 if (!dataClass.color) {
164 if (options.dataClassColor === 'category') {
165  
166 dataClass.colorIndex = colorCounter;
167  
168 // increase and loop back to zero
169 colorCounter++;
170 if (colorCounter === colorCount) {
171 colorCounter = 0;
172 }
173 } else {
174 dataClass.color = axis.tweenColors(
175 color(options.minColor),
176 color(options.maxColor),
177 len < 2 ? 0.5 : i / (len - 1) // #3219
178 );
179 }
180 }
181 });
182 },
183  
184 initStops: function(userOptions) {
185 this.stops = userOptions.stops || [
186 [0, this.options.minColor],
187 [1, this.options.maxColor]
188 ];
189 each(this.stops, function(stop) {
190 stop.color = color(stop[1]);
191 });
192 },
193  
194 /**
195 * Extend the setOptions method to process extreme colors and color
196 * stops.
197 */
198 setOptions: function(userOptions) {
199 Axis.prototype.setOptions.call(this, userOptions);
200  
201 this.options.crosshair = this.options.marker;
202 },
203  
204 setAxisSize: function() {
205 var symbol = this.legendSymbol,
206 chart = this.chart,
207 legendOptions = chart.options.legend || {},
208 x,
209 y,
210 width,
211 height;
212  
213 if (symbol) {
214 this.left = x = symbol.attr('x');
215 this.top = y = symbol.attr('y');
216 this.width = width = symbol.attr('width');
217 this.height = height = symbol.attr('height');
218 this.right = chart.chartWidth - x - width;
219 this.bottom = chart.chartHeight - y - height;
220  
221 this.len = this.horiz ? width : height;
222 this.pos = this.horiz ? x : y;
223 } else {
224 // Fake length for disabled legend to avoid tick issues and such (#5205)
225 this.len = (this.horiz ? legendOptions.symbolWidth : legendOptions.symbolHeight) || this.defaultLegendLength;
226 }
227 },
228  
229 /**
230 * Translate from a value to a color
231 */
232 toColor: function(value, point) {
233 var pos,
234 stops = this.stops,
235 from,
236 to,
237 color,
238 dataClasses = this.dataClasses,
239 dataClass,
240 i;
241  
242 if (dataClasses) {
243 i = dataClasses.length;
244 while (i--) {
245 dataClass = dataClasses[i];
246 from = dataClass.from;
247 to = dataClass.to;
248 if ((from === undefined || value >= from) && (to === undefined || value <= to)) {
249 <= to)) { color = dataClass.color;
250 <= to)) { if (point) {
251 <= to)) { point.dataClass = i;
252 <= to)) { point.colorIndex = dataClass.colorIndex;
253 <= to)) { }
254 <= to)) { break;
255 <= to)) { }
256 <= to)) { }
257  
258 <= to)) { } else {
259  
260 <= to)) { if (this.isLog) {
261 <= to)) { value = this.val2lin(value);
262 <= to)) { }
263 <= to)) { pos = 1 - ((this.max - value) / ((this.max - this.min) || 1));
264 <= to)) { i = stops.length;
265 <= to)) { while (i--) {
266 <= to)) { if (pos > stops[i][0]) {
267 <= to)) { break;
268 <= to)) { }
269 <= to)) { }
270 <= to)) { from = stops[i] || stops[i + 1];
271 <= to)) { to = stops[i + 1] || from;
272  
273 <= to)) { // The position within the gradient
274 <= to)) { pos = 1 - (to[0] - pos) / ((to[0] - from[0]) || 1);
275  
276 <= to)) { color = this.tweenColors(
277 <= to)) { from.color,
278 <= to)) { to.color,
279 <= to)) { pos
280 <= to)) { );
281 <= to)) { }
282 <= to)) { return color;
283 <= to)) { },
284  
285 <= to)) { /**
286 <= to)) { * Override the getOffset method to add the whole axis groups inside the legend.
287 <= to)) { */
288 <= to)) { getOffset: function() {
289 <= to)) { var group = this.legendGroup,
290 <= to)) { sideOffset = this.chart.axisOffset[this.side];
291  
292 <= to)) { if (group) {
293  
294 <= to)) { // Hook for the getOffset method to add groups to this parent group
295 <= to)) { this.axisParent = group;
296  
297 <= to)) { // Call the base
298 <= to)) { Axis.prototype.getOffset.call(this);
299  
300 <= to)) { // First time only
301 <= to)) { if (!this.added) {
302  
303 <= to)) { this.added = true;
304  
305 <= to)) { this.labelLeft = 0;
306 <= to)) { this.labelRight = this.width;
307 <= to)) { }
308 <= to)) { // Reset it to avoid color axis reserving space
309 <= to)) { this.chart.axisOffset[this.side] = sideOffset;
310 <= to)) { }
311 <= to)) { },
312  
313 <= to)) { /**
314 <= to)) { * Create the color gradient
315 <= to)) { */
316 <= to)) { setLegendColor: function() {
317 <= to)) { var grad,
318 <= to)) { horiz = this.horiz,
319 <= to)) { options = this.options,
320 <= to)) { reversed = this.reversed,
321 <= to)) { one = reversed ? 1 : 0,
322 <= to)) { zero = reversed ? 0 : 1;
323  
324 <= to)) { grad = horiz ? [one, 0, zero, 0] : [0, zero, 0, one]; // #3190
325 <= to)) { this.legendColor = {
326 <= to)) { linearGradient: {
327 <= to)) { x1: grad[0],
328 <= to)) { y1: grad[1],
329 <= to)) { x2: grad[2],
330 <= to)) { y2: grad[3]
331 <= to)) { },
332 <= to)) { stops: options.stops || [
333 <= to)) { [0, options.minColor],
334 <= to)) { [1, options.maxColor]
335 <= to)) { ]
336 <= to)) { };
337 <= to)) { },
338  
339 <= to)) { /**
340 <= to)) { * The color axis appears inside the legend and has its own legend symbol
341 <= to)) { */
342 <= to)) { drawLegendSymbol: function(legend, item) {
343 <= to)) { var padding = legend.padding,
344 <= to)) { legendOptions = legend.options,
345 <= to)) { horiz = this.horiz,
346 <= to)) { width = pick(legendOptions.symbolWidth, horiz ? this.defaultLegendLength : 12),
347 <= to)) { height = pick(legendOptions.symbolHeight, horiz ? 12 : this.defaultLegendLength),
348 <= to)) { labelPadding = pick(legendOptions.labelPadding, horiz ? 16 : 30),
349 <= to)) { itemDistance = pick(legendOptions.itemDistance, 10);
350  
351 <= to)) { this.setLegendColor();
352  
353 <= to)) { // Create the gradient
354 <= to)) { item.legendSymbol = this.chart.renderer.rect(
355 <= to)) { 0,
356 <= to)) { legend.baseline - 11,
357 <= to)) { width,
358 <= to)) { height
359 <= to)) { ).attr({
360 <= to)) { zIndex: 1
361 <= to)) { }).add(item.legendGroup);
362  
363 <= to)) { // Set how much space this legend item takes up
364 <= to)) { this.legendItemWidth = width + padding + (horiz ? itemDistance : labelPadding);
365 <= to)) { this.legendItemHeight = height + padding + (horiz ? labelPadding : 0);
366 <= to)) { },
367 <= to)) { /**
368 <= to)) { * Fool the legend
369 <= to)) { */
370 <= to)) { setState: noop,
371 <= to)) { visible: true,
372 <= to)) { setVisible: noop,
373 <= to)) { getSeriesExtremes: function() {
374 <= to)) { var series = this.series,
375 <= to)) { i = series.length;
376 <= to)) { this.dataMin = Infinity;
377 <= to)) { this.dataMax = -Infinity;
378 <= to)) { while (i--) {
379 <= to)) { if (series[i].valueMin !== undefined) {
380 <= to)) { this.dataMin = Math.min(this.dataMin, series[i].valueMin);
381 <= to)) { this.dataMax = Math.max(this.dataMax, series[i].valueMax);
382 <= to)) { }
383 <= to)) { }
384 <= to)) { },
385 <= to)) { drawCrosshair: function(e, point) {
386 <= to)) { var plotX = point && point.plotX,
387 <= to)) { plotY = point && point.plotY,
388 <= to)) { crossPos,
389 <= to)) { axisPos = this.pos,
390 <= to)) { axisLen = this.len;
391  
392 <= to)) { if (point) {
393 <= to)) { crossPos = this.toPixels(point[point.series.colorKey]);
394 <= to)) { if (crossPos < axisPos) {
395 <= to)) {< axisPos) { crossPos = axisPos - 2;
396 <= to)) {< axisPos) { } else if (crossPos > axisPos + axisLen) {
397 <= to)) {< axisPos) { crossPos = axisPos + axisLen + 2;
398 <= to)) {< axisPos) { }
399  
400 <= to)) {< axisPos) { point.plotX = crossPos;
401 <= to)) {< axisPos) { point.plotY = this.len - crossPos;
402 <= to)) {< axisPos) { Axis.prototype.drawCrosshair.call(this, e, point);
403 <= to)) {< axisPos) { point.plotX = plotX;
404 <= to)) {< axisPos) { point.plotY = plotY;
405  
406 <= to)) {< axisPos) { if (this.cross) {
407 <= to)) {< axisPos) { this.cross
408 <= to)) {< axisPos) { .addClass('highcharts-coloraxis-marker')
409 <= to)) {< axisPos) { .add(this.legendGroup);
410  
411  
412  
413 <= to)) {< axisPos) { }
414 <= to)) {< axisPos) { }
415 <= to)) {< axisPos) { },
416 <= to)) {< axisPos) { getPlotLinePath: function(a, b, c, d, pos) {
417 <= to)) {< axisPos) { return isNumber(pos) ? // crosshairs only // #3969 pos can be 0 !!
418 <= to)) {< axisPos) { (this.horiz ? ['M', pos - 4, this.top - 6, 'L', pos + 4, this.top - 6, pos, this.top, 'Z'] : ['M', this.left, pos, 'L', this.left - 6, pos + 6, this.left - 6, pos - 6, 'Z']) :
419 <= to)) {< axisPos) { Axis.prototype.getPlotLinePath.call(this, a, b, c, d);
420 <= to)) {< axisPos) { },
421  
422 <= to)) {< axisPos) { update: function(newOptions, redraw) {
423 <= to)) {< axisPos) { var chart = this.chart,
424 <= to)) {< axisPos) { legend = chart.legend;
425  
426 <= to)) {< axisPos) { each(this.series, function(series) {
427 <= to)) {< axisPos) { series.isDirtyData = true; // Needed for Axis.update when choropleth colors change
428 <= to)) {< axisPos) { });
429  
430 <= to)) {< axisPos) { // When updating data classes, destroy old items and make sure new ones are created (#3207)
431 <= to)) {< axisPos) { if (newOptions.dataClasses && legend.allItems) {
432 <= to)) {< axisPos) { each(legend.allItems, function(item) {
433 <= to)) {< axisPos) { if (item.isDataClass) {
434 <= to)) {< axisPos) { item.legendGroup.destroy();
435 <= to)) {< axisPos) { }
436 <= to)) {< axisPos) { });
437 <= to)) {< axisPos) { chart.isDirtyLegend = true;
438 <= to)) {< axisPos) { }
439  
440 <= to)) {< axisPos) { // Keep the options structure updated for export. Unlike xAxis and yAxis, the colorAxis is
441 <= to)) {< axisPos) { // not an array. (#3207)
442 <= to)) {< axisPos) { chart.options[this.coll] = merge(this.userOptions, newOptions);
443  
444 <= to)) {< axisPos) { Axis.prototype.update.call(this, newOptions, redraw);
445 <= to)) {< axisPos) { if (this.legendItem) {
446 <= to)) {< axisPos) { this.setLegendColor();
447 <= to)) {< axisPos) { legend.colorizeItem(this, true);
448 <= to)) {< axisPos) { }
449 <= to)) {< axisPos) { },
450  
451 <= to)) {< axisPos) { /**
452 <= to)) {< axisPos) { * Get the legend item symbols for data classes
453 <= to)) {< axisPos) { */
454 <= to)) {< axisPos) { getDataClassLegendSymbols: function() {
455 <= to)) {< axisPos) { var axis = this,
456 <= to)) {< axisPos) { chart = this.chart,
457 <= to)) {< axisPos) { legendItems = this.legendItems,
458 <= to)) {< axisPos) { legendOptions = chart.options.legend,
459 <= to)) {< axisPos) { valueDecimals = legendOptions.valueDecimals,
460 <= to)) {< axisPos) { valueSuffix = legendOptions.valueSuffix || '',
461 <= to)) {< axisPos) { name;
462  
463 <= to)) {< axisPos) { if (!legendItems.length) {
464 <= to)) {< axisPos) { each(this.dataClasses, function(dataClass, i) {
465 <= to)) {< axisPos) { var vis = true,
466 <= to)) {< axisPos) { from = dataClass.from,
467 <= to)) {< axisPos) { to = dataClass.to;
468  
469 <= to)) {< axisPos) { // Assemble the default name. This can be overridden by legend.options.labelFormatter
470 <= to)) {< axisPos) { name = '';
471 <= to)) {< axisPos) { if (from === undefined) {
472 <= to)) {< axisPos) { name = '< ';
473 <= to)) {< axisPos) {< '; } else if (to === undefined) {
474 <= to)) {< axisPos) {< '; name = '> ';
475 <= to)) {< axisPos) {< '; }
476 <= to)) {< axisPos) {< '; if (from !== undefined) {
477 <= to)) {< axisPos) {< '; name += H.numberFormat(from, valueDecimals) + valueSuffix;
478 <= to)) {< axisPos) {< '; }
479 <= to)) {< axisPos) {< '; if (from !== undefined && to !== undefined) {
480 <= to)) {< axisPos) {< '; name += ' - ';
481 <= to)) {< axisPos) {< '; }
482 <= to)) {< axisPos) {< '; if (to !== undefined) {
483 <= to)) {< axisPos) {< '; name += H.numberFormat(to, valueDecimals) + valueSuffix;
484 <= to)) {< axisPos) {< '; }
485 <= to)) {< axisPos) {< '; // Add a mock object to the legend items
486 <= to)) {< axisPos) {< '; legendItems.push(extend({
487 <= to)) {< axisPos) {< '; chart: chart,
488 <= to)) {< axisPos) {< '; name: name,
489 <= to)) {< axisPos) {< '; options: {},
490 <= to)) {< axisPos) {< '; drawLegendSymbol: LegendSymbolMixin.drawRectangle,
491 <= to)) {< axisPos) {< '; visible: true,
492 <= to)) {< axisPos) {< '; setState: noop,
493 <= to)) {< axisPos) {< '; isDataClass: true,
494 <= to)) {< axisPos) {< '; setVisible: function() {
495 <= to)) {< axisPos) {< '; vis = this.visible = !vis;
496 <= to)) {< axisPos) {< '; each(axis.series, function(series) {
497 <= to)) {< axisPos) {< '; each(series.points, function(point) {
498 <= to)) {< axisPos) {< '; if (point.dataClass === i) {
499 <= to)) {< axisPos) {< '; point.setVisible(vis);
500 <= to)) {< axisPos) {< '; }
501 <= to)) {< axisPos) {< '; });
502 <= to)) {< axisPos) {< '; });
503  
504 <= to)) {< axisPos) {< '; chart.legend.colorizeItem(this, vis);
505 <= to)) {< axisPos) {< '; }
506 <= to)) {< axisPos) {< '; }, dataClass));
507 <= to)) {< axisPos) {< '; });
508 <= to)) {< axisPos) {< '; }
509 <= to)) {< axisPos) {< '; return legendItems;
510 <= to)) {< axisPos) {< '; },
511 <= to)) {< axisPos) {< '; name: '' // Prevents 'undefined' in legend in IE8
512 <= to)) {< axisPos) {< '; });
513  
514 <= to)) {< axisPos) {< '; /**
515 <= to)) {< axisPos) {< '; * Handle animation of the color attributes directly
516 <= to)) {< axisPos) {< '; */
517 <= to)) {< axisPos) {< '; each(['fill', 'stroke'], function(prop) {
518 <= to)) {< axisPos) {< '; H.Fx.prototype[prop + 'Setter'] = function() {
519 <= to)) {< axisPos) {< '; this.elem.attr(
520 <= to)) {< axisPos) {< '; prop,
521 <= to)) {< axisPos) {< '; ColorAxis.prototype.tweenColors(
522 <= to)) {< axisPos) {< '; color(this.start),
523 <= to)) {< axisPos) {< '; color(this.end),
524 <= to)) {< axisPos) {< '; this.pos
525 <= to)) {< axisPos) {< '; ),
526 <= to)) {< axisPos) {< '; null,
527 <= to)) {< axisPos) {< '; true
528 <= to)) {< axisPos) {< '; );
529 <= to)) {< axisPos) {< '; };
530 <= to)) {< axisPos) {< '; });
531  
532 <= to)) {< axisPos) {< '; /**
533 <= to)) {< axisPos) {< '; * Extend the chart getAxes method to also get the color axis
534 <= to)) {< axisPos) {< '; */
535 <= to)) {< axisPos) {< '; wrap(Chart.prototype, 'getAxes', function(proceed) {
536  
537 <= to)) {< axisPos) {< '; var options = this.options,
538 <= to)) {< axisPos) {< '; colorAxisOptions = options.colorAxis;
539  
540 <= to)) {< axisPos) {< '; proceed.call(this);
541  
542 <= to)) {< axisPos) {< '; this.colorAxis = [];
543 <= to)) {< axisPos) {< '; if (colorAxisOptions) {
544 <= to)) {< axisPos) {< '; new ColorAxis(this, colorAxisOptions); // eslint-disable-line no-new
545 <= to)) {< axisPos) {< '; }
546 <= to)) {< axisPos) {< '; });
547  
548  
549 <= to)) {< axisPos) {< '; /**
550 <= to)) {< axisPos) {< '; * Wrap the legend getAllItems method to add the color axis. This also removes the
551 <= to)) {< axisPos) {< '; * axis' own series to prevent them from showing up individually.
552 <= to)) {< axisPos) {< '; */
553 <= to)) {< axisPos) {< '; wrap(Legend.prototype, 'getAllItems', function(proceed) {
554 <= to)) {< axisPos) {< '; var allItems = [],
555 <= to)) {< axisPos) {< '; colorAxis = this.chart.colorAxis[0];
556  
557 <= to)) {< axisPos) {< '; if (colorAxis && colorAxis.options) {
558 <= to)) {< axisPos) {< '; if (colorAxis.options.showInLegend) {
559 <= to)) {< axisPos) {< '; // Data classes
560 <= to)) {< axisPos) {< '; if (colorAxis.options.dataClasses) {
561 <= to)) {< axisPos) {< '; allItems = allItems.concat(colorAxis.getDataClassLegendSymbols());
562 <= to)) {< axisPos) {< '; // Gradient legend
563 <= to)) {< axisPos) {< '; } else {
564 <= to)) {< axisPos) {< '; // Add this axis on top
565 <= to)) {< axisPos) {< '; allItems.push(colorAxis);
566 <= to)) {< axisPos) {< '; }
567 <= to)) {< axisPos) {< '; }
568  
569 <= to)) {< axisPos) {< '; // Don't add the color axis' series
570 <= to)) {< axisPos) {< '; each(colorAxis.series, function(series) {
571 <= to)) {< axisPos) {< '; series.options.showInLegend = false;
572 <= to)) {< axisPos) {< '; });
573 <= to)) {< axisPos) {< '; }
574  
575 <= to)) {< axisPos) {< '; return allItems.concat(proceed.call(this));
576 <= to)) {< axisPos) {< '; });
577  
578 <= to)) {< axisPos) {< '; wrap(Legend.prototype, 'colorizeItem', function(proceed, item, visible) {
579 <= to)) {< axisPos) {< '; proceed.call(this, item, visible);
580 <= to)) {< axisPos) {< '; if (visible && item.legendColor) {
581 <= to)) {< axisPos) {< '; item.legendSymbol.attr({
582 <= to)) {< axisPos) {< '; fill: item.legendColor
583 <= to)) {< axisPos) {< '; });
584 <= to)) {< axisPos) {< '; }
585 <= to)) {< axisPos) {< '; });
586  
587 <= to)) {< axisPos) {< '; }(Highcharts));
588 <= to)) {< axisPos) {< '; (function(H) {
589 <= to)) {< axisPos) {< '; /**
590 <= to)) {< axisPos) {< '; * (c) 2010-2017 Torstein Honsi
591 <= to)) {< axisPos) {< '; *
592 <= to)) {< axisPos) {< '; * License: www.highcharts.com/license
593 <= to)) {< axisPos) {< '; */
594 <= to)) {< axisPos) {< '; var defined = H.defined,
595 <= to)) {< axisPos) {< '; each = H.each,
596 <= to)) {< axisPos) {< '; noop = H.noop,
597 <= to)) {< axisPos) {< '; seriesTypes = H.seriesTypes;
598  
599 <= to)) {< axisPos) {< '; /**
600 <= to)) {< axisPos) {< '; * Mixin for maps and heatmaps
601 <= to)) {< axisPos) {< '; */
602 <= to)) {< axisPos) {< '; H.colorPointMixin = {
603 <= to)) {< axisPos) {< '; /**
604 <= to)) {< axisPos) {< '; * Color points have a value option that determines whether or not it is a null point
605 <= to)) {< axisPos) {< '; */
606 <= to)) {< axisPos) {< '; isValid: function() {
607 <= to)) {< axisPos) {< '; return this.value !== null;
608 <= to)) {< axisPos) {< '; },
609  
610 <= to)) {< axisPos) {< '; /**
611 <= to)) {< axisPos) {< '; * Set the visibility of a single point
612 <= to)) {< axisPos) {< '; */
613 <= to)) {< axisPos) {< '; setVisible: function(vis) {
614 <= to)) {< axisPos) {< '; var point = this,
615 <= to)) {< axisPos) {< '; method = vis ? 'show' : 'hide';
616  
617 <= to)) {< axisPos) {< '; // Show and hide associated elements
618 <= to)) {< axisPos) {< '; each(['graphic', 'dataLabel'], function(key) {
619 <= to)) {< axisPos) {< '; if (point[key]) {
620 <= to)) {< axisPos) {< '; point[key][method]();
621 <= to)) {< axisPos) {< '; }
622 <= to)) {< axisPos) {< '; });
623 <= to)) {< axisPos) {< '; },
624 <= to)) {< axisPos) {< '; setState: function(state) {
625 <= to)) {< axisPos) {< '; H.Point.prototype.setState.call(this, state);
626 <= to)) {< axisPos) {< '; if (this.graphic) {
627 <= to)) {< axisPos) {< '; this.graphic.attr({
628 <= to)) {< axisPos) {< '; zIndex: state === 'hover' ? 1 : 0
629 <= to)) {< axisPos) {< '; });
630 <= to)) {< axisPos) {< '; }
631 <= to)) {< axisPos) {< '; }
632 <= to)) {< axisPos) {< '; };
633  
634 <= to)) {< axisPos) {< '; H.colorSeriesMixin = {
635 <= to)) {< axisPos) {< '; pointArrayMap: ['value'],
636 <= to)) {< axisPos) {< '; axisTypes: ['xAxis', 'yAxis', 'colorAxis'],
637 <= to)) {< axisPos) {< '; optionalAxis: 'colorAxis',
638 <= to)) {< axisPos) {< '; trackerGroups: ['group', 'markerGroup', 'dataLabelsGroup'],
639 <= to)) {< axisPos) {< '; getSymbol: noop,
640 <= to)) {< axisPos) {< '; parallelArrays: ['x', 'y', 'value'],
641 <= to)) {< axisPos) {< '; colorKey: 'value',
642  
643  
644  
645 <= to)) {< axisPos) {< '; /**
646 <= to)) {< axisPos) {< '; * In choropleth maps, the color is a result of the value, so this needs translation too
647 <= to)) {< axisPos) {< '; */
648 <= to)) {< axisPos) {< '; translateColors: function() {
649 <= to)) {< axisPos) {< '; var series = this,
650 <= to)) {< axisPos) {< '; nullColor = this.options.nullColor,
651 <= to)) {< axisPos) {< '; colorAxis = this.colorAxis,
652 <= to)) {< axisPos) {< '; colorKey = this.colorKey;
653  
654 <= to)) {< axisPos) {< '; each(this.data, function(point) {
655 <= to)) {< axisPos) {< '; var value = point[colorKey],
656 <= to)) {< axisPos) {< '; color;
657  
658 <= to)) {< axisPos) {< '; color = point.options.color ||
659 <= to)) {< axisPos) {< '; (point.isNull ? nullColor : (colorAxis && value !== undefined) ? colorAxis.toColor(value, point) : point.color || series.color);
660  
661 <= to)) {< axisPos) {< '; if (color) {
662 <= to)) {< axisPos) {< '; point.color = color;
663 <= to)) {< axisPos) {< '; }
664 <= to)) {< axisPos) {< '; });
665 <= to)) {< axisPos) {< '; },
666  
667 <= to)) {< axisPos) {< '; /**
668 <= to)) {< axisPos) {< '; * Get the color attibutes to apply on the graphic
669 <= to)) {< axisPos) {< '; */
670 <= to)) {< axisPos) {< '; colorAttribs: function(point) {
671 <= to)) {< axisPos) {< '; var ret = {};
672 <= to)) {< axisPos) {< '; if (defined(point.color)) {
673 <= to)) {< axisPos) {< '; ret[this.colorProp || 'fill'] = point.color;
674 <= to)) {< axisPos) {< '; }
675 <= to)) {< axisPos) {< '; return ret;
676 <= to)) {< axisPos) {< '; }
677 <= to)) {< axisPos) {< '; };
678  
679 <= to)) {< axisPos) {< '; }(Highcharts));
680 <= to)) {< axisPos) {< '; (function(H) {
681 <= to)) {< axisPos) {< '; /**
682 <= to)) {< axisPos) {< '; * (c) 2010-2017 Torstein Honsi
683 <= to)) {< axisPos) {< '; *
684 <= to)) {< axisPos) {< '; * License: www.highcharts.com/license
685 <= to)) {< axisPos) {< '; */
686 <= to)) {< axisPos) {< '; var colorPointMixin = H.colorPointMixin,
687 <= to)) {< axisPos) {< '; colorSeriesMixin = H.colorSeriesMixin,
688 <= to)) {< axisPos) {< '; each = H.each,
689 <= to)) {< axisPos) {< '; LegendSymbolMixin = H.LegendSymbolMixin,
690 <= to)) {< axisPos) {< '; merge = H.merge,
691 <= to)) {< axisPos) {< '; noop = H.noop,
692 <= to)) {< axisPos) {< '; pick = H.pick,
693 <= to)) {< axisPos) {< '; Series = H.Series,
694 <= to)) {< axisPos) {< '; seriesType = H.seriesType,
695 <= to)) {< axisPos) {< '; seriesTypes = H.seriesTypes;
696  
697 <= to)) {< axisPos) {< '; // The Heatmap series type
698 <= to)) {< axisPos) {< '; seriesType('heatmap', 'scatter', {
699 <= to)) {< axisPos) {< '; animation: false,
700 <= to)) {< axisPos) {< '; borderWidth: 0,
701  
702 <= to)) {< axisPos) {< '; dataLabels: {
703 <= to)) {< axisPos) {< '; formatter: function() { // #2945
704 <= to)) {< axisPos) {< '; return this.point.value;
705 <= to)) {< axisPos) {< '; },
706 <= to)) {< axisPos) {< '; inside: true,
707 <= to)) {< axisPos) {< '; verticalAlign: 'middle',
708 <= to)) {< axisPos) {< '; crop: false,
709 <= to)) {< axisPos) {< '; overflow: false,
710 <= to)) {< axisPos) {< '; padding: 0 // #3837
711 <= to)) {< axisPos) {< '; },
712 <= to)) {< axisPos) {< '; marker: null,
713 <= to)) {< axisPos) {< '; pointRange: null, // dynamically set to colsize by default
714 <= to)) {< axisPos) {< '; tooltip: {
715 <= to)) {< axisPos) {< '; pointFormat: '{point.x}, {point.y}: {point.value}<br/>'
716 <= to)) {< axisPos) {< '; },
717 <= to)) {< axisPos) {< '; states: {
718 <= to)) {< axisPos) {< '; normal: {
719 <= to)) {< axisPos) {< '; animation: true
720 <= to)) {< axisPos) {< '; },
721 <= to)) {< axisPos) {< '; hover: {
722 <= to)) {< axisPos) {< '; halo: false, // #3406, halo is not required on heatmaps
723 <= to)) {< axisPos) {< '; brightness: 0.2
724 <= to)) {< axisPos) {< '; }
725 <= to)) {< axisPos) {< '; }
726 <= to)) {< axisPos) {< '; }, merge(colorSeriesMixin, {
727 <= to)) {< axisPos) {< '; pointArrayMap: ['y', 'value'],
728 <= to)) {< axisPos) {< '; hasPointSpecificOptions: true,
729 <= to)) {< axisPos) {< '; supportsDrilldown: true,
730 <= to)) {< axisPos) {< '; getExtremesFromAll: true,
731 <= to)) {< axisPos) {< '; directTouch: true,
732  
733 <= to)) {< axisPos) {< '; /**
734 <= to)) {< axisPos) {< '; * Override the init method to add point ranges on both axes.
735 <= to)) {< axisPos) {< '; */
736 <= to)) {< axisPos) {< '; init: function() {
737 <= to)) {< axisPos) {< '; var options;
738 <= to)) {< axisPos) {< '; seriesTypes.scatter.prototype.init.apply(this, arguments);
739  
740 <= to)) {< axisPos) {< '; options = this.options;
741 <= to)) {< axisPos) {< '; options.pointRange = pick(options.pointRange, options.colsize || 1); // #3758, prevent resetting in setData
742 <= to)) {< axisPos) {< '; this.yAxis.axisPointRange = options.rowsize || 1; // general point range
743 <= to)) {< axisPos) {< '; },
744 <= to)) {< axisPos) {< '; translate: function() {
745 <= to)) {< axisPos) {< '; var series = this,
746 <= to)) {< axisPos) {< '; options = series.options,
747 <= to)) {< axisPos) {< '; xAxis = series.xAxis,
748 <= to)) {< axisPos) {< '; yAxis = series.yAxis,
749 <= to)) {< axisPos) {< '; between = function(x, a, b) {
750 <= to)) {< axisPos) {< '; return Math.min(Math.max(a, x), b);
751 <= to)) {< axisPos) {< '; };
752  
753 <= to)) {< axisPos) {< '; series.generatePoints();
754  
755 <= to)) {< axisPos) {< '; each(series.points, function(point) {
756 <= to)) {< axisPos) {< '; var xPad = (options.colsize || 1) / 2,
757 <= to)) {< axisPos) {< '; yPad = (options.rowsize || 1) / 2,
758 <= to)) {< axisPos) {< '; x1 = between(Math.round(xAxis.len - xAxis.translate(point.x - xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
759 <= to)) {< axisPos) {< '; x2 = between(Math.round(xAxis.len - xAxis.translate(point.x + xPad, 0, 1, 0, 1)), -xAxis.len, 2 * xAxis.len),
760 <= to)) {< axisPos) {< '; y1 = between(Math.round(yAxis.translate(point.y - yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len),
761 <= to)) {< axisPos) {< '; y2 = between(Math.round(yAxis.translate(point.y + yPad, 0, 1, 0, 1)), -yAxis.len, 2 * yAxis.len);
762  
763 <= to)) {< axisPos) {< '; // Set plotX and plotY for use in K-D-Tree and more
764 <= to)) {< axisPos) {< '; point.plotX = point.clientX = (x1 + x2) / 2;
765 <= to)) {< axisPos) {< '; point.plotY = (y1 + y2) / 2;
766  
767 <= to)) {< axisPos) {< '; point.shapeType = 'rect';
768 <= to)) {< axisPos) {< '; point.shapeArgs = {
769 <= to)) {< axisPos) {< '; x: Math.min(x1, x2),
770 <= to)) {< axisPos) {< '; y: Math.min(y1, y2),
771 <= to)) {< axisPos) {< '; width: Math.abs(x2 - x1),
772 <= to)) {< axisPos) {< '; height: Math.abs(y2 - y1)
773 <= to)) {< axisPos) {< '; };
774 <= to)) {< axisPos) {< '; });
775  
776 <= to)) {< axisPos) {< '; series.translateColors();
777 <= to)) {< axisPos) {< '; },
778 <= to)) {< axisPos) {< '; drawPoints: function() {
779 <= to)) {< axisPos) {< '; seriesTypes.column.prototype.drawPoints.call(this);
780  
781 <= to)) {< axisPos) {< '; each(this.points, function(point) {
782  
783 <= to)) {< axisPos) {< '; // In styled mode, use CSS, otherwise the fill used in the style
784 <= to)) {< axisPos) {< '; // sheet will take precesence over the fill attribute.
785 <= to)) {< axisPos) {< '; point.graphic.css(this.colorAttribs(point));
786  
787 <= to)) {< axisPos) {< '; }, this);
788 <= to)) {< axisPos) {< '; },
789 <= to)) {< axisPos) {< '; animate: noop,
790 <= to)) {< axisPos) {< '; getBox: noop,
791 <= to)) {< axisPos) {< '; drawLegendSymbol: LegendSymbolMixin.drawRectangle,
792 <= to)) {< axisPos) {< '; alignDataLabel: seriesTypes.column.prototype.alignDataLabel,
793 <= to)) {< axisPos) {< '; getExtremes: function() {
794 <= to)) {< axisPos) {< '; // Get the extremes from the value data
795 <= to)) {< axisPos) {< '; Series.prototype.getExtremes.call(this, this.valueData);
796 <= to)) {< axisPos) {< '; this.valueMin = this.dataMin;
797 <= to)) {< axisPos) {< '; this.valueMax = this.dataMax;
798  
799 <= to)) {< axisPos) {< '; // Get the extremes from the y data
800 <= to)) {< axisPos) {< '; Series.prototype.getExtremes.call(this);
801 <= to)) {< axisPos) {< '; }
802  
803 <= to)) {< axisPos) {< '; }), colorPointMixin);
804  
805 <= to)) {< axisPos) {< '; }(Highcharts));
806 <= to)) {< axisPos) {< ';}));