Skip to content
Snippets Groups Projects
Verified Commit 0ee56251 authored by Owen Graham's avatar Owen Graham
Browse files

Give plot image routes solid filenames

parent bdfd17b6
Branches
No related tags found
No related merge requests found
......@@ -55,8 +55,7 @@ def record_link():
return jsonify(get_link(station, year))
@app.route('/plot', defaults={'name': 'time-series'})
@app.route('/plot/<name>')
@app.route('/plot/<name>.png')
def plot(name):
"""Create a data plot image."""
plotter = plotters.get(name)
......
......@@ -60,21 +60,21 @@ function appendYears(years, n) {
function timeSeriesVisualize() {
const params = getControlsParams();
setSources(sourceLink(params.get('station'), params.get('year')));
visualize(`${SCRIPT_ROOT}/plot?${params}`);
visualize(`${SCRIPT_ROOT}/plot/time-series.png?${params}`);
}
function overlayVisualize() {
const params = getControlsParams();
setSources(sourceLink(params.get('station1'), params.get('year1'), 1),
sourceLink(params.get('station2'), params.get('year2'), 2));
visualize(`${SCRIPT_ROOT}/plot/overlay?${params}`);
visualize(`${SCRIPT_ROOT}/plot/overlay.png?${params}`);
}
function boxplotVisualize() {
const params = getControlsParams();
setSources(sourceLink(params.get('station'), params.get('year1')));
// XXX No year 2?
visualize(`${SCRIPT_ROOT}/plot/boxplot?${params}`);
visualize(`${SCRIPT_ROOT}/plot/boxplot.png?${params}`);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment