MakieOrg / Makie.jl

Interactive data visualizations and plotting in Julia
https://docs.makie.org/stable
MIT License
2.39k stars 302 forks source link

Timeseries recipe extension #378

Open wsphillips opened 5 years ago

wsphillips commented 5 years ago

Related to discussion here

I may be slow to offer solutions but timeseries could use a couple things to make it more useful and generalizable:

1) ability to accept vectors of new data points instead of just single numbers 2) expose history for controlling length of time plotted 3) expose unit scaling for x axis so that number ranges appropriately reflect true sampling rates

Any pointers of where to focus in the api would be helpful.

asinghvi17 commented 5 years ago

Exposing unit scaling would be pretty easy in that we could provide a scaling factor to multiply the x-axis by - that would just be a simple change in the recipe.

wsphillips commented 5 years ago

Before I go hunting too much farther in vain: Are methods like scissoring or blitting used when rendering 2D line plots (specifically)? Or textures?

SimonDanisch commented 5 years ago

Are methods like scissoring

Yup, using scissor tests + stencil tests right now, but I'm not actually clipping outside the plotrange... But that's planned pretty soon, and subscenes already clip anything outside their pixelarea(scene)

Or textures?

What do you mean? Textures are used, yes...

wsphillips commented 5 years ago

Sorry, I should preface with: I'm learning as I go with OpenGL.

I have been looking for different techniques to efficiently plot lines fast and so far I have come across blitting the previously plotted points + line grid + time axis. Or alternatively (and again apologies if partial naivete) you can draw the points and use it as a texture surface that you only update a portion of using glTexSubImage2D. If some solution already exists then there's little point chasing such dead ends.

Aside: I work with live neural data that's high frequency (think kHz) sampled, and the events we monitor are short and happen quickly. Monitoring this type of data was part of what motivated the similar package VisPy--it turns out OpenGL is pretty good at handling plots with massive data streaming in. Since my take is that it might be an edge case need, and I'm impressed with what's come out of this project so far, I don't mind doing a bit of work here (if I'm able) :)