Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(110)

Unified Diff: packages/charted/lib/svg/shapes/arc.dart

Issue 1521693002: Roll Observatory deps (charted -> ^0.3.0) (Closed) Base URL: https://chromium.googlesource.com/external/github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « packages/charted/lib/svg/axis.dart ('k') | packages/charted/lib/svg/shapes/line.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/charted/lib/svg/shapes/arc.dart
diff --git a/packages/charted/lib/svg/shapes/arc.dart b/packages/charted/lib/svg/shapes/arc.dart
index 78797b10e1c4f2bfc0e3e42a9cc33ceaab499edc..6e2a3961e998a9c7dbe388731d12af7f1ecf87ac 100644
--- a/packages/charted/lib/svg/shapes/arc.dart
+++ b/packages/charted/lib/svg/shapes/arc.dart
@@ -36,12 +36,11 @@ class SvgArc implements SvgShape {
/// and element in the context.
final SelectionCallback<num> endAngleCallback;
- SvgArc({
- this.innerRadiusCallback : defaultInnerRadiusCallback,
+ SvgArc(
+ {this.innerRadiusCallback: defaultInnerRadiusCallback,
this.outerRadiusCallback: defaultOuterRadiusCallback,
this.startAngleCallback: defaultStartAngleCallback,
- this.endAngleCallback: defaultEndAngleCallback
- });
+ this.endAngleCallback: defaultEndAngleCallback});
String path(d, int i, Element e) {
var ir = innerRadiusCallback(d, i, e),
@@ -54,8 +53,13 @@ class SvgArc implements SvgShape {
if (delta > _MAX) {
return ir > 0
- ? "M0,$or" "A$or,$or 0 1,1 0,-$or" "A$or,$or 0 1,1 0,$or"
- "M0,$ir" "A$ir,$ir 0 1,0 0,-$ir" "A$ir,$ir 0 1,0 0,$ir" "Z"
+ ? "M0,$or"
+ "A$or,$or 0 1,1 0,-$or"
+ "A$or,$or 0 1,1 0,$or"
+ "M0,$ir"
+ "A$ir,$ir 0 1,0 0,-$ir"
+ "A$ir,$ir 0 1,0 0,$ir"
+ "Z"
: "M0,$or" "A$or,$or 0 1,1 0,-$or" "A$or,$or 0 1,1 0,$or" "Z";
}
@@ -66,11 +70,15 @@ class SvgArc implements SvgShape {
df = delta < PI ? 0 : 1;
return ir > 0
- ? "M${or * cs},${or * ss}" "A$or,$or 0 $df,1 ${or * ce},${or * se}"
- "L${ir * ce},${ir * se}" "A$ir,$ir 0 $df,0 ${ir * cs},${ir * ss}"
- "Z"
- : "M${or * cs},${or * ss}" "A$or,$or 0 $df,1 ${or * ce},${or * se}"
- "L0,0" "Z";
+ ? "M${or * cs},${or * ss}"
+ "A$or,$or 0 $df,1 ${or * ce},${or * se}"
+ "L${ir * ce},${ir * se}"
+ "A$ir,$ir 0 $df,0 ${ir * cs},${ir * ss}"
+ "Z"
+ : "M${or * cs},${or * ss}"
+ "A$or,$or 0 $df,1 ${or * ce},${or * se}"
+ "L0,0"
+ "Z";
}
List centroid(d, int i, Element e) {
@@ -106,12 +114,10 @@ class SvgArcData {
num startAngle;
num endAngle;
- SvgArcData(this.data, this.value,
- this.startAngle, this.endAngle, [
- this.innerRadius = 0, this.outerRadius = 100 ]);
+ SvgArcData(this.data, this.value, this.startAngle, this.endAngle,
+ [this.innerRadius = 0, this.outerRadius = 100]);
}
-
/// Returns the interpolator between two [SvgArcData] [a] and [b].
///
/// The interpolator will interpolate the older innerRadius and outerRadius with
@@ -126,6 +132,6 @@ Interpolator interpolateSvgArcData(SvgArcData a, SvgArcData b) {
bi = b.innerRadius - ai,
bo = b.outerRadius - ao;
- return (t) => new SvgArcData(b.data, b.value,
- (ast + bst * t), (aen + ben * t), (ai + bi * t), (ao + bo * t));
+ return (t) => new SvgArcData(b.data, b.value, (ast + bst * t),
+ (aen + ben * t), (ai + bi * t), (ao + bo * t));
}
« no previous file with comments | « packages/charted/lib/svg/axis.dart ('k') | packages/charted/lib/svg/shapes/line.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698