corrade-nucleus-nucleons – Diff between revs 1 and 11
?pathlinks?
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 113... | Line 114... | |||
113 | |
114 | |
|
114 | return y > neckY || height === neckHeight ? |
115 | return y > neckY || height === neckHeight ? |
|
115 | neckWidth : |
116 | neckWidth : |
|
116 | neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight)); |
117 | neckWidth + (width - neckWidth) * (1 - (y - top) / (height - neckHeight)); |
|
117 | }; |
118 | }; |
|
118 | series.getX = function(y, half) { |
119 | series.getX = function(y, half, point) { |
|
119 | return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + options.dataLabels.distance); |
120 | return centerX + (half ? -1 : 1) * ((getWidthAt(reversed ? 2 * centerY - y : y) / 2) + point.labelDistance); |
|
Line 120... | Line 121... | |||
120 | }; |
121 | }; |
|
121 | |
122 | |
|
122 | // Expose |
123 | // Expose |
|
Line 227... | Line 228... | |||
227 | if (!ignoreHiddenPoint || point.visible !== false) { |
228 | if (!ignoreHiddenPoint || point.visible !== false) { |
|
228 | cumulative += fraction; |
229 | cumulative += fraction; |
|
229 | } |
230 | } |
|
230 | }); |
231 | }); |
|
231 | }, |
232 | }, |
|
232 | /** |
- | ||
233 | * Draw a single point (wedge) |
- | ||
234 | * @param {Object} point The point object |
- | ||
235 | * @param {Object} color The color of the point |
- | ||
236 | * @param {Number} brightness The brightness relative to the color |
- | ||
237 | */ |
- | ||
238 | drawPoints: seriesTypes.column.prototype.drawPoints, |
- | ||
Line 239... | Line 233... | |||
239 | |
233 | |
|
240 | /** |
234 | /** |
|
241 | * Funnel items don't have angles (#2289) |
235 | * Funnel items don't have angles (#2289) |
|
242 | */ |
236 | */ |
|
Line 248... | Line 242... | |||
248 | |
242 | |
|
249 | /** |
243 | /** |
|
250 | * Extend the pie data label method |
244 | * Extend the pie data label method |
|
251 | */ |
245 | */ |
|
- | 246 | drawDataLabels: function() { |
||
252 | drawDataLabels: function() { |
247 | var series = this, |
|
253 | var data = this.data, |
248 | data = series.data, |
|
254 | labelDistance = this.options.dataLabels.distance, |
249 | labelDistance = series.options.dataLabels.distance, |
|
255 | leftSide, |
250 | leftSide, |
|
256 | sign, |
251 | sign, |
|
257 | point, |
252 | point, |
|
258 | i = data.length, |
253 | i = data.length, |
|
259 | x, |
254 | x, |
|
Line 260... | Line 255... | |||
260 | y; |
255 | y; |
|
261 | |
256 | |
|
262 | // In the original pie label anticollision logic, the slots are distributed |
257 | // In the original pie label anticollision logic, the slots are distributed |
|
263 | // from one labelDistance above to one labelDistance below the pie. In funnels |
258 | // from one labelDistance above to one labelDistance below the pie. In funnels |
|
Line 264... | Line 259... | |||
264 | // we don't want this. |
259 | // we don't want this. |
|
265 | this.center[2] -= 2 * labelDistance; |
260 | series.center[2] -= 2 * labelDistance; |
|
266 | |
261 | |
|
267 | // Set the label position array for each point. |
262 | // Set the label position array for each point. |
|
268 | while (i--) { |
263 | while (i--) { |
|
269 | point = data[i]; |
264 | point = data[i]; |
|
- | 265 | leftSide = point.half; |
||
- | 266 | sign = leftSide ? 1 : -1; |
||
- | 267 | y = point.plotY; |
||
- | 268 | point.labelDistance = pick( |
||
- | 269 | point.options.dataLabels && point.options.dataLabels.distance, |
||
- | 270 | labelDistance |
||
270 | leftSide = point.half; |
271 | ); |
|
Line 271... | Line 272... | |||
271 | sign = leftSide ? 1 : -1; |
272 | |
|
272 | y = point.plotY; |
273 | series.maxLabelDistance = Math.max(point.labelDistance, series.maxLabelDistance || 0); |
|
273 | x = this.getX(y, leftSide); |
274 | x = series.getX(y, leftSide, point); |
|
274 | |
275 | |
|
275 | // set the anchor point for data labels |
276 | // set the anchor point for data labels |
|
276 | point.labelPos = [ |
277 | point.labelPos = [ |
|
277 | 0, // first break of connector |
278 | 0, // first break of connector |
|
278 | y, // a/a |
279 | y, // a/a |
|
279 | x + (labelDistance - 5) * sign, // second break, right outside point shape |
280 | x + (point.labelDistance - 5) * sign, // second break, right outside point shape |
|
280 | y, // a/a |
281 | y, // a/a |
|
281 | x + labelDistance * sign, // landing point for connector |
282 | x + point.labelDistance * sign, // landing point for connector |
|
282 | y, // a/a |
283 | y, // a/a |