Comments (2)
I am guessing you don’t mean a literal infinite loop here (that hangs the browser and causes the blue tab of death). You mean that the transition never ends and so the tween is called every tick with t = 1, even though the transition should have ended immediately after the first tick with t = 1.
I guess it would be reasonable to ensure that the transition ends even if an error is thrown on end. Just have to be careful where we put the try-finally for optimization reasons and to preserve the existing state (the transition state is not cleared until after the transition ends).
from d3-transition.
Confirmed that this is not an infinite loop (and that the transition doesn’t end):
http://bl.ocks.org/mbostock/93b26626ac948365fe8efb3ff054c204
Related d3/d3#2415. From a quick read-through of the code, there are potentially a bunch of issues here, though some of the following behaviors may be reasonable:
- If an error is thrown by an interrupt event listener when a transition starts, the interrupted transition is never cleaned up and the starting transition never starts.
- If an error is thrown by a start event listener, the transition does not finish starting nor is it cleaned up.
- If a tween throws an error on start, subsequent tweens are never initialized and will not be invoked for the duration of the transition.
- If a tween throws an error on tick, subsequent tweens are not invoked for that tick (nor are subsequent timers).
- If a tween throws an error on the last tick, the transition does not finish ending and is not cleaned up.
- If an error is thrown by an end event listener, the transition is not cleaned up.
I don’t think the answer is to wrap every listener and tween invocation if a try block, but I do think we can probably define better behavior when errors are thrown.
from d3-transition.
Related Issues (20)
- transition.end() never resolves if 0 elements are matched HOT 2
- transition.easeVarying?
- [d3@6] transition.end() crashes HOT 3
- transitions are not iterable. HOT 1
- [v2.0.0] error: transition 1 not found HOT 4
- transition().style() fails to work as expected when applied to a starting property of 0px HOT 1
- transition().textTween not working HOT 1
- .end() with textTween causes uncaught promise when used at the same time as d3-force HOT 1
- transition.selectChild[ren] HOT 2
- Is there a way to control transition process?
- test 122 failure on Ubuntu HOT 2
- issues when doing .transition(t) HOT 6
- Can not bundle project with webpack minimize option. Cannot get final name for export 'easeCubicInOut' ... HOT 2
- Security patches
- Example for transition() isn't correct in READ.ME? HOT 2
- transition() prevents click events on iOS Safari/15.5 HOT 2
- Tranzicija
- Administrator
- d3-color version issue
- Opacity transition does not work properly for % values HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-transition.