Grid layout package

My usecase is a grid for a timetable where the vertical coordinates are 15 min timeslots and the horizontal axis are events (in my case lessons) happening simultaneously. I can imagine this being a use case for others, too. Unfortunately I don’t have the time now to look at it myself, so just an idea for now. Thank you for sharing with the community!

oki. what you need is a time(table) widget. This is a bit different, but that might be an interesting challenge once I’ll have reached v1 (I hope soon).

Atm, target is dashboard/grid engine for stuff like analytics, iot (like grafana) etc. But sure, it can also be used for building UI with lazy loading (and it’s also composable with others slivers which is handy).

Actually, my goal is to fill the gap between Flutter and JS grid engines.. the direct β€œJS contender” is react-grid-layout (I’ve been heavily inspired by this package). And I added some fancy features and opti.

Remaining tasks on my todo:

  • Allow to create your own custom compaction and positioning algo
  • Sections/visual headers to segment the dashboard, with sticky option
  • Allow items to be dropped into or dragged out of groups.
1 Like

For those following my iterations, in next coming version (0.9) :

  • new feat: add your custom compaction algo, by implementing CompactorDelegate to define custom rules (e.g., specific gravity, fixed zones).
  • huge performance boost on compaction algo. noticeable when there are a lot of items in dashboard

Compaction algo comparison v.0.8 (old) vs 0.9 (new), on desktop:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                          BENCHMARK RESULTS                               β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ Test                                                 β”‚ Time              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ COMPACTION                                           β”‚                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Vertical Old (100 items)                           β”‚           1.22 ms β”‚
β”‚   Vertical New (100 items)                           β”‚             17 Β΅s β”‚
β”‚   Horizontal Old (100 items)                         β”‚            355 Β΅s β”‚
β”‚   Horizontal New (100 items)                         β”‚             17 Β΅s β”‚
β”‚   Vertical Old (500 items)                           β”‚          99.90 ms β”‚
β”‚   Vertical New (500 items)                           β”‚             99 Β΅s β”‚
β”‚   Horizontal Old (500 items)                         β”‚          10.30 ms β”‚
β”‚   Horizontal New (500 items)                         β”‚            101 Β΅s β”‚
β”‚   Vertical Old (1000 items)                          β”‚         898.88 ms β”‚
β”‚   Vertical New (1000 items)                          β”‚            222 Β΅s β”‚
β”‚   Horizontal Old (1000 items)                        β”‚          37.99 ms β”‚
β”‚   Horizontal New (1000 items)                        β”‚            217 Β΅s β”‚
β”‚ MOVE                                                 β”‚                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Move Element (100 items)                           β”‚             72 Β΅s β”‚
β”‚   Move Element (500 items)                           β”‚           1.40 ms β”‚
β”‚ SORT                                                 β”‚                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Sort Layout (100 items)                            β”‚              6 Β΅s β”‚
β”‚   Sort Layout (500 items)                            β”‚             43 Β΅s β”‚
β”‚   Sort Layout (1000 items)                           β”‚             99 Β΅s β”‚
β”‚ OPTIMIZE                                             β”‚                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚   Defrag (100 items)                                 β”‚           4.76 ms β”‚
β”‚   Defrag (500 items)                                 β”‚         855.42 ms β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Optimize Defrag is not called by dashboard, this is an api that can ponctually be used when you want to β€œdefragment” your dashboard.

Would be interesting to compare to the JS contender I mentioned previously. Although they use mutable state if I’m not wrong, and my package uses immutable and copyWith, I wouldn’t be suprised if we get better results thx to AOT (maybe same for web wasm..). When I’ll have more time, I’ll compare both.

Final stretch before the 1.0 …

2 Likes

POC: nested dashboards/groups

test590

  • Sections
  • Folders/Groups (nested dashboard)
  • scrollToItem by its logical id

test594