Skip to content

Commit 6039981

Browse files
Release v5.0.3
1 parent a630a4a commit 6039981

21 files changed

+2219
-958
lines changed

app/assets/javascripts/highcharts.js

Lines changed: 1850 additions & 740 deletions
Large diffs are not rendered by default.

app/assets/javascripts/highcharts/highcharts-3d.js

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
*
44
* 3D features for Highcharts JS
55
*
@@ -115,6 +115,25 @@
115115
});
116116
};
117117

118+
/**
119+
* Calculate a distance from camera to points - made for calculating zIndex of scatter points.
120+
* Parameters:
121+
* - coordinates: The coordinates of the specific point
122+
* - chart: the chart
123+
* Returns:
124+
* - a distance from camera to point
125+
*/
126+
H.pointCameraDistance = function(coordinates, chart) {
127+
var options3d = chart.options.chart.options3d,
128+
cameraPosition = {
129+
x: chart.plotWidth / 2,
130+
y: chart.plotHeight / 2,
131+
z: pick(options3d.depth, 1) * pick(options3d.viewDistance, 0) + options3d.depth
132+
},
133+
distance = Math.sqrt(Math.pow(cameraPosition.x - coordinates.plotX, 2) + Math.pow(cameraPosition.y - coordinates.plotY, 2) + Math.pow(cameraPosition.z - coordinates.plotZ, 2));
134+
return distance;
135+
};
136+
118137
}(Highcharts));
119138
(function(H) {
120139
/**
@@ -1991,11 +2010,11 @@
19912010
rawPoint.plotY = projectedPoint.y;
19922011
rawPoint.plotZ = projectedPoint.z;
19932012

1994-
19952013
}
19962014

19972015
});
19982016

2017+
19992018
wrap(seriesTypes.scatter.prototype, 'init', function(proceed, chart, options) {
20002019
if (chart.is3d()) {
20012020
// add a third coordinate
@@ -2022,6 +2041,17 @@
20222041
return result;
20232042
});
20242043

2044+
/**
2045+
* Updating zIndex for every point - based on the distance from point to camera
2046+
*/
2047+
wrap(seriesTypes.scatter.prototype, 'pointAttribs', function(proceed, point) {
2048+
var pointOptions = proceed.apply(this, [].slice.call(arguments, 1));
2049+
if (point) {
2050+
pointOptions.zIndex = H.pointCameraDistance(point, this.chart);
2051+
}
2052+
return pointOptions;
2053+
});
2054+
20252055
}(Highcharts));
20262056
(function(H) {
20272057
/**

app/assets/javascripts/highcharts/highcharts-more.js

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
*
44
* (c) 2009-2016 Torstein Honsi
55
*
@@ -1420,9 +1420,12 @@
14201420
seriesType = H.seriesType,
14211421
seriesTypes = H.seriesTypes;
14221422

1423-
/* ****************************************************************************
1424-
* Start Box plot series code *
1425-
*****************************************************************************/
1423+
/**
1424+
* The boxplot series type.
1425+
*
1426+
* @constructor seriesTypes.boxplot
1427+
* @augments seriesTypes.column
1428+
*/
14261429
seriesType('boxplot', 'column', {
14271430
threshold: null,
14281431
tooltip: {
@@ -1454,8 +1457,7 @@
14541457
whiskerWidth: 2
14551458

14561459

1457-
// Prototype members
1458-
}, {
1460+
}, /** @lends seriesTypes.boxplot */ {
14591461
pointArrayMap: ['low', 'q1', 'median', 'q3', 'high'], // array point configs are mapped to this
14601462
toYData: function(point) { // return a plain array for speedy calculation
14611463
return [point.low, point.q1, point.median, point.q3, point.high];
@@ -2372,8 +2374,11 @@
23722374

23732375
// Point class
23742376
}, {
2375-
haloPath: function() {
2376-
return Point.prototype.haloPath.call(this, this.shapeArgs.r + this.series.options.states.hover.halo.size);
2377+
haloPath: function(size) {
2378+
return Point.prototype.haloPath.call(
2379+
this,
2380+
this.shapeArgs.r + size
2381+
);
23772382
},
23782383
ttBelow: false
23792384
});
@@ -2427,7 +2432,9 @@
24272432

24282433
});
24292434
series.minPxSize = extremes.minSize;
2430-
series.maxPxSize = extremes.maxSize;
2435+
// Prioritize min size if conflict to make sure bubbles are
2436+
// always visible. #5873
2437+
series.maxPxSize = Math.max(extremes.maxSize, extremes.minSize);
24312438

24322439
// Find the min and max Z
24332440
zData = series.zData;

app/assets/javascripts/highcharts/modules/accessibility.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
* Accessibility module
44
*
55
* (c) 2010-2016 Highsoft AS

app/assets/javascripts/highcharts/modules/annotations.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
*
44
* (c) 2009-2016 Torstein Honsi
55
*

app/assets/javascripts/highcharts/modules/boost.js

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
* Boost module
44
*
55
* (c) 2010-2016 Highsoft AS
@@ -108,11 +108,14 @@
108108
}
109109

110110
// Set default options
111-
each(['area', 'arearange', 'column', 'line', 'scatter'], function(type) {
112-
if (plotOptions[type]) {
113-
plotOptions[type].boostThreshold = 5000;
111+
each(
112+
['area', 'arearange', 'bubble', 'column', 'line', 'scatter'],
113+
function(type) {
114+
if (plotOptions[type]) {
115+
plotOptions[type].boostThreshold = 5000;
116+
}
114117
}
115-
});
118+
);
116119

117120
/**
118121
* Override a bunch of methods the same way. If the number of points is below the threshold,
@@ -144,12 +147,11 @@
144147

145148
// A special case for some types - its translate method is already wrapped
146149
if (method === 'translate') {
147-
if (seriesTypes.column) {
148-
wrap(seriesTypes.column.prototype, method, branch);
149-
}
150-
if (seriesTypes.arearange) {
151-
wrap(seriesTypes.arearange.prototype, method, branch);
152-
}
150+
each(['arearange', 'bubble', 'column'], function(type) {
151+
if (seriesTypes[type]) {
152+
wrap(seriesTypes[type].prototype, method, branch);
153+
}
154+
});
153155
}
154156
});
155157

@@ -285,7 +287,10 @@
285287
r = options.marker && options.marker.radius,
286288
cvsDrawPoint = this.cvsDrawPoint,
287289
cvsLineTo = options.lineWidth ? this.cvsLineTo : false,
288-
cvsMarker = r <= 1 ? this.cvsMarkerSquare : this.cvsMarkerCircle,
290+
cvsMarker = r && r <= 1 ?
291+
this.cvsMarkerSquare :
292+
this.cvsMarkerCircle,
293+
strokeBatch = this.cvsStrokeBatch || 1000,
289294
enableMouseTracking = options.enableMouseTracking !== false,
290295
lastPoint,
291296
threshold = options.threshold,
@@ -318,7 +323,7 @@
318323
ctx.stroke();
319324
}
320325
},
321-
drawPoint = function(clientX, plotY, yBottom) {
326+
drawPoint = function(clientX, plotY, yBottom, i) {
322327
if (c === 0) {
323328
ctx.beginPath();
324329

@@ -335,14 +340,14 @@
335340
} else if (cvsLineTo) {
336341
cvsLineTo(ctx, clientX, plotY);
337342
} else if (cvsMarker) {
338-
cvsMarker(ctx, clientX, plotY, r);
343+
cvsMarker.call(series, ctx, clientX, plotY, r, i);
339344
}
340345
}
341346

342347
// We need to stroke the line for every 1000 pixels. It will crash the browser
343348
// memory use if we stroke too infrequently.
344349
c = c + 1;
345-
if (c === 1000) {
350+
if (c === strokeBatch) {
346351
stroke();
347352
c = 0;
348353
}
@@ -483,7 +488,8 @@
483488
drawPoint(
484489
clientX,
485490
hasThreshold ? Math.min(plotY, translatedThreshold) : plotY,
486-
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom
491+
hasThreshold ? Math.max(yBottom, translatedThreshold) : yBottom,
492+
i
487493
);
488494
addKDPoint(clientX, plotY, maxI);
489495
if (yBottom !== plotY) {
@@ -497,7 +503,7 @@
497503
}
498504
} else {
499505
plotY = Math.round(yAxis.toPixels(y, true));
500-
drawPoint(clientX, plotY, yBottom);
506+
drawPoint(clientX, plotY, yBottom, i);
501507
addKDPoint(clientX, plotY, i);
502508
}
503509
}
@@ -559,6 +565,15 @@
559565
};
560566
seriesTypes.scatter.prototype.fill = true;
561567

568+
if (seriesTypes.bubble) {
569+
seriesTypes.bubble.prototype.cvsMarkerCircle = function(ctx, clientX, plotY, r, i) {
570+
ctx.moveTo(clientX, plotY);
571+
ctx.arc(clientX, plotY, this.radii && this.radii[i], 0, 2 * Math.PI, false);
572+
};
573+
seriesTypes.bubble.prototype.cvsStrokeBatch = 1;
574+
}
575+
576+
562577
extend(seriesTypes.area.prototype, {
563578
cvsDrawPoint: function(ctx, clientX, plotY, yBottom, lastPoint) {
564579
if (lastPoint && clientX !== lastPoint.clientX) {

app/assets/javascripts/highcharts/modules/broken-axis.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
*
44
* (c) 2009-2016 Torstein Honsi
55
*

app/assets/javascripts/highcharts/modules/data.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
* Data module
44
*
55
* (c) 2012-2016 Torstein Honsi

app/assets/javascripts/highcharts/modules/drilldown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
* Highcharts Drilldown module
44
*
55
* Author: Torstein Honsi

app/assets/javascripts/highcharts/modules/exporting.js

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* @license Highcharts JS v5.0.2 (2016-10-26)
2+
* @license Highcharts JS v5.0.3 (2016-11-18)
33
* Exporting module
44
*
55
* (c) 2010-2016 Torstein Honsi
@@ -374,7 +374,9 @@
374374
if (allowHTML) {
375375
html = svg.match(/<\/svg>(.*?$)/);
376376
if (html) {
377-
html = '<foreignObject x="0" y="0" width="200" height="200">' +
377+
html = '<foreignObject x="0" y="0" ' +
378+
'width="' + sourceWidth + '" ' +
379+
'height="' + sourceHeight + '">' +
378380
'<body xmlns="http://www.w3.org/1999/xhtml">' +
379381
html[1] +
380382
'</body>' +
@@ -527,11 +529,7 @@
527529
innerMenu,
528530
hide,
529531
menuStyle,
530-
docMouseUpHandler = function(e) {
531-
if (!chart.pointer.inClass(e.target, className)) {
532-
hide();
533-
}
534-
};
532+
removeMouseUp;
535533

536534
// create the menu only the first time
537535
if (!menu) {
@@ -578,11 +576,14 @@
578576
});
579577

580578

581-
// Hide it on clicking or touching outside the menu (#2258, #2335, #2407)
582-
addEvent(doc, 'mouseup', docMouseUpHandler);
583-
addEvent(chart, 'destroy', function() {
584-
removeEvent(doc, 'mouseup', docMouseUpHandler);
579+
// Hide it on clicking or touching outside the menu (#2258, #2335,
580+
// #2407)
581+
removeMouseUp = addEvent(doc, 'mouseup', function(e) {
582+
if (!chart.pointer.inClass(e.target, className)) {
583+
hide();
584+
}
585585
});
586+
addEvent(chart, 'destroy', removeMouseUp);
586587

587588

588589
// create the items

0 commit comments

Comments
 (0)