Skip to content

use step interpolation for chart fidelity, linear for PV only#4

Merged
cayossarian merged 2 commits intomainfrom
fix/graph_fidelity
Apr 5, 2026
Merged

use step interpolation for chart fidelity, linear for PV only#4
cayossarian merged 2 commits intomainfrom
fix/graph_fidelity

Conversation

@cayossarian
Copy link
Copy Markdown
Member

@cayossarian cayossarian commented Apr 5, 2026

Circuit graphs previously used linear interpolation between data points, creating misleading diagonal ramps for instantaneous value changes. Step interpolation accurately represents discrete on/off behavior. PV is the sole exception — solar output follows the sun's arc so linear is faithful. Resolves Issue #5

Circuit graphs previously used linear interpolation between data points,
creating misleading diagonal ramps for instantaneous value changes. Step
interpolation accurately represents discrete on/off behavior. PV is the
sole exception — solar output follows the sun's arc so linear is faithful.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts chart interpolation to better represent discrete circuit state changes by using step interpolation for most circuit graphs, while keeping PV charts linear to reflect solar’s gradual ramps.

Changes:

  • Pass a PV/linear-interpolation flag from circuit DOM updates into chart rendering.
  • Extend chart update/options builders to support PV-specific interpolation behavior.
  • Regenerate the bundled dist/span-panel-card.js output to reflect the new interpolation logic.

Reviewed changes

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

File Description
src/core/dom-updater.ts Determines whether a circuit is PV and passes that into chart updates.
src/chart/chart-update.ts Extends updateChart to forward PV interpolation preference into option building.
src/chart/chart-options.ts Adds ECharts step series option for non-PV charts (linear for PV).
dist/span-panel-card.js Rebuilt bundle incorporating the interpolation changes.

Circuit graphs previously used linear interpolation between data points,
creating misleading diagonal ramps for instantaneous value changes. Step
interpolation accurately represents discrete on/off behavior. Continuous
signals (PV solar arc, BESS SoC/SoE) use linear interpolation.
@cayossarian cayossarian merged commit 211914e into main Apr 5, 2026
2 checks passed
@cayossarian cayossarian deleted the fix/graph_fidelity branch April 5, 2026 14:00
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