Add currency statistics
This commit is contained in:
parent
368d05349a
commit
8dc24a7763
3 changed files with 60 additions and 8 deletions
|
@ -63,3 +63,19 @@
|
|||
.s-progress--bar.bg-yellow-400(title=`${count.taste[1]} labels with 20-199 fans`)= count.taste[1]
|
||||
.s-progress--bar.bg-orange-400(title=`${count.taste[2]} labels with 200-1999 fans`)= count.taste[2]
|
||||
.s-progress--bar.bg-red-400(title=`${count.taste[3]} labels with >2000 fans`)= count.taste[3]
|
||||
tr.s-sidebarwidget--item
|
||||
th currency
|
||||
td.w100
|
||||
- var totalLabels = count.currencies.reduce((a, c) => a + c[1], 0)
|
||||
- var palette = ["red", "orange", "green", "blue", "purple", "bronze"]
|
||||
- var i = 0
|
||||
.s-progress.d-grid.g2.h4.mtn6(style=`grid-template-columns: ${count.currencies.map(t => t[1] + "fr").join(" ")}`).bg-white.fc-black-400.fs-fine.lh-xxl
|
||||
each c in count.currencies
|
||||
.s-progress--bar.wmn-initial(title=`bought from ${c[1]} labels with ${c[0]}` class=`fc-${palette[i]}-400 bg-${palette[i++]}-400`)
|
||||
- if (i >= palette.length) i = 0
|
||||
if c[1] / totalLabels >= 0.08
|
||||
= c[0]
|
||||
else if c[1] / totalLabels >= 0.06
|
||||
= c[0].slice(0, 2)
|
||||
else
|
||||
= c[0][0]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue