diff --git a/visualizer/__init__.py b/visualizer/__init__.py index 4de95162e610c3656b5e4b69a1e800cc3345b481..e8a7cd32eab7579f94fbca06a64addc15fe192f2 100644 --- a/visualizer/__init__.py +++ b/visualizer/__init__.py @@ -11,14 +11,14 @@ app.jinja_env.lstrip_blocks = True app.jinja_env.keep_trailing_newline = True -@app.route('/', defaults={'name': 'index'}) +@app.route('/', defaults={'name': 'time-series'}) @app.route('/<name>') def plot_page(name): """Render a full plot page.""" return render_plotter(name, embedded=False) -@app.route('/embed/', defaults={'name': 'index'}) +@app.route('/embed/', defaults={'name': 'time-series'}) @app.route('/embed/<name>') def plot_embed(name): """Render a plot embed page.""" @@ -55,7 +55,7 @@ def record_link(): return jsonify(get_link(station, year)) -@app.route('/plot', defaults={'name': 'index'}) +@app.route('/plot', defaults={'name': 'time-series'}) @app.route('/plot/<name>') def plot(name): """Create a data plot image.""" diff --git a/visualizer/plotting.py b/visualizer/plotting.py index 3814ed7bb49ead0b0f0ec63cb02d69d1c36e1bef..b10fe0766c69ef881eb0c8dbb7e229fdcbb72af7 100644 --- a/visualizer/plotting.py +++ b/visualizer/plotting.py @@ -31,8 +31,8 @@ def add_plotter(name, nav_title): return decorator -@add_plotter('index', 'Time Series') -def plot_index(): +@add_plotter('time-series', 'Time Series') +def plot_time_series(): """Plot one station/year/measurement.""" station_id = get_param('station') year = get_param('year', to=year_type) diff --git a/visualizer/static/visualizer.js b/visualizer/static/visualizer.js index 72e73afa17da2a248a2e6ff5407f2ca845e97484..bc69c2df12324ea8d38a61c45cb52b2c0df20fa2 100644 --- a/visualizer/static/visualizer.js +++ b/visualizer/static/visualizer.js @@ -57,7 +57,7 @@ function appendYears(years, n) { yearSelect.disabled = false; } -function indexVisualize() { +function timeSeriesVisualize() { const params = getControlsParams(); setSources(sourceLink(params.get('station'), params.get('year'))); visualize(`${SCRIPT_ROOT}/plot?${params}`); diff --git a/visualizer/templates/plotters/index.html b/visualizer/templates/plotters/time-series.html similarity index 86% rename from visualizer/templates/plotters/index.html rename to visualizer/templates/plotters/time-series.html index 8bf35f8956b85aa2018bb8c5f5a2eeacc0f93762..7f2053af41d3a757c7e0e35e1362b31179ef1adf 100644 --- a/visualizer/templates/plotters/index.html +++ b/visualizer/templates/plotters/time-series.html @@ -4,8 +4,8 @@ {% block content -%} -<form id="controls" onsubmit="indexVisualize(); return false;" - method="get" action="{{ url_for('plot', name='index') }}"> +<form id="controls" onsubmit="timeSeriesVisualize(); return false;" + method="get" action="{{ url_for('plot', name='time-series') }}"> <div id="selections"> <div> <label for="station">Station</label>