eisman / neo4jd3

Neo4j graph visualization using D3.js
https://eisman.github.io/neo4jd3/
MIT License
1.37k stars 422 forks source link

Created options nodeStrokeColor and processNode; Updated FontAwesome #48

Open jlcd opened 5 years ago

jlcd commented 5 years ago

Just created nodeStrokeColor and processNode options.

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 commented 1 year ago

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 :)