corrade-nucleus-nucleons – Diff between revs 1 and 11

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 1 Rev 11
Line 1... Line 1...
1 /** 1 /**
2 * @license Highcharts JS v5.0.10 (2017-03-31) 2 * @license Highcharts JS v5.0.12 (2017-05-24)
3 * Highcharts funnel module 3 * Highcharts funnel module
4 * 4 *
5 * (c) 2010-2017 Torstein Honsi 5 * (c) 2010-2017 Torstein Honsi
6 * 6 *
7 * License: www.highcharts.com/license 7 * License: www.highcharts.com/license
Line 26... Line 26...
26   26  
27 // create shortcuts 27 // create shortcuts
28 var seriesType = Highcharts.seriesType, 28 var seriesType = Highcharts.seriesType,
29 seriesTypes = Highcharts.seriesTypes, 29 seriesTypes = Highcharts.seriesTypes,
-   30 noop = Highcharts.noop,
30 noop = Highcharts.noop, 31 pick = Highcharts.pick,
Line 31... Line 32...
31 each = Highcharts.each; 32 each = Highcharts.each;
32   33  
Line 99... Line 100...
99   100  
100 return y > neckY || height === neckHeight ? 101 return y > neckY || height === neckHeight ?
101 neckWidth : 102 neckWidth :
102 neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight)); 103 neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight));
103 }; 104 };
104 series.getX = function(y, half) { 105 series.getX = function(y, half, point) {
105 return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + options.dataLabels.distance); 106 return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + point.labelDistance);
Line 106... Line 107...
106 }; 107 };
107   108  
108 // Expose 109 // Expose
Line 213... Line 214...
213 if (!ignoreHiddenPoint || point.visible !== false) { 214 if (!ignoreHiddenPoint || point.visible !== false) {
214 cumulative += fraction; 215 cumulative += fraction;
215 } 216 }
216 }); 217 });
217 }, 218 },
218 /** -  
219 * Draw a single point (wedge) -  
220 * @param {Object} point The point object -  
221 * @param {Object} color The color of the point -  
222 * @param {Number} brightness The brightness relative to the color -  
223 */ -  
224 drawPoints: seriesTypes.column.prototype.drawPoints, -  
Line 225... Line 219...
225   219  
226 /** 220 /**
227 * Funnel items don't have angles (#2289) 221 * Funnel items don't have angles (#2289)
228 */ 222 */
Line 234... Line 228...
234   228  
235 /** 229 /**
236 * Extend the pie data label method 230 * Extend the pie data label method
237 */ 231 */
-   232 drawDataLabels: function() {
238 drawDataLabels: function() { 233 var series = this,
239 var data = this.data, 234 data = series.data,
240 labelDistance = this.options.dataLabels.distance, 235 labelDistance = series.options.dataLabels.distance,
241 leftSide, 236 leftSide,
242 sign, 237 sign,
243 point, 238 point,
244 i = data.length, 239 i = data.length,
245 x, 240 x,
Line 246... Line 241...
246 y; 241 y;
247   242  
248 // In the original pie label anticollision logic, the slots are distributed 243 // In the original pie label anticollision logic, the slots are distributed
249 // from one labelDistance above to one labelDistance below the pie. In funnels 244 // from one labelDistance above to one labelDistance below the pie. In funnels
Line 250... Line 245...
250 // we don't want this. 245 // we don't want this.
251 this.center[2] -= 2 * labelDistance; 246 series.center[2] -= 2 * labelDistance;
252   247  
253 // Set the label position array for each point. 248 // Set the label position array for each point.
254 while (i--) { 249 while (i--) {
255 point = data[i]; 250 point = data[i];
-   251 leftSide = point.half;
-   252 sign = leftSide ? 1 : -1;
-   253 y = point.plotY;
-   254 point.labelDistance = pick(
-   255 point.options.dataLabels && point.options.dataLabels.distance,
-   256 labelDistance
256 leftSide = point.half; 257 );
Line 257... Line 258...
257 sign = leftSide ? 1 : -1; 258  
258 y = point.plotY; 259 series.maxLabelDistance = Math.max(point.labelDistance, series.maxLabelDistance || 0);
259 x = this.getX(y, leftSide); 260 x = series.getX(y, leftSide, point);
260   261  
261 // set the anchor point for data labels 262 // set the anchor point for data labels
262 point.labelPos = [ 263 point.labelPos = [
263 0, // first break of connector 264 0, // first break of connector
264 y, // a/a 265 y, // a/a
265 x + (labelDistance - 5) * sign, // second break, right outside point shape 266 x + (point.labelDistance - 5) * sign, // second break, right outside point shape
266 y, // a/a 267 y, // a/a
267 x + labelDistance * sign, // landing point for connector 268 x + point.labelDistance * sign, // landing point for connector
268 y, // a/a 269 y, // a/a