I am trying to add a label to each edge in my Graph, below:

Basically higher with labels for each edge in the center:

I tried adding a label when I add an edge to each graph, for example (for graph g ):
g.add_edge(... label=edge.distance ...)
After some research, I found that such marking is possible under Nodebox 1, which works only for Mac , there seems to be no suitable alternative for Nodebox-OpenGL from the documentation. The error I get is:
Traceback (most recent call last): File "C:\foo\bar\baz\Imager.py", line 29, in <module> g.add_edge(edge.fr, edge.to, length=edge.distance, weight=2, stroke=color(1.0, 0.2, 0.0), label="cheese") File "C:\Python27\lib\site-packages\nodebox\graphics\physics.py", line 1254, in add_edge e2 = e2(n1, n2, *args, **kwargs) TypeError: __init__() got an unexpected keyword argument 'label'
You can reproduce the problem:
from nodebox.graphics import * from nodebox.graphics.physics import Node, Edge, Graph
So the question remains, how can I add a label to the edge of the graph in Nodebox-OpenGL?
python nodebox
Games Brainiac Nov 22 '13 at 5:41 2013-11-22 05:41
source share