Feature Diagrams

View: New views
4 Messages — Rating Filter:   Alert me  

Feature Diagrams

by Paulo J. Matos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi all,

Given I found no package in LaTeX for this I come to the Tikz community
which I am sure knows how to draw this... (assuming it knows how to draw
anything...)

How can I create feature diagrams like the following:
http://en.wikipedia.org/wiki/File:E-shopFM.jpg

The big problem here is not the tree itself which is quite trivial but
the circle parts on the Or and Alternative branches. Example is the
black circle part between Bank Transfer and Credit Card and the white
one between  High and Standard. Note that if the branching is > 2, the
circle part needs to span all of them.

What's the best way to achieve this effect?

Cheers,

Paulo Matos



------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Feature Diagrams

by Werner Grundlingh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I think your best bet here would be to attempt a tree in PStricks.
Consider viewing the more complex examples contained in the package
documentation at
  http://www.dante.de/CTAN/graphics/pstricks/base/doc/pstricks-doc.pdf
More specifically, view the example tree on page 110. Alternatively,
the tree examples at
  http://www.tug.org/PSTricks/main.cgi?file=pst-tree/pst-tree
also shows some options to follow.

------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Feature Diagrams

by Alain Matthes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 25 juin 09 à 00:05, Werner Grundlingh a écrit :

> I think your best bet here would be to attempt a tree in PStricks.
> Consider viewing the more complex examples contained in the package
> documentation at
>  http://www.dante.de/CTAN/graphics/pstricks/base/doc/pstricks-doc.pdf
> More specifically, view the example tree on page 110. Alternatively,
> the tree examples at
>  http://www.tug.org/PSTricks/main.cgi?file=pst-tree/pst-tree
> also shows some options to follow.

hi,


:)

  it's easy to make this example with tikz.


\documentclass[]{article}
\usepackage{tikz,fullpage}
  \begin{document}

\begin{tikzpicture}

\node[draw](A) at (0,0) {A};
\node[draw](B) at (2,3) {B};
\node[draw](C) at (5,0) {C};
\node[draw](D) at (6,1) {D};
\node[draw](E) at (6,4) {E};
\draw (B.south)--(C.north);
\draw (B.south)--(A.north);
\begin{scope}
        \clip (B.south)--(C.north)--(A.north)--cycle;
        \draw[fill=black](B.south)  circle(0.5cm);
\end{scope}

\draw (B.east)--(D.west);
\draw (B.east)--(E.west);
\begin{scope}
        \clip (B.east)--(D.west)--(E.west)--cycle;
        \draw[](B.east)  circle(0.5cm);
\end{scope}
\end{tikzpicture}

\end{document}

Best Regards

Alain Matthes
------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users

Re: Feature Diagrams

by Alain Matthes-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Le 25 juin 09 à 00:05, Werner Grundlingh a écrit :

> I think your best bet here would be to attempt a tree in PStricks.
> Consider viewing the more complex examples contained in the package
> documentation at
>  http://www.dante.de/CTAN/graphics/pstricks/base/doc/pstricks-doc.pdf
> More specifically, view the example tree on page 110. Alternatively,
> the tree examples at
>  http://www.tug.org/PSTricks/main.cgi?file=pst-tree/pst-tree
> also shows some options to follow.


hi,

it's possible to make something like tree22.tex

with

\documentclass[]{article}
\usepackage{tikz,fullpage}
\makeatletter
\newdimen\pt@ax
\newdimen\pt@ay
\newdimen\pt@bx
\newdimen\pt@by
\newdimen\pt@cx
\newdimen\pt@cy

  \begin{document}

\begin{tikzpicture}

\node[draw](A) at (0,0) {A};
\node[draw](B) at (2,3) {B};
\node[draw](C) at (5,0) {C};

\draw (B.south)--(C.north);
\draw (B.south)--(A.north);

% the next code can be used in a macro
\makeatletter
\pgfextractx{\pgf@x}{\pgfpointanchor{B}{south}}
\pgfextracty{\pgf@y}{\pgfpointanchor{B}{south}}
\pt@ax\pgf@x
\pt@ay\pgf@y
\pgfextractx{\pgf@x}{\pgfpointanchor{A}{north}}
\pgfextracty{\pgf@y}{\pgfpointanchor{A}{north}}
\pt@bx\pgf@x
\pt@by\pgf@y
\pgfextractx{\pgf@x}{\pgfpointanchor{C}{north}}
\pgfextracty{\pgf@y}{\pgfpointanchor{C}{north}}
\pt@cx\pgf@x
\pt@cy\pgf@y
\pgfmathanglebetweenpoints{\pgfpoint{\pt@ax}{\pt@ay}}%
                           {\pgfpoint{\pt@bx}{\pt@by}}
\pgfmathsetmacro{\firstangle}{\pgfmathresult}
\pgfmathanglebetweenpoints{\pgfpoint{\pt@ax}{\pt@ay}}%
                           {\pgfpoint{\pt@cx}{\pt@cy}}
\pgfmathsetmacro{\secondangle}{\pgfmathresult}
\makeatother

\fill[shift=(B.south),fill=black] (0,0) --(\firstangle:.5cm) arc  
(\firstangle:\secondangle:.5cm)--cycle;

\end{tikzpicture}
\end{document}

perhaps Mark Wibrow can find a better solution

Best Regards

Alain Matthes
------------------------------------------------------------------------------
_______________________________________________
pgf-users mailing list
pgf-users@...
https://lists.sourceforge.net/lists/listinfo/pgf-users