keithknott26/datadash

Redraw the whole graph?

for-coursera opened this issue · 4 comments

(Sorry in advance for being a bit slow and probably noisy :)

As I understand, when datadash gets the new data from STDIN, it draws a new graph and adds it alongside the previous one, thus creating something like a "tape" (similar to an electrocardiogram, for instance).

But what if we'd have an option to redraw the graph completely, so that only the new data would be added (and the missing data – if any – would be removed)?

So, that instead

...we'd get

Or, may be an option limiting the number of these graphs on the screen? Like, if set to 1, then only the latest graph will be drawn (and if set to 2, then no more than 2 graphs will be displayed, like in the example above).

Again, I do apologise if this is already possible (or if this is out of the scope of this project), just couldn't figure out how to achieve it, and thought that may be it could be a useful addition.

Thank you :)

@for-coursera ,

I'm pretty sure you want to use command line option -s (scrolling) to achieve what you're after. Keep in mind it will only scroll after a certain number of records have been reached.

Thanks,
Keith

@keithknott26

No, not really :)

I've tried both with and without -s before posting this issue, and as far as I can tell, the difference lies in a way these joined charts are presented: either they are "stacked" / drawn one after another with (probably?) no limits (scrolling is set to false), or only a certain number of those updated charts is shown on a screen, and then the scrolling starts (scrolling set to true).

But there's no way to display only one chart not joining / adding the updates with the previous chart.

If this -s option could take a numeric argument, like with -s 3 only 3 joined charts are shown, and then the scrolling starts, then, yes, we could say -s 1, and the scrolling would start exactly after the second chart would be generated.

But as of now I don't really see a way to achieve that :)

(Sorry for probably not being clear enough, but may be the screenshots above could help :)

gedw99 commented

I thinking I see what you’re getting at .
well let’s see .

you want to update data from the past, not just the new data fed to the end of the chart.

I have not looked into the u der lying code, but perhaps a Marge or patch is possible into the gui layer ?

may the data layer you probably want a mixer that gets all data events and then place old data into the right place that the gui needs.

@gedw99, thank you for your interest!

you want to update data from the past, not just the new data fed to the end of the chart.

Mmm... not really, as far as I understand you :)

As of now, when the data is read for the first time, datadash draws the first chart, and for the sake of simplicity let's call this init chart (like the one on the screenshot) a letter A. Then, the new data is read, and a new chart is drawn alongside, let's call the new chart B, and the whole representation on the screen will look like AB (like on this screenshot). Then, the data is updated again, then even newer chart is drawn, C, and on the screen it looks like ABC. And so on. And at some point the representation on the screen will be something like BCDE, and it will be possible to scroll to the left (to the past), and see ABCD.

What I suggest, however, is always to draw one chart at a time on a screen:

  • first we get A
  • then B (just B, not AB, but you can scroll to the left to see A)
  • then C (and you can scroll to the left to see first B, and if you keep scrolling, then A)
  • and so on.

Hope it makes more sense now :)