Custom layouters (element positions + size)

Something is missing? Have an idea? Ask for new stuff here.
Post Reply
dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Custom layouters (element positions + size)

Post by dew » Wed Apr 10, 2019 12:53 pm

Currently the positions of elements are defined by two mechanisms:
- grid (fixed height, width, dimensions)
- freely (detached from grid)

Both mechanisms are very useful and desired. I now propose a third mechanism which instroduces user defined layouters. A layouter would control where objects are placable and it would optionally control the size of elements. You can only add elements at the positions defined by the layouter. Their width and height of elements can also be controlled by the layouter but this is an optional feature and can be turned off so that each elements has is own size. The rotation of elements is not affected by a layouter - but optionally the elements could all be auto-rotated if desired. Otherwise they have their custom rotation at their position.

The following layouters make sense:

- custom grid
The user defines how many elements in x and y dimensions shall be available. In a sense this is really similar to the current grid. The main difference is that this custom grid is placable as an element on a desktop, in a window or in a panel. And because it's a separate element with it own grid definition it cal locally override the container's grid by its own settings.
The custom grid defines positions where emements can be placed, This is differnt to the current grid behavior. The current grid defines "cells" with width and height. The custom grid on the other hand only defines points where objects can be placed. These positions are evenly spaced. The objects at these positions CAN have their own custom size OR the size can be controlled by the custom grid which offers width and height properties to define the size of each element at its position. Elem,ents can be smaller than the space between each position or they can be larger. If width and height are not defined then each element is NOT resized and has its own custom width and height just as if it was detached from grid. The difference is that the positions where the elements are placed are still controlled by the custom grid.
Re-scaling a custom grid or re-positioning it will change the positions of the elements that are controlled by the custom grid.

- polyline
The user draws a polyline with n segments for this layout or recalls a preset (circle, spiral, triangle, rectangle, star, ...). By default elements are placed at the set points of this polyline. The user can activate sub-positions between the set points by increasing the placement density for element positioning. There could be 0..n additional elements between each set point of the polyline. The space between elements shall be evenly spread.
The polyline then defines n positions where elements can be placed. Scaling, rotating or moving the polyline will change the placement positions for elements. In the same way as described for the custom grid user can OPTIONALLY override the width and height of elements along the polyline. If the width and height are not overriden (which is the default) then each elements kepps it original user defines width and height. But if width and height are overriden then all elements are forced into a user defined bounding box and their size is controlled this way.


These layouters would give additional automatic ways for object placement and object sizes.


Hope you like it :D

User avatar
TrianguloY
Posts: 83
Joined: Thu Jan 24, 2019 9:46 am

Re: Custom layouters (element positions + size)

Post by TrianguloY » Wed Apr 10, 2019 5:53 pm

Seems interesting, although I'm having difficulty understanding it.

About the custom grid: what will be the difference with a panel? What you describe is very similar to what a panel allows.
About the polyline: some of the earlier scripts that were made allowed some items to be placed in a 'circle' (which also could be rotated).

Again this is the same discussion of 'script/addon vs builtin'.

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Custom layouters (element positions + size)

Post by dew » Wed Apr 10, 2019 8:28 pm

Well, I don|t think that a script could helps in this case. The problem is that a script won't respect interactive changes like scaling, rotating and so on.
I made a graphics to show what custom grids and polygonal placement mean in my understanding.

The main difference for the "custom" grid is that instead of cells where each object is fit into the elements remain their individual scale and rotation and only their positions are controlled. The user places elements based on the center positon of these elements to the positions of the grid. Scaling and rotating the grid will only change the positions but NOT rotate the elements of the grid. So the grid basically serves for the anchorpoint positions of the added elements.

The same is true for the polygon. Positions are placed along the path of the polygon. The "density" (how many set points per segment) would be user defined.
Attachments
grids.jpg
grids.jpg (98.22 KiB) Viewed 361 times
Last edited by dew on Wed Apr 10, 2019 9:01 pm, edited 1 time in total.

User avatar
TrianguloY
Posts: 83
Joined: Thu Jan 24, 2019 9:46 am

Re: Custom layouters (element positions + size)

Post by TrianguloY » Wed Apr 10, 2019 8:50 pm

A script can respect anything you want ;) you just need to program it.

I see what you mean. Basically you want to 'fix' the position of the element to another object (in this case a cell in a grid or a position in a path) while having the rest of parameters (scaling and rotation) independent.
This is definitely doable with scripts, but having a builtin object...hmm...not sure.
Other users opinions?

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Custom layouters (element positions + size)

Post by dew » Wed Apr 10, 2019 8:55 pm

Well the problem with doing it by script is basically the assigment of elements to positions.

