ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Inclusion of flow chart
@ 2003-05-07  0:17 emmanuel.rialland
  2003-05-07  8:26 ` Willi Egger
  0 siblings, 1 reply; 9+ messages in thread
From: emmanuel.rialland @ 2003-05-07  0:17 UTC (permalink / raw)



Hi all,

I have definitely not been flooded by answers. I am getting the impression
that this forum might
not have been the best one to ask (i.e. I have a practical problem which
has little bearing with
implementation aspects / bugs / new features of Context).

I have gone through comp.text.tex, but it seems to be heavily oriented
towards latex.
Would you have any other direction I could go to and get some assistance?

Thanks for showing a door (;-)),

Emmanuel






Thanks Hans. Apologies if the discussion doesn't flow very much, I am
writing from down under.


In fact, what I would ideally like to do is the following:

1- Define a template with the boxes without any arrows.
2- Write numbered lists describing arrows that would be generated on top of
the template.

The overview might look like the following (with some bogus macro names):

% Somewhere in a template file
% Template for the boxes:

\StartMPTemplate[Boxes]
%
%   -----     -----     -----
%   !   !     !   !     !   !
%   ! A !     ! B !     ! C !
%   -----     -----     -----
%
\startFLOWcell
  \name      {a}
  \location  {1,1}
  \shape     {action}
  \text      {\ss A}
\stopFLOWcell

\startFLOWcell
  \name      {b}
  \location  {2,1}
  \shape     {action}
  \text      {\ss B}
\stopFLOWcell

\startFLOWcell
  \name      {c}
  \location  {3,1}
  \shape     {action}
  \text      {\ss C}
\stopFLOWcell

\StopMPTemplate


------------------------------------------------------------------

% This creates the first chapter
\startcomponent Right
\Chapter{Every to the right}


% Inserts a float with the proper figure and the proper arrows using the
difinitions coming afterward
\StartMPGraphWithTemplate[Right]
\IncludeFLOWchartTemplate[Boxes]
\StopMPGraphWithTemplate

% Place the float
\placefigure
  [here,force]
  [fig:chart1]
  {Chart One}
  {\framed{\FLOWchart[Right]}}

% normal itemised text that will be numbered and will dynamically add tyhe
arrows to the figure [Right]
\startitemizeWithFLOWchart
  \arrow[labels=number,from=a,fromside=r,to=b,toside=l] This is the first
arrow.
  \arrow[labels=number,from=b,fromside=r,to=c,toside=l] This is the second
arrow.
\stopitemizeWithFLOWchart

%  This is the result
%
%   -----     -----     -----
%   !   !  1  !   !  2  !   !
%   ! A !---->! B !---->! C !
%   !   !     !   !     !   !
%   -----     -----     -----
%

% The text should appear below the float as \startitemize would have done

% 1  This is the first arrow.
% 2  This is the second arrow.

------------------------------------------------------------------

% This creates the next chapter
\startcomponent Left
\Chapter{Every to the left}


% Inserts a float with the proper figure and the proper arrows using the
difinitions coming afterward
\StartMPGraphWithTemplate[Left]
\IncludeFLOWchartTemplate[Boxes]
\StopMPGraphWithTemplate

% normal itemised text that will be numbered and will dynamically add tyhe
arrows to the figure [Right]
\startitemizeWithFLOWchart
  \arrow[labels=number,from=c,fromside=r,to=a,toside=l] This is the top
arrow.
\stopitemizeWithFLOWchart

%  This is the result
% !------------------------------
% !  -----     -----     -----  !
% !  !   !     !   !     !   !  !
% -->! A !     ! B !     ! C !--!
%    !   !     !   !     !   !
%    -----     -----     -----
%
%


The idea is that everything is dynamic:
- if the template changes, all the graphs get redrawn with the boxes at
their new place. The arrows get moved as needed.
- if the itemised text is changed (say the 'second arrow' line is written
before the 'first arrow'), then on the graph, the arrow from a to b would
be numbered 2 and the arrow from b to c would become 1.


What I tried is the definition you see at the top for the boxes. Then, to
generate the first graph, I would have:

---------------------------------------------------
\startFLOWchart[chart]

% Inserts template
\includeFLOWchart[template][x=1,y=1]

% Additional information on top of cell a
\startFLOWcell
  \name       {a}
  \connection [rl] {b}
  \comment    [t]  {\ss 1}
\stopFLOWcell

% Additional information on top of cell b
\startFLOWcell
  \name       {b}
  \connection [rl] {c}
  \comment    [t]  {\ss 2}
\stopFLOWcell

\stopFLOWchart
---------------------------------------------------


All I get is the template without any arrows.


I thought about trying to generate massive metafun macros. But I want the
itemised text to be text and not a graph.


Bottom line: is it possible? realistic?

I have been using MS Word so far to do that sort of thing. It has been
quite tedious to reflect any change in the box structure: 10 charts means
10 charts to re-edit.




As a bonus question that should be easier. Is it possible to draw other
sorts of arrows: i would like to draw straght line arrows that could follow
a diagonal (say go north-east instead of east first then north), or
circular arrows like:


%
%   -----
%   !   !
%   !   !<--
%   -----   \
%            \
%            |
%   -----    /
%   !   !   /
%   ! A !<--
%   -----



As usual any help is welcome.

Emmanuel






                      Hans Hagen
                      <pragma@wxs.nl>          To:       ntg-context@ntg.nl
                      Sent by:                 cc:       Emmanuel
                      RIALLAND/au/socgen@socgen
                      ntg-context-admin        Subject:  Re: [NTG-context]
                      Inclusion of flow chart
                      @ntg.nl


                      30/04/2003 05:17
                      Please respond to
                      ntg-context






At 18:49 24/04/2003 +1100, emmanuel.rialland@sgib.com wrote:

>As you might have guessed, this breaks everything.
>
>Has anybody an idea as to how I could do that?

can you make a minimal example?

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context







_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context






**************************************************************************
Have you checked our new corporate website at  http://www.sgib.com ?

The information contained herein is confidential and is intended solely
for the addressee(s).  It shall not be construed as a recommendation to
buy or sell any security.  Any unauthorized access, use, reproduction,
disclosure or dissemination is prohibited.
Neither SGIB nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
**************************************************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: Inclusion of flow chart
@ 2003-05-09  6:16 emmanuel.rialland
  2003-05-09 17:54 ` Willi Egger
  0 siblings, 1 reply; 9+ messages in thread
