addPoint with FIFO policy

Issue #40 new
Sid Bradipao
created an issue

While experimenting with the library I added a small enhancement, a function name shiftPointToLine() that is very similar to addPointToLine(), but uses a First-In-First-Out policy with user-defined FIFO size.

It's useful for super-easy implementation of a rolling LineGraph with fixed number of point.

Here is my implementation, if interested in adding

Comments (2)

  1. Daniel Nadeau repo owner

    Interesting... While I like it, I think that keeping it separate (in your branch rather than master) is best plan on this one. Many people would most likely do this manually, and isn't really used by many.

    If you can think of some really good use cases, I will consider. But really, I can't think of many times the user couldn't just add 10 or so lines of code to do it manually.

    Thoughts? :)

  2. Sid Bradipao reporter

    It's ok for me keeping in specific branch, my intention was to share with community. :)

    My specific use case is for real-time visualization of environmental parameters. I have a sort of dashboard-app with temperature and humidity data acquired every 10 seconds (or whatever) from an Arduino board, and shown in shifting LineGraph used as a 48 entries FIFO.

    But basically any real-time data visualization needs this approach (think of graph for Gps Signal strength, Wifi strength, luminosity sensor, accelerometer data), even the CPU load graph of Windows OS is a fixed size LineGraph with shifting data.

    The distinctive factors of this usage policy are the need of "real-time" graph update and its "fixed number" of samples.

  3. Log in to comment