-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Altair SolaraViz ignores dependencies / update_counter, causing stale renders #3243
Description
Description
SpaceRendererComponent accepts a dependencies parameter but only wires it into Matplotlib rendering. The Altair path does not use dependencies (or update_counter) at all, so updates that should trigger a redraw can be missed, leading to stale charts.
There’s a # FIXME: Manage dependencies properly comment at the SpaceRendererComponent signature, which appears to refer to this gap.
Steps to Reproduce
- Create a model that updates visible state each step.
- Use Altair backend in
SolaraViz. - Trigger updates via
update_counteror by passing dependencies. - Observe that the Altair chart does not re-render consistently.
Expected
Altair renders should respond to the same dependency signals as Matplotlib renders, including update_counter and any explicit dependencies passed into SpaceRendererComponent.
Actual
Altair rendering ignores dependencies, so updates may not trigger a re-render.
Proposed Fix
Compute viz_dependencies = [update_counter.value] + dependencies for both backends, and use these dependencies to drive Altair chart recomputation (e.g., via solara.use_memo or a supported dependencies argument to FigureAltair).
Possible Test
Add a test that renders SolaraViz with Altair, triggers a dependency change, and asserts that the draw methods are called again or that a new chart is produced.