From: emmanuel.rialland @ 2003-05-09  6:16 UTC (permalink / raw)



Thanks to all. That gives me some leads.

I wanted to try something using your advice but in the mean-time decided to
typeset my document in lucida instead of comp modern. My installation just
won't do it. So I am struggling on this and leave the graphs to later.

Emmanuel







                                                                                                                            
                      "Willi Egger"                                                                                         
                      <w.egger@boede.nl        To:       <ntg-context@ntg.nl>                                               
                      >                        cc:                                                                          
                      Sent by:                 Subject:  Re: [NTG-context] Inclusion of flow chart                          
                      ntg-context-admin                                                                                     
                      @ntg.nl                                                                                               
                                                                                                                            
                                                                                                                            
                      07/05/2003 18:42                                                                                      
                      Please respond to                                                                                     
                      ntg-context                                                                                           
                                                                                                                            
                                                                                                                            




> At 11:17 07/05/2003 +1100, you wrote:
>
> >Hi all,
> >
> >I have definitely not been flooded by answers. I am getting the
impression
> >that this forum might
> >not have been the best one to ask (i.e. I have a practical problem which
> >has little bearing with
> >implementation aspects / bugs / new features of Context).
>
> hm, normally questions get answered (willy often does the flow chart
ones,
> but he may be off for a few days; begin may are also problematic days:
many
> holidays, national thingies and so; personally i'm just back from the
> polish tex conference)
>
> i forwarded the mail to willy -)
>
> the best hack i can come up with is:
>
> % output=pdftex
>
> \usemodule[chart]
>
> \starttext
>
> \startFLOWchart[boxes]
> \startFLOWcell
>    \name      {a}
>    \location  {1,1}
>    \shape     {action}
>    \text      {\ss A}
> \stopFLOWcell
>
> \startFLOWcell
>    \name      {b}
>    \location  {2,1}
>    \shape     {action}
>    \text      {\ss B}
> \stopFLOWcell
>
> \startFLOWcell
>    \name      {c}
>    \location  {3,1}
>    \shape     {action}
>    \text      {\ss C}
> \stopFLOWcell
> \stopFLOWchart
>
> \FLOWchart[boxes]
>
> \startFLOWchart[arrows]
>    \includeFLOWchart[boxes]
>    \startFLOWcell
>      \name      {1-2}
>      \location  {1,1}
>      \shape     {none}
>      \connection[rl]{b}
>    \stopFLOWcell
>    \startFLOWcell
>      \name      {2-3}
>      \location  {2,1}
>      \shape     {none}
>      \connection[rl]{c}
>    \stopFLOWcell
> \stopFLOWchart
>
> \FLOWchart[arrows]
>
> \stoptext
>
> when i have time i'll think about some extension

