Repository navigation
v0.17.1
This version is a PATCH: it adds an export and an optional parameter. No output changes.
The pick of a level
itemSizes(levels, side)takes an optional side,long(the default) orshort. The typeItemSidenames the two values.- The new function
pickLevelOf(levels, scale, options)picks a level from the levels themselves. Its options are the thresholds ofpickLevel,sideandminItems. - With
minItems, the search from fine to coarse stops at a level with fewer items. When no level passes, the pick is the coarsest level with enough items. - Without
sideandminItems,pickLevelOfgives the result ofpickLevel. A test compares a rule with one threshold on 400 random sets of levels.