sort plot labels by score

This commit is contained in:
xenia 2020-12-04 20:45:47 -05:00
parent 304a16b98b
commit 5365272e27
1 changed files with 8 additions and 3 deletions

View File

@ -97,9 +97,14 @@
(set-pts! mid now pts))
(plot-x-ticks (date-ticks))
(plot (for/list ([(mid data) (in-hash point-tls)])
(lines data
#:label (hash-ref member-names mid)
(define ordered-mids
(sort (hash-keys point-tls)
(lambda (a b)
(>= (get-last-pts (hash-ref point-tls a)) (get-last-pts (hash-ref point-tls b))))))
(plot (for/list ([mid (in-list ordered-mids)])
(lines (hash-ref point-tls mid)
#:label (format "~a (~a pts)" (hash-ref member-names mid)
(get-last-pts (hash-ref point-tls mid)))
#:color mid
#:style mid
#:width 2))