Fantastic plugin to clean up flows - but it does not adhere to the grid (when it exists), I don't know how impossible it would be for the plugin to align according to the grid, overriding the 'margin', or perhaps the margin option should read the current grid setting, not sure how feasible this all can be or not ? @BartButenaers
Because it cleans up, but if it does not align, one would still be moving around the nodes manually.
Or perhaps let it execute the 'align to grid' function that is available ?
@bakman2
Good remark!
I thought we had provided a snap to grid feature, but it seems not...
I am going to ask the opinion of @gregorius, since he is the mastermind behind the routing algorithms. Perhaps he has an idea already about the possibilities.
My opinion is that it's not "snap to grid" but "auto layout" Personally I see this being beyond the scope of the node.
Especially since there is grid size that can vary:
Ah sorry, sure it would be possible but there several algorithms:
I use box for certain things and there I could set the spacing. But I need to know which options for each algorithm should be set using the grid spacing.
The alternative is to set this once for each algorithm in Node-RED:
So you can set it once and then use it everywhere.
So the effort for the developers of the plugin to make this automatic can be worked-around by the user of the plugin doing this themselves!
EDIT: this is also the reason why each algorithm has a JSON object as configuration: each algorithm has different setup so creating a UI for each would be too painful - especially since auto layout does not seem that popular.
1 Like
Ah yes true. Good point...
Could we perhaps allow variables to be used in the json's, that you e.g. can specify:
algorithm_grid_size: FLOW_EDITOR_GRID_SIZE
And that we use this as the default value in our html file. And automatically replace this variable by the current grid size of the flow editor? Just thinking out loud, although perhaps not possible for all algorithms...
Yes very weird. Had expected completely the opposite. That we would have received a bunch of feedback, which allowed us to select the most popular algorithm and create a simple dummy-proof ui for that one. But that hasn't been the case at all...
if so, then I would use mustache syntax to make it all consist:
algorithm_grid_size: {{{ FLOW_EDITOR_GRID_SIZE }}}
Or better something like JSONata ...
My first idea to propose here was Mustache, but then I thought: most probably we will never add a second variable, if there is no interest in this sidebar.
Yes Jsonata might also be possible. But that certainly won't fit into my calendar...
Your calendar needs to get bigger!
Never believe it’s just one variable … my learning playing this game!
Edit: Need --> Never
1 Like