andrew,
@andrew@fediscience.org avatar

#rstats Q: I'm trying to make a flexdashboard (or Quarto dashboard or whatever) that displays data dynamically when loading in the browser (like pulling from an API). It looks like running a full Shiny server is the only way to get that to work. Is there some other way to populate it w/live data?

andrew,
@andrew@fediscience.org avatar

Or alternatively, all the data comes from JSON that gets spat out of RESTful API URLs, and all I really need to do is show values from the JSON results. Is there a nice easy non-Shiny, non-R way of making JSON-backed dashboards?

adam42smith,

@andrew I don't know how far you want to go but a lot of dashboards are straight d3.js https://d3js.org/what-is-d3

andrew,
@andrew@fediscience.org avatar

@adam42smith I was just heading down the d3 route and then remembered that Quarto supports OJS, which is d3-esque https://fediscience.org/@andrew/111700608422507419

scheidegger,
@scheidegger@mastodon.social avatar

@andrew @adam42smith yeah I’d start with OJS and their plotting libraries, no need for d3 even

andrew,
@andrew@fediscience.org avatar

@scheidegger @adam42smith holy moly it works with the new Quarto dashboard format! And it's live!

I'll just have my plumber API do all the heavy lifting and spit out the data I need to show

This is incredible!

thomasw,
@thomasw@toot.bldrweb.org avatar

@andrew

There's a brand new shinylive for R package(?) And quarto extension that I just heard about by watching the posit conf video [1]. This is the best reference I could find quickly, but you might find more with a bit more searching
https://github.com/coatless-quarto/r-shinylive-demo

[1] https://youtu.be/j1M6YyU2ZX8?si=aKMN0Eooa4GQFe-t

josi,
@josi@fosstodon.org avatar

@andrew @thomasw shinylive is probably the best bet so far?

thomasw,
@thomasw@toot.bldrweb.org avatar

@josi @andrew

If one is down to learn OJS, I bet that's a more elegant approach. I'm guessing R shinylive is a bit finicky right now (but I haven't tried it).

andrew,
@andrew@fediscience.org avatar

@thomasw @josi Yeah, I’m about to learn some bare minimum OJS I guess

markigra,
@markigra@sciences.social avatar

@andrew I think that there’s a project that runs with webr completely in the browser. I believe @hrbrmstr has written about it

hrbrmstr,
@hrbrmstr@mastodon.social avatar

@markigra @andrew If one of these doesn't fit the bill lemme know and I’ll mock something up https://rud.is/webr-experiments/

andrew,
@andrew@fediscience.org avatar

@hrbrmstr @markigra Oooh cool I'll hunt around those experiments to see what might work.

Alternatively, I have a {plumber} API that I can use to do all the heavy lifting and spit out JSON, but I don't think flexdashboard has a way to dynamically grab URLs like that and update plots/text

andrew,
@andrew@fediscience.org avatar

@hrbrmstr @markigra OH WAIT! Quarto can use OJS, which can grab stuff dynamically https://quarto.org/docs/interactive/ojs/data-sources.html#web-apis

image/png

hrbrmstr,
@hrbrmstr@mastodon.social avatar

@andrew @markigra aye. OJS Plot() FTW

andrew,
@andrew@fediscience.org avatar

@hrbrmstr @markigra brb re-learning javascript

hrbrmstr,
@hrbrmstr@mastodon.social avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • DreamBathrooms
  • magazineikmin
  • InstantRegret
  • thenastyranch
  • cubers
  • Youngstown
  • ethstaker
  • slotface
  • mdbf
  • rosin
  • Durango
  • kavyap
  • GTA5RPClips
  • khanakhh
  • JUstTest
  • tacticalgear
  • ngwrru68w68
  • cisconetworking
  • modclub
  • everett
  • osvaldo12
  • tester
  • anitta
  • Leos
  • normalnudes
  • megavids
  • provamag3
  • lostlight
  • All magazines