That is what I meant with my other reply. - I feel however that this is not
quite what Emmanuel is looking for. I stand corrected, the idea is to have
a
basket with shapes and another basket with arrows. Pick on the fly the
necessary pieces and assemble them in a chart, place the chart in a figure
environment and put a numberd legenda underneath of it. -- Hm, I would not
know how to achieve this without tweaking the sources...

Willi


_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context






**************************************************************************
Have you checked our new corporate website at  http://www.sgib.com ?

The information contained herein is confidential and is intended solely
for the addressee(s).  It shall not be construed as a recommendation to
buy or sell any security.  Any unauthorized access, use, reproduction,
disclosure or dissemination is prohibited.
Neither SGIB nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
**************************************************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <OFDF16F088.98092AAB-ONCA256D1F.00005588@tk.jp.world.socgen >]
* Re: Inclusion of flow chart
@ 2003-04-29 23:29 emmanuel.rialland
  0 siblings, 0 replies; 9+ messages in thread
From: emmanuel.rialland @ 2003-04-29 23:29 UTC (permalink / raw)



Thanks Hans. Apologies if the discussion doesn't flow very much, I am
writing from down under.


In fact, what I would ideally like to do is the following:

1- Define a template with the boxes without any arrows.
2- Write numbered lists describing arrows that would be generated on top of
the template.

The overview might look like the following (with some bogus macro names):

% Somewhere in a template file
% Template for the boxes:

\StartMPTemplate[Boxes]
%
%   -----     -----     -----
%   !   !     !   !     !   !
%   ! A !     ! B !     ! C !
%   -----     -----     -----
%
\startFLOWcell
  \name      {a}
  \location  {1,1}
  \shape     {action}
  \text      {\ss A}
\stopFLOWcell

\startFLOWcell
  \name      {b}
  \location  {2,1}
  \shape     {action}
  \text      {\ss B}
\stopFLOWcell

\startFLOWcell
  \name      {c}
  \location  {3,1}
  \shape     {action}
  \text      {\ss C}
\stopFLOWcell

\StopMPTemplate


------------------------------------------------------------------

% This creates the first chapter
\startcomponent Right
\Chapter{Every to the right}


% Inserts a float with the proper figure and the proper arrows using the
difinitions coming afterward
\StartMPGraphWithTemplate[Right]
\IncludeFLOWchartTemplate[Boxes]
\StopMPGraphWithTemplate

% Place the float
\placefigure
  [here,force]
  [fig:chart1]
  {Chart One}
  {\framed{\FLOWchart[Right]}}

% normal itemised text that will be numbered and will dynamically add tyhe
arrows to the figure [Right]
\startitemizeWithFLOWchart
  \arrow[labels=number,from=a,fromside=r,to=b,toside=l] This is the first
arrow.
  \arrow[labels=number,from=b,fromside=r,to=c,toside=l] This is the second
arrow.
\stopitemizeWithFLOWchart

%  This is the result
%
%   -----     -----     -----
%   !   !  1  !   !  2  !   !
%   ! A !---->! B !---->! C !
%   !   !     !   !     !   !
%   -----     -----     -----
%

% The text should appear below the float as \startitemize would have done

% 1  This is the first arrow.
% 2  This is the second arrow.

------------------------------------------------------------------

% This creates the next chapter
\startcomponent Left
\Chapter{Every to the left}


% Inserts a float with the proper figure and the proper arrows using the
difinitions coming afterward
\StartMPGraphWithTemplate[Left]
\IncludeFLOWchartTemplate[Boxes]
\StopMPGraphWithTemplate

% normal itemised text that will be numbered and will dynamically add tyhe
arrows to the figure [Right]
\startitemizeWithFLOWchart
  \arrow[labels=number,from=c,fromside=r,to=a,toside=l] This is the top
arrow.
\stopitemizeWithFLOWchart

%  This is the result
% !------------------------------
% !  -----     -----     -----  !
% !  !   !     !   !     !   !  !
% -->! A !     ! B !     ! C !--!
%    !   !     !   !     !   !
%    -----     -----     -----
%
%


The idea is that everything is dynamic:
- if the template changes, all the graphs get redrawn with the boxes at
their new place. The arrows get moved as needed.
- if the itemised text is changed (say the 'second arrow' line is written
before the 'first arrow'), then on the graph, the arrow from a to b would
be numbered 2 and the arrow from b to c would become 1.


What I tried is the definition you see at the top for the boxes. Then, to
generate the first graph, I would have:

---------------------------------------------------
\startFLOWchart[chart]

% Inserts template
\includeFLOWchart[template][x=1,y=1]

% Additional information on top of cell a
\startFLOWcell
  \name       {a}
  \connection [rl] {b}
  \comment    [t]  {\ss 1}
\stopFLOWcell

