Description
Problem description
In some cases (when node attributes are not "grouped" in the file) some attributes are incorrectly interpreted.
I save a graph (generated with NetworkX) and save it in graphml and try to import it in Gephi
The nodes have the following attributes:
- id
- label (similar value with the id)
- x, y, z
- r, g, b
After importing in Gephi I see that some attributes have wrong values: the label field contains the value from one of the rgb components, the r,g,b values are wrong etc.
http://forum-gephi.org/viewtopic.php?f=29&t=6206&p=14383&hilit=Import+graphml#p14383
Expected Behavior
All the attributes from the graphml file should be correctly loaded
Current Behavior
The attribute values are read from the input file but assigned to wrong attributes:
- label field contains the value from one of the rgb components
- the values of the r,g,b are wrong
Possible Solution
By changing the order of the elements and making sure that x,y,x and r,g,b are in the correct order the problem is usually avoided. However this is only a workaround since the definition of the attributes can be in any order in the graphml file
Steps to Reproduce
- Import in Gephi the "test.graphml" file provided (on the gephi forum) http://forum-gephi.org/download/file.php?id=719
- Right click on a node and choose "Select in data laboratory"
- Click on tab "Data laboratory"
- Right click on the selected line from the table and choose: "Edit Node"
- In the left pane inspect the values for attributes: Position (x),Position (y),Position (z),Color, Label and notice they are different from the values within the test.graphml provided file
Context
I am dynamically generating graph with hundreds of node with NetworkX (and I customly set the positions and colours of the nodes/edges based on the app logic). I save it in graphml (no control over how NetworkX is saving the file)
Your Environment
- Version used: Gephi 0.9.1 (but same with the latest 0.9.2 snapshot)
- Operating System: Ubuntu 16.04: 4.4.0-78-generic Filtered graph not exported with "Select" pressed #99-Ubuntu SMP x86_64 GNU/Linux
- NetworkX version 1.11
- Python Python 3.5.2