JonnyDawe / UK-Sewage-Map

This map shows real-time information about river sections that might be affected by sewage discharges from combined sewer overflows. Currently, it is limited to the Thames basin.
https://sewagemap-jonnydawe.vercel.app
MIT License
4 stars 1 forks source link

Add a "first recorded event" marker to discharge history pop-ups #13

Open AlexLipp opened 6 months ago

AlexLipp commented 6 months ago

Problem

Different EDM monitors were installed and hooked up to the API at a variety of dates. Unfortunately, the Thames API does not provide a "data valid from" date for each monitor. A consequence is that inspecting different histories for different monitors may give a false impression if the monitors were installed at different dates.

Solution

A reasonable proxy for when the monitors history becomes 'valid' is the date at which it first records an "event". The pop-up could display this as a labelled red-line so a user can see when the data may be valid from. For example, something that is similar (but more attractive than):

image

JonnyDawe commented 5 months ago

@AlexLipp This is a great idea!

Unfortunately implementing it in google charts looks to be extremely hacky! For example this stackexchange article has an implementation](https://stackoverflow.com/a/48509661), but it requires some gnarly injection of dom elements into the Google chart svg!.

I'll give it a go and report back.

In the long term I'd like to switch us over to using this timeline library: https://visjs.github.io/vis-timeline/examples/timeline/items/backgroundAreas.html