Reworking the local graph


#1

Thanks to recent contributors @frogmore and @timbailey99, I’ve taken renewed interest in this tool. As I was designing the new query API, it became obvious that the best way to deal with the hugely complicated issue of time-zones and DST was to push that down into the IoTaWatt, which knows the local time and when the clocks change. There are still issues with the browser being in a different timezone than the IoTaWatt, but that’s a rare case.

Anyone who has used Emoncms will see that this graph program is derived from the original Emoncms graph developed by Trystan Lea some years ago. I forked it for IoTaWatt a couple of years ago. Since then, Emoncms has taken it in a different direction.

The IoTaWatt version runs completely asynchronous. That is to say that as you click and select, the query and graphing that causes is done independently, so you don’t have to wait for the graph to click something else. To be sure, the wait is much shorter in Emoncms, but the added delay in IoTaWatt is inconsequential because it is asynchronous.

The changes made recently leverage the new query, and also eliminate functionality that was optional in Emoncms but standard with IoTaWatt like averaging. One of the most prominent new featyres is an enhancement to the new time period selection added by @frogmore in the last release.

You can see that rather than just a list of lookback periods measured in days, the list now includes periods with day, week, month and year boundaries. These are translated to queries that are evaluated using the local date/time of the IoTaWatt.

If the menu choices don’t satisfy your needs, you can simply go into custom select mode by clicking on the start and end dates to specify custom dates with a calendar date-picker. Once you get close, the pan and zoom can be used to narrow it down or just select the period of interest on the graph as in the prior versions.

A lot of extra stuff was 86’d to make this more streamlined, and a lot of the large data manipulations have been reigned in so it should work better on lighter weight browsers like some memory constrained phones and tablets.

Still some QC to do to get everything mostly working, then I’ll put it out along with the old graph for Alpha testers to beat on.


#2

Looking good. Looking forward to trying it out. I have some other ideas for small improvements too.