Treemap project problems


(solved for now, I leave my question for the next person)

I’m wondering what is wrong in my treemap.
I’m assuming the .sum function traverses the dataset, like .data , but I don’t see any x0 x1 ,y0 and y1 values for all the nodes ?

Because when I console.log(root) in line 52, it shows no depth or height to the tree. And I only see one x1,x0,y0,y1 set of values.

I rather fix any errors now before continuing.
I tried adding the rects, but it just looks like one big rectangle.

Here’s my codepen:


Never mind, I figured out I need the json object as is, I was converting it into an array.

Hi all .
All tests pass, so I’m happy about that.
But I’ve been unable to finish it entirely due to the fact that the link is not working.
I only added one, for the moment.
I used this tutorial as a guide :

Also, I’ve been unable to add a little space to the left of the legend from the svg left side?
I tried in css , with the usual position:relative, left: 25px , and tried in d3 with .style(“left”, 20+“px”) ,none of which worked.

I still have to add text to the rects, but just wanted the tests to pass

Also, btw, when will the certificate for this course be visible?
I submitted the last project last night.


This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.