Allign edge labels to fit its path in SVG output

Dear Dev Team,

I have always missed the feature to be able to have edge label aligned to edge path ...

"The attached file (dstdp-consice.txt) packs several "tspan" tags into a single textPath tag and is slightly more concise than the successful one (which has multiple textPath tags each containing tspan tags). However, in inkscape it displays in a staircase manner -- much like how text files with line feed (\n) but without carriage return (\r) displayes in DOS. Or windows. Whatever. It displays ok in firefox 4.0.1. I didn't study the svg spec, but it seems that the way firefox renders it makes more sense to an end user"

I know that a challenge will arise to scale long text to fit short paths, but there is a work around
Reference:

http://stackoverflow.com/questions/2938779/svg-scaling-text-to-fit-conta...
http://stackoverflow.com/questions/5185699/multiple-lines-of-curved-text...

This feature is not more feasible after having introduced the xlabels which has the floating effect that does not interact with the nodes distributions.

All the best

AttachmentSize
graphviz_test_fit_path.PNG212.79 KB
SVG_Essentials_I_8_tt176.png5.77 KB
ds2tp-concise.txt885 bytes
net-pheno-nocr_en.png372.27 KB

This feature would be a

This feature would be a break-through, and an extended arm for graphviz.

It could be enabled by introducing a new switch to the dot svg output command line.

Align edge labels to fit its path in SVG output

Well, it's open source, and the graphviz SVG driver is pretty hackable - just a bunch of printfs() really. The downside is that you lose the features of the cairopango (or even Quartz) drivers. 

It appears possible to hack this in cairo: see 
http://mces.blogspot.com/2008/11/text-on-path-with-cairo.html

This might require adding a new entry point to the codegen interface to support text-on-a-path, but we would be open to that, of course.

Stephen North   [email protected]

It is possible in either

It is possible in either way:

  • rely on cairo library
    - this way the png output as well shall have the same output as the svg
  • rely on SVG renderer
    - this requires some switch to be defined on the dot command to affect the xml of the svg file being generated.

Not to forget unicode support

Not to forget unicode support as well :))

This will be a real dream come true !!!

Is there any hope to table edge label align with curved path

Is there any hope to table edge label to optionaly align with curved path when exporting to SVG format which natively support this feature.

graphviz does not have to create new logic execpt affecting the generated code in the SVG file

I have added a prototype

I have added a prototype implementation of this today, that only works for ordinary labels and only in svg output, and ignores any potential space or geometric issues. You can set labelaligned=true in the edge and try it.

To make this an official feature, it would have to work with cairopango output (at least), handling label tooltips and hrefs. It would also have to work with non-table HTML-like labels. As there is at most one person supporting Graphviz at present, it would be difficult to attach a date when this might happen.

Recent comments