Giter Site home page Giter Site logo

d3.geo.interpolatedProjection about d3-plugins HOT 6 OPEN

d3 avatar d3 commented on June 9, 2024
d3.geo.interpolatedProjection

from d3-plugins.

Comments (6)

jasondavies avatar jasondavies commented on June 9, 2024

Nice! A minor improvement could be to use d3.geo.interpolate for center.

from d3-plugins.

mbostock avatar mbostock commented on June 9, 2024

That reminds me, there’s a related problem where the interpolated projection can get out of sync with its a & b projections if their center or translate changes after alpha is set. I debate whether it’s a requirement that the interpolated projection be a “view” on its constituent projection, but at the same time there’s no way to take a snapshot of a projection so the alternative is to allow undefined behavior.

Maybe it would be cleaner to interpolate raw projection functions instead, but then you’d have to expose some other API for interpolating changes to scale, center, translate, rotate, etc. Also that would avoid trying to interpolate changes in clipping behavior, which isn’t possible.

from d3-plugins.

jasondavies avatar jasondavies commented on June 9, 2024

Perhaps we should consider adding projection.copy(), similar to scale.copy()? I think we’ve come across other situations where it might have been useful in the past.

from d3-plugins.

jasondavies avatar jasondavies commented on June 9, 2024

I’m not sure if it’s really possible to copy projections with custom streams though, like the current implementation of d3.geo.hammerRetroazimuthal.

from d3-plugins.

jasondavies avatar jasondavies commented on June 9, 2024

Another idea could be to allow projection.center(null), which would disable center altogether.

from d3-plugins.

iamvdo avatar iamvdo commented on June 9, 2024

Is there any improvement since then? I can't find any other solution to interpolate projections.

Btw, I find this solution pretty complex. For example, how to add an invert method, or how to animate clipAngle, etc. Also, why this fails with Mercator projection?

Maybe d3-geo (or d3-geo-projection) should add a built-in function?

If I'm totally off-topic, please let me know ;-)

from d3-plugins.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.