1-DAV-202 Data Management 2023/24
Previously 2-INF-185 Data Source Integration
Difference between revisions of "Ljavascript"
Jump to navigation
Jump to search
Line 10: | Line 10: | ||
'''Tips:''' | '''Tips:''' | ||
* Each graph contains also HTML+JS code example. That is a good startpoint. | * Each graph contains also HTML+JS code example. That is a good startpoint. | ||
− | * You can write your data into JavaScript data structures (`var data` from examples) in a Flask template. You might need a jinja for loop (https://jinja.palletsprojects.com/en/2.11.x/templates/#for). Or you can produce string in Python, which you will put into a HTML. It is a (very) bad practice, but sufficient for this lecture. (A better way is to load data in JSON format through API). | + | * You can write your data into JavaScript data structures (`var data` from examples) in a Flask template. You might need a jinja for loop (https://jinja.palletsprojects.com/en/2.11.x/templates/#for). Or you can produce string in Python, which you will put into a HTML. You might need to turnoff autoescaping (https://stackoverflow.com/questions/3206344/passing-html-to-template-using-flask-jinja2). It is a (very) bad practice, but sufficient for this lecture. (A better way is to load data in JSON format through API). |
* Consult the [[Lflask|previous lecture]] on running and accessing Flask applications. | * Consult the [[Lflask|previous lecture]] on running and accessing Flask applications. |
Revision as of 14:54, 1 April 2021
In this lecture we will extend the website from the previous lecture with interactive visualizations written in JavaScript. We will not cover details of the JavaScript programming language, only use visualization contained in the Google Charts library.
Your goal is to take examples from the documentation and tweak them for your purposes.
Tips:
- Each graph contains also HTML+JS code example. That is a good startpoint.
- You can write your data into JavaScript data structures (`var data` from examples) in a Flask template. You might need a jinja for loop (https://jinja.palletsprojects.com/en/2.11.x/templates/#for). Or you can produce string in Python, which you will put into a HTML. You might need to turnoff autoescaping (https://stackoverflow.com/questions/3206344/passing-html-to-template-using-flask-jinja2). It is a (very) bad practice, but sufficient for this lecture. (A better way is to load data in JSON format through API).
- Consult the previous lecture on running and accessing Flask applications.