You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In many cases where the max_count for any particular tag and the number of steps are of similar magnitude, tag_cloud will emit only n-1 steps even when it would be possible to emit n steps.
Expected behavior
Tag_cloud makes use of all n steps.
Example
min_count 1, max count 5, steps 4 -- assume tags exist for all possible sizes (1,2,3,4,5). Tag_cloud will emit tag-4, tag-2, and tag-1. No tags will be assigned tag-3, since the formula produces 2.7 for size 2 tags, which gets floored to 2.
size
result
floored
rounded
1
4
4
4
2
2.71
2
3
3
1.95
1
2
4
1.42
1
1
5
1
1
1
Suggested resolution
If the formula used round instead of math.floor, this would naturally resolve the issue in most (though not all) cases:
min_count
max_count
steps
steps used (floor)
steps used (round)
result
1
3
3
2
3
✅ improved
1
3
4
3
3
👌 ok
1
4
4
3
4
✅ improved
1
5
4
3
4
✅ improved
1
6
4
3
4
✅ improved
1
7
4
3
4
✅ improved
1
8
4
4
4
👌 ok
1
4
5
4
4
👌 ok
1
5
5
4
4
❌ bad in both
1
6
5
4
4
❌ bad in both
1
7
5
4
5
✅ improved
1
8
5
4
5
✅ improved
1
9
5
4
5
✅ improved
1
10
5
4
5
✅ improved
1
11
5
4
5
✅ improved
1
12
5
4
5
✅ improved
1
13
5
4
5
✅ improved
1
14
5
4
5
✅ improved
1
15
5
4
5
✅ improved
1
16
5
5
5
👌 ok
The text was updated successfully, but these errors were encountered:
tofof
changed the title
[tag cloud] Tag cloud emits fewer steps than expected
[tag cloud] Tag cloud emits fewer steps than expected (improvement)
Sep 12, 2018
Summary
In many cases where the max_count for any particular tag and the number of steps are of similar magnitude, tag_cloud will emit only n-1 steps even when it would be possible to emit n steps.
Expected behavior
Tag_cloud makes use of all n steps.
Example
min_count 1, max count 5, steps 4 -- assume tags exist for all possible sizes (1,2,3,4,5). Tag_cloud will emit tag-4, tag-2, and tag-1. No tags will be assigned tag-3, since the formula produces 2.7 for size 2 tags, which gets floored to 2.
Suggested resolution
If the formula used
round
instead ofmath.floor
, this would naturally resolve the issue in most (though not all) cases:The text was updated successfully, but these errors were encountered: