ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Maurice Diamantini <Maurice.Diamantini@ensta.fr>
Cc: Maurice Diamantini <Maurice.Diamantini@ensta.fr>
Subject: Re: Metapost + metaObjet connector label on arcs
Date: Fri, 22 Oct 2004 18:35:54 +0200	[thread overview]
Message-ID: <717A1C36-2448-11D9-BD8A-000A9595B57C@ensta.fr> (raw)
In-Reply-To: <20041022122446.GC23718@cebitec.uni-bielefeld.de>


Le 22 oct. 04, à 14:24, Eckhart Guthöhrlein a écrit :

> You can attach named paths to objects and then labels these. Here is my
> first try, seems to work:

Thank very much Eckhart, I read the metaObj manual, but I
didn't realised showing that one can attached a labelObj
to arbitrary objects (just for Matrix and trees).

Now it works !
It is my first Metapost figure (I am switching
from pstricks).
As graph (in the sens nodes + arcs, not curve functions)
will be frequentjy used (at least by me).

I am thinking about some highlevel  class (using MetaObj)
- class Node for creating node
- class Arc for connecting nodes.
The goal is that the data (coordinate, various labels, ...)
will be as simple as possible.
Also it should be easy to pick the Node and Arc class,
and personnalide them gor its own graph.

For now, I'm trying to anderstand how the label options
works,
A new problem is that the label sep is to big from thes arcs, and
I'm not able to ajust it. The "labshift" option doesn't seem
to work with ncarc, althought it works for the nodes.


P.S.
is one of the Metapost lists still alive?


Here is the full exemple (with only 2 nodes)
I don use the inline context feature because it
doesnt work for me, and I have to work on several
workstation, so I still stay (for now) with the indenpendent
file
I'm sorry for the "latex" line on a context list, but
Metafun is not clean installed (texlive 2003), I wanting
for the next texlive... And I hope context will be install
by default with Metafun
.

Thank you very much.

-- Maurice Diamantini,

verbatimtex   % -*-latex-*-
     %&latex
     \documentclass{article}
     \usepackage[latin1]{inputenc}
     \begin{document}
     \sffamily
etex

input mp-tool ; % some initializations and auxiliary macros
input mp-spec ; % macros that support special features
input metaobj.mp ; % suffixe non indispensable ?

beginfig(1) ;

     % For now node positions will be hardcoded
     numeric u; u=1cm;
     z0=(0u,2u);
     z1=(3u,4u);
     % % verbatimtex \small etex;

     setCurveDefaultOption("arcangle", 25);
     %
     % building nodes of the graph. Nodes are object that arc will be 
able to
     % refere to.
     % Later, I will have to build my own Class "Activity" with some 
other
     % parameters (labels above and under the circle, ...)
     %
     newCircle.n0(btex \large 0 etex) "circmargin(0.1u)";
     ObjLabel.n0(btex b0 etex)  "labshift((0, -.5u))";
     ObjLabel.n0(btex u0 etex)  "labshift((0, .5u))";
     n0.c = z0;

     newCircle.n1(btex  \large 1 etex) "circmargin(0.1u)";
     ObjLabel.n1(btex b1 etex)  "labshift((0, -.5u))";
     ObjLabel.n1(btex u1 etex)  "labshift((0, .5u))";
     n1.c = z1;

     %
     % build some Arcs, with various label or other parameters
     % I'll have to make some vardef fonction for that.
     % For now, all arcs related stuffs are in th esame place
     %
     % - Howto reduce the label separation ? ("labshift" doen't work)

     ncarc.n0(n0)(n1)  "name(n0_n1)";
     ObjLabel.n0(btex $\times$ etex) "labpathname(n0_n1)",
                                     "labpos(0.8)";
     ObjLabel.n0(btex $0\rightarrow 1$ etex)
                             "labpathname(n0_n1)",
                             "labpos(0.8)",
                             "labangle(0)",
                             "labshift((0, -0.5u))",
                             "labdir(bot)" ;


     ncarc.n1(n1)(n0)  "name(n1_n0)";

     ObjLabel.n1(btex $\times$ etex) "labpathname(n1_n0)",
                                     "labpos(0.8)";
     ObjLabel.n1(btex $1\rightarrow 0$ etex)
                             "labpathname(n1_n0)",
                             "labpos(0.8)",
                             "labangle(180)",
                             "labdir(top)" ;

     drawObj(n0, n1);

endfig ;
end .

  reply	other threads:[~2004-10-22 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-20 11:57 Maurice Diamantini
2004-10-22 12:24 ` Eckhart Guthöhrlein
2004-10-22 16:35   ` Maurice Diamantini [this message]
2004-10-24 18:30     ` Denis Roegel
2004-10-26 11:34       ` Maurice Diamantini
2004-10-26 11:53         ` Hans Hagen
2004-10-26 16:16           ` Maurice Diamantini
2004-10-27  7:23             ` Hans Hagen
2004-10-27 13:20               ` Metapost installation Maurice Diamantini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=717A1C36-2448-11D9-BD8A-000A9595B57C@ensta.fr \
    --to=maurice.diamantini@ensta.fr \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).