0

I'm building a dashboard to display on a TV for production data using Django+RaspberryPI but the rendering is quite slow.

The dashboard contains 12 plotly indicator (number type) and 3 bar charts.

At my view, I'm reading a .csv file using pandas, about ~50 lines, then I start creating variables to generates the plotly graphs and pass as context, like below

Create plotly indicator:

df_36_ordered = df_detalhado_full.query('Maquina=="3.6"').sort_values(by='Data')    
oee_36 = df_36_ordered['OEE'].iloc[-1:].iloc[0]

Create dataframe for bar plot:

df_36_historico = df_36_ordered[['dia_semana', 'OEE']].tail(6).iloc[:-1]

And then I generates the html for all of it:

oee_36 = plot(fig, output_type='div', include_plotlyjs=False, show_link=False, link_text='')

I'm looking for tips/alternatives on improving rendering the page.

From entering address to full load it's taking 20 seconds.

Thanks in advance!!

1 Answer 1

1
  • Dask Instead of Pandas, however, your dataset is only 50 lines, I don't know if it will improve processing time.
  • Try to implement multithreading to process your graphs simultaneously.
  • If you can only use plotly.graph_objects it's will probably make it faster, but harder for a similar result. Try to delete useless feature, plotly give you lot of built in feature when you plot somethings, those features will make your rendering slower
Sign up to request clarification or add additional context in comments.

2 Comments

I will try the miltithreading tip, sounds very good. About the module, you mean when importing? At the moment i'm just doing: import plotly.graph_objects as go and from plotly.offline import plot, those are the only two libs
It is always a good idea to only import only package you use, however, I don't think it will heavily improve processing time to make very accurate imports. It can be a good idea to investigate with features of plotly you don't use but that are still in the function you call. As you said it for displaying plots on a TV, maybe you don't need interactive features like : zoom, hovering etc...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.