Skip to content

refactor: e-charts imperative model#1888

Merged
pedrolamas merged 4 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/echarts-refactor
Jun 21, 2026
Merged

refactor: e-charts imperative model#1888
pedrolamas merged 4 commits into
fluidd-core:developfrom
pedrolamas:pedrolamas/echarts-refactor

Conversation

@pedrolamas

Copy link
Copy Markdown
Member

Refactor e-charts usage to use imperative changes rather than observable ones.

Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>
@pedrolamas pedrolamas requested a review from Copilot June 21, 2026 17:40
@pedrolamas pedrolamas added the Code - Optimizations Everything that relates to code optimizations! label Jun 21, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors ECharts usage to favor imperative setOption updates (via manual-update) instead of relying on reactive :option binding, and consolidates repeated system chart markup into a shared wrapper component.

Changes:

  • Switch AppChart (and ThermalChart) to manual-update and explicitly apply options/datasets imperatively.
  • Introduce SystemChart wrapper to unify layout/label styling across system charts and remove duplicated “ready” gating logic.
  • Minor safety hardening around optional chart refs (e.g., BedMeshChart).

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/components/widgets/thermals/ThermalChart.vue Moves to manual-update + imperative option application; adds chart-ready handler and option watcher.
src/components/widgets/system/SystemUsageCard.vue Removes now-relocated chart label styling.
src/components/widgets/system/SystemMemoryChart.vue Switches to shared SystemChart wrapper; removes local ready/watch plumbing.
src/components/widgets/system/SystemLoadChart.vue Switches to SystemChart; simplifies yAxis max logic.
src/components/widgets/system/SystemChart.vue New wrapper component encapsulating common system chart markup + styles + “has data” gating.
src/components/widgets/system/MoonrakerLoadChart.vue Switches to SystemChart; removes local ready/watch plumbing.
src/components/widgets/system/McuLoadChart.vue Switches to SystemChart; removes local ready/watch plumbing.
src/components/widgets/system/KlipperLoadChart.vue Switches to SystemChart; removes local ready/watch plumbing.
src/components/widgets/bedmesh/BedMeshChart.vue Makes chart ref optional and guards chart method calls.
src/components/ui/AppChart.vue Converts to manual-update and applies options/dataset imperatively.

Comment thread src/components/widgets/thermals/ThermalChart.vue
An empty Moonraker temperature store sets charts.ready with an empty chart array, so ThermalChart could be created with no data and throw in Object.keys(chartData[0]). Build the series only once data has entries, and re-apply once it arrives.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread src/components/ui/AppChart.vue
Comment thread src/components/widgets/system/SystemChart.vue
AppChart and SystemChart validate `data` with `type: Array` and use array semantics, but typed it as `DatasetComponentOption['source']` (which includes a non-array form). Narrow to `Extract<…, unknown[]>` so the type matches the validator and usage.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Comment thread src/components/widgets/thermals/ThermalChart.vue
Comment thread src/components/ui/AppChart.vue
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Pedro Lamas <pedrolamas@gmail.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.

@pedrolamas pedrolamas merged commit 0678636 into fluidd-core:develop Jun 21, 2026
1 check passed
@pedrolamas pedrolamas deleted the pedrolamas/echarts-refactor branch June 21, 2026 19:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Code - Optimizations Everything that relates to code optimizations!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants