cmu-delphi / cmu-delphi/forecast-eval
Consider caching old common location set to check if we should rerender the truth plot, instead of using an observer
- Dominant language
- R
- Stars
- 6
- Forks
- 3
- PR merge metrics
- No merged PRs in 30d
Description
To save plot rendering/computation time in https://github.com/cmu-delphi/forecast-eval/pull/271, we could also save the previous `locationsIntersect` to a user session-specific global and check during the next call to `summaryPlot()` if it has changed. If `locationsIntersect` has changed, make a new truth plot.
Potential problems:
- Because it is in an `observer`, the re-plotting logic in https://github.com/cmu-delphi/forecast-eval/blob/49896afaece66985f0b0d59c3eab1dee20bfe32a/app/server.R#L239 is confined to cases where the forecaster selection has changed. If we move the logic to `summaryPlot()` truth re-plotting could be triggered in other cases that we don't need/want.
- It's unclear how much extra time making a new truth plot takes. The re-plotting logic [re-renders the old plot](https://github.com/cmu-delphi/forecast-eval/blob/49896afaece66985f0b0d59c3eab1dee20bfe32a/app/server.R#L328-L332) and rendering is slow.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in app/server.R at the observer around line 239 and the truth-plot rendering logic around lines 328-332; trace how summaryPlot() uses locationsIntersect. Measure or inspect when the old plot is rendered and identify cases where a changed location set should trigger rerendering. Done means the caching approach avoids unnecessary work without causing rerenders in unrelated cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data-visualization, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100