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
Missing real time streaming example #1775
Comments
We would love to add some streaming examples! I think the flask suggestion is a good idea but the biggest problem I have is thinking of a source of live data that 1. everyone can easily understand 2. that everyone can access without needing 3rd party libraries (ideally) 3. that is robust but also free - ideally not some internet stream by some unreliable source that may vanish (or simply change) overnight. If you have any suggestions, I would love to hear them! |
Could we just use something generated by the local machine, e.g. an operating system performance metric? |
I had considered this before...e.g core temperatures, CPU load etc. Unfortunately, I don't know of any reliable way to get this sort of information across machines/operating systems in a way that won't rely on some sort of 3rd party libraries (that are unlikely to be installed). Maybe it would be easier to get some sound information from a microphone? I wonder if pyglet lets you do this, especially as that can be packaged as a single file... |
The Bokeh spectrogram example might be a good starting point. |
@jbednar That is what I had in mind. Unfortunately, |
psutil looks like another reasonable option. My only worry is it seems to need a C compiler of some sort on Unix systems. |
I suppose we should replicate the bokeh spectogram example in HoloViews regardless of any issues getting pyaudio running... |
an example of such a capability need not rely on a 'real data source': just generate some data that drive the display. The point is 'here is how to do this', not 'here is a neat example, and here is how to do this'? |
That is a good point - there isn't any difference between ongoing simulations and real streaming measurements from the perspective of HoloViews. For example, the current boids example can be run indefinitely as an example of live data. It isn't streaming in the sense of a growing curve though and it obviously doesn't demonstrate the flask suggestion either. |
The only problem with a fake data source is that it requires a chunk of code that can be distracting from what's really going on; we don't really want people to fake a data source. I'd favor having something pyaudio or psutils based that runs well when it runs, and not worry too much about whether it will run on every system; it's still a useful example anyway. Separately having a fake data source is also useful, for one that will always run but will be more confusing. |
Agreed. We don't need to chose one over the other - the more examples we have the better! |
Another idea would be to show network traffic. Not sure if there is a suitable cross-platform library for that though... |
ah, there are some "http://assets.holoviews.org/gifs/guides/user_guide/Streaming_Data/streamz1.gif" which are not cleared by the notebook "clear" option |
That's right, I've embedded gifs to demonstrate the streaming data in a static notebook. I have not added those to the notebook in the repo yet, but I'm going to have to do something. The problem is that they are indeed very annoying when running the notebook yourself. |
@philippjfr Maybe there is a way we can embed the gifs but only for doc building? Maybe we can specify the gif somehow e.g commented out HTML in the markdown cell which only gets uncommented for the docs? |
I've never worked out how to comment out HTML in notebook markdown and that would involve further buildsteps. For now I may just go for something like this which will hide the gifs when you run it:
|
All the proposed solutions here are pretty horrible, I agree! |
I think this has been sufficiently addressed with a user guide about streaming data along. The issue about embedding gifs should be addressed separately. |
Holoviews is great but I miss a real time streaming example.
It could probably be interesting for a lot of people: try to imagine all the Arduino/IoT aficionados that could show graphs with very little programming expertise.
This demo would show:
how to embed a couple of Holoviews/Bokeh plots in a minimal flask web server (so they can manage multiple sources); I would use <iframe> to avoid useless complexities.
how these plots would be updated automagically every X seconds.
Thanks
The text was updated successfully, but these errors were encountered: