Same color for same Relationship nodes/same Origination nodes


(Sucheta) #1

Hi,

We have a concern. As showed in the example diagram , all the same originated nodes or probably same relationship nodes here have same color

but in my neovis.js we get a different output of colors of the nodes belonging to the same relationship/ origination from the same node-

Can this issue of different colors be resolved and that the color of the node be made the same as its relationship parameter.


(Michael Hunger) #2

Neovis colors the nodes by default after the community property.
You can choose other properties (or label) as coloring source in the config.


(Sucheta) #3

I tried to change the config in Neovis.js in both labels and well as relationships, but to no avail. Only the lines became thin and the font - size reduced (that is desired). But the concern of all for example - parameter arrows as well as parameter nodes becoming same color did not happen . My code is -

      
         var cypherQuery = "MATCH (n)-[r]->(m) RETURN n,r,m;";

         var config = {
             container_id: "viz",
             server_url: "bolt://localhost:11001/",
             server_user: "neo4j",
             server_password: "ib1",
             labels: {
              
                 "Banking": {
                     "caption": "name",
                     "size": "pagerank",
                     "community": "community",
                  
                     
                 },
                 "Parameter": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "green"
                },
                "Method": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Blue"
               },
               "Request": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Red"
               },
               "Response": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Black"
               },
               "Paths": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Yellow"
               },
               "API": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Purple"
               },
               "Department": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Pink"
               },
               "System": {
                   "thickness": "weight",
                   "caption": true,
                   "color": "Gray"
               },
                 
             },
             relationships: {
                 "Parameter": {
                     "thickness": "weight",
                     "caption": true,
                     "color": "green"
                 },
                 "Method": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Blue"
                },
                "Request": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Red"
                },
                "Response": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Black"
                },
                "Paths": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Yellow"
                },
                "API": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Purple"
                },
                "Department": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Pink"
                },
                "System": {
                    "thickness": "weight",
                    "caption": true,
                    "color": "Gray"
                },
             },
          RETURN cc",
         
           initial_cypher:cypherQuery ,        
            arrows: true,
            hierarchical_layout:true,
            hierarchical_sort_method:"directed",
            
         };                 
         this.viz = new NeoVis.default(config);
         this.viz.render();
         console.log(this.viz);

And the output result is -

Please help to segregate the nodes according to the colors.


(Michael Hunger) #4

The color comes from: "community": "propertyName"


(Sucheta) #5

Here i tried, but it doesn't work. I tried in labels as well as relationships also.

 var cypherQuery = "MATCH (n)-[r]->(m) RETURN n,r,m;";
var config = {
             container_id: "viz",
             server_url: "bolt://localhost:11001/",
             server_user: "neo4j",
             server_password: "Virtuallib1",
             labels: {
                 //"Character": "name",
                 "Banking": {
                     "caption": "name",
                     "size": "pagerank",
                     "community": "community",
                  
                     //"sizeCypher": "MATCH (n) WHERE id(n) = {id} MATCH (n)-[r]-() RETURN sum(r.weight) AS c"
                 },
                 "Parameter": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Green",
                },
                "Method": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Blue",
               },
               "Request": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Red"
               },
               "Response": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Pink"
               },
               "Paths": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Purple"
               },
               "API": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Black"
               },
               "Department": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Yellow"
               },
               "System": {
                   "thickness": "weight",
                   "caption": true,
                   "community": "Red"
               },
                 
             },
             relationships: {
                 "Parameter": {
                     "thickness": "weight",
                     "caption": true,
                     "community": "green"
                 },
                 "Method": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Blue"
                },
                "Request": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
                "Response": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
                "Paths": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
                "API": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
                "Department": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
                "System": {
                    "thickness": "weight",
                    "caption": true,
                    "community": "Red"
                },
             },
           
             initial_cypher:cypherQuery ,        
            arrows: true,
            hierarchical_layout:true,
            hierarchical_sort_method:"directed",
            
         };                 
         this.viz = new NeoVis.default(config);  
      
         this.viz.render();
         console.log(this.viz);

output nodes are still multi-color.

I am sorry, but you will have to spoon-feed.