Skip to content

Commit

Permalink
zoomInterpolate.rho() has no getter
Browse files Browse the repository at this point in the history
  • Loading branch information
Fil committed Jun 5, 2020
1 parent 794ce05 commit 1954d05
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -131,9 +131,9 @@ Returns an interpolator between the two views *a* and *b* of a two-dimensional p

The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds. This duration is based on the path length of the curved trajectory through *x,y* space. If you want a slower or faster transition, multiply this by an arbitrary scale factor (<i>V</i> as described in the original paper).

<a name="interpolate_rho" href="#interpolate_rho">#</a> *interpolateZoom*.<b>rho</b>(<i>[rho]</i>) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js)<!-- , [Examples](https://observablehq.com/@d3/interpolatezoom-rho) -->
<a name="interpolate_rho" href="#interpolate_rho">#</a> *interpolateZoom*.<b>rho</b>(<i>rho</i>) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/zoom.js)<!-- , [Examples](https://observablehq.com/@d3/interpolatezoom-rho) -->

Given a [zoom interpolator](#interpolateZoom), returns a new zoom interpolator using the specified curvature *rho*. When *rho* is close to 0, the interpolator is almost linear. The default curvature is sqrt(2). If *rho* is not specified, returns the interpolator’s curvature.
Given a [zoom interpolator](#interpolateZoom), returns a new zoom interpolator using the specified curvature *rho*. When *rho* is close to 0, the interpolator is almost linear. The default curvature is sqrt(2).

<a name="interpolateDiscrete" href="#interpolateDiscrete">#</a> d3.<b>interpolateDiscrete</b>(<i>values</i>) · [Source](https://github.com/d3/d3-interpolate/blob/master/src/discrete.js), [Examples](https://observablehq.com/@d3/d3-interpolatediscrete)

Expand Down
1 change: 0 additions & 1 deletion src/zoom.js
Expand Up @@ -63,7 +63,6 @@ export default (function zoomRho(rho, rho2, rho4) {
}

zoom.rho = function(_) {
if (arguments.length === 0) return rho;
var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;
return zoomRho(_1, _2, _4);
};
Expand Down
3 changes: 1 addition & 2 deletions test/zoom-test.js
Expand Up @@ -15,10 +15,9 @@ tape("interpolateZoom returns the expected duration", function(test) {

tape("interpolateZoom parameter rho() defaults to sqrt(2)", function(test) {
test.inDelta(
interpolate.interpolateZoom([0,0,1], [10, 10, 5])(0.5),
interpolate.interpolateZoom.rho(Math.sqrt(2))([0,0,1], [10, 10, 5])(0.5),
interpolate.interpolateZoom([0,0,1], [10, 10, 5])(0.5)
);
test.inDelta(interpolate.interpolateZoom.rho(), Math.sqrt(2));
test.end();
});

Expand Down

0 comments on commit 1954d05

Please sign in to comment.