TreeMap Test #5 & #6

TreeMap Test #5 & #6
0

#1

Hello,

I’m having trouble passing tests #5 & #6 for my TreeMap project.

For test #5 (Each tile should have the properties “data-name”, “data-category”, and “data-value” containing their corresponding name, category, and value) when I inspect each ‘rect’ I can see each property with it’s associated value. I can’t figure out why it won’t pass when those values are there.

For test #6 (The area of each tile should correspond to the data-value amount: tiles with a larger data-value should have a bigger area) it’s working visually, but I’m not sure why it won’t pass the test.

Here is a link to my Codepen: https://codepen.io/ttstauss/pen/OoBZmR

Any help would be appreciated!

Thanks,
Taylor


#2

I am having exactly the same problem. Can anybody help? It really a pain because as he say when inspecting the rect has these “data” properties


#3

take a look at here D3 TreeMap Diagram - Test #6 won't pass


#4

Hi,

Any news on this? It seems that I have exactly same issue.


#5

Taylor, I think the problem is that in line 66 you’re using root.descendants() which includes the upper level categories (Wii, X360), so when the test looks for a data-name, for example, it will find it blank, since only the deeper level (the leaves) will have them. I used root.leaves() instead of root.descendants(), and it passed all tests. However, this change will cause labels to disappear unless you adjust the part of your code that hides labels. I also could not see the legend displayed, but I think I might know why. Hope this helps you too, ededals.