Plotly load time, plotly "widgets" and real time data

Howdy,

I have now tested plotly for the first time :slight_smile:

After some research I find the library very awesome, but sadly I am experiencing that loading a basic plot is super slow (takes a couple of seconds to load).

I don’t know if this is correct, but since I would like to display “live data” I have added a timer which (should) refresh the plot.

The only reason of the slowness that I can think of is that the figure is being created at the server side. I am not quite sure if it is correct to put it there or if it should be created on the client side?

The reason I put it there was that I followed a guide of how to use the plotly-express library.

Project is inserted below.

https://anvil.works/build#clone:Z43YM5HBZQETGF2C=URPRKAOLYKZXARMHB6HOA7CE

A bit more context of what I am trying to achive - I would like to create a “real time” dashboard and yes I have looked at https://anvil.works/learn/tutorials/dashboard.

Please correct me if i am wrong, I find that anvil lacks pre made ui widgets like https://webix.com/widget/gage/ or https://bernii.github.io/gauge.js/ or

But maybe some these “widgets” can be created using plotly?

Regarding displaying “real time data” - is anvil suited for handling live data? Lets say that the “live data” lives in a table and then each graphical component (widget) will look at the table.

“Live data” is very much in the eye of the beholder. Some concrete requirements would help clarify matters.

Folks often use a Timer component to update in-browser data at regular intervals, from the database or other sources. Depending on the amount of data looked up and delivered, two-second intervals is probably the shortest one should expect.

Recommend calling a single Server function, to find and collect all the changes in one go, and deliver them to the Client in a single bunch. Otherwise, you have extra round-trips (client-server-client) for each new datum.

Anvil’s Accelerated Tables feature may help here.

Anvil doesn’t have many graphical widgets, but it does have the means to build them to suit. Check out the Canvas component in the Documentation.

Anvil supports user-built components, so you can parameterize and “componentize” widgets for reuse. Search this forum to see what other users have built and made available.

2 Likes

Thanks @p.colbert for your answer!

Dont get me wrong, I am a huge Anvil fan :slight_smile:
What I am trying to say is that I am willing to put in the hours of creating my own custom widgets.

But before I do that I would like to know if Anvil is suited for this type of “real time” applications.

And before I can answer that, I would need to know what “real time” means, in this application, in concrete terms.

For some applications, “real time” is one short update an hour. For others, it’s a megabyte of data every 15 milliseconds. There’s a whole spectrum in between. Do you know where on that spectrum your application sits?