I'm very very new to tikz, I've already done this:
With this code:
\documentclass{article}
\usepackage[spanish,es-noquoting]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usetikzlibrary{arrows}
\usetikzlibrary{shapes.misc}
\usetikzlibrary{positioning}
\usetikzlibrary{calc,intersections}
\begin{document}
\begin{tikzpicture}[terminal/.style={draw, drop shadow, fill=white, rectangle, inner sep=5pt, font=\bfseries, align=center}]
\tikzset{fallastyle/.style={text=red}}
\tikzset{pasastyle/.style={text=green}}
\def \radius {0.25\textwidth}
\def \margin {20} % margin in angles, depends on the radius
\path[name path=circulo] (0, 0) circle (\radius);
\node(escribir_prueba)[name path=path_escribir_prueba,terminal] at ({0+90}:\radius){(Re)Escribir\\ Prueba};
\node(correr_prueba)[name path=path_correr_prueba, terminal] at ({300+90}:\radius){Correr\\ Prueba};
\node(escribir_codigo)[name path=path_escribir_codigo, terminal] at ({240+90}:\radius){Escribir\\ Código};
\node(correr_todas_pruebas_1)[name path=path_correr_todas_pruebas_1, terminal] at ({180+90}:\radius){Correr todas\\ las pruebas};
\node(refactorizar)[name path=path_refactorizar, terminal] at ({120+90}:\radius){Refactorizar};
\node(correr_todas_pruebas_2)[name path=path_correr_todas_pruebas_2, terminal] at ({60+90}:\radius){Correr todas\\ las pruebas};
\node (start) [node distance=8mm and -1mm, above left=of escribir_prueba, circle, fill=black, minimum width=1pt]{};
% INTERSECCIONES
\path [name intersections={of=circulo and path_escribir_prueba,name=intESCRIBIRPRUEBA}];
\def \ESCRIBIRRIGHT {intESCRIBIRPRUEBA-1}
\def \ESCRIBIRLEFT {intESCRIBIRPRUEBA-2}
\path [name intersections={of=circulo and path_correr_prueba,name=intCORRERPRUEBA}];
\def \CORRERPRUEBAUP {intCORRERPRUEBA-1}
\def \CORRERPRUEBADOWN {intCORRERPRUEBA-2}
\path [name intersections={of=circulo and path_escribir_codigo,name=intESCRIBIRCODIGO}];
\def \ESCRIBIRCODIGOUP {intESCRIBIRCODIGO-1}
\def \ESCRIBIRCODIGODOWN {intESCRIBIRCODIGO-2}
\path [name intersections={of=circulo and path_correr_todas_pruebas_1,name=intCORRERTODASPRUEBASFIRST}];
\def \CORRERTODASPRUEBASFIRSTLEFT {intCORRERTODASPRUEBASFIRST-1}
\def \CORRERTODASPRUEBASFIRSTRIGHT {intCORRERTODASPRUEBASFIRST-2}
\path [name intersections={of=circulo and path_refactorizar,name=intREFACTORIZAR}];
\def \REFACTORIZARUP {intREFACTORIZAR-1}
\def \REFACTORIZARDOWN {intREFACTORIZAR-2}
\path [name intersections={of=circulo and path_correr_todas_pruebas_2,name=intCORRERTODASPRUEBASSECOND}];
\def \CORRERTODASPRUEBASSECONDUP {intCORRERTODASPRUEBASSECOND-1}
\def \CORRERTODASPRUEBASSECONDDOWN {intCORRERTODASPRUEBASSECOND-2}
\draw [->,bend left=15] (\ESCRIBIRRIGHT) to (\CORRERPRUEBAUP);
\draw [->,bend left=15] (node cs:name=correr_prueba, anchor=west) to node [midway,left,pasastyle] { [pasa] } (node cs:name=escribir_prueba, anchor=south);
\draw [->,bend left=15] (\CORRERPRUEBADOWN) to node [midway,right,fallastyle] { [falla] } (\ESCRIBIRCODIGOUP);
\draw [->,bend left=15] (\ESCRIBIRCODIGODOWN) to (\CORRERTODASPRUEBASFIRSTRIGHT);
\draw [->,bend left=15] (node cs:name=correr_todas_pruebas_1, anchor=north) to node [midway,left,fallastyle] { [falla] } (node cs:name=escribir_codigo, anchor=west);
\draw [->,bend left=15] (\CORRERTODASPRUEBASFIRSTLEFT) to node [midway,left,pasastyle] { [pasa] } (\REFACTORIZARDOWN);
\draw [->,bend left=15] (\REFACTORIZARUP) to (\CORRERTODASPRUEBASSECONDDOWN);
\draw [->,bend left=15] (node cs:name=correr_todas_pruebas_2, anchor=south) to node [midway,right,fallastyle] { [falla] } (node cs:name=refactorizar, anchor=north);
\draw [->,bend left=15] (\CORRERTODASPRUEBASSECONDUP) to node [midway,left,pasastyle] { [pasa] }(\ESCRIBIRLEFT);
\draw [->,bend left=15] (node cs:name=start, anchor=east) to (node cs:name=escribir_prueba, anchor=north);
\end{tikzpicture}
I'm sure it's not the best way to do that, but as I said, I'm very new in tikz, and the concept seems clear: draw the nodes
at 360/total_nodes degrees, find intersections between node and a circle, draw an arc
between intersections.
So far so good. Now I want to do this, that is pretty much the same thing:
I would like to make the 3 bubbles (prueba-codigo-refactor) a node
, so I can do the same thing I did before.
This code draws the 3 bubbles:
\begin{tikzpicture}
\node [draw, circle, fill=white, minimum width=5em]at (0, 0){Prueba};
\node [draw, circle, fill=white, minimum width=5em]at (1.2, -0.6){Código};
\node [draw, circle, fill=white, minimum width=5em]at (1.2, 0.6){Refactor};
\end{tikzpicture}
But I need the hole thing to behave as one node. So the questions are:
- How can I do to make the 3 bubbles a node (and behave like a node) so I can do the same thing I did before?
- This is all I can think with one-day experience with tikz, you sure know better and may come up with a better solution, I want to hear it!
I want to learn tikz, so a "here, paste this code and works, bye bye" it's not the best answer for me. On the other side, "look at this link, bye bye" it's kind of hard to me to understand, a MME would be awesome (and the link).