fhew has asked for the wisdom of the Perl Monks concerning the following question:

The base system (GraphViz) allows you to specify multiple label to a nodes and apparently also specify the compass point to 'place the label' at a particular point on the node based on the points of a compass. ie.

a -> b:f0:se

'connect node 'a' to node 'b' at label 'f0' at the compass point 'se' (south east).

But the perl interface doesn't mention how to specify this option. It only talks about assigning 'multiple labels' to a node and how to select a connection to a specific node.

Tomorrow I might try:

$g->add_node('a'); $g->add_node('b', label => ['0', '1']); $g->add_edge('a' => 'b', to_port => '0:se');

Comments anyone?

TIA Fulko

Replies are listed 'Best First'.
Re: graphViz and compass pointed labels
by Anonymous Monk on May 26, 2010 at 22:31 UTC
    headlabel, taillabel and labeldistance, port_label_distance, labelangle
      > headlabel, taillabel and labeldistance, port_label_distance, labelangle

      None of these directly address my problem. The symptom is:

      Since I have many edges that may go into the same port/label in a target node, each edge appears as a unique line that comes from 'wherever' the source node is into the center of the target node. ie.

      +---+ +---+ | A | | B | +---+ +---+ \ / \ / target target \ / +-----+ | D | +-----+ / target / / +---+ | C | +---+

      What I would prefer is that all edges that target the same label should enter the target node at the same spot. That also means that it should re-orient the nodes to minimize any overlap accordingly, In my simple example above, that effectively means that all the source nodes should end up on 'the same side as the target node. ie. something like this:

      +---+ +---+ +---+ | C | | B | | C | +---+ +---+ +---+ \ | / \ | / \ | / target \|/ +---+ | D | +---+

      Or evern more cleanly... allow the target label to exist 'within' the target node rather than on the 'edge'. Ie. the port is labeled, rather than each and every edge-endpoint.

      +---+ +---+ +---+ | A | | B | | C | +---+ +---+ +---+ \ | / \ | / \ | / \ | / \|/ +---------+ | target | | | | D | | | +---------+
      It would make for 'cleaner' graphs!
        Here is hack, uses separate compass_pt argument for $to because i don't grok dot :) It seems to work
        None of these directly address my problem.

        I don't pretend to understand your problem, but I don't even know which GraphViz program you're using :) I suggest you create a tiny program and try the debug method to figure out where to patch GraphViz.pm.