OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. All rights reserved. | 2 * Copyright 2014 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style | 4 * Use of this source code is governed by a BSD-style |
5 * license that can be found in the LICENSE file or at | 5 * license that can be found in the LICENSE file or at |
6 * https://developers.google.com/open-source/licenses/bsd | 6 * https://developers.google.com/open-source/licenses/bsd |
7 */ | 7 */ |
8 part of charted.layout; | 8 part of charted.layout; |
9 | 9 |
10 /** | 10 /** |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 index.forEach((i) { | 60 index.forEach((i) { |
61 endAngle = startAngle + values[i] * scaleFactor; | 61 endAngle = startAngle + values[i] * scaleFactor; |
62 arcs[count++] = new SvgArcData(data[i], values[i], startAngle, endAngle); | 62 arcs[count++] = new SvgArcData(data[i], values[i], startAngle, endAngle); |
63 startAngle = endAngle; | 63 startAngle = endAngle; |
64 }); | 64 }); |
65 | 65 |
66 return arcs; | 66 return arcs; |
67 } | 67 } |
68 | 68 |
69 /** Sets a constant value to start angle of the layout */ | 69 /** Sets a constant value to start angle of the layout */ |
70 set startAngle(num value) => startAngleCallback = toCallback(value); | 70 set startAngle(num value) { |
| 71 startAngleCallback = toCallback(value); |
| 72 } |
71 | 73 |
72 /** Sets a constant value to end angle of the layout */ | 74 /** Sets a constant value to end angle of the layout */ |
73 set endAngle(num value) => endAngleCallback = toCallback(value); | 75 set endAngle(num value) { |
| 76 endAngleCallback = toCallback(value); |
| 77 } |
74 | 78 |
75 /** Default value accessor */ | 79 /** Default value accessor */ |
76 static num defaultValueAccessor(num d, i) => d; | 80 static num defaultValueAccessor(num d, i) => d; |
77 | 81 |
78 /** Default start angle callback - returns 0 */ | 82 /** Default start angle callback - returns 0 */ |
79 static num defaultStartAngleCallback(d, i, _) => 0; | 83 static num defaultStartAngleCallback(d, i, _) => 0; |
80 | 84 |
81 /** Default end angle callback - returns 2 * PI */ | 85 /** Default end angle callback - returns 2 * PI */ |
82 static num defaultEndAngleCallback(d, i, _) => 2 * PI; | 86 static num defaultEndAngleCallback(d, i, _) => 2 * PI; |
83 } | 87 } |
OLD | NEW |