-
Notifications
You must be signed in to change notification settings - Fork 44
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
front: d3 performances #6108
front: d3 performances #6108
Conversation
683369b
to
dce87b1
Compare
c9f818f
to
5ef8190
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## dev #6108 +/- ##
============================================
+ Coverage 26.69% 26.74% +0.04%
Complexity 2139 2139
============================================
Files 931 932 +1
Lines 123484 123547 +63
Branches 2682 2690 +8
============================================
+ Hits 32968 33044 +76
+ Misses 88918 88897 -21
- Partials 1598 1606 +8
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d63bc5c
to
371d020
Compare
371d020
to
b80bb28
Compare
front/src/modules/simulationResult/components/ChartHelpers/ChartHelpers.ts
Show resolved
Hide resolved
ec46d1f
to
6683b26
Compare
It's really more fluid than before, well done ! From what I see, it's not related to D3 itself, but to redux. You replaced the redux stack with a manual observable, which works good . But like you said in your comment, it's outside the react lifecycle, and it's the first time that such a pattern (singleton + custom observable) is used in the stack, so a front leader must take a look at it. In react style, I would have created a context shared by all the component, with a custom hook. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments, awesome job :)
front/src/modules/simulationResult/components/ChartHelpers/ChartHelpers.ts
Show resolved
Hide resolved
front/src/modules/simulationResult/components/ChartHelpers/ChartHelpers.ts
Show resolved
Hide resolved
front/src/modules/simulationResult/components/ChartHelpers/ChartSynchronizer.ts
Outdated
Show resolved
Hide resolved
ef5c6e1
to
015aa1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, tested ✅
015aa1a
to
c0ab994
Compare
LGTM nice job <3 |
@sim51 you're right, we've discussed about it and we decide that the gain worth it now. In a few weeks, as we say together, we'll rewrite all the component and the time synchronization between graphs, this "code style exception" will be lost. |
Improving d3 general performance during interactions with the main charts and map.
timePosition
andpositionValues
are now removed from the store and now handled in a separate classChartSynchronizer
. These two values are now completely seperate from redux and react life cycle, which alleviates quite some unnecessary workload and re-renders.Second source of improvement: memoization of the function
interpolateOnTime
, which is called on every mouse move on the charts.closes #6105