How to create custom layout in d3.js ?
Any links or examples would help
I don't want standard layouts d3 uses , want to write my own .
How to create custom layout in d3.js ?
Any links or examples would help
I don't want standard layouts d3 uses , want to write my own .
A layout function could be a simple function that assign coordinates (and any additional data for the drawing like startAngle, endAngle, ...) to your data, and then return an array for the list of nodes. A quick example:
This is the basic bare bone approach. If you want to follow d3's own code structure, the layout would return a function that does the same as above, but has additional functions to configure it: