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

Unified Diff: packages/charted/lib/svg/shapes/line.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/shapes/arc.dart ('k') | packages/charted/lib/svg/shapes/rect.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/charted/lib/svg/shapes/line.dart
diff --git a/packages/charted/lib/svg/shapes/line.dart b/packages/charted/lib/svg/shapes/line.dart
index 8b663ec5b0b41957e8000bcc1fc03568d4242dec..7e0f6ac6268cfdfff95b13021cde244c9dd97a77 100644
--- a/packages/charted/lib/svg/shapes/line.dart
+++ b/packages/charted/lib/svg/shapes/line.dart
@@ -18,9 +18,7 @@ typedef String LineInterpolator(Iterable<math.Point> points, int tension);
class SvgLine implements SvgShape {
static const LINE_INTERPOLATOR_LINEAR = 'linear';
- static final LINE_INTERPOLATORS = {
- LINE_INTERPOLATOR_LINEAR: _linear
- };
+ static final LINE_INTERPOLATORS = {LINE_INTERPOLATOR_LINEAR: _linear};
/// Callback to access/convert datum to x coordinate value.
final SelectionValueAccessor<num> xValueAccessor;
@@ -39,12 +37,12 @@ class SvgLine implements SvgShape {
/// Tension of the line, as used by a few interpolators.
final int tension;
- SvgLine({
- this.xValueAccessor: defaultDataToX,
+ SvgLine(
+ {this.xValueAccessor: defaultDataToX,
this.yValueAccessor: defaultDataToY,
this.isDefined: defaultIsDefined,
this.tension: 0,
- String interpolate: LINE_INTERPOLATOR_LINEAR })
+ String interpolate: LINE_INTERPOLATOR_LINEAR})
: interpolator = LINE_INTERPOLATORS[interpolate] {
assert(interpolator != null);
}
@@ -53,13 +51,12 @@ class SvgLine implements SvgShape {
@override
String path(data, int index, Element e) {
assert(data is Iterable);
- var segments = new StringBuffer(),
- points = [];
+ var segments = new StringBuffer(), points = [];
for (int i = 0, len = data.length; i < len; ++i) {
final d = data.elementAt(i);
if (isDefined(d, i, e)) {
points.add(new math.Point(xValueAccessor(d, i), yValueAccessor(d, i)));
- } else if (points.isNotEmpty){
+ } else if (points.isNotEmpty) {
segments.write('M${interpolator(points, tension)}');
points.clear();
}
« no previous file with comments | « packages/charted/lib/svg/shapes/arc.dart ('k') | packages/charted/lib/svg/shapes/rect.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698