500 000 elements in Roassal [we made it :-) ]

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

500 000 elements in Roassal [we made it :-) ]

abergel
Hi!

Just to share our latest feature. 
We have implemented a simple mechanism in Roassal to prevent the environment to be sluggish with many elements.

The class RTCache has the effect to remove the elements from a view, create a bitmap from them, and add the bitmap to the view. Simple and effective.
Consider the following script:

-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
v := RTView new.
v @ RTDraggableView.

colors := ColorPalette qualitative colors: 8 scheme:'Set1'.

elements := (RTEllipse new color: [ :aValue | colors atRandom alpha: 0.01 ]; size: #yourself) elementsOn: ((1 to: 500000) collect: [ :vv | 10 atRandom + 5 ]).
elements do: [ :e | e translateTo: 500 atRandom @ 500 atRandom ].
v addAll: elements.

RTCache new cacheView: v.
v
-=-=—=-=-=—=-=-=—=-=-=—=-=-=—=

Without the line "RTCache new cacheView: v.” Pharo would be completely unresponsive. 500 000 elements is quite a lot.


The drawback is that all interaction with the elements are lost. I have some idea on how to add them back. We will work on this in future work.

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: 500 000 elements in Roassal [we made it :-) ]

Offray
Clever! I'll be waiting for your idea on how to bring interaction
back... I imagine something like coordinates on the bitmap to get the
back elements as object again... Anyway surely will be an interesting
solution, like this one.

Cheers,

Offray

El 18/03/15 a las 08:03, Alexandre Bergel escribió:

> Hi!
>
> Just to share our latest feature.
> We have implemented a simple mechanism in Roassal to prevent the environment to
> be sluggish with many elements.
>
> The class RTCache has the effect to remove the elements from a view, create a
> bitmap from them, and add the bitmap to the view. Simple and effective.
> Consider the following script:
>
> -=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
> v := RTView new.
> v @ RTDraggableView.
>
> colors := ColorPalette qualitative colors: 8 scheme:'Set1'.
>
> elements := (RTEllipse new color: [ :aValue | colors atRandom alpha: 0.01 ];
> size: #yourself) elementsOn: ((1 to: 500000) collect: [ :vv | 10 atRandom + 5 ]).
> elements do: [ :e | e translateTo: 500 atRandom @ 500 atRandom ].
> v addAll: elements.
>
> RTCache new cacheView: v.
> v
> -=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
>
> Without the line "RTCache new cacheView: v.” Pharo would be completely
> unresponsive. 500 000 elements is quite a lot.
>
>
> The drawback is that all interaction with the elements are lost. I have some
> idea on how to add them back. We will work on this in future work.
>
> Cheers,
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: 500 000 elements in Roassal [we made it :-) ]

Offray


El 18/03/15 a las 10:26, Offray Vladimir Luna Cárdenas escribió:
> Clever! I'll be waiting for your idea on how to bring interaction
> back... I imagine something like coordinates on the bitmap to get the
> back elements as object again... Anyway surely will be an interesting
> solution, like this one.
>


I mean the one you are propossing with RTCache, not the one I just told :-P

Offray

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: 500 000 elements in Roassal [we made it :-) ]

philippeback
In reply to this post by Offray
Yes, very nice!

This is opening doors...

Phil

On Wed, Mar 18, 2015 at 4:26 PM, Offray Vladimir Luna Cárdenas
<[hidden email]> wrote:

> Clever! I'll be waiting for your idea on how to bring interaction back... I
> imagine something like coordinates on the bitmap to get the back elements as
> object again... Anyway surely will be an interesting solution, like this
> one.
>
> Cheers,
>
> Offray
>
> El 18/03/15 a las 08:03, Alexandre Bergel escribió:
>>
>> Hi!
>>
>> Just to share our latest feature.
>> We have implemented a simple mechanism in Roassal to prevent the
>> environment to
>> be sluggish with many elements.
>>
>> The class RTCache has the effect to remove the elements from a view,
>> create a
>> bitmap from them, and add the bitmap to the view. Simple and effective.
>> Consider the following script:
>>
>> -=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
>> v := RTView new.
>> v @ RTDraggableView.
>>
>> colors := ColorPalette qualitative colors: 8 scheme:'Set1'.
>>
>> elements := (RTEllipse new color: [ :aValue | colors atRandom alpha: 0.01
>> ];
>> size: #yourself) elementsOn: ((1 to: 500000) collect: [ :vv | 10 atRandom
>> + 5 ]).
>> elements do: [ :e | e translateTo: 500 atRandom @ 500 atRandom ].
>> v addAll: elements.
>>
>> RTCache new cacheView: v.
>> v
>> -=-=—=-=-=—=-=-=—=-=-=—=-=-=—=
>>
>> Without the line "RTCache new cacheView: v.” Pharo would be completely
>> unresponsive. 500 000 elements is quite a lot.
>>
>>
>> The drawback is that all interaction with the elements are lost. I have
>> some
>> idea on how to add them back. We will work on this in future work.
>>
>> Cheers,
>> Alexandre
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev