Thanks to visit codestin.com
Credit goes to github.com

Skip to content

include a shortcut for largestRect label placement #754

@davelandry

Description

@davelandry
.shapeConfig({
    label: d => d.id,
    labelBounds: (d, i, s) => {

        const poly = d3plus.largestRect(s.points);

        return poly ? {
            x: poly.cx - poly.width / 2,
            y: poly.cy - poly.height / 2,
            width: poly.width,
            height: poly.height
        } : null;

    }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions