D3| Treemap help


Looking for help to pass the Test case #6 “The area of each tile should correspond to the data-value amount: tiles with a larger data-value should have a bigger area”. of treemap project.
Also, the text of a tile is overlapping even after using tspan to wrap a long movie name.
Please find code at below link.
D3| Treemap|Test case #6 issue

I have checked the below discussion but it did not resolve my issue.


Finally I found what I was doing wrong. I used padding inner on tiles to show the gap between them. Instead we should use ‘stroke’ attribute to show outline around tile. Also remove the round(true) which causes issue while calculating the area of tile.

It took so much time but glad its resolved now.

1 Like