flekschas/piling.js

Fix naming issue of itemSize and itemSizeRange

Opened this issue · 1 comments

As a new user I would assume itemSize defines the size of an item but it's actually the maximum size of the longer side of an item.

For itemSizeRange I would assume that it's the actual range of the sizes, e.g., 10px to 100px but in reality, it's the relative shrinkage. Since we decoupled itemSize from cellSize there's no need to redefine the max size via itemSizeRange.

I propose that we merge the two properties and just call them itemSize. If itemSize is a single number than the longer side of all items should be equal. if itemSize is an array we should treat it as a range. The array should hereby be absolute pixel values to not make things even more confusing. So 16 would mean that all items are at most 16px high or wide. [16,32] would linearly scale items to be at most 16 to 32 pixels high or wide.

@eeeeenchanted what do you think?

Sounds good!