Copy this code and paste it in your HTML
static final popularityMap
= [(0..9
):
'notPopular',
(10..29
):
'notVeryPopular',
(30..49
):
'popular',
(50..100
):
'veryPopular',
(101..
Integer.
MAX_VALUE):
'ultraPopular']
tags = []
9.
times { tags
<< 'tag1' }12.
times { tags
<< 'tag2' }44.
times { tags
<< 'tag3' }50.
times { tags
<< 'tag4' }233.
times { tags
<< 'tag5' }
tagsByPopularity = [:]
if(!tagsByPopularity
[item
]) { popularityMap.
each { k,v
-> tagsByPopularity[item] = v
}
}
}