Skip to content

Undesirable padding behaviour with disparately sized children #175

Open
@russss

Description

@russss

I'm fairly new to d3, so forgive me if I'm wildly wrong here...

I've got a treemap which looks like this:

image

Note that the brown category at the bottom right is quite small compared to all the others.

I'd like to add 25px of paddingTop so that I can add titles to these categories, but when I do so, the brown category is unfortunately squashed to 1px high:

image

I don't entirely understand what's going on here, but it looks like the layout algorithm (I'm using the default in this case, but others are similarly bad) is stealing the same constant amount of padding space from each child, when I guess it should be proportionally taken from (in this case) all of the children in the same vertical column.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions