ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Charting module
@ 2001-09-09 17:02 Giuseppe Bilotta
  2001-09-10 20:18 ` Hans Hagen
  2001-09-10 21:01 ` Hans Hagen
  0 siblings, 2 replies; 5+ messages in thread
From: Giuseppe Bilotta @ 2001-09-09 17:02 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 2724 bytes --]

Hello,

I just began exploring the charting module. And here I am with a
couple of requests! :-)

What I basically have the need for is "half-grid" steps.

Say that I want a layout like the following

     X4X
      \
       +--XbX
      /
X2X  X1X  X3X
 |   | |   |
 \-+-/ \-+-/
   |     |
  XcX  /-+-\
       |   |
      XdX XaX

I would like to occupy as less space as possible, while still
retaining the "local centering" (that is, box c between box 1 and
2, box b between box 1 and 4, box d possibly aligned under box 1
and box a possibly under box 3). Also the link between 1-3 and d-a
should join in the middle before splitting again. Note that I can
achieve this by putting intermediate empty spaces between the main
(Roman-numbered) boxes, but this would leave too much space. With
the grid, we have

 Empty    Empty   "Box 4"   Empty    Empty
 Empty    Empty    Empty   "Box b"   Empty
"Box 2"   Empty   "Box 1"   Empty   "Box 3"
 Empty   "Box c"   Empty      0      Empty
 Empty    Empty   "Box d"   Empty   "Box a"

while with half-grid steps I could put the intermediate link box 0
(which btw shows as an empty dot; how to make it disappear so that
the conjunction is seamless?) and boxes b and c in a half-step,
reducing space waste.

A second question is about connection points. Despite the
recommendations in the manual about trying to avoid multiple
(outgoing) links per side (using e.g. [-b] or [+b]), I find this
possibility helpful, and actually essential in the above mentioned
example, where "Box 1" has two connection at the bottom (left and
right). (Yes I know I should rearrange the chart, but I don't want
to; I prefer it this way.)

However, these connections are too spaced away, because they are
at about 1/4, 3/4 of the side, which is essential if a third
connection (midpoint) is used, but sub-optimal when only two
connections are used (a better positioning in this case would be
to use a 1/3, 2/3 spacing). The suggestion resolves finally in
either giving the user the possibility to control position of the
connection points, or providing automatically the best position
depending on how many connection points are actually used. (And
what about allowing the users to have "as many connection points
per side as desired"? Imagine a (horrible?) thing with five
connection points: ++b, +b, b, -b, --b !)

Finally: why do corner radius and arrow size share the same value?
Is there a way to change the value for some connections only and
activate/deactivate arrows for specific connections? is there a
way to force a straight arrow even when by default it would come
out bended?

Btw, see attached file if you want to see how the chart is
currently implemented.

--
Giuseppe "Oblomov" Bilotta

[-- Attachment #2: gb-chart.tex --]
[-- Type: application/octet-stream, Size: 1947 bytes --]

%&cont-en

\usemodule[chart]

\setuppapersize[S6][S6]

\newif\ifpdf
\pdftrue
\ifx\pdfoutput\relax
    \pdffalse
\else
    \ifnum\pdfoutput=0
        \pdffalse
    \fi
\fi

\ifpdf
  \setupinteractionscreen[option=max]
  \setupbackgrounds[paper][text]
                   [background=color,backgroundcolor=darkyellow]
\fi


\setuppagenumbering[state=stop]

\starttext

\setupFLOWcharts[maxwidth=\textwidth,dx=\bodyfontsize,dy=\bodyfontsize]
\setupFLOWshapes[default=procedure]
\setupFLOWlines[radius=\bodyfontsize,arrow=no]

\startFLOWchart[gbchart]
    \startFLOWcell
       \name {boxone}
       \text {Box 1}
       \location {3,3}
       \connection[-bt]{boxc}
       \connection[+bt]{boxnull}
       \connection[tl]{boxb}
   \stopFLOWcell

   \startFLOWcell
       \name {boxtwo}
       \text {Box 2\\More text}
       \location {1,3}
       \connection[bt]{boxc}
   \stopFLOWcell

   \startFLOWcell
       \name {boxc}
       \text {Box c\\Even more\\Text}
       \location {2,4}
   \stopFLOWcell

   \startFLOWcell
       \name {boxthree}
       \text {Box 3\\More text}
       \location {5,3}
       \connection[bt]{boxnull}
   \stopFLOWcell

   \startFLOWcell
       \name{boxnull}
       \shape{0}
       \location {4,4}
       \connection[bt]{boxa}
       \connection[bt]{boxd}
   \stopFLOWcell
   
   \startFLOWcell
       \name {boxa}
       \text {Box a\\Even more\\Text}
       \location {5,5}
   \stopFLOWcell

   \startFLOWcell
       \name {boxd}
       \text {Box d\\Even more\\Text}
       \location {3,5}
   \stopFLOWcell

   \startFLOWcell
       \name {boxfour}
       \text {Box 4\\More text}
       \location {3,1}
       \connection[bl]{boxb}
   \stopFLOWcell

   \startFLOWcell
       \name {boxb}
       \text {Box b\\Even more\\Text}
       \location {4,2}
   \stopFLOWcell

\stopFLOWchart

\FLOWchart[gbchart]

\stoptext

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

end of thread, other threads:[~2001-09-12  6:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-09 17:02 Charting module Giuseppe Bilotta
2001-09-10 20:18 ` Hans Hagen
2001-09-11 12:38   ` Re[2]: " Giuseppe Bilotta
2001-09-12  6:28     ` Hans Hagen
2001-09-10 21:01 ` Hans Hagen

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).