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.
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.
Wow, thanks for that answer raphaeluziel! I always find it interesting how one’s solution can ‘appear’ completely right, but fail tests because of something happening in the background that only matters for the sake of the tests. This fixed my #5 and #6 right up.
@raphaeluziel, thanks for the help! Your solution cleared it right up (though for some reason all my text is now invisible, but I’ll look into it). Not sure how I missed this since I used root.leaves() later in my code already