Bug with stack in the north direction

john's Avatar

john

28 May, 2015 11:54 PM

Hello Node Staff!

I have encountered a problem with the stack node which appears to be a bug (unless there is something about stack I'm not getting).

Stacking shapes South, West, and East works as expected. But when I try to stack in the North direction the margins are all off and I can't get anything to stack properly no matter how I set the margin parameter. I've tried reordering the shapes and that doesn't help. Simple test file attached.

My only workaround is to stack South and do extra math to calculate total stack height and translate shapes within each stack - which is a bit of a pain in the multi-stack bar chart I am working on.

Can you verify that this is a bug? I'm hoping it's something simple that could be easily fixed.

Thanks,

John

  1. Support Staff 1 Posted by Stefan Gabriels on 29 May, 2015 08:55 AM

    Stefan Gabriels's Avatar

    But in your input shapes you already do some stacking yourself, you place one shape lower than the other, nodebox adds these offset position to its own calculations of the stack so that's why you get this result. So it's not a bug. I suggest you take an align node and align your input shapes center and middle, that way you won't get any weird behaviour with the stack node.

    That said, maybe the stack node is wrong in the way it "should" work. We will discuss it.

  2. Support Staff 2 Posted by john on 29 May, 2015 05:58 PM

    john's Avatar

    Thanks, Stefan!

    My own intuition about the way stack "should" work was that it would take a set of shapes, wherever they currently are, and stack them. I played with it extensively and it never occurred to me that stacking would not work properly in certain directions unless all the shapes were first aligned on top of each other.

    In animations you may need to show shapes in a certain arrangement and then stack them (without first superimposing them) so this requirement seems like an unnecesassy and unnatural complication.

    That said, it might be a little late to change the behavior now, unless you could do so without breaking everyone's past projects.

    The one thing you *could* do right now, with little effort, is to update your documentation so that users have a fighting chance of figuring this out.

    Here is the current complete documentation for the stacking node:

    "Arrange shapes in a horizontal or vertical layout."

    That's it: eight words. Just adding a single sentence would save untold hours of frustration:

    "Note: In order to work properly, shapes must be superimposed and aligned before stacking (which can be done using Align nodes)."

    Thanks again for your quick response.

    John

  3. Support Staff 3 Posted by john on 09 Jun, 2015 08:27 AM

    john's Avatar

    One clarification...

    I've been thinking about how to make stacking more intuitive, and I think the key is using the first shape in the list as a base. This is, after all, how stacking works with real objects. It would also make it easy and intuitive to precisely define the location of the entire stack before the stacking even begins.

    So my proposal is that the stacking node leaves the first shape in the list untouched. Every subsequent shape is then stacked north, south, east, or west of that base shape regardless of its previous location. Clean, intuitive, predictable, controllable.

    If that first shape is not where the stack needs to be, you can simply move it before stacking. This would save people the bother of grouping the stack afterwards in order to move it (which I had to do in a recent project).

    And maybe this wouldn't be as disruptive as I first thought. Even if it does change some past projects, it would be easy to fix them. I think the improvement would be worth it.

    Perhaps you can add this idea to your issues list for a rainy day.

    Thanks!

    John

  4. Support Staff 4 Posted by Frederik De Ble... on 30 Jul, 2015 10:46 AM

    Frederik De Bleser's Avatar

    Hey John,

    I think that makes sense: leaving the first object untouched and stacking the rest on top (or on the side) of it.

  5. Support Staff 5 Posted by Stefan Gabriels on 16 Feb, 2016 01:02 PM

    Stefan Gabriels's Avatar

    This is also in the next release.

  6. Stefan Gabriels closed this discussion on 16 Feb, 2016 01:02 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

01 Oct, 2024 07:59 AM
30 Sep, 2024 11:37 PM
30 Sep, 2024 11:11 AM
30 Sep, 2024 02:37 AM
28 Sep, 2024 10:33 AM

 

26 Sep, 2024 06:41 AM
24 Sep, 2024 12:32 AM
24 Sep, 2024 12:27 AM
13 Sep, 2024 12:07 AM
12 Sep, 2024 11:54 PM
07 Sep, 2024 05:16 AM