Looks good to me. Maybe you could have in addition to DFTreeMapBuilder>>associations: something DFTreeMapBuilder>>parent: aBlockOrASymbol
Also, something very important that I forgot to mention, we need a method DFTreeMapBuilder>>drawOn: aROView
Like that, we should be able to have a treemap when using the mondrian builder. Using your example, we should have exactly the same result if we do: -=-=-=-=-=-=-=-=-=-=-=-= builder := DFTreeMapBuilder new. builder ... // your example here
view := ROView new. builder drawOn: view. view open -=-=-=-=-=-=-=-=-=-=-=-=
Cheers, Alexandre
On Oct 7, 2013, at 1:07 PM, "roberto.minelli@usi.ch" roberto.minelli@usi.ch wrote:
Hi,
I finished the first version of the new tree map builder for Roassal.
You can find the source code in my SmalltalkHub package 'DevFlow-View'!
Gofer new smalltalkhubUser: 'RobertoMinelli' project: 'DevFlow'; package: 'DevFlow-View'; load.
Here's an example usage:
builder := DFTreeMapBuilder new. builder weightBlock: [ :el | el ]. builder nodes: (1 to: 50). builder associations: (builder nodes allButFirst collect: [:each | (each // 2) -> each ]).
"Some optional configurations parameters" colors := Color white mix: Color blue shades: (builder nodes size). builder colorBlock: [ :el | colors at: el ]. builder rootColor: ((Color red) alpha: 0.5). builder inset: 5. builder extent: 500@300. builder origin: 10@30.
builder draw.
And the resulting tree map!
[cid:EC2669CC-CA97-4B81-8B1B-B792FBE1C04F@mobile.usilu.net]
Please tell me what do you think!
The next steps are:
- Add customizable interactions
- Remove z-ordering and use proper nesting
- Eventually unroll the recursion in the layout algorithm
Cheers, Roberto