neo4jd3 icon indicating copy to clipboard operation
neo4jd3 copied to clipboard

Created options nodeStrokeColor and processNode; Updated FontAwesome

Open jlcd opened this issue 5 years ago • 1 comments

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.

jlcd avatar May 15 '19 19:05 jlcd

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

ajmeese7 avatar Nov 22 '22 01:11 ajmeese7