Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

137
Views
Carámbano vertical en D3

Necesito rotar este carámbano de forma vertical (arriba-abajo): https://observablehq.com/@d3/zoomable-icicle . La primera opción de pantalla funciona, pero cuando hice clic en el elemento, falla. Los siguientes cambios funcionaron:

 .attr("transform", d => "translate(" + d.x0 + "," + d.y0 + ")"); .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); }

Tengo problemas para rotar el zoom o hacer clic en la función:

 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); }

He intentado invertir x e y. Cambié la función a:

 function clicked(p) { focus = focus === p ? p = p.parent : p; root.each(d => d.target = { y1: (d.y0 - p.y0) / (p.y1 - p.y0) * width, y0: (d.y1 - p.y0) / (p.y1 - p.y0) * width, x1: d.x0 - p.x0, x0: d.x1 - p.x0 }); 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); }

Sigue sin funcionar, no se que mas hacer.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Aquí hay una bifurcación de ese cuaderno Observable que muestra cómo hacer esto.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!