Feature Request - Change chart lookback from main page

It would be nice to be able to make quick changes to each chart’s lookback setting from http://pioreactor1.local/ . Currently, I would have to go to the Config page and change the lookback, save the config file, (and then refresh the page?), and then navigate back to the main page. Some of the charts you have to edit the .yaml itself.

I’d like to be able to quickly switch between viewing the entirety of the experiment and just the last X hours of the data.

I looked in normalized optical density .yaml and I see a lookback: parseFloat(config['ui.overview.settings']['filtered_od_lookback_hours']) and I think something like this might work. Charts could instead reference the lookback from somewhere on the main page.

I am having a bit of difficulty getting one of my charts to use the correct lookback value. I have set the lookback value to 20, but it keeps displaying the entire experiment (~3 days). I’ve tried a couple different values for lookback but none of them has an effect. Here’s my code:

/var/www/pioreactorui/config/charts/08_implied_growth_rate_24_hours.yaml

---
data_source: growth_rates # SQL table
chart_key: implied_growth_rate_24_hours
title: Implied growth rate (24 hours)
mqtt_topic: growth_rate_calculating/growth_rate
source: app
payload_key: growth_rate
y_axis_label: Growth rate, h⁻¹
interpolation: stepAfter
y_axis_domain: [-0.02, 0.1]
lookback: 20
fixed_decimals: 3

Ah, growth_rate is hardcoded to all-time for a reason I can’t remember! I’ve made an issue to unlock this.

An option we tinkered with early on is a “zoom” feature. It caused performance issues. The lookback was a hack around this. I’d like to attempt this again in the future.