I have drawn a graph using Tikz \graph command, using a layered layout.
I would like to draw a kind-of-ellipsis that would circle some nodes of this graph, without overlapping the other nodes. If possible, I would like to stay in the "no need to compute any coordinate" policy.
So far, here is what I have (with a rectangle shape):
\documentclass{article}
\usepackage{pgf}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,snakes,automata,backgrounds,petri}
\usetikzlibrary{positioning}
\usetikzlibrary{graphs}
\usetikzlibrary{graphdrawing}
\usegdlibrary{layered}
\begin{document}
\tikzstyle{input}=[circle, thick,draw=blue!75,fill=blue!20,minimum size=5mm]
\tikzstyle{bitwise}=[rectangle, thick, draw=green!75, fill=green!20]
\tikzstyle{sub}=[draw, rectangle, fill=red!30, opacity=.2]
\tikz \graph [layered layout, nodes={bitwise}, level sep=1cm] {
{{{{""[input], ""[input]} -> 2, "com"[as={}, input]}-> 4}, {""[input], {"com", {""[input], ""[input]}-> 1} -> 3}-> 5} -> 6;
""[sub]// {3, 5, 6};
""[sub]// {1, 2, 4};
};
\end{document}
As you can see, the result is misleading - I wanted to include only 3, 5, 6, but the rectangle included the 4th node as well (which is logical, considering it's a rectangle). The result is not that great for the nodes 1, 2, 4 neither.
I would like to find a shape (or another method) that only overlaps the given nodes - something curved that would "follow" the nodes which are overlapped.
Do you have any clue how could I do that ?
Thanks for your answers !
EDIT : I have found a work around - instead of drawing subgraphs, I'm coloring the nodes. However, I'm still curious of an answer, if any.
