angular-grid-layout
angular-grid-layout copied to clipboard
feature: advanced gravity (compactType) options
It would be nice to have more then hor/vert gravity options. Especially combined hor+vert, like:
export type CompactType = ('top' | 'left' | 'right' | 'bottom' | 'top-left' | 'left-top' | 'right-bottom' .......) | null | undefined;
IMO, this would be just a nice to have, but not much people would end up using it, what do you think? Can you explain some use cases for those new gravity options?
The purpose of this library is to have an excellent layout tool for dashboard components. Dashboard components are not meant to be set in all this gravity options. Said that Angular-grid-layout is not closed for only dashboards components, but for now, it is its purpose. In order to add this functionality, we need to find first real use cases. If we find real use cases and more users are pushing for this feature, this feature would be able to be added.
Because if you have for example 'vertical' compact type you can end up with this layout
that looks really strange for me.
This layout may look strange, I agree, but it is just the way you position it. What you need to do is manually position each item the way you want. Having other gravity options would not help in this case. So, this layout example, IMO, is not a reason to put all those gravity options.
i would also be interested in such a feature. maybe "gravity" is the wrong word. Also, I think a lot of people would use this functionality because it's much more convenient to be able to switch components horizontally AND vertically in the layout. By this I mean: you move a component from left to right and then the positions are swapped with the right one. But exactly the same also only vertically. A "CompactType" with "both" would be very nice here.