burghoff / Scientific-Inkscape

Scientific Inkscape: Inkscape extensions for figure resizing and editing
528 stars 20 forks source link

Working with multiple subfigures in a single layer #3

Closed roaldarbol closed 1 year ago

roaldarbol commented 1 year ago

Hi there! Thanks for making an amazing extension - I've just discovered it, but I'm sure it'll become a dear companion!

For my current workflow, I prepare all figures for a paper in the same file, but on separate layers. This means that figures containing multiple subfigures have a few groups within them. Currently, it seems that the flattener flattens to the top group, even if I select only select a single subgroup (i.e. all the subfigures become a single group). Is there a way (or could there be) of only doing the deep ungrouping from the chosen group and down?

Thanks!

burghoff commented 1 year ago

Sure, could you give an example? Normally the Flattener should only flatten the selection on down.

roaldarbol commented 1 year ago

Thanks for the super-swift reply! I can upload some photos and provide the information needed, sure. :-) First, here's the figure, with 4 subplots: Screenshot 2022-12-15 at 10 33 03

It consists of 4 groups within a layer: Screenshot 2022-12-15 at 10 33 15

When I use the flattener on a single subplot with default options, it completely ungroups to the level above rather than ungrouping within the group: Screenshot 2022-12-15 at 10 36 47

Hope that makes sense.

roaldarbol commented 1 year ago

Okay, found out it works if I select all the elements within the group. So I guess the question is actually kind of the opposite. How can you choose a group and do the ungrouping of everything within that group?

burghoff commented 1 year ago

I see, you want to preserve the main group while flattening the contents. Currently there's no option to do this. What you said should work. You could also place the whole thing in a trivial group prior to flattening, then flatten the original.

It's something to consider. When adjusting subfigures I usually end up putting subfigures into groups (as Scale Plots can then do all of them at once), but by that point I have typically already flattened everything and do not need to do it again.

burghoff commented 1 year ago

I've also been considering changing the behavior of Scale Plots so that groups are affected by the scaling, which would make flattening optional. (The tradeoff would be that groups would have to be marked as scale-free manually sometimes.)

roaldarbol commented 1 year ago

Ah, I see, thanks.

Yes, perhaps it could check how many groups are selected, and if it's only a single one then flatten inside the group? Would that be possible? That could help for Scale Plot as well, then one could just select the group and scaling would automatically be performed on all the content of the group.

roaldarbol commented 1 year ago

Haha, didn't see your last reply. That would make sense in my mind. I still prefer having things grouped (I sometimes name the groups to more easily find things).