You really want to do this with editor support! So tapping on a position to select or create an element there.
With a script it might be doable but it would not be maintanable when changing positions of elements (easily done by drag + drop with an editor) and when creating or erasing elements (editor: long-tap and choose "delete" from a menu).

I think scripts are nice. But something like this needs some editor support to be usable.

I would also like to draw the polygon rather than having an array in a script which needs to be edited all the time when I change something...
Last edited by dew on Thu Apr 11, 2019 11:15 am, edited 1 time in total.

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Custom layouters (element positions + size)

Post by dew » Wed Apr 10, 2019 9:07 pm

TrianguloY wrote:
Wed Apr 10, 2019 8:50 pm
....while having the rest of parameters (scaling and rotation) independent.
Not necessarily independent - I would allow to override and enforce certain values if desired. But independence is one option for sure.

If the user likes to override scale and / or rotation for all elements of a layouter instance this would be doable in the custom grid layouter or the polyline layouter as well. Simply define a scale or rotation in the layouter and all elements will get the same scale / rotation when defined. This way a homogenous scale / rotation can be maintained across all elements of the layouter - if desired.

User avatar
TrianguloY
Posts: 83
Joined: Thu Jan 24, 2019 9:46 am

Re: Custom layouters (element positions + size)

Post by TrianguloY » Thu Apr 11, 2019 8:19 am

You are right on the 'it is easier with the editor'. In fact some of the latter suggestions have a common element: a way to have some sort of 'linked elements'. Think of them as points in the grid joined by a line (initially two points, but with an option to add/remove vertices) where you can move freely the vertices.

Progressive variables, paths for items, polygons/lines...all require (among other things) this concept of polyline. Perhaps...It can start by adding this item with limited features, and then seeing how to improve it. Hmm, could work, let's see if Pierre has something to say.

User avatar
Pierrot
Site Admin
Posts: 181
Joined: Wed Jan 23, 2019 12:18 pm
Location: French Alps

Re: Custom layouters (element positions + size)

Post by Pierrot » Sun Apr 14, 2019 7:56 am

If I had to generalize the idea, a layouter would be a way to set item's properties with computed values. A layouters would be an implementation that set X and Y.

I'm not a fan of a new editor because usually it locks you in a specific case. In my opinion it's legitimate only when it's frequently used otherwise it adds weight and complexity but most people don't benefit from it. For other advanced use cases, the script is often a better way to go.
While the grid layouter could possibly fit in the existing architecture and without too much modifications (although that's not exactly simple neither), other placement strategies won't fit at all.

That doesn't mean there's nothing more to do. Maybe there's something that could be done halfway: partly an editor, partly script, based on the generalization above. For instance the editor could let the user define a simple function to apply on a group of items. This simple function would set X and Y and would be called by the launcher as needed.

dew
Posts: 34
Joined: Wed Apr 03, 2019 7:09 pm

Re: Custom layouters (element positions + size)

Post by dew » Sun Apr 14, 2019 11:28 am

Pierrot wrote:
Sun Apr 14, 2019 7:56 am
If I had to generalize the idea, a layouter would be a way to set item's properties with computed values. A layouters would be an implementation that set X and Y.

I'm not a fan of a new editor because usually it locks you in a specific case. In my opinion it's legitimate only when it's frequently used otherwise it adds weight and complexity but most people don't benefit from it. For other advanced use cases, the script is often a better way to go.
While the grid layouter could possibly fit in the existing architecture and without too much modifications (although that's not exactly simple neither), other placement strategies won't fit at all.

That doesn't mean there's nothing more to do. Maybe there's something that could be done halfway: partly an editor, partly script, based on the generalization above. For instance the editor could let the user define a simple function to apply on a group of items. This simple function would set X and Y and would be called by the launcher as needed.
I agree with the generaization part. When you say the polyline layouter does not fit I tend to think it has to do with the fact it sort of enforces a new editor because doing this from script is awkward and pointless.

I was hoping for an interactive polyline editor because it would be useful for multiple of my ideas so far:
- clipping masks -> interactive definition would make use of an interactively created polyline / polygon
- layouters -> placing elements along a line makes sense - its flexible, layouts can be changed simply by moving setpoints - but no launcher currenly can do that
- creating line based graphic elements for the desktop

But as posted in the class approach thread: I would prefer if you would finsh and then leave behind LL. Create a new app adding all these powerful new things rather than adding it to LL. It helps to redesign parts of the app, add the new stuff and give it a new name and a new price tag. For me that's a good idea. You would get money back for your great work and the thing could get rid of issues in LL code base and other limitations that prevent larger changes.

Just saying... :)

Post Reply