|
| 1 | +# Fire plot architecture and migration path |
| 2 | + |
| 3 | +## 1) Purpose |
| 4 | + |
| 5 | +This note documents the current fire-visualization architecture and gives a safe migration path toward shared viewer semantics. |
| 6 | + |
| 7 | +A successful migration will not begin by swapping plotting libraries. It will begin by making the fire-event products renderer-neutral enough that the same event geometry can drive either the existing Plotly hull figure or a future custom cube-viewer scene. |
| 8 | + |
| 9 | +## 2) Current state |
| 10 | + |
| 11 | +- `v.plot()` is the canonical custom HTML/CSS/JS cube viewer for general cube rendering. |
| 12 | +- `v.fire_plot()` currently returns a fire-event analysis bundle and uses a Plotly hull figure (`fig_hull`) as the supported interactive fire-specific display. |
| 13 | +- Fire geometry and climate sampling logic live in backend-agnostic parts of the fire workflow, while the final figure is currently Plotly-specific. |
| 14 | + |
| 15 | +## 3) Stable separations of concern |
| 16 | + |
| 17 | +Keep these layers distinct when modifying fire visualization: |
| 18 | + |
| 19 | +1. Event or cube data construction |
| 20 | +2. Geometry generation |
| 21 | +3. Scene/adapter packaging |
| 22 | +4. Rendering backend |
| 23 | + |
| 24 | +This separation enables one event product to feed multiple renderers and reduces regression risk. |
| 25 | + |
| 26 | +## 4) Migration strategy |
| 27 | + |
| 28 | +1. Make docs and interfaces honest about current backend status. |
| 29 | +2. Factor fire-event outputs into a renderer-neutral scene description or data adapter. |
| 30 | +3. Implement a custom-viewer renderer for that adapter. |
| 31 | +4. Only then consider changing the default fire viewer backend. |
| 32 | + |
| 33 | +## 5) Anti-patterns to avoid |
| 34 | + |
| 35 | +- Swapping rendering libraries before adapter/data boundaries are stable. |
| 36 | +- Duplicating geometry logic independently in multiple renderers. |
| 37 | +- Claiming migration is complete while `v.fire_plot()` still returns a Plotly-only interactive path. |
| 38 | +- Changing coordinate or axis conventions without updating invariants and tests together. |
| 39 | + |
| 40 | +## 6) Recommended next incremental PRs |
| 41 | + |
| 42 | +- Introduce a thin renderer-neutral adapter object for fire scene payloads (without changing current return keys). |
| 43 | +- Add tests that validate adapter payload shape and mapping from hull/summary outputs. |
| 44 | +- Implement an experimental custom-viewer renderer behind a non-default option. |
| 45 | +- Compare semantic parity (axes, time-depth direction, labels, camera defaults) before any default switch. |
0 commit comments