Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The treemap builder should support multiple types of nodes #1002

Closed
seandenigris opened this issue Aug 3, 2015 · 1 comment
Closed

The treemap builder should support multiple types of nodes #1002

seandenigris opened this issue Aug 3, 2015 · 1 comment

Comments

@seandenigris
Copy link
Contributor

Originally reported on Google Code with ID 1002

TreeMaps are particularly useful to show leaf nodes within a nested parent nodes tree.
For example, they can show classes within packages. They are less useful for showing
only one type of nodes, like a class hierarchy given that the weight is only meaningful
when applied to the leaf nodes.

However, right now, we can specify nodes only with one block, weight with one block
only and edges with another one block. This is less convenient. We should extend this
to allow multiple sets of nodes.

Consider this code:

packages := RPackageOrganizer default packages select: [:each | each name beginsWith:
'AST'].
classes := packages flatCollect: [:each | each definedClasses ].
...
builder weightBlock: [ :el | el isBehavior ifTrue: [ el linesOfCode + 1] ifFalse: [
1 ] ].
builder nodes: (packages), (classes).
builder nestingFromAssociations: (
    (builder nodes select: [ :each | each isBehavior ])
        collect: [ :each | 
            (each) -> each package ]).
builder drawOn: rawView .

It would be better to have it like:

builder weight: [ :el | el linesOfCode + 1] ].
builder nodes: classes.
builder nodes: packages
builder nest: classes in: [ :each | each package ].
builder drawOn: rawView .

Note how nesting is defined following the same pattern as edges:from:to:, and how the
weight is only applied to the next nodes.

Reported by tudor@tudorgirba.com on 2013-11-15 05:24:32

@seandenigris
Copy link
Contributor Author

Reported by tudor@tudorgirba.com on 2014-11-02 18:56:09

  • Status changed: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant