d3 / d3

Bring data to life with SVG, Canvas and HTML. :bar_chart::chart_with_upwards_trend::tada:

Home Page:https://d3js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I can't understand how the squarifyRatio works

officialBusiness opened this issue · comments

d3-hierarchy => treemap => squarify.js

I don't know what alpha and bata mean, why alpha is Math.max(dy / dx, dx / dy) / (value * ratio) and beta is sumValue * sumValue * alpha.
I also want to know why ratio is Math.max(maxValue / beta, beta / minValue)
I've learn about squarify's algorithm briefly, but I don't understand how your code implements the length allocation of child nodes on an edge.
I'm tired. hlep