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

feat: add option to disable d3 transitions. #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

pedro-tav
Copy link

Addition of option to chart props: disableD3Transitions()

This pull request adds an extra option to the chart props called "disableD3Transitions" which disables the d3Transition function used in icicle.js. The reason that I think this is necessary is because, while developing my react application using this library, I encountered an issue where d3 transitions throws an error on very fast re-renders of the chart. A solution to this fix is to completely remove the d3 transition function and set the transition value to null. This causes the animation to be default (therefore transitionDuration does not work if disableD3Transition is true), but fixes the fast re-render issue.

Here is an example of the error generated by d3 transitions.

ERR

@vasturiano
Copy link
Owner

@pedro-tav thanks for reaching out.

If you set transition to null this will have the effect of falling back to the default transition definitions, which has a duration of 250ms, as you can see here: https://github.com/d3/d3-transition#transition_duration

I'm not sure this is what you intend.

But perhaps the higher question is what's leading your app to perform so many update calls on this component that it will cause it to stack overflow. Do you perhaps have a cyclical render loop in your React app that's causing it to reach this state?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants