Sort dispersion

Insert and reposition flow

What is sort dispersion in Gridifier?

Sort dispersion defines, how far from valid insertion position/positions next inserted/repositioned item can be placed.

var grid = new Gridifier(demoGrid, {
    // By default, sort dispersion is disabled.(items are inserted in normal flow)
    sortDispersion: false|true

What those values means?

What is valid item position? (normal flow)

What is valid item coords? (in normal flow)

In which cases each of modes is more preferable?

Reposition flow notices

The one more important thing to notice is that with disabled sort dispersion Gridifier is assigning insertion number(GUID) to each inserted item. Thus, on viewport/custom grid resizes items will be collected retaining GUIDS order, so initial items order will never break.

Alternatively, with enabled sort dispersion modes no GUIDS are assigned, so Gridifier is collecting items based on they position and append type. For example, with default append type and vertical grid items will be collected starting from left top corner by min Y to the right.

So, it is correctly to admit that with enabled sort dispersion each grid item is tied to its insertion coords instead of insertion order.

Sort dispersion demo grid:

Sort dispersion:



append 10
clear grid
sortDispersion setting
defines inserted/repositioned items insert flow type
next: Repack sorts prev: Filters