Open jonocarroll opened 7 years ago
I seem to recall a shiny gauge that responded in (near?) realtime to a non-blocking API call. Maybe to CRAN requests?
I may be thinking of this though https://gallery.shinyapps.io/087-crandash/ which is probably just updating frequently.
I'm wondering if there is there some neat way we could make this dual use for streaming and for animations of static data ala gganimate
. I think that would be a handy tool to have!
Like maybe we can create a 'source' that is just an emitter of static data at a defined rate?
So, instead of animating some data and viewing the resulting .gif
, we could have
data_object %>%
electric_ketchup(fps = 60, key = frame) %>%
geom_realtime()
I like it. I'm not sure that it's easier than just passing the data and saying 'loop this', but ideas.
Yes. And then we have the more sophisticated:
dat_object %>%
turbo_catfish(fps = 60,
key = frame,
loop = True,
tween_frames = 10,
tween_cols = c("x", "y"),
easing = "cubic-in-out"
) %>%
geom_realtime()
Or maybe the tweener is a separate function to the emitter. That way you could tween your realtime streams. Granted you'd have to be plotting a frame behind realtime for that to work.
Real-time display of streaming data in Shiny would be great. We are currently investigating feasibility of capturing high-temporal-resolution waveform data (ECG, pulse oxygenation etc) in ICUs, and a way to display it as it is acquired would be fab.
There's the Plotly real-time stuff, but it's not open-source and it is not stand-alone - it only works via their servers, afaik. https://github.com/plotly/Streaming-Demos
htmlwidgets
, which is how I've incorporated p5.js
so far, can have a shiny
implementation, so this would work in well.
its probably better to think of this as "stat_realtime" and then you would have the full plotting functionality of gems still available
That would be true if there ends up being more than the current level of ggplot2
in there. There is currently 0, despite the name and appearance. I've been deliberately deceptive in making the plot look like that, but it does have some nice familiarity to people, no?
The question of whether or not ggplot2
could be adapted to plot in realtime is an interesting, but separate one. I suspect it's not quite that flexible.
I'm certainly open to ideas as to how to implement this better than p5.js
; @dicook; any help/guidance/contribution you're able to provide would be of great benefit.
@jonocarroll's blog post on this: 2017 rOpenSci ozunconf :: Reflections and the realtime Package https://ropensci.org/blog/2017/11/14/realtime/
Anything happened afterwards. looks like real real-time plot in R.
Any public Github repository yet?
This was an experimental project developed during a conference. Here's the public repo https://github.com/ropenscilabs/realtime
We got a proof of concept working at the ROpenSci ozunconf, but @kcf-jackson was the one to actually build something that works. He presented it at useR2018. His version was called jsReact (this repo has examples) but was later refactored to rjs.
FYI, none of this is an actual ggplot2 geom - this is using javascript to visualise data faster than a plot can be generated in R, but using R to do the calculating.
A more focused application of #23 would be to implement what I've played around with here: https://www.youtube.com/watch?v=3mdiCUbgxi0 as a general plotting framework. I floated the idea on Twitter of extending webrockets to be able to actually plot incoming data in realtime. Point R at a streaming source and tell it to graph it.
cc: @milesmcbain