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

Unified Diff: packages/charted/lib/selection/src/transition_impl.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
Index: packages/charted/lib/selection/src/transition_impl.dart
diff --git a/packages/charted/lib/selection/src/transition_impl.dart b/packages/charted/lib/selection/src/transition_impl.dart
index 204f28cae2033858bdeba369cb0cda434982f14f..ff6ff7a4d38454eee5dca8a2082bd72264ba99f7 100644
--- a/packages/charted/lib/selection/src/transition_impl.dart
+++ b/packages/charted/lib/selection/src/transition_impl.dart
@@ -13,15 +13,15 @@ Map<Element, int> _transitionMap = {};
class _TransitionImpl implements Transition {
SelectionCallback _delay = (d, i, c) => 0;
- SelectionCallback _duration = (d, i, c) =>
- Transition.defaultDurationMilliseconds;
+ SelectionCallback _duration =
+ (d, i, c) => Transition.defaultDurationMilliseconds;
Selection _selection;
Map _attrs = {};
Map _styles = {};
Map _attrTweens = {};
Map _styleTweens = {};
Map<AnimationTimer, Element> _timerMap = {};
- Map<Element, List<Map>> _attrMap = {};
+ Map<Element, List<Interpolator>> _attrMap = {};
Map<Element, int> _durationMap = {};
bool _interrupted = false;
bool _remove = false;
@@ -82,7 +82,7 @@ class _TransitionImpl implements Transition {
_transitionNode(num delay) {
new AnimationTimer((elapsed) {
_selection.each((d, i, c) {
- var tweenList = [];
+ var tweenList = <Interpolator>[];
_attrs.forEach((key, value) {
tweenList.add(_getAttrInterpolator(c, key, value(d, i, c)));
});
@@ -117,14 +117,16 @@ class _TransitionImpl implements Transition {
}
// Returns the correct interpolator function for the old and new attribute.
- _getAttrInterpolator(Element element, String attrName, newValue) {
+ Interpolator _getAttrInterpolator(
+ Element element, String attrName, newValue) {
var attr = element.attributes[attrName];
var interpolator = createStringInterpolator(attr, newValue.toString());
return (t) => element.setAttribute(attrName, interpolator(t).toString());
}
// Returns the correct interpolator function for the old and new style.
- _getStyleInterpolator(Element element, String styleName, newValue, priority) {
+ Interpolator _getStyleInterpolator(
+ Element element, String styleName, newValue, priority) {
var style = element.style.getPropertyValue(styleName);
var interpolator = createStringInterpolator(style, newValue.toString());
@@ -136,7 +138,7 @@ class _TransitionImpl implements Transition {
// Ticks of the transition, this is the callback registered to the
// ChartedTimer, called on each animation frame until the transition duration
// has been reached.
- bool _tick(elapsed) {
+ bool _tick(int elapsed) {
if (_interrupted) {
return true;
}
« no previous file with comments | « packages/charted/lib/selection/src/selection_impl.dart ('k') | packages/charted/lib/selection/transition.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698