Skip to content

Conversation

jlcd
Copy link

@jlcd jlcd commented May 15, 2019

Just created nodeStrokeColor and processNode options.

  • nodeStrokeColor will set the "border" color for all nodes;
  • processNode will process each individual node, allowing changing property values and many customizations.
    Among the customizations I added icon, strokeColor and color options to each node, so we can have each one with a different icon, "border" color and fill color, respectively.

Example, to customize a node based on a property, you can do the following:

var neo4jd3 = new Neo4jd3('#neo4jd3', {
(...)
processNode: function (node) {
                if (node.labels.includes('Company') && node.properties.is_warehouse) {
                    node.color = '#0F52BA';
                    node.icon = 'warehouse';
                    node.strokeColor = 'red';
                    node.labels = ["Warehouse"];
                }
}
(...)
}

I'm not 100% familiar with what I should do to have everything tested and ready to deploy (eg. minimize the source etc), so feel free to give me a hand on that.

@ajmeese7
Copy link

FYSA the file you modified is automatically created from the neo4jd3.js file, so if you make any changes in a real file it will automatically overwrite everything you've written. In the future be sure to edit the scripts directly instead of the docs or dist directories :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants