1. NodeBox 1
    1. Homepage
    2. NodeBox 3Node-based app for generative design and data visualization
    3. NodeBox OpenGLHardware-accelerated cross-platform graphics library
    4. NodeBox 1Generate 2D visuals using Python code (Mac OS X only)
  2. Gallery
  3. Documentation
  4. Forum
  5. Blog

Graph Library and NodeBox 1.9.1

Posted by Martin Reinberg on Nov 28, 2007

I downloaded the Graph Library and tried to run one of the two included examples with NodeBox 1.9.1 . I always get the following error message:

Traceback (most recent call last):
File "nodebox/gui/mac/__init__.pyo", line 346, in _execScript
File "/Users/martinreinberg/Programming/NodeBox/graph/graph_example2.py", line 19, in ?
File "/Users/martinreinberg/Programming/NodeBox/graph/__init__.py", line 192, in solve
AttributeError: 'module' object has no attribute 'Graph'

Something seems broken?

Any help is appreciated!


 
Posted by Tom De Smedt on Nov 29, 2007

Try downloading again, I've uploaded a version which should be okay.

We'll be switching to a new graph library (which doesn't rely on Boost) in the near future by the way.



Posted by Martin Reinberg on Nov 29, 2007

Great! Now the library works! Thanks for the fast support!

But I ran into the next problem. Line feeds in node id's don't work properly:

size(600,700)
 
g = ximport("graph")
reload(g)
  
network = g.network(0, 0, 600, 700, style="deepsea")
 
id1 = "Test1\nTest4"
node1 = network.add(id1, type = network.style.randomtype())
id2 = "Test2"
node2 = network.add(id2, type = network.style.randomtype())
id3 = "Test3"
node3 = network.add(id3, type = network.style.randomtype())
 
network.connect(id1,id2)
 
network.solve()
 
for node in network.nodes:
    node.type = "light"
 
# Draw the network.
network.draw(orphans=True, core=False)
 
 
The node text is not really centered!