Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to modify ρ value in d3.interpolateZoom #25

Closed
fallenartist opened this issue Jul 13, 2016 · 6 comments
Closed

Add option to modify ρ value in d3.interpolateZoom #25

fallenartist opened this issue Jul 13, 2016 · 6 comments

Comments

@fallenartist
Copy link

It would be great if the ρ value responsible for the curvature of the 'flight' path in d3.interpolateZoom function could be modified by users, e.g.:

interpolate.rho(ρ)

var i=d3.interpolateZoom.rho(.25)([ux0, uy0, w0],[ux1, uy1, w1]);

I would imagine the default ρ value would be the current √2.

It would also be good to have a value that produces linear path (e.g. ρ=0), making it a standard non-zoom interpolator.

What I'm not sure about is if the value should only be a constant or also a function, if there should be allowed min & max values, could it accept negative values and if it should be a set function or a get too?

@mbostock
Copy link
Member

mbostock commented Jul 13, 2016

See d3.interpolateRgb.gamma for precedent.

It should be a numeric constant, not a function. There should not be a getter; the method returns a new interpolator with the given rho value. I am ambivalent about whether it should automatically protect against invalid values; generally speaking I would say that’s not necessary.

@fallenartist
Copy link
Author

Thanks. I looked at the d3.interpolateRgb.gamma but I'm afraid it's too advanced a task for a JS n00b like me.

@mbostock
Copy link
Member

mbostock commented Jul 15, 2016 via email

@fallenartist
Copy link
Author

I was also wondering if easing function could be customised similarly to map.flyTo in Mapbox GL? Many thanks.

@mbostock
Copy link
Member

mbostock commented Aug 1, 2016

Can you be more specific about what you are asking for? Easing functions are handled by transition.ease in D3; the suggested zoom duration is exposed by the interpolator. That leaves rho (which this issue already discussed) and a minimum zoom level parameter. So, are you asking for a minimum scale factor parameter?

@fallenartist
Copy link
Author

No, sorry! Somehow I thought the zoom transition algorithm uses a fixed easing that can't be modified. Still learning the ropes!

@mbostock mbostock self-assigned this Aug 27, 2016
@mbostock mbostock removed their assignment Sep 19, 2016
@Fil Fil closed this as completed in 629b0dc Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants