Summary
v1.1.0 introduces year-aware theme colors and further modularization of the codebase. Themes can now be determined by a curated COLOR_OF_YEAR mapping, with a small hue-prediction algorithm used for future years. This release also consolidates engine initialization into a lightweight bootstrap and polishes tooltip behavior and watermark appearance.
Notable Changes
- Year-aware themes
js/theme.jsexportsCOLOR_OF_YEARandTHEME_COLORS.TraceEngine.getColorForYear(year)returns a validated color for a given year (exact match, nearest, or predicted for future years).TraceEngine.setThemeByYear(year, { persist = false })applies the theme and can persist the selected year tolocalStorage.
- Modularization
js/trace-engine.jscontains the core engine (rendering, interactions, theming).js/app.jsprovides a small bootstrap that instantiates the engine and exposeswindow.traceEnginefor debugging.
- UX polish
- Unified tooltip positioning with an above-biased auto-flip.
- Watermark alpha and radii tuned for improved legibility.
- Randomization
randomizeTheme()and related flows now prefer year-based selection within the engine's supported year range.
Files Changed (high level)
- Added:
js/theme.js(theme constants and color-of-year map) - Modified:
js/trace-engine.js(theming APIs, tooltip logic, randomization behaviors) - Modified:
js/app.js(bootstrap wiring) - Modified:
CHANGELOG.md - Added:
RELEASE_NOTES/1.1.0.md
Migration / Usage
- Developers can now programmatically set year-based themes:
traceEngine.setThemeByYear(1999, { persist: true })TraceEngine.getColorForYear(2025)returns a hex color string.
- Default behavior remains unchanged: if you haven't opted to use year-based theme persistence, the saved theme index still controls the initial theme.
Testing Notes
- Verify theme application across a few representative years (historical, nearest, and future-predicted).
- Validate tooltip placement across mouse, touch, and keyboard focus.
- Run accessibility checks for color contrast and ensure
announcerbehavior remains non-intrusive on load.