% Additional information on top of cell b
\startFLOWcell
  \name       {b}
  \connection [rl] {c}
  \comment    [t]  {\ss 2}
\stopFLOWcell

\stopFLOWchart
---------------------------------------------------


All I get is the template without any arrows.


I thought about trying to generate massive metafun macros. But I want the
itemised text to be text and not a graph.


Bottom line: is it possible? realistic?

I have been using MS Word so far to do that sort of thing. It has been
quite tedious to reflect any change in the box structure: 10 charts means
10 charts to re-edit.




As a bonus question that should be easier. Is it possible to draw other
sorts of arrows: i would like to draw straght line arrows that could follow
a diagonal (say go north-east instead of east first then north), or
circular arrows like:


%
%   -----
%   !   !
%   !   !<--
%   -----   \
%            \
%            |
%   -----    /
%   !   !   /
%   ! A !<--
%   -----



As usual any help is welcome.

Emmanuel





                                                                                                                                       
                      Hans Hagen                                                                                                       
                      <pragma@wxs.nl>          To:       ntg-context@ntg.nl                                                            
                      Sent by:                 cc:       Emmanuel RIALLAND/au/socgen@socgen                                            
                      ntg-context-admin        Subject:  Re: [NTG-context] Inclusion of flow chart                                     
                      @ntg.nl                                                                                                          
                                                                                                                                       
                                                                                                                                       
                      30/04/2003 05:17                                                                                                 
                      Please respond to                                                                                                
                      ntg-context                                                                                                      
                                                                                                                                       
                                                                                                                                       




At 18:49 24/04/2003 +1100, emmanuel.rialland@sgib.com wrote:

>As you might have guessed, this breaks everything.
>
>Has anybody an idea as to how I could do that?

can you make a minimal example?

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

_______________________________________________
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context






**************************************************************************
Have you checked our new corporate website at  http://www.sgib.com ?

The information contained herein is confidential and is intended solely
for the addressee(s).  It shall not be construed as a recommendation to
buy or sell any security.  Any unauthorized access, use, reproduction,
disclosure or dissemination is prohibited.
Neither SGIB nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
**************************************************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread
[parent not found: <OF8363F585.30148613-ONCA256D12.0029DA1E@tk.jp.world.socgen >]
* Inclusion of flow chart
@ 2003-04-24  7:49 emmanuel.rialland
  0 siblings, 0 replies; 9+ messages in thread
From: emmanuel.rialland @ 2003-04-24  7:49 UTC (permalink / raw)


Hans, Thanks for the answer on the section and paragraph signs.

I tried \definesymbol[yen][\getglyph{\char165}] to have a yen sign, but it
didn't work. How should I do it otherwise?



Now, I have another brainteaser.

I have a number of charts which a very similar one to another.
They all have the same boxes, with the same texts. The only difference from
one chart to another is the arrows: I am drawing different arrows with
different comments from one chart to another.

To be more efficient, I created a chart containing all the shapes without
any arrows.

Then for each chart, I use the example given at the top of page 8 on the
chart doc:

\includeFLOWchart[][]    (this works perfectly)

and I then try to define the arrows. \connection mentions where the arrows
goes to, but not where it comes from (which is given by the surrounding
cell definition). So I tried the following

\startFLOWcell
  \name[name1]
  \connection[name2]
\stopFLOWcell

where name1 and name2 are cells defined in the generic chart.

As you might have guessed, this breaks everything.

Has anybody an idea as to how I could do that?

Thanks,

Emmanuel





**************************************************************************
Have you checked our new corporate website at  http://www.sgib.com ?

The information contained herein is confidential and is intended solely
for the addressee(s).  It shall not be construed as a recommendation to
buy or sell any security.  Any unauthorized access, use, reproduction,
disclosure or dissemination is prohibited.
Neither SGIB nor any of its subsidiaries or affiliates
shall assume any legal liability or responsibility for any incorrect,
misleading or altered information contained herein.
**************************************************************************

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-05-09 17:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-07  0:17 Inclusion of flow chart emmanuel.rialland
2003-05-07  8:26 ` Willi Egger
  -- strict thread matches above, loose matches on Subject: below --
2003-05-09  6:16 emmanuel.rialland
2003-05-09 17:54 ` Willi Egger
     [not found] <OFDF16F088.98092AAB-ONCA256D1F.00005588@tk.jp.world.socgen >
2003-05-07  7:44 ` Hans Hagen
2003-05-07  8:42   ` Willi Egger
2003-04-29 23:29 emmanuel.rialland
     [not found] <OF8363F585.30148613-ONCA256D12.0029DA1E@tk.jp.world.socgen >
2003-04-29 19:17 ` Hans Hagen
2003-04-24  7:49 emmanuel.rialland

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).