Giter Site home page Giter Site logo

Comments (5)

enjoylife avatar enjoylife commented on April 29, 2024

Gist pulled out from a larger app which reproduces the issue

from d3-axis.

enjoylife avatar enjoylife commented on April 29, 2024

Seems like the key for data binding is a possible culprit.

If I use the identity function it updates correctly.

// this works instead of using the scale for the key accessor
 tick = selection.selectAll(".tick").data(values, identity).order(),

from d3-axis.

mbostock avatar mbostock commented on April 29, 2024

I think the problem lies in how the exit selection is being computed. In this case the key function is returning the same key for all of the old ticks because you’ve enabled rounding. The old ticks values are [0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1], and the new scale maps them all to the same values: [450, 450, 450, 450, 450, 450, 450, 450, 450, 450, 450].

So, this is probably a bug in d3-selection, where if there are multiple elements with the same key, the later ones are should be put into the exit selection and not ignored.

from d3-axis.

mbostock avatar mbostock commented on April 29, 2024

Fixed in d3-selection 0.7.3. I will push a new alpha build of D3 4.0 shortly.

from d3-axis.

mbostock avatar mbostock commented on April 29, 2024

This fix is now included in alpha 41.

from d3-axis.

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.