Here I am using https://mermaid.live/ to create a flowcharts. For example with the following code:
flowchart TB
subgraph w1
A
B
C
end
subgraph w2
D
E
end
subgraph w3
F
end
A & B & C --> D & E
D & E --> F
It generates:
Looks like mermaid handles subgraphs as an array and generates boxes side by side.
It it possible to generate this example flowchart in tikz? if possible dynamically, where new nodes could be added in each subgraph like:
<A B C D E ...>
<F G H ...>
<Y Z ...>
The closest I was able to come up with is as follows, with the help from https://tex.stackexchange.com/a/357573/127048 :
\documentclass[tikz,border=2pt]{standalone}
\usepackage{tikz, tikzscale}
\usepackage{paralist} % compactitem
\usetikzlibrary{
shapes.geometric,
arrows,
arrows.meta,
calc,
positioning,
decorations.pathreplacing,
calligraphy, % had to be after lib. decorations.pathreplacing
bending} % add geometric shapes and arrows for flowcharts, plus calc package, positioning for relative positions
\tikzstyle{startstop} = [rectangle, rounded corners, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{process} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{process2} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{process3} = [rectangle, minimum width=3cm, minimum height=1cm, text centered, draw=black, fill=white]
\tikzstyle{arrow} = [thick,->,>=stealth]
\begin{document}
\begin{tikzpicture}[
transform shape,
node distance = 22mm and 11mm,
box/.style = {shape=rectangle, draw, thin,
minimum height=10mm, text width=32mm, align=center,
top color=#1!20, bottom color=#1!80,
anchor=south west
},
BC/.style args = {#1/#2/#3}{ % Braces Calligraphic
decorate,
decoration={calligraphic brace, amplitude=6pt,
raise=#1,
#2, % for mirroring of brace
aspect=#3},
very thick
},
]
\node (start) [process, align=center] {A};
\node (pro1) [process, right of=start, align=center, xshift=2cm] {B};
\node (pro2) [process, right of=pro1, align=center, xshift=2cm] {C};
\node (pro3) [process2, below of=start, align=center, yshift=-.5cm] {D};
\node (pro4) [process2, below of=pro2, yshift=-.5cm] {E};
\node (main) [startstop, below of=pro1, yshift= -2cm, fill=black!30] {F};
\draw[-Stealth] (start) edge (pro3)
(start) edge (pro4)
(pro1) edge (pro3)
(pro1) edge (pro4)
(pro2) edge (pro3)
(pro2) edge (pro4)
(pro3) edge (main)
(pro4) edge (main)
\end{tikzpicture}
\end{document}
output:





graphslibrary (for input syntax) would allow something like{A, B, C} -> [complete bipartite] {D, E} -> Ffor specifing the edges. Thegraphdrawinglibrary (need Lua!) with itslayeredlibrary would help in placing the nodes automatically. There's also sublayouts for the yellow boxes. – Qrrbrbirlbel Feb 14 '23 at 17:42graphslibrary as well. It doesn't do anything you can't do with nodes and edges already but the graphdrawing library kinda depends on it (and all the examples use it). – Qrrbrbirlbel Feb 14 '23 at 20:59\tikzMatrixNodeswith a few adjustments. – Qrrbrbirlbel Feb 14 '23 at 21:31