Skip to content

Naming non-leaf boxes for later use #2

@AlainRo

Description

@AlainRo

Very useful idea and code. Thanks.
I got several applications. One of them needs to "do something" with non-leaf boxes which do not really exist apart from their size.

I propose to optionally name them :
var layout = {orientation: "vertical", children: [...], size: 2, name: "myname"}

One line of code is enough to allow this:

  • 87 if (child.name) {result[child.name] = childBox; result[child.name].leaf= false;};

The returned object now contains the non-leaf box with its own attributes x, y, width, height + leaf flag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions