Excellent job, Milton!
I reviewed the code and it looks good. You just made the code twice faster :).
Now, we need to refine a bit the API:
- We should have a variation of explore:using: that allows a collection as a starting
point. In this case, we should create a fake root object with the collection.
- I would more prefer something like buildFrom:using: or from:using:. Then we can have
buildFromAll:using: or fromAll:using:.
Could you look at this as well?
Cheers,
Doru
On Thu, Oct 30, 2014 at 9:16 PM, milton mamani
<akevalion(a)gmail.com> wrote:
Hi Tudor
I update the TreeMapBuilder in order to explore nodes of one tree similar to Sunburst.
The next two images show the execution of this code:
MessageTally on: [
b := RTTreeMapBuilder new.
b
extent: 400@400;
weight: [:n | n].
b explore: 1
using: [:n |
n >= 10000
ifTrue: [ { } ]
ifFalse: [ (n*10 to: (n+1) * 10 - 1) ]].
b open ]
<image.png>
<image.png>
Cheers,
Milton
2014-10-30 7:25 GMT-03:00 Tudor Girba <tudor(a)tudorgirba.com>om>:
> Hi Milton,
>
> I cannot see the pictures that you sent, but I did try your algorithm and it does not
solve yet the original problem.
>
> Try this:
> MessageTally on: [
> b := RTTreeMapBuilder new.
> b
> extent: 400@400;
> weight: [:n | n].
> b explore: 1
> using: [:n |
> n >= 10000
> ifTrue: [ { } ]
> ifFalse: [ (n*10 to: (n+1) * 10 - 1) ]].
> b open ]
>
>
> On my machine it takes some 10s, and half of it is spent on buildEdges (see the
attached picture).
> <tally-explore-using.png>
>
> This part we can dramatically optimize by simply creating the nodes during the
createNodes:using: instead of creating edges only to afterwards look them up. For this,
you would need to extend the recursive traversal by also passing on the parent node so
that you can create directly children of it.
> The Sunburst version does that. For example, this:
>
> MessageTally on: [
> b := RTSunburstBuilder new.
> b explore: 1
> using: [:n |
> n >= 10000
> ifTrue: [ { } ]
> ifFalse: [ (n*10 to: (n+1) * 10 - 1) ]].
>
> b open ]
>
> shows that the traversal is much faster (some 150ms).
>
> Could you try to implement like that?
>
>
> Cheers,
> Doru
>
>
>
>> On Wed, Oct 29, 2014 at 10:46 PM, milton mamani <akevalion(a)gmail.com>
wrote:
>> I update the code of RTTreeMapBulder to get this:
>>
>>
>> | b |
>> b := RTTreeMapBuilder new.
>> b
>> extent: 400@400;
>> nodes: (RTShape withAllSubclasses);
>> edgesFrom: #superclass toAll: #yourself;
>> weight: [:el | el numberOfMethods ].
>>
>> b shape
>> if: [ :cls| Smalltalk includesKey: (cls name,'Test') asSymbol ]
fillColor: Color lightGreen;
>> if: [ :cls | cls name endsWith: 'Line' ] fillColor: Color purple;
>> if: [ :cls | cls hasAbstractMethods ] fillColor: Color red.
>> b popup text: [ :cls | cls name, ' number of methods: ', cls
numberOfMethods asString ].
>> b open.
>>
>>
>>
>> This is now in Roassal repository.
>>
>> You can also build something like this:
>>
>> | b |
>> b := RTTreeMapBuilder new.
>> b
>> extent: 400@400;
>> weight: [:m | m tally ].
>> b explore: (MessageTally new
>> spyEvery: 1
>> on: [Nautilus open]; yourself)
>> using: #children.
>>
>> b open.
>>
>>
>>
>> Cheers,
>> Milton
>>
>> 2014-10-29 15:49 GMT-03:00 Tudor Girba <tudor(a)tudorgirba.com>om>:
>>
>>> I believe the idea of the API is to simulate the Mondrian API, but it does
not make much sense in the context of the treemap because we only need to build a tree, so
we do not need to provide a mechanism with which to build a graph.
>>>
>>> Actually more than half of the time is being spent on precisely constructing
the tree. We should simply have a construct that acts like we have in the DeepTraverser:
>>>
http://www.humane-assessment.com/blog/traversal-enabled-pharo-objects/
>>>
>>> Cheers,
>>> Doru
>>>
>>>
>>>
>>>> On Wed, Oct 29, 2014 at 7:42 PM, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
>>>> I do not understand how it works.
>>>> I tried the following:
>>>> | b |
>>>> b := RTTreeMapBuilder new.
>>>> b
>>>> extent: 400@400;
>>>> nodes: (RTShape withAllSubclasses);
>>>> edges: #superclass;
>>>> weight: [:el | el numberOfMethods ].
>>>>
>>>> b build
>>>>
>>>> Apparently edges is not well specified. What I should provide in edges?
>>>>
>>>> Alexandre
>>>>
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel
http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>> On Oct 29, 2014, at 12:44 PM, milton mamani
<akevalion(a)gmail.com> wrote:
>>>>>
>>>>> The code is now in Roassal2 repository
>>>>>
>>>>> 2014-10-29 4:27 GMT-03:00 Tudor Girba <tudor(a)tudorgirba.com>om>:
>>>>>> Where is the code?
>>>>>>
>>>>>> Doru
>>>>>>
>>>>>>> On Wed, Oct 29, 2014 at 2:55 AM, Tudor Girba
<tudor(a)tudorgirba.com> wrote:
>>>>>>> Great. I will look at it tomorrow. I am also interested in
the time complexity.
>>>>>>>
>>>>>>> Doru
>>>>>>>
>>>>>>> --
>>>>>>>
www.tudorgirba.com
>>>>>>>
>>>>>>> "Every thing has its own flow"
>>>>>>>
>>>>>>> > On 28 Oct 2014, at 21:40, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
>>>>>>> >
>>>>>>> > Can someone have a look at this?
>>>>>>> >
>>>>>>> > Cheers,
>>>>>>> > Alexandre
>>>>>>> >
>>>>>>> >
>>>>>>> >> On Oct 28, 2014, at 5:14 PM, milton mamani
<akevalion(a)gmail.com> wrote:
>>>>>>> >>
>>>>>>> >> Hi,
>>>>>>> >>
>>>>>>> >> I been working in RTTreeMapBuilder,
>>>>>>> >>
>>>>>>> >> Try to run the next piece of code
>>>>>>> >>
>>>>>>> >> .=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
>>>>>>> >> | b |
>>>>>>> >> b := RTTreeMapBuilder new.
>>>>>>> >> b
>>>>>>> >> extent: 400@400;
>>>>>>> >> nodes: (1 to: 76);
>>>>>>> >> edges: ((1 to: 76) collect: [:n | (n //10) ->
n]);
>>>>>>> >> weight: [:n | n].
>>>>>>> >> b shape
>>>>>>> >> if: [:n | n even ] fillColor: Color lightGray;
>>>>>>> >> if: [ :n | n odd ] fillColor: Color purple.
>>>>>>> >>
>>>>>>> >> b open.
>>>>>>> >> .=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=
>>>>>>> >>
>>>>>>> >> to get this preatty visualization.
>>>>>>> >>
>>>>>>> >> <image.png>
>>>>>>> >>
>>>>>>> >> Let me know what you think about it
>>>>>>> >>
>>>>>>> >> Cheers,
>>>>>>> >> Milton
>>>>>>> >>
>>>>>>> >> 2014-10-28 14:41 GMT-03:00 Tudor Girba
<tudor(a)tudorgirba.com>om>:
>>>>>>> >> Great. This is the only missing thing :)
>>>>>>> >>
>>>>>>> >> Cheers,
>>>>>>> >> Doru
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> On Tue, Oct 28, 2014 at 1:28 PM, Alexandre Bergel
<alexandre.bergel(a)me.com> wrote:
>>>>>>> >> Just to let you know that we are working with Milton
on a new treemap.
>>>>>>> >>
>>>>>>> >> Cheers,
>>>>>>> >> Alexandre
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>> On Oct 22, 2014, at 1:14 AM, Tudor Girba
<tudor(a)tudorgirba.com> wrote:
>>>>>>> >>>
>>>>>>> >>> We "just" need a treemap :)
>>>>>>> >>>
>>>>>>> >>> Doru
>>>>>>> >>>
>>>>>>> >>> On Wed, Oct 22, 2014 at 2:24 AM, Alexandre
Bergel <alexandre.bergel(a)me.com> wrote:
>>>>>>> >>> Ok, we will pay attention to this
>>>>>>> >>>
>>>>>>> >>> Alexandre
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>> On Oct 21, 2014, at 5:24 PM, Tudor Girba
<tudor(a)tudorgirba.com> wrote:
>>>>>>> >>>>
>>>>>>> >>>>
http://www.humane-assessment.com/blog/system-nesting-map
>>>>>>> >>>>
>>>>>>> >>>> Doru
>>>>>>> >>>>
>>>>>>> >>>> On Tue, Oct 21, 2014 at 10:17 PM, Alexandre
Bergel <alexandre.bergel(a)me.com> wrote:
>>>>>>> >>>> What is SystemNesting ?
>>>>>>> >>>>
>>>>>>> >>>> Alexandre
>>>>>>> >>>> --
>>>>>>> >>>>
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>>>> >>>> Alexandre Bergel
http://www.bergel.eu
>>>>>>> >>>>
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>> On Oct 19, 2014, at 4:24 PM, Tudor Girba
<tudor(a)tudorgirba.com> wrote:
>>>>>>> >>>>>
>>>>>>> >>>>> Hi,
>>>>>>> >>>>>
>>>>>>> >>>>> There are only a couple of things left
to do in the migration:
>>>>>>> >>>>> - Fix the UML diagram to properly show
attributes (we need another transformation to show the name of an attribute)
>>>>>>> >>>>> - Reimplement a treemap visualization in
Roassal2 and have the SystemNesting ported to it
>>>>>>> >>>>> - Reimplement the
GLMBrowser>>viewTree visualization
>>>>>>> >>>>>
>>>>>>> >>>>> Anyone interested in helping?
>>>>>>> >>>>>
>>>>>>> >>>>> Just a reminder: these are pretty much
the main things that are still left to do in order for us to release Moose 5. Once we
release it, we can move to Pharo 4 and benefit from a larger exposure and feedback for all
the tools built around Moose.
>>>>>>> >>>>>
>>>>>>> >>>>> Cheers,
>>>>>>> >>>>> Doru
>>>>>>> >>>>>
>>>>>>> >>>>>
>>>>>>> >>>>> --
>>>>>>> >>>>>
www.tudorgirba.com
>>>>>>> >>>>>
>>>>>>> >>>>> "Every thing has its own
flow"
>>>>>>> >>>>>
_______________________________________________
>>>>>>> >>>>> Moose-dev mailing list
>>>>>>> >>>>> Moose-dev(a)iam.unibe.ch
>>>>>>> >>>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
_______________________________________________
>>>>>>> >>>> Moose-dev mailing list
>>>>>>> >>>> Moose-dev(a)iam.unibe.ch
>>>>>>> >>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>>
>>>>>>> >>>> --
>>>>>>> >>>>
www.tudorgirba.com
>>>>>>> >>>>
>>>>>>> >>>> "Every thing has its own flow"
>>>>>>> >>>>
_______________________________________________
>>>>>>> >>>> Moose-dev mailing list
>>>>>>> >>>> Moose-dev(a)iam.unibe.ch
>>>>>>> >>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>>
>>>>>>> >>> --
>>>>>>> >>>
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>>>> >>> Alexandre Bergel
http://www.bergel.eu
>>>>>>> >>>
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>> _______________________________________________
>>>>>>> >>> Moose-dev mailing list
>>>>>>> >>> Moose-dev(a)iam.unibe.ch
>>>>>>> >>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>>
>>>>>>> >>> --
>>>>>>> >>>
www.tudorgirba.com
>>>>>>> >>>
>>>>>>> >>> "Every thing has its own flow"
>>>>>>> >>> _______________________________________________
>>>>>>> >>> Moose-dev mailing list
>>>>>>> >>> Moose-dev(a)iam.unibe.ch
>>>>>>> >>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>>>> >> Alexandre Bergel
http://www.bergel.eu
>>>>>>> >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> _______________________________________________
>>>>>>> >> Moose-dev mailing list
>>>>>>> >> Moose-dev(a)iam.unibe.ch
>>>>>>> >>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> --
>>>>>>> >>
www.tudorgirba.com
>>>>>>> >>
>>>>>>> >> "Every thing has its own flow"
>>>>>>> >>
>>>>>>> >> _______________________________________________
>>>>>>> >> Moose-dev mailing list
>>>>>>> >> Moose-dev(a)iam.unibe.ch
>>>>>>> >>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >>
>>>>>>> >>
>>>>>>> >> _______________________________________________
>>>>>>> >> Moose-dev mailing list
>>>>>>> >> Moose-dev(a)iam.unibe.ch
>>>>>>> >>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>> >
>>>>>>> > --
>>>>>>> > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>>>> > Alexandre Bergel
http://www.bergel.eu
>>>>>>> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> >
>>>>>>> > _______________________________________________
>>>>>>> > Moose-dev mailing list
>>>>>>> > Moose-dev(a)iam.unibe.ch
>>>>>>> >
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>>
www.tudorgirba.com
>>>>>>
>>>>>> "Every thing has its own flow"
>>>>>>
>>>>>> _______________________________________________
>>>>>> Moose-dev mailing list
>>>>>> Moose-dev(a)iam.unibe.ch
>>>>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> Moose-dev(a)iam.unibe.ch
>>>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> Moose-dev(a)iam.unibe.ch
>>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>>
>>>
>>> --
>>>
www.tudorgirba.com
>>>
>>> "Every thing has its own flow"
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> Moose-dev(a)iam.unibe.ch
>>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> Moose-dev(a)iam.unibe.ch
>>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
> --
>
www.tudorgirba.com
>
> "Every thing has its own flow"
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch