Open Alexandre-SCHOEPP opened 6 months ago
Hi @Alexandre-SCHOEPP, thanks for reporting the issue.
But I wouldn’t really consider this an issue; subgraphs are just rectangles that wrap nodes according to their size; there is no point in creating empty rectangles with no nodes inside.
It’s kind of similar to the empty namespace in class
diagram, see https://github.com/mermaid-js/mermaid/issues/4625#issuecomment-1629778506.
Unless you’re suggesting to make the behavior similar to the default renderer, degre
, to consider it a regular node:
flowchart
subgraph a
end
Hi @Yokozuna59 !
there is no point in creating empty rectangles with no nodes inside.
I regularly use this functionality in mermaid with the default renderer as it allows for flowchart that evolve with development. For example, if I suspect that there will be subsystems in the future, I often leave an empty subgraph.
I also tend to make rather complex graphs, which, I understand, is a bit beyond the typical usecase for mermaid, but having empty subgraphs allows me to :
Unless you’re suggesting to make the behavior similar to the default renderer, degre, to consider it a regular node:
I think that this needs to either be properly documented (as I didn't find my answer in your documentation) with an error message saying that this is an intentional choice, or, as you've said, be brought to consistency with both renderer.
Thank you for the work you do on mermaid, I love that it does not have to be a static graph, and I think that this would help move the project in that direction.
Description
When using the
elk
renderer when a subgraph is empty, I get the following error :Cannot read properties of null (reading 're')
Steps to reproduce
Screenshots
Code Sample
Here is my minimum reproducible example:
Here is my minimum reproducible example:
Works
:::mermaid %%{init: {"flowchart": {"defaultRenderer": "dagre"}} }%% flowchart TD subgraph A end :::
Setup
Suggested Solutions
variable
re
seems to be at the root of the issue.Additional Context
No response