Javascript "Smart Div" - Rectangle Packer Algorithm

  Рет қаралды 205

John Downey

John Downey

5 жыл бұрын

This is a showcase of an implementation of an algorithm I created to lay out arbitrarily sized rectangles within another rectangle. I originally wrote it in Java for entirely different reasons, but I recently rewrote it in Javascript to act as a "smart div" that attempts to lay out each of its child elements in the most visually pleasing way possible and in the minimum amount of space possible, while still retaining some semblance of order and resizing the div as needed. This is the type of thing that is hard to gauge success on because visually pleasing is subjective, but I think it's doing pretty damn well! I do think there is room for improvement, but it's basically doing what I want it to do, so I'm just posting this video to see if this is something anyone else would want to use and if it's worth trying to release a more publicly accessible version of it. I don't want to rip people off, but I would like to make at least a little bit of $$ off of it if it is something that people want to use because I'm a broke little billygoat.

Пікірлер: 2
@cretumarian4556
@cretumarian4556 2 ай бұрын
I'm interested.
@johntdowney
@johntdowney Ай бұрын
Ha, you're in luck. Happened to dig up this old code and asked a similar question on Reddit a week or so ago, and happened to open up KZfaq and see this old video l posted, along with your comment. Not very many responses on the reddit post, but 4 out of 5 of them wanted access to the code. So.. it gave me enough confidence to actually post it, so I'm working on making the code less shameful (I wrote it a long time ago), and potentially more efficient (I'm better with time complexity these days). I'll shoot you a DM when I actually post it on github. Here's a link to the reddit post, has newer videos: www.reddit.com/r/webdev/comments/1czzu53/i_wrote_an_algorithm_to_try_and_position/
⚡ Box Packing is Hard - Keegan R
17:48
UWCS - University of Warwick Computing Society
Рет қаралды 6 М.
WHO LAUGHS LAST LAUGHS BEST 😎 #comedy
00:18
HaHaWhat
Рет қаралды 21 МЛН
Жайдарман | Туған күн 2024 | Алматы
2:22:55
Jaidarman OFFICIAL / JCI
Рет қаралды 1,8 МЛН
A clash of kindness and indifference #shorts
00:17
Fabiosa Best Lifehacks
Рет қаралды 75 МЛН
Rectenza Tutorial 3: Rectangle Packing
3:54
The Algorist
Рет қаралды 509
Why I Chose Rust Over Zig
33:18
ThePrimeTime
Рет қаралды 23 М.
Better Algorithms for Bin Packing
39:04
UW Video
Рет қаралды 30 М.
Object-Oriented Programming is Embarrassing: 4 Short Examples
28:03
OCR Discrete: Algorithms 3-4
10:00
FM Videos
Рет қаралды 5 М.
Characters, Symbols and the Unicode Miracle - Computerphile
9:37
Computerphile
Рет қаралды 2 МЛН
Sprite packing algorithm in RetroBlit
0:42
Martin Cietwierkowski
Рет қаралды 315
bin packing - first fit decreasing algorithm
0:55
Algorithm
Рет қаралды 4,5 М.
Greedy Packing Algorithm -- Processing
7:41
Mitko Nikov
Рет қаралды 14 М.
Красиво, но телефон жаль
0:32
Бесполезные Новости
Рет қаралды 963 М.
Хотела заскамить на Айфон!😱📱(@gertieinar)
0:21
Взрывная История
Рет қаралды 6 МЛН
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 333 М.