#592 Measures: plugin scripts and derived metadata read a summary's totals (#587)
–
- github
- github/openchronology/timeline-app
- github/openchronology/timeline-app#592
- pull request
- state:merged
Closes #587, a follow-up to #570. Stacked on #591: until that merges, this diff includes its commit. Plugins can read summaries' totals, not only single moments' values. - **Summary scripts:** a plugin with `renderSummaries: true` has its script render summaries too, setting their color, shape, size and outline from their totals. - Scripts read a total with `api.total(name)`. On a moment, that's its value. - In a comparison, `api.total(name, n)` reads the *n*th compared timeline's totals, kept by timeline (#586). Without `n`, a comparison's summary has no totals, so plugins choose how to show each timeline's. - Plugins without the flag render single moments only, as before, so existing plugins don't start styling summaries. - **Derived metadata (#122):** a new `{ "measure": "cost" }` source reads an entity's value, or a summary's total, as exact text. **Tests:** unit tests cover summary effects from totals, per-timeline totals in comparisons, a moment's value, plugins without the flag, and `measure` derivations on moments and summaries. Docs (plugins, measures) updated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_011fFY8eruEi1xAkkMBni13B https://github.com/circagraph/timeline-app/pull/592
Related
- #122 journald & other import formats severity colorization
- #570 Measures: typed quantities on moments and durations, totalled in every summary
- #586 Measures: comparisons keep totals per timeline, never added across them
- #587 Measures: plugin scripts and derived metadata read a summary's totals
- #591 Measures: comparisons keep totals per timeline, never added across them (#586)
- Merge pull request #592 from openchronology/feat/587-plugin-totals