Feature request: disable animation on load
See original GitHub issueI’m submitting a…
[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report
[ ] Performance issue
[x] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:
Current behavior
Currently, the on each render the diagram animates as it loads. This is a cool effect, but quickly gets distracting if a user is switching between pages rapidly, or if the app wants to render a modal-like overlay that may trigger a re-render.
I tried following down the path to the elk docs. As best I can make out, the closest parameter that might modify this behavior is elk.animate
, which accepts a boolean, but as far as I can tell no value I could pass would alter this behavior—I tried passing a string with various values, and overriding the TS types to force an actual boolean value, without luck. I don’t know where the behavior originates.
Expected behavior
Ideally I’d like to be able to pass in a rendering option to the canvas that disables the initial animation on render.
Minimal reproduction of the problem with instructions
N/A
What is the motivation / use case for changing the behavior?
Non-visible root rerenders of the diagram for cases where loading behavior would otherwise make it seem distracting.
Environment
Libs:
- react version: 17.0.1
- reaflow version: 3.0.14
Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
OK - so let’s just add a new property on the Canvas component called
animated
- default it to true and then in the spots where framer-motion is used u need to pass it as a flag like i did here in reaviz: https://github.com/reaviz/reaviz/blob/master/src/BarChart/BarSeries/Bar.tsx#L476Oh goodness! So sorry for dawdling on this and thanks for adding it, I appreciate it.