Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Idea: Polar/Circular Charts #119

Open
cinderblock opened this issue Jan 24, 2020 · 4 comments
Open

Idea: Polar/Circular Charts #119

cinderblock opened this issue Jan 24, 2020 · 4 comments

Comments

@cinderblock
Copy link

I've got a desire to display streaming data on a circular area. I'm wondering if it would make sense to extend Smoothie to do this or maybe fork and rework to be independent.

The center would be t=0 and the edge would be like t=10s (default). A value (or multiple) from [0-2π) (or maybe allows wrapping) is then charted and animates towards the edge of the circle, dissapearing when it gets there.

Any thoughts on implementing this? I'm not super familiar with how canvas does drawing efficiently and if we can just slide the data to the edge as I'm thinking.

Related Idea: Plotting on a 2D grid and having old values fade away.

Thoughts?

@drewnoakes
Copy link
Collaborator

Can you share an image that shows roughly what you'd like the output to look like?

@cinderblock
Copy link
Author

Something like these two plots showing the angle of a motor at two different angular velocities.

image

Note, the polar grid would be fixed in angle but the radius lines would be "scrolling" from the center to the edge.

The more I look at this, the more I think this might need to be a separate (forked) project...

@drewnoakes
Copy link
Collaborator

One difference to consider is that Smoothie has a TimeSeries object that is logically unbounded, and only a fixed length window at the end (leading up to Date.now()) is shown. For a polar chart, you have 0-360 degrees, potentially wrapping.

It probably makes sense to use Smoothie's code for inspiration and creating something new. It would be possible to start supporting new chart types in Smoothie, but we wouldn't want to get away from the value Smoothie has in being a simple focussed chart type.

@cinderblock
Copy link
Author

cinderblock commented Jan 30, 2020

I think I've failed to articular my thinking fully.

Just like SmoothieCharts, the data from a TimeSeries, once it gets to the edge of the circle, gets discarded (just like SmoothieCharts).

Basically, map the x axis of SmoothieCharts to r (radius) and the y axis to θ (angle). Auto scaling basically not needed since you always know what one revolution is. Though I imagine being able to specify a scale would make a lot of sense.

Back to the point at hand, it sounds like it makes more sense to keep this as a separate project.


I'm still wondering if a 2D chart would make sense, where the canvas doesn't scroll and the data essentially just expires (or fades to nothing) over some defined period of time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants