Files
weave/pipelines/web/templates/partials/_chart.html
T
2026-04-28 22:50:53 -04:00

31 lines
1.4 KiB
HTML

<section class="chart-card">
<header>
<h2>Score history{% if selected_issue_label %} — {{ selected_issue_label }}{% endif %}</h2>
<a href="{{ build_url(request, compare=[]) }}"
hx-get="/partials/dashboard{{ build_url(request, compare=[])|replace('/', '', 1) }}"
hx-target="#dashboard-body"
hx-push-url="{{ build_url(request, compare=[]) }}">Clear comparison</a>
</header>
<div class="chart-frame">
{{ chart_svg | safe }}
</div>
{% if chart_series %}
<div class="chart-legend" aria-label="Chart legend">
{% for item in chart_series %}
{% set style_index = loop.index0 % 4 %}
<div class="chart-legend-row">
<span class="chart-legend-line line-{{ style_index }}"></span>
<span class="chart-legend-marker marker-{{ style_index }}"></span>
<div class="chart-legend-copy">
<span class="chart-legend-label">{{ item.label }}</span>
<span class="chart-legend-meta">
{% if item.party %}{{ item.party }}{% endif %}{% if item.party and item.state %} · {% endif %}{% if item.state %}{{ item.state }}{% endif %}
</span>
</div>
</div>
{% endfor %}
</div>
{% endif %}
<p class="score-note">Scores reflect averaged precomputed topic rows per year. Sparse years are omitted rather than plotted as zero.</p>
</section>