Re: Graph layout with Metapost?

Marcus Harnisch <[email protected]> Sun, 19 Jan 2003 15:52:58 -0500
Newsgroups gmane.comp.tex.metafont
Message-ID <[email protected]>
Hi Denis,

Denis Roegel writes:
 > But you can certainly add text that doesn't change the layout, no?
 > I guess the problem is acting on the layout.

And how would I determine the size of the text and whether my
replacement text would change the layout?

[sorry for getting Graphviz specific here. I am trying to make my
 point clear.]

There are two main issues. First is that edge labels can only contain
text. Node labels can be of a "record" type which adds some basic
table support. Node shapes can be selected from a variety of different
geometric shapes. Or node labels can be Postscript files (for the
Postscript and SVG drivers anyway).

I thought about adding support for edge labels to be arbitrary
Postscript files. That way I could use user defined node/edge
attributes containing (La)TeX code. A preprocessor mechanism could
render the graphics and include the resulting Postscript files as
node/edge labels accordingly. For nodes this worked in a
proof-of-concept study I came up with. I was the preprocessor, BTW ;-)

 > It doesn't seem simple. Why not stick to a specialized tool
 > and enhance it?

First of all Graphviz' code base is, well, mature ;-) One of the
developers I discussed that issue with agreed that it is quite
messy. Particularly the Postscript file handling is inefficient and
full of bugs. Fixing that is a task that would probably be not much
easier than implementing the layout features in Metapost.

And in the end I still haven't solved the problem that I might want to
have more than just a graph in my picture. Post-editing is a manual
process since other objects don't have any knowledge about the graph
objects. Each time I make a minor change to the graph, all the code I
added might be worthless.

Anyway, I was just curious if anybody had the same idea.

Thanks,
	Marcus