Dynamically update html page with Plotly visualization in Flask

تبليغ
سؤال

يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.

تبليغ
‎إلغاء

I have a flask app which gets user input from an html form. The python code(as shown below) then uses that input to generate a visualization using Plotly and stores that as a <div> tag in an html file.

fig = px.line(df,x=’date’,y=column)
pio.write_html(fig,file=’visualization.html’,auto_open=False,full_html=False)

My question is how can I display this visualization on the same page in which I got the user input from? In other words, I want to display the visualization right underneath the html form from which it gets input from, as opposed to opening up the visualization in a new tab. I need a dynamically update an html page to include new elements based on some user actions.

‫أضف إجابة

تصفح
تصفح

مجهول يجيب