neo4j-contrib / neovis.js

Neo4j + vis.js = neovis.js. Graph visualizations in the browser with data from Neo4j.
Apache License 2.0
1.6k stars 326 forks source link

Node Type Legend #248

Open shalevv123 opened 2 years ago

shalevv123 commented 2 years ago

Is there anyway you could get a color legend? for example in the picture: Screenshot_199 can you somehow display a map like: pink- > test blue -> code yellow -> requirement

LukasRasmussen commented 2 years ago

@shalevv123 Try like this:

neovis.registerOnEvent('completed', () => {
  neovis.edges.updateOnly( neovis.edges.get().filter( getTestEdges() ).map(edge => ( {...edge, color:"pink" } ) ) );
});

getTestEdges(x) {
 return x.raw.labels.includes("Test")
}
thebestnom commented 2 years ago

@LukasRasmussen not what he asked for 😅 I don't think vis.js allow to read auto node/edge color but I can search