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

Rename default plot "time series"

parent b2127d83
No related branches found
No related tags found
No related merge requests found
...@@ -11,14 +11,14 @@ app.jinja_env.lstrip_blocks = True ...@@ -11,14 +11,14 @@ app.jinja_env.lstrip_blocks = True
app.jinja_env.keep_trailing_newline = True app.jinja_env.keep_trailing_newline = True
@app.route('/', defaults={'name': 'index'}) @app.route('/', defaults={'name': 'time-series'})
@app.route('/<name>') @app.route('/<name>')
def plot_page(name): def plot_page(name):
"""Render a full plot page.""" """Render a full plot page."""
return render_plotter(name, embedded=False) return render_plotter(name, embedded=False)
@app.route('/embed/', defaults={'name': 'index'}) @app.route('/embed/', defaults={'name': 'time-series'})
@app.route('/embed/<name>') @app.route('/embed/<name>')
def plot_embed(name): def plot_embed(name):
"""Render a plot embed page.""" """Render a plot embed page."""
...@@ -55,7 +55,7 @@ def record_link(): ...@@ -55,7 +55,7 @@ def record_link():
return jsonify(get_link(station, year)) return jsonify(get_link(station, year))
@app.route('/plot', defaults={'name': 'index'}) @app.route('/plot', defaults={'name': 'time-series'})
@app.route('/plot/<name>') @app.route('/plot/<name>')
def plot(name): def plot(name):
"""Create a data plot image.""" """Create a data plot image."""
......
...@@ -31,8 +31,8 @@ def add_plotter(name, nav_title): ...@@ -31,8 +31,8 @@ def add_plotter(name, nav_title):
return decorator return decorator
@add_plotter('index', 'Time Series') @add_plotter('time-series', 'Time Series')
def plot_index(): def plot_time_series():
"""Plot one station/year/measurement.""" """Plot one station/year/measurement."""
station_id = get_param('station') station_id = get_param('station')
year = get_param('year', to=year_type) year = get_param('year', to=year_type)
......
...@@ -57,7 +57,7 @@ function appendYears(years, n) { ...@@ -57,7 +57,7 @@ function appendYears(years, n) {
yearSelect.disabled = false; yearSelect.disabled = false;
} }
function indexVisualize() { function timeSeriesVisualize() {
const params = getControlsParams(); const params = getControlsParams();
setSources(sourceLink(params.get('station'), params.get('year'))); setSources(sourceLink(params.get('station'), params.get('year')));
visualize(`${SCRIPT_ROOT}/plot?${params}`); visualize(`${SCRIPT_ROOT}/plot?${params}`);
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
{% block content -%} {% block content -%}
<form id="controls" onsubmit="indexVisualize(); return false;" <form id="controls" onsubmit="timeSeriesVisualize(); return false;"
method="get" action="{{ url_for('plot', name='index') }}"> method="get" action="{{ url_for('plot', name='time-series') }}">
<div id="selections"> <div id="selections">
<div> <div>
<label for="station">Station</label> <label for="station">Station</label>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment