-
Notifications
You must be signed in to change notification settings - Fork 2
Replace bin-packing with word-wrapping #49
Comments
bin-packing does not disregard priority, it uses it very strictly. The thing, is right now In general, I do agree that bin-packing may not serve us best.
Regarding, the word-wrapping itself, I'm not sure what do you exactly mean by it. New row starts where the tallest tile endsContainer is 400px wide, priority goes as in HTML
Will be rendered
Then:
New row starts where the shortest tile ends
Will be rendered
Tetris-like packing - we still support tiles spanning across grid. Then:
we would need a group, or "line-break" feature
I have already proposed long time ago to separate different functionalities of our That ways packing engine, will be just an external function, that does math to prepare setup. Later we could do it on server-size, or only at first load, and evolve it to more AI robot-phase. and |
I mean a similar algorithm that Word is using for word wrapping. Basically it is bin-packing that only considers the current row or the next row: Now, which variant do we prefer:
I think that variant 2 is preferable, considering how Products + Barcodes + Images layout looks like: If you want to force a new line, you can always use the line break feature (#47). I totally agree that the algorithm (which is math only) should be separate from |
In Word, words have the same baseline, and behaves the same. While our tiles comes in variety of different sizes and run-time behaviors. Would you also like to change concept of grid to lines? Are we going to keep current behavior and relation between tile, and grid tracks (columns and rows)? |
I mean no other changes than this: change bin-packing to only consider the current row or the next row when deciding where to place the item. Meaning, if I am trying to place item 5 in row 3 and there is no place in row 3, put it in row 4. Do not consider rows 1 and 2. |
I discussed this with @Starcounter-Jack on the phone today.
It seems that a lot of times we are fighting with bin-packing algorithm, which fills the gaps with contents with lower priority, if elements with higher priority are already placed.
For example, consider such layout:
When the container is 400px wide, bin-packing renders it like below (disregarding the arbitrary priority):
Whereas word-wrapping would render it like this:
I would like to discuss creating word-wrapping mode in packery and turn it ON by default.
Bin-packing is a nice feature in general (when you are building Pinterest), but not so efficient when you are building a business form.
Also, with word-wrapping, line break feature (#47) makes much more sense.
The text was updated successfully, but these errors were encountered: