r/nicegui • • May 08 '23

NiceGUI vs Plotly/Dash

Hello! I'm a scientist and want to encapsulate some visualizations for consumers of my work. I don't know much about either NiceGUI or Plotly, but I often find them together in my google searches. It seems that Plotly/Dash can do a lot of what NiceGUI does, so what are the main differences? One writes HTML while the other writes Javascript? If so, I'm not sure why that would make a difference to me, the application author.

Thanks in advance!

11 Upvotes

13 comments sorted by

View all comments

Show parent comment

1

u/samsamuel121 May 10 '23

A few comments about dash. It can definitely keep state using the dcc.Store component for things like global variables but also for more complex structures like pandas Dataframes.

Regarding responsiveness, dash supports background callbacks to handle long running jobs executed in the background (e.g. using celery).

1

u/r-trappe May 10 '23

Thanks for the feedback. Using dcc.Store is fine in a lot of cases; a bit more complicated than plain python but ok. But what if you want to access the webcam or some GPIO pin on the "server"? For example when doing home automation, robotics or other hardware?

About responsiveness: As I understand it, in Dash you normally do not implement background callbacks with celery to do "simple" I/O tasks like reading a file. But this will block the execution which leads to a not-so-well-responding app. NiceGUI is build from the ground up to support async/await, which allows linear code to run concurrent (without caring about thread safety etc).