How to use the d3-hierarchy.treemapResquarify.ratio function in d3-hierarchy

To help you get started, we’ve selected a few d3-hierarchy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spotify / reactochart / src / TreeMap.js View on Github external
function getTree(options) {
  const { width, height, ratio, round, padding } = options;
  const tiling = !isUndefined(ratio)
    ? treemapResquarify.ratio(ratio)
    : treemapResquarify;
  const tree = treemap()
    .tile(tiling)
    .size([width, height]);
  if (!isUndefined(padding)) tree.paddingOuter(padding);
  if (!isUndefined(round)) tree.round(round);
  return tree;
}