{% load i18n ui help %}{% comment %} The map of one index at one time step and the time series of one cell, drawn on the server as inline SVG (no map tiles: offline and low bandwidth), each with a table and a CSV. The form and the cells are plain links and GET forms, so it works without JavaScript; htmx swaps only this fragment (gridded:explore), and the response's HX-Push-Url puts the results page's address for it in the history. Parameters: run, explore_files, chosen, layer, t, time_label, scale, scale_label, map (maps.MapDrawing), cell, cell_label, lat_options, lon_options, series (maps.SeriesDrawing or None), map_csv, series_csv, series_json, explore_error. The cell's series is an interactive chart (#75): chart_frame with data from gridded:series_json (series_json), the static SVG as the noscript fallback and _series_table.html as the table view. Clicking a map cell swaps this fragment; charts.js hydrates the new chart on htmx:load. {% endcomment %}
{% if explore_error %} {% include "components/alert.html" with kind="error" message=explore_error title="" %} {% else %}
{% if layer.variables|length > 1 %}
{% else %}{% endif %}
{% if layer.scales %}
{% endif %}
{% if index_topic %}
{% help_topic index_topic %}
{% endif %}

{% blocktranslate with name=layer.variable when=time_label %}{{ name }}, {{ when }}{% endblocktranslate %}{% if scale_label %} {% blocktranslate with months=scale_label %}({{ months }}-month scale){% endblocktranslate %}{% endif %}

{% if layer.units %}{% blocktranslate with name=layer.long_name units=layer.units %}{{ name }} ({{ units }}).{% endblocktranslate %}{% else %}{% blocktranslate with name=layer.long_name %}{{ name }}.{% endblocktranslate %}{% endif %}{% if map.lo %} {% blocktranslate with lo=map.lo hi=map.hi %}Values from {{ lo }} to {{ hi }}.{% endblocktranslate %}{% endif %} {% translate "Choose a cell to see its time series." %}

{% icon "download" %}{% translate "CSV" %}
{% for c in map.cells %}{% endfor %} {% for c in map.cells %}{% if c.selected %}{% endif %}{% endfor %} {% for l in map.x_labels %}{{ l.text }}{% endfor %} {% for l in map.y_labels %}{{ l.text }}{% endfor %}
    {% for b in map.bins %}
  • {{ b.label }}
  • {% endfor %} {% if map.has_missing %}
  • {% translate "No value" %}
  • {% endif %}
{% if not map.bins %}

{% icon "info" %}{% blocktranslate with when=time_label %}No cell has a value for {{ when }}. Choose another time.{% endblocktranslate %}

{% endif %} {% if map.stride > 1 %}

{% blocktranslate with n=map.stride %}The grid is large: the map shows every {{ n }}th row and column. The CSV has every cell.{% endblocktranslate %}

{% endif %}
{% icon "table" %}{% translate "View as table" %}{% icon "chevron-down" %}
{% for h in map.lon_headers %}{% endfor %}{% for row in map.rows %}{% for v in row.values %}{% endfor %}{% endfor %}
{% blocktranslate with name=layer.variable when=time_label %}{{ name }}, {{ when }}, by latitude (rows) and longitude (columns){% endblocktranslate %}
{% translate "Latitude" %}{{ h }}
{{ row.lat }}{{ v|default:"–" }}
{% blocktranslate asvar series_title with name=layer.variable where=cell_label %}{{ name }} at {{ where }}{% endblocktranslate %} {% if series %} {% include "components/chart_frame.html" with id="series-chart" title=series_title data_url=series_json csv_href=series_csv table_template="gridded/_series_table.html" layer=layer cell_label=cell_label series=series only %} {% else %}

{{ series_title }}

{% translate "This cell has no values." %}

{% icon "download" %}{% translate "CSV" %}
{% endif %}
{% endif %}