Treemap Diagram - test 6 failing

It’s strange, test 6 fails but only when I load the Movies data. With both the Kickstarter and Video Games data all tests are passing, so this is bugging me.

This is my code:

Thanks in advance.

There’s at least two parts to the problem.

First, there are two identical entries for “The Twilight Saga: Breaking Dawn - Part 2” in the data set. There should be only one.

Second, in the creation of the treemap, the two corresponding tiles are assigned slightly different floating point values for the width and height and hence have a different area. The test sorts these according to data-value and the larger one is getting sorted where the smaller one should be. The test is not designed for duplicate data and is performing a strict greater than or equal comparison and is not allowing for small differences between tile areas on the order of the floating point error.

You have no control over any of this. One or both of these should probably be reported as an issue. However, I seem to remember encountering a similar problem and I thought that I circumvented it by changing the padding parameters with d3.treemap() but I can’t verify that (I didn’t change the dataset). I would suggest testing some of those padding parameters, changing the size of the treemap area, and removing any tile or cell related CSS to see if you can work around the problem because it can work, it just doesn’t always work due to the duplicate data.

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