Chromium Code Reviews

Side by Side Diff: packages/charted/lib/core/interpolators/interpolators.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 8
9 part of charted.core.interpolators; 9 part of charted.core.interpolators;
10 10
(...skipping 372 matching lines...)
383 Interpolator uninterpolateNumber(num a, num b) { 383 Interpolator uninterpolateNumber(num a, num b) {
384 b = 1 / (b - a); 384 b = 1 / (b - a);
385 return (x) => (x - a) * b; 385 return (x) => (x - a) * b;
386 } 386 }
387 387
388 /// Reverse interpolator for a clamped number. 388 /// Reverse interpolator for a clamped number.
389 Interpolator uninterpolateClamp(num a, num b) { 389 Interpolator uninterpolateClamp(num a, num b) {
390 b = 1 / (b - a); 390 b = 1 / (b - a);
391 return (x) => math.max(0, math.min(1, (x - a) * b)); 391 return (x) => math.max(0, math.min(1, (x - a) * b));
392 } 392 }
OLDNEW
« no previous file with comments | « packages/charted/lib/core/interpolators/easing.dart ('k') | packages/charted/lib/core/scales.dart » ('j') | no next file with comments »

Powered by Google App Engine