Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for grouped shapes #48

Open
DrChainsaw opened this issue Mar 16, 2024 · 4 comments
Open

Support for grouped shapes #48

DrChainsaw opened this issue Mar 16, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@DrChainsaw
Copy link

Are there any plans to support grouped shapes?

When using python-pptx I have found them quite useful for layout purposes when generating slides with more than one shape as one can just change the size of the group to fit the slide and let power point handle where things end up as a result (or at least I hope it is power point that does this and not python-pptx).

@matthijscox-asml
Copy link
Collaborator

We'd have to check how python-pptx does this, but my first guess is that the python code is doing the layouting.

If our PPTX code should handle the layouting, we could look into adding an interface like Makie's gridlayout, which I think is available in GridLayoutBase.jl. Or we define our own layout mechanism.

I guess we would turn the slide into a layout or something? Very naively:

s = Slide()
layout = SlideLayout(s) # or push! the layout into the slide?
layout[1,1] = Picture("figure.png")
layout[1,2] = TextBox("see the nice picture on the left")

@matthijscox-asml matthijscox-asml added the enhancement New feature or request label Jul 16, 2024
@DrChainsaw
Copy link
Author

Having a generic layout mechanism would be awesome. I would probably prefer if it acted like just another shape you could put anywhere on the slide.

I think the support for groups is a bit of an orthogonal issue which maybe could be useful even if the above becomes a reality (e.g w.r.t manual post-generation editing).

If you have the possibility to review/accept PRs I can try to look into both of these and see what I can come up with. The fact that GridLayoutBase does not have any documentation is a bit daunting, but maybe the makie docs are sufficient.

@matthijscox-asml
Copy link
Collaborator

Feel free to experiment on a fork and open a PR when you have something useful.

Did I interpret your request for groups in the wrong way? I thought it was equivalent to such a layout mechanism?

@DrChainsaw
Copy link
Author

Awesome. I'll open a PR as soon as I have something to not block/discourage others from trying in case I get stalled somehow.

I think that groups can help with a subset of the layouting (scaling the size of all shapes in the group while retaining their relative position to each other), but the layout mechanisms for a plotting library are going to be much more powerful and easy to work with.

They might still be useful for the sole purpose that someone might want to programmatically create a group though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants