-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
titleTopMargin
option for flowchart does not affect subgraph titles
#4935
Comments
Hi everyone, which solution suggested by @zoeyTM is suitable? |
@VishalMCF I think we need a configuration option for margins. You can extend schema, update types generated from it with with
and then fix Flowchart renderer. |
@nirname Is adding 2 separate config options (1 for top and 1 for bottom) an ideal solution for this? I figured that in some cases users might want to also add spacing between the subgraph title and its content. |
@mathbraga I think that 2 configuration options in is enough. It will allow to adjust margins for all the subtitles. May be we should keep it as an object itself:
or we could use
which would affect graph title too, but we should keep current |
Hi @nirname, I solved the issue for the generic subgraph, but I'm having trouble when subgraphs have external connections. Was wondering if it would be possible to make a PR for only the general case and then create another issue for the external connections variation. To clarify, this is what I mean with external connection: |
@mathbraga Hi! Open PR, let's have a live preview of the change. Your request will be deployed and everyone will be able to see what is going on. |
@sidharthv96 Can we reopen this issue since the feature PR that closed it got reverted? |
@zoeyTM I think it has been eventually merged |
Ah! I missed that, thanks! |
Any idea when the next release might be that would include the re-revert? @nirname |
@zoeyTM Not really sure, I am not currently responsible for making releases, maybe @sidharthv96 can respond to this |
Description
When using subgraphs in a flowchart, there is currently no way to customize the padding around a subgraph's title. Larger diagrams consisting of multiple concurrent subgraphs cause mermaid to render the subgraph titles extremely close to the subgraphs top border, making the graph appear unpolished.
I hoped that
titleTopMargin
would affect subgraph titles too, but it currently only applies to the main flowchart title. There is no other config option that allows for this specific type of customization either.--
The current workaround I've found is to nest subgraphs inside each other to give the illusion of a padded subgraph title, like in this live editor snippet, however this comes with its own drawbacks such as the subgraph scaling inconsistently in size and there being a lot of extra empty space everywhere else in the graph as well.
Steps to reproduce
Here's a live editor snippet demonstrating a flowchart with a title containing a subgraph that also has a title. The
titleTopMargin
config option has also been set, but it's only affecting the flowchart title, not the subgraph title.Screenshots
Screenshot showing the subgraph without the desired padding:
Screenshot showing the workaround solution (still not ideal, but at least the subgraphs title is padded):
Code Sample
No response
Setup
Suggested Solutions
Preferred solution would be a new flowchart config option that allows for custom padding around subgraph titles.
An alternate solution would be to apply
titleTopMargin
to subgraph titles as well as the current functionality of applying to the general flowchart title.Additional Context
No response
The text was updated successfully, but these errors were encountered: