obfuscurity / descartes

Introspective dashboard for Graphite
MIT License
502 stars 65 forks source link

Timeshift mode #101

Open obfuscurity opened 11 years ago

obfuscurity commented 11 years ago

Overview

Ability to view a timeshifted comparison between the current selected interval and the same interval at some time in the past. For example, being able to compare the most recent one hour of data against one hour from two weeks prior.

Proposed Implementation

Enabling timeshift mode

There would be a new toolbar icon to toggle timeshift mode. When enabled, a secondary toolbar "well" (in Bootstrap terminology) would open with visual tips to make it obvious we're in the alternate mode. Inside the well we'd have a new interval selector to choose the timeshift interval.

Selecting the timeshift interval

Upon clicking one of the intervals (e.g. 2w), we fire off one concatenated Graphite query to determine the max and min values for each of the graphs on the page. Once we've obtained these thresholds we request two versions of each graph: the "current" version and the "timeshifted" version. Both will use the same min/max values to ensure they're presented on the same scale. The "timeshifted" graph will be set to opacity: 0 and the "current" graph will be set to opacity: 1.

Timeshifting

A horizontal slider will exist in the timeshift control panel. By default the slider will be all the way to the right, representing full opacity for the "current" graphs. Moving the slider to the left will gradually adjust the opacity of each image; when the slider is in the middle, all graphs will render at opacity: 0.5; all the way to the left, the "timeshifted" graphs will be fully visible and the "current" graphs will be fully transparent.

Dieterbe commented 11 years ago

i wonder which UI features you'ld like that would warrant an extra toolbar? I would just provide an interval selector on the actual graph itself. by default it would say none but you can just choose an other interval. with timeserieswidget I already have a tiny html form right under the legend, that could fit an extra widget

obfuscurity commented 11 years ago

@Dieterbe It goes beyond simply adding a toolbar for the sake of adding buttons. It needs to be visibly obvious that we've entered a new mode for the sake of usability. You may think it's ok to start tacking selectors on each graph, but I do not. That sort of duplication is unnecessary, particularly when all of the graphs are supposed to be viewed with the same context.

In fact, thank you for mentioning it. I made a mistake in proposing a slider associated with each graph. That should exist in the "timeshift control panel" as well. I will update the description accordingly.

P.S. I do not plan to integrate https://github.com/Dieterbe/timeserieswidget in Descartes.