Debo poner el icicle plot en vertical. Actualmente utilizo el código base de https://observablehq.com/@d3/zoomable-icicle. Sin embargo no logro hacer el zoom bien al darle click al sector. Utilizo transform como
.attr("transform", d => "translate(" + d.x0 + "," + d.y0 + ")");
También intercambié las x y y de casi todo el código
.attr("width", d => d.x1 - d.x0 - 1)
.attr("height", d => rectHeight(d))
function rectHeight(d) {
return d.y1 - d.y0 - Math.min(1, (d.y1 - d.y0) / 2);
}
Al utilizar y hacer lo mismo, la figura se pierde. Actualmente la función clicked la tengo como: function clicked(p) { focus = focus === p ? p = p.parent : p;
root.each(d => d.target = {
x0: (d.x0 - p.x0) / (p.x1 - p.x0) * height,
x1: (d.x1 - p.x0) / (p.x1 - p.x0) * height,
y0: d.y0 - p.y0,
y1: d.y1 - p.y0
});
const t = cell.transition().duration(750)
.attr("transform", d => "translate(" + d.target.x0 + "," + d.target.y0 + ")");
rect.transition(t).attr("height", d => rectHeight(d.target));
text.transition(t).attr("fill-opacity", d => +labelVisible(d.target));
tspan.transition(t).attr("fill-opacity", d => labelVisible(d.target) * 0.7);
}
Ayuda por favor
(No se puede continuar esta discusión porque tiene más de dos meses de antigüedad. Si tienes dudas parecidas, abre un nuevo hilo.)