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

Charts rendering optimization #6573

Merged
merged 10 commits into from
Feb 13, 2025
Merged

Conversation

jryu01
Copy link
Contributor

@jryu01 jryu01 commented Feb 11, 2025

Description

When updating a chart setting, we encountered an issue where updates to all chart settings were being triggered, leading to unnecessary chart rendering or expensive spec diff checks. This change mitigates the issue by:

  • Leveraging watch to detect updates in chart settings of the same type and only applying updates to settings that have actually changed. (See useChartSettings.ts)
  • Ensuring that the entire node.state object is not included as a dependency in computed properties used for rendering the chart (e.g., chartData). Including the entire state object would cause the computed property to update whenever state changes. (See usePreparedChartInputs in the simulate, calibrate, and optimize utilities.)

Before

BeforeOptimize.mov

After

AfterOptimize.mov

Resolves #(issue)

@jryu01 jryu01 marked this pull request as ready for review February 11, 2025 22:34
Copy link
Member

@mwdchang mwdchang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay

@mwdchang mwdchang merged commit cba2df8 into main Feb 13, 2025
4 checks passed
@mwdchang mwdchang deleted the jryu/charts-settings-optimization branch February 13, 2025 14:14
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.

4 participants