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

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

Issue 2213693002: Updated charted DEP to 0.4.X (Closed) Base URL: https://github.com/dart-lang/observatory_pub_packages.git@master
Patch Set: Created 4 years, 4 months 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/selection/transition.dart ('k') | packages/charted/pubspec.yaml » ('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 7e0f6ac6268cfdfff95b13021cde244c9dd97a77..66336528b7eedd6853684e8f041e0ad7a8f78615 100644
--- a/packages/charted/lib/svg/shapes/line.dart
+++ b/packages/charted/lib/svg/shapes/line.dart
@@ -18,7 +18,9 @@ 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 = <String, LineInterpolator>{
+ LINE_INTERPOLATOR_LINEAR: _linear
+ };
/// Callback to access/convert datum to x coordinate value.
final SelectionValueAccessor<num> xValueAccessor;
@@ -51,7 +53,7 @@ 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 = <math.Point<num>>[];
for (int i = 0, len = data.length; i < len; ++i) {
final d = data.elementAt(i);
if (isDefined(d, i, e)) {
@@ -80,6 +82,6 @@ class SvgLine implements SvgShape {
static bool defaultIsDefined(d, i, e) => d != null;
/// Linear interpolator.
- static String _linear(Iterable points, _) =>
+ static String _linear(Iterable points, int _) =>
points.map((pt) => '${pt.x},${pt.y}').join('L');
}
« no previous file with comments | « packages/charted/lib/selection/transition.dart ('k') | packages/charted/pubspec.yaml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698