Podcast
Questions and Answers
What should you do in your html template file for your results page?
What should you do in your html template file for your results page?
Create a placeholder for your plot code
What template engine does Flask use?
What template engine does Flask use?
Jinja
What type of request will you likely be processing in your Flask views.py file to create the plotly graph?
What type of request will you likely be processing in your Flask views.py file to create the plotly graph?
POST data
How should you render the template with the plot code inserted into the div_placeholder variable?
How should you render the template with the plot code inserted into the div_placeholder variable?
Signup and view all the answers
What is the author's main goal for building the offline application?
What is the author's main goal for building the offline application?
Signup and view all the answers
What technology is the author using for the backend of the application?
What technology is the author using for the backend of the application?
Signup and view all the answers
What technology is the author using for the frontend of the application?
What technology is the author using for the frontend of the application?
Signup and view all the answers
What module does the author suggest using to create an offline version of a plot?
What module does the author suggest using to create an offline version of a plot?
Signup and view all the answers
What does the offline.plot function in plotly take as a kwarg?
What does the offline.plot function in plotly take as a kwarg?
Signup and view all the answers
How does the author suggest to insert the plot code into HTML?
How does the author suggest to insert the plot code into HTML?
Signup and view all the answers
Study Notes
- The text discusses the process of building an offline application using Plotly for displaying graphs with Python (Flask) at the back end and HTML (JavaScript) for the front end.
- The author mentions that they are currently able to plot graphs on the front end using Plotly.js, but they want to build the graphs at the back end and then display the data on the front end.
- The author has looked into the Plotly documentation for building graphs in Python, but they're unsure of how to send the built graph to the front end for display.
- The suggested solution is to use Plotly's offline module, which creates an offline version of a plot. This module uses a kwarg for output_type, which can be set to 'file' or 'div'.
- To insert the div into HTML code using Flask, the author suggests creating a placeholder for the plot code in the HTML template file, rendering the template with the plot code inserted into the placeholder in the Flask views file, and processing user requests using POST data to create the Plotly graph.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.
Description
Learn how to build and display Plotly graphs on the server side using Python (Flask) for backend and HTML (Javascript) for frontend. Explore the process of generating the graph at the backend and sending the data to be displayed in HTML.