Last active
April 25, 2019 02:52
-
-
Save crawftv/0917d0396eb45e637859ded469c46adc to your computer and use it in GitHub Desktop.
Javascript, jinja tutorial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The important imports for this tutorial | |
from flask import Flask, render_template, json | |
#Skiping a whole lot of the file to get to the useful parts. | |
"""Focusing on just this route that display a linechart for the sentiment of a topic over time.""" | |
@app.route('/line', methods =["GET"]) | |
def line_chart(): | |
""" | |
Doing a bunch of python | |
Using a small example data set. | |
""" | |
data = json.dumps( [1.0,2.0,3.0] ) | |
labels=json.dumps( ["12-31-18", "01-01-19", "01-02-19"] ) | |
return render_template("linechart.html", data = data, | |
labels=labels) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment