How to use the d3-hierarchy.treemapBinary 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 DefinitelyTyped / DefinitelyTyped / types / d3-hierarchy / d3-hierarchy-tests.ts View on Github external
return node.x0 > 10 ? 2 : 1;
});

numberRectangularNodeAccessor = treemapLayout.paddingLeft();


// Use treemap layout generator ==========================================

let treemapRootNode: d3Hierarchy.HierarchyRectangularNode;

treemapRootNode = treemapLayout(stratifiedRootNode);


// Tiling functions ======================================================

tilingFn = d3Hierarchy.treemapBinary;

tilingFn = d3Hierarchy.treemapDice;

tilingFn = d3Hierarchy.treemapSlice;

tilingFn = d3Hierarchy.treemapSliceDice;

// Tiling Factory functions treemapSquarify() and treemapResquarify() ====

let tilingFactoryFn: d3Hierarchy.RatioSquarifyTilingFactory;

tilingFactoryFn = d3Hierarchy.treemapSquarify;
tilingFactoryFn = d3Hierarchy.treemapSquarify.ratio(2);

treemapLayout.tile(d3Hierarchy.treemapSquarify.ratio(2));
github DefinitelyTyped / DefinitelyTyped / d3-hierarchy / d3-hierarchy-tests.ts View on Github external
return node.x0 > 10 ? 2 : 1;
});

numberRectangularNodeAccessor = treemapLayout.paddingLeft();


// Use treemap layout generator ==========================================

let treemapRootNode: d3Hierarchy.HierarchyRectangularNode;

treemapRootNode = treemapLayout(stratifiedRootNode);


// Tiling functions ======================================================

tilingFn = d3Hierarchy.treemapBinary;

tilingFn = d3Hierarchy.treemapDice;

tilingFn = d3Hierarchy.treemapSlice;

tilingFn = d3Hierarchy.treemapSliceDice;

// Tiling Factory functions treemapSquarify() and treemapResquarify() ====

let tilingFactoryFn: d3Hierarchy.RatioSquarifyTilingFactory;

tilingFactoryFn = d3Hierarchy.treemapSquarify;
tilingFactoryFn = d3Hierarchy.treemapSquarify.ratio(2);

treemapLayout.tile(d3Hierarchy.treemapSquarify.ratio(2));
github plotly / plotly.js / src / traces / treemap / partition.js View on Github external
function getTilingMethod(key, squarifyratio) {
    switch(key) {
        case 'squarify':
            return d3Hierarchy.treemapSquarify.ratio(squarifyratio);
        case 'binary':
            return d3Hierarchy.treemapBinary;
        case 'dice':
            return d3Hierarchy.treemapDice;
        case 'slice':
            return d3Hierarchy.treemapSlice;
        default: // i.e. 'slice-dice' | 'dice-slice'
            return d3Hierarchy.treemapSliceDice;
    }
}