Autofit The Size Of D3js Graph In A Simple Html Page
This question is originated as per the suggestion given here. As per the suggested edits to fix the issue of first node being cut off, the code looks like follows:
Solution 1:
You can regulate the width of the tree to draw into smaller space:
So this code
var tree = d3.cluster()
.size([height, width - 160]);
make it this:
var tree = d3.cluster()
.size([height, width - 360]);//reducing the width of the tree by 200
This should give more space for the labels.
working example here
Post a Comment for "Autofit The Size Of D3js Graph In A Simple Html Page"