D3 treemap sizing

Hi,

I’m currently working on my D3 treemap project.
my codepen: https://codepen.io/tlaschkolnig/pen/qBQGYVN?editors=1111
All the tests regarding the actual tiles for it are passing with the exception of the sizing.
I even changed the width and height of the treemap to match the one in the example, and comparing it, it fits in about 80-90% of the places seemingly perfectly. (i.e. the wii section seems to be 100% right)
however, there are just a few small differences, for example, in the DS section, where the part on the right is arranged slightly different.

given how it is correct in a lot of places, im kinda stumped as to where the error lies here, even when comparing to others doing this project. does anybody have any hints as to what potentially could be the problem with it?

Thank you very much for your help, I appreciate any and all help.

Hola @tim-la

No te se decir exactamente cual es la causa del error, ya que en mi proyecto, dependiendo del tamaño de la ventana del navegador, tambien llega a fallar esa prueba.

En tu caso creo que el error lo genera el padding que utilizas para separar la informacion de las diferentes consolas, si eliminas la linea 42 del codigo la prueba pasa.

  const treemap = d3.treemap()
                    .size([width, height])
                    .padding(1)
                    (root)
  const treemap = d3.treemap()
                    .size([width, height])
                    (root)

Espero te sirva de algo.

Saludos

1 Like

Thank you, that fixed it, I appreciate your help. hope you have a great day.

muchas gracias

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