Skip to content

Commit 39fcf37

Browse files
committed
Label each risk-trend point with its risk, not the scan id
The bubble at each point on the risk trend now shows that scan's risk number, so the line can be read straight off without tracing back to the axis. The scan it belongs to is still the link behind the point and is still named in its hover title, so nothing is lost in telling the scans apart.
1 parent 8dde4dd commit 39fcf37

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎app/core/charts.py‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,10 @@ def y_at(value):
217217
marks = []
218218
for i, point in enumerate(points):
219219
x, y = x_at(i), y_at(values[i])
220-
label = str(point.get("id") or "")
220+
# The bubble shows the risk value itself, so the trend reads without
221+
# tracing back to the axis; the scan it belongs to is still the link
222+
# and is named in the point's hover title.
223+
label = str(values[i])
221224
bubble_w = round(len(label) * 6.6 + 12, 1)
222225
# Centre the bubble on the point, then keep it inside the frame so the
223226
# first and last ones are not clipped at the edges.

‎app/web/templates/external_site.html‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
</div>
267267
</div>
268268
{% endfor %}
269-
<div class="faint small risk-trend-note">Each point is one finished scan, oldest on the left. Risk weighs findings by severity: critical 25, high 12, medium 5, low 2. The number in each bubble is the scan id; click a point to open that scan. A dot takes the color of the scan's worst finding.</div>
269+
<div class="faint small risk-trend-note">Each point is one finished scan, oldest on the left. Risk weighs findings by severity: critical 25, high 12, medium 5, low 2. The number in each bubble is that scan's risk; click a point to open the scan behind it. A dot takes the color of the scan's worst finding.</div>
270270
</div>
271271
{% else %}<div class="empty">No finished scan yet, so there is nothing to trend.</div>{% endif %}
272272
</div>

0 commit comments

Comments
 (0)