Skip to content

Remove invisible datapoints without derpy animation #1347

@KaappoRaivio

Description

@KaappoRaivio

I have a graph displaying real-time data. Over time the number of data points grows impractical to manage, so I have tried to "shave off" the invisible ones. Unfortunately, the animation isn't working right.

Desired outcome:
desired

Actual outcome ("notice how the library thinks that the new data is unrelated to the old one, resulting in the points moving vertically, not horizontally):
derpy

This is the code that removes the old data:

const truncate = (data, length) => {
    if (data.length > length) {
        while (data.length >= length) {
            data.shift();
        }
    }

    return data;
}

Is there a way to get rid of the derpiness?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions