When using the Create Widget endpoint, all widgets become stacked on top of each other toward the middle of the board. Without calling all widgets prior and determining the free space and setting the x and y coordinate, how are you to create widgets NOT right on top of eachother?
I know you say “without setting x and y” ...
What I do sometimes is build widget objects in a loop and use an iterator (‘for loop’ i, i++) to add a little x and a little y (<100%of width or height X i ) to each position. As you create them push each onto an array and send that array to the create endpoint. That’ll make a cascading stack.
Add (>100% of width or height X iterator) to each and you’ll get them laying out in an array.
Get fancy, modulo divide them, i rows of j elements, and place them in a matrix….
That kind of thing...
The workflow runs should be fast and light so doing a GET of all widgets and running them through some sort of evaluator to determine “free space” is also not possible.
I just wish that there was some sort of server-side processor on Miro that would put the widgets as close to the center as possible in the nearest “free space”.
Thanks again for your response as it validates that there really isn’t anything I can do but just add a bit of randomness to the X and Y.
Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.