{% extends "base.html" %}

{% block head %}
  <script src='dist/vendor.bundle.js'></script>
{% endblock %}

{% block content %}
  {% if filtered_columns %}
  <div class="row">
    <p class="alert alert-warning col-md-12">
      The following metadata columns have been omitted because they didn't
      contain numeric data, or they consisted only of missing data:
      <strong>{{ filtered_columns }}</strong>
    </p>
  </div>
  {% endif %}

  <div class="row">
    <p class="alert alert-warning col-md-12" id="filtered-samples"></p>
  </div>

  <div class="row">
    <div class="col-lg-12" id="main"></div>
  </div>

  <div class="row">
    <div class="col-lg-12">
      <a href="metadata.tsv" target="_blank" rel="noopener noreferrer">
        Download raw data as TSV
      </a>
    </div>
  </div>

  <div class="row">
    <div class="col-lg-12">
      <table class="table table-striped table-hover">
        <thead>
          <tr>
            <th>Test</th>
            <th id="method"></th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <th scope="row">Test statistic</th>
            <td id="test-stat"></td>
          </tr>
          <tr>
            <th scope="row">P-value</th>
            <td id="p-val"></td>
          </tr>
          <tr>
            <th scope="row">Sample size</th>
            <td id="sample-size"></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

<script>
  var d = [];
  function load_data(columnName, data, filtered, stats) {
    d.push({
      column: columnName,
      data: data,
      filtered: filtered,
      stats: stats,
    });
  }
</script>
{% for column in columns %}
<script src='{{ column }}?callback=load_data'></script>
{% endfor %}
<script src='dist/bundle.js'></script>
{% endblock %}
