I got an example code from http://localhost:8000/examples/. And starting building my own. The problem that I am facing is that I have JSON of nodes from neo4j graph DB. that I want to add. I am succesful in adding it but the Icon and Color associated with the noe4j_labels are not represented in the graph.
Sigma Design Plugin is being used
var graphStyles = {
nodes: {
icon: {
by: 'neo4j_labels',
scheme: 'nodeIconScheme',
},
color: {
by: 'neo4j_labels',
scheme: 'nodeColorScheme',
},
}
}
// Instanciate the design:
var design = sigma.plugins.design(s, {
styles: graphStyles,
palette: graphPalettes
});
The nodes that are added from the first query are represented properly with their respective Icons and Colors.
sigma.neo4j.cypher(
{ url: 'http://localhost:7474', user: 'neo4j', password: 'neo' },
query_init,
s,
function(s) {
But when I try to add new nodes I run into this problem.
s.graph.addNode(new_graph_vars[0]);
new_graph_vars has got JSON of various nodes
Object
0
:
Object
color
:
"#ff0000"
fa2_x
:
6.330295085906982
fa2_y
:
6.543041706085205
id
:
"148655"
label
:
"Desaru Investments (Cayman Isl.) Limited"
neo4j_data
:
Object
neo4j_labels
:
Object
read_cam0:size
:
1
read_cam0:x
:
6.330295085906982
read_cam0:y
:
6.543041706085205
renderer1:size
:
6.5694811875994725
renderer1:x
:
718.2437463015784
renderer1:y
:
651.9931886710822
size
:
1
x
:
6.330295085906982
y
:
6.543041706085205
__proto__
:
Object
length
:
9
__proto__
:
Array[0]