GithubHelp home page GithubHelp logo

Easing/Transitioning in Chrome about d3-ease HOT 4 CLOSED

d3 avatar d3 commented on April 25, 2024
Easing/Transitioning in Chrome

from d3-ease.

Comments (4)

mbostock avatar mbostock commented on April 25, 2024

If you can post an example on bl.ocks.org or similar so I can take a look, that’d be great. If you can’t, unfortunately I can’t think of an immediate reason why the code above wouldn’t work as expected… sorry.

from d3-ease.

skipjack avatar skipjack commented on April 25, 2024

Yep here's a pen that has the issue. That example is using v3 but it's essentially the same issue. It would take me a few days as I don't have time right this but I can update pen that to v4 if it'd be helpful.

Here's what I'm seeing:

May be a little tough to see in the gif, but it essentially just jerks back and forth erratically during the rotation.

You should be able to see the issue in Chrome (v60.0.3112.101 in my case), but if you open in another browser (Firefox is the other I tested) the animation runs perfectly. Thanks for your help!

from d3-ease.

mbostock avatar mbostock commented on April 25, 2024

Thanks, that identified the problem. It’s your style here:

#q-loader * {
  transition: all 500ms;
}

When you do that, any change you make to a style on any descendent of #q-loader has a 500ms transition. In modern browsers, SVG presentation attributes have been unified with styles, so this style rule also applies to the transform attribute you are setting through JavaScript. Each time JavaScript changes the transform attribute, it triggers a new CSS transition, so the JavaScript doesn’t have a chance to run.

Either you should disable (or reduce the scope) or your transition CSS style, or you should not just JavaScript to run the transition.

from d3-ease.

skipjack avatar skipjack commented on April 25, 2024

Ah I see, that makes sense. Didn't realize transition would affect transform attribute. Thanks for your help!

from d3-ease.

Related Issues (16)

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.