Force based layout progress bar

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

Force based layout progress bar

Natalia Tymchuk
Hello.

As we all know Force based layout is quite slow. For example if I use it for more that 200 points it takes ages and during that time I’m not even sure if it works or no.
So I wonder maybe it will be better to draw progress bar during the time it works?
Thanks.

Best regards,
Natalia


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

Re: Force based layout progress bar

Peter Uhnak
Hi,

from what I've seen when digging through layouts, the slowest part is RTForceBasedLayout>>doExecute:, however there is whileTrue: loop so there is no knowing when it will stop.

So is there some "unknown status" progress bar? That would be useful here.

Because for example RTRectanglePackLayout uses do:displaingProgress: to show the progress, but it knows when it will end. That would have to be adapted for whileTrue: and unknown sizes.

Peter

On Tue, Apr 7, 2015 at 5:38 PM, Natalia Tymchuk <[hidden email]> wrote:
Hello.

As we all know Force based layout is quite slow. For example if I use it for more that 200 points it takes ages and during that time I’m not even sure if it works or no.
So I wonder maybe it will be better to draw progress bar during the time it works?
Thanks.

Best regards,
Natalia


_______________________________________________
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: Force based layout progress bar

Uko2
I thing that it makes sense to create execution indicator without progress (with spinner for example). It can’t be done easily now, but maybe in pharo 5 we can change how jobs are displayed.

One more progress that I want to have is to display a number of “steps". Sometimes number can increase, so progress bar is not really suitable, but we would be able to at least indicate the number of remaining steps.

Uko

On 07 Apr 2015, at 17:55, Peter Uhnák <[hidden email]> wrote:

Hi,

from what I've seen when digging through layouts, the slowest part is RTForceBasedLayout>>doExecute:, however there is whileTrue: loop so there is no knowing when it will stop.

So is there some "unknown status" progress bar? That would be useful here.

Because for example RTRectanglePackLayout uses do:displaingProgress: to show the progress, but it knows when it will end. That would have to be adapted for whileTrue: and unknown sizes.

Peter

On Tue, Apr 7, 2015 at 5:38 PM, Natalia Tymchuk <[hidden email]> wrote:
Hello.

As we all know Force based layout is quite slow. For example if I use it for more that 200 points it takes ages and during that time I’m not even sure if it works or no.
So I wonder maybe it will be better to draw progress bar during the time it works?
Thanks.

Best regards,
Natalia


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Force based layout progress bar

Uko2
In reply to this post by Peter Uhnak
I’ve checked the whileTrue:

What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.

Uko

On 07 Apr 2015, at 17:55, Peter Uhnák <[hidden email]> wrote:

Hi,

from what I've seen when digging through layouts, the slowest part is RTForceBasedLayout>>doExecute:, however there is whileTrue: loop so there is no knowing when it will stop.

So is there some "unknown status" progress bar? That would be useful here.

Because for example RTRectanglePackLayout uses do:displaingProgress: to show the progress, but it knows when it will end. That would have to be adapted for whileTrue: and unknown sizes.

Peter

On Tue, Apr 7, 2015 at 5:38 PM, Natalia Tymchuk <[hidden email]> wrote:
Hello.

As we all know Force based layout is quite slow. For example if I use it for more that 200 points it takes ages and during that time I’m not even sure if it works or no.
So I wonder maybe it will be better to draw progress bar during the time it works?
Thanks.

Best regards,
Natalia


_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Force based layout progress bar

Peter Uhnak
Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.

In any case, try replacing RTForceBasedLayout>>doExecute: with this

~~~~~~~~~~~~~~~~~~~~~~~~~
doExecute: nodeElements
self start: nodeElements.
[ :job |
job
title: 'Laying out elements';
min: 1 - alpha;
max: 1.
nbIterations = 0 
ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
] asJob run.
alpha := 0.
nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
~~~~~~~~~~~~~~~~~~~~~~~~~

it's bit messy (and doesn't account for nbIterations), but its a proof of concept.


I thing that it makes sense to create execution indicator without progress (with spinner for example)
 
What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.

Peter

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

Re: Force based layout progress bar

Peter Uhnak
And example

~~~~~~~~~~~~~~~~~~~~~~~~~
| v |
v := RTView new.
v addAll: ((RTEllipse new color: (Color red alpha: 0.3)) elementsOn: (1 to: 300)).
"RTRectanglePackLayout on: v elements."
RTForceBasedLayout on: v elements.
^ v
~~~~~~~~~~~~~~~~~~~~~~~~~

Peter

On Tue, Apr 7, 2015 at 10:04 PM, Peter Uhnák <[hidden email]> wrote:
Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.

In any case, try replacing RTForceBasedLayout>>doExecute: with this

~~~~~~~~~~~~~~~~~~~~~~~~~
doExecute: nodeElements
self start: nodeElements.
[ :job |
job
title: 'Laying out elements';
min: 1 - alpha;
max: 1.
nbIterations = 0 
ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
] asJob run.
alpha := 0.
nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
~~~~~~~~~~~~~~~~~~~~~~~~~

it's bit messy (and doesn't account for nbIterations), but its a proof of concept.


I thing that it makes sense to create execution indicator without progress (with spinner for example)
 
What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.

Peter


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

Re: Force based layout progress bar

abergel
In reply to this post by Peter Uhnak
Wow, I have never heard about this Job.
What is missing in your implementation?

Alexandre


> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>
> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>
> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> doExecute: nodeElements
> self start: nodeElements.
> [ :job |
> job
> title: 'Laying out elements';
> min: 1 - alpha;
> max: 1.
> nbIterations = 0
> ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
> ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
> ] asJob run.
> alpha := 0.
> nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>
> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>
>
> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>  
> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>
> Peter
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Force based layout progress bar

Tudor Girba-2
Yes. We have to replace MooseTask with Job.

Doru

On Wed, Apr 8, 2015 at 2:33 PM, Alexandre Bergel <[hidden email]> wrote:
Wow, I have never heard about this Job.
What is missing in your implementation?

Alexandre


> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>
> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>
> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> doExecute: nodeElements
>       self start: nodeElements.
>       [ :job |
>               job
>                       title: 'Laying out elements';
>                       min: 1 - alpha;
>                       max: 1.
>               nbIterations = 0
>                       ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>                       ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>       ] asJob run.
>       alpha := 0.
>       nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>
> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>
>
> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>
> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>
> Peter
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




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



--

"Every thing has its own flow"

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

Re: Force based layout progress bar

abergel
In reply to this post by Peter Uhnak
I have cleaned a bit your code with something like:

doExecute: nodeElements
        self start: nodeElements.
        self isJobInstalled
                ifTrue: [ self runLayoutInJob ]
                ifFalse: [ self runLayoutSimply ].
        alpha := 0.
        nodes do: [ :e | translator translateTopLeftOf: e to: e position ]

It is in version .816 of Roassal2.

We should be able to run the layout without job. This is important for us

Thanks!
Alexandre


> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>
> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>
> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> doExecute: nodeElements
> self start: nodeElements.
> [ :job |
> job
> title: 'Laying out elements';
> min: 1 - alpha;
> max: 1.
> nbIterations = 0
> ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
> ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
> ] asJob run.
> alpha := 0.
> nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>
> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>
>
> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>  
> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>
> Peter
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Force based layout progress bar

Tudor Girba-2
We need a better way of modeling that :)

Doru

On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
I have cleaned a bit your code with something like:

doExecute: nodeElements
        self start: nodeElements.
        self isJobInstalled
                ifTrue: [ self runLayoutInJob ]
                ifFalse: [ self runLayoutSimply ].
        alpha := 0.
        nodes do: [ :e | translator translateTopLeftOf: e to: e position ]

It is in version .816 of Roassal2.

We should be able to run the layout without job. This is important for us

Thanks!
Alexandre


> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>
> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>
> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~
> doExecute: nodeElements
>       self start: nodeElements.
>       [ :job |
>               job
>                       title: 'Laying out elements';
>                       min: 1 - alpha;
>                       max: 1.
>               nbIterations = 0
>                       ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>                       ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>       ] asJob run.
>       alpha := 0.
>       nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
> ~~~~~~~~~~~~~~~~~~~~~~~~~
>
> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>
>
> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>
> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>
> Peter
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

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




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



--

"Every thing has its own flow"

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

Re: Force based layout progress bar

abergel
An alternative is to have another subclass, such as RTForceBasedWithProgressBarLayout
But this is not idea, because the progress bar should be by default Pharo. And on VisualWorks no.

Another alternative, and the cleanest one I believe, is to have event generated to every X steps. You can have whatever you wish as a callback, moving the progress bar or not.

I have added an issue about this:
https://code.google.com/p/moose-technology/issues/detail?id=1119

Alexandre


> On Apr 8, 2015, at 9:50 AM, Tudor Girba <[hidden email]> wrote:
>
> We need a better way of modeling that :)
>
> Doru
>
> On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
> I have cleaned a bit your code with something like:
>
> doExecute: nodeElements
>         self start: nodeElements.
>         self isJobInstalled
>                 ifTrue: [ self runLayoutInJob ]
>                 ifFalse: [ self runLayoutSimply ].
>         alpha := 0.
>         nodes do: [ :e | translator translateTopLeftOf: e to: e position ]
>
> It is in version .816 of Roassal2.
>
> We should be able to run the layout without job. This is important for us
>
> Thanks!
> Alexandre
>
>
> > On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
> >
> > Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
> >
> > In any case, try replacing RTForceBasedLayout>>doExecute: with this
> >
> > ~~~~~~~~~~~~~~~~~~~~~~~~~
> > doExecute: nodeElements
> >       self start: nodeElements.
> >       [ :job |
> >               job
> >                       title: 'Laying out elements';
> >                       min: 1 - alpha;
> >                       max: 1.
> >               nbIterations = 0
> >                       ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
> >                       ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
> >       ] asJob run.
> >       alpha := 0.
> >       nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
> > ~~~~~~~~~~~~~~~~~~~~~~~~~
> >
> > it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
> >
> >
> > I thing that it makes sense to create execution indicator without progress (with spinner for example)
> >
> > What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
> > I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
> >
> > Peter
> > _______________________________________________
> > Moose-dev mailing list
> > [hidden email]
> > https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel  http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
> --
> www.tudorgirba.com
>
> "Every thing has its own flow"
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Force based layout progress bar

Uko2
How do they display progress in VW?

> On 08 Apr 2015, at 15:34, Alexandre Bergel <[hidden email]> wrote:
>
> An alternative is to have another subclass, such as RTForceBasedWithProgressBarLayout
> But this is not idea, because the progress bar should be by default Pharo. And on VisualWorks no.
>
> Another alternative, and the cleanest one I believe, is to have event generated to every X steps. You can have whatever you wish as a callback, moving the progress bar or not.
>
> I have added an issue about this:
> https://code.google.com/p/moose-technology/issues/detail?id=1119
>
> Alexandre
>
>
>> On Apr 8, 2015, at 9:50 AM, Tudor Girba <[hidden email]> wrote:
>>
>> We need a better way of modeling that :)
>>
>> Doru
>>
>> On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
>> I have cleaned a bit your code with something like:
>>
>> doExecute: nodeElements
>>        self start: nodeElements.
>>        self isJobInstalled
>>                ifTrue: [ self runLayoutInJob ]
>>                ifFalse: [ self runLayoutSimply ].
>>        alpha := 0.
>>        nodes do: [ :e | translator translateTopLeftOf: e to: e position ]
>>
>> It is in version .816 of Roassal2.
>>
>> We should be able to run the layout without job. This is important for us
>>
>> Thanks!
>> Alexandre
>>
>>
>>> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>>>
>>> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>>>
>>> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>>>
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>> doExecute: nodeElements
>>>      self start: nodeElements.
>>>      [ :job |
>>>              job
>>>                      title: 'Laying out elements';
>>>                      min: 1 - alpha;
>>>                      max: 1.
>>>              nbIterations = 0
>>>                      ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>>>                      ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>>>      ] asJob run.
>>>      alpha := 0.
>>>      nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>
>>> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>>>
>>>
>>> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>>>
>>> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
>>> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>>>
>>> Peter
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>>
>>
>> --
>> www.tudorgirba.com
>>
>> "Every thing has its own flow"
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> 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: Force based layout progress bar

abergel
No idea. We have a platform TRPlatform class that contains platform dependent features. Maybe we could include one to have platform. But I am afraid this may complexify the whole things if progress bars are radically different in VW.

Alexandre


> On Apr 8, 2015, at 10:38 AM, Yuriy Tymchuk <[hidden email]> wrote:
>
> How do they display progress in VW?
>
>> On 08 Apr 2015, at 15:34, Alexandre Bergel <[hidden email]> wrote:
>>
>> An alternative is to have another subclass, such as RTForceBasedWithProgressBarLayout
>> But this is not idea, because the progress bar should be by default Pharo. And on VisualWorks no.
>>
>> Another alternative, and the cleanest one I believe, is to have event generated to every X steps. You can have whatever you wish as a callback, moving the progress bar or not.
>>
>> I have added an issue about this:
>> https://code.google.com/p/moose-technology/issues/detail?id=1119
>>
>> Alexandre
>>
>>
>>> On Apr 8, 2015, at 9:50 AM, Tudor Girba <[hidden email]> wrote:
>>>
>>> We need a better way of modeling that :)
>>>
>>> Doru
>>>
>>> On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
>>> I have cleaned a bit your code with something like:
>>>
>>> doExecute: nodeElements
>>>       self start: nodeElements.
>>>       self isJobInstalled
>>>               ifTrue: [ self runLayoutInJob ]
>>>               ifFalse: [ self runLayoutSimply ].
>>>       alpha := 0.
>>>       nodes do: [ :e | translator translateTopLeftOf: e to: e position ]
>>>
>>> It is in version .816 of Roassal2.
>>>
>>> We should be able to run the layout without job. This is important for us
>>>
>>> Thanks!
>>> Alexandre
>>>
>>>
>>>> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>>>>
>>>> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>>>>
>>>> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>>>>
>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>> doExecute: nodeElements
>>>>     self start: nodeElements.
>>>>     [ :job |
>>>>             job
>>>>                     title: 'Laying out elements';
>>>>                     min: 1 - alpha;
>>>>                     max: 1.
>>>>             nbIterations = 0
>>>>                     ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>>>>                     ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>>>>     ] asJob run.
>>>>     alpha := 0.
>>>>     nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>
>>>> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>>>>
>>>>
>>>> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>>>>
>>>> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
>>>> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>>>>
>>>> Peter
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> [hidden email]
>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>
>>>
>>>
>>> --
>>> www.tudorgirba.com
>>>
>>> "Every thing has its own flow"
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> 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

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Force based layout progress bar

Thomas Brodt-2
There is class Notice for that in Visualworks, with several methods for
a simple popup dialog only, or with an overall progress meter, or even a
progress bar with an additional message for every step.

You invoke something like:

Notice
     showProgress: 'Doing layout...'
     complete: 1000
     while: [
         ...do stuff ...
         IncrementNotification raiseSignal].

The counter is increased by raising the Notification.

So maybe there is a chance to get this handled by TRPlatform.

HTH

Thomas

Am 08.04.2015 um 16:08 schrieb Alexandre Bergel:

> No idea. We have a platform TRPlatform class that contains platform dependent features. Maybe we could include one to have platform. But I am afraid this may complexify the whole things if progress bars are radically different in VW.
>
> Alexandre
>
>
>> On Apr 8, 2015, at 10:38 AM, Yuriy Tymchuk <[hidden email]> wrote:
>>
>> How do they display progress in VW?
>>
>>> On 08 Apr 2015, at 15:34, Alexandre Bergel <[hidden email]> wrote:
>>>
>>> An alternative is to have another subclass, such as RTForceBasedWithProgressBarLayout
>>> But this is not idea, because the progress bar should be by default Pharo. And on VisualWorks no.
>>>
>>> Another alternative, and the cleanest one I believe, is to have event generated to every X steps. You can have whatever you wish as a callback, moving the progress bar or not.
>>>
>>> I have added an issue about this:
>>> https://code.google.com/p/moose-technology/issues/detail?id=1119
>>>
>>> Alexandre
>>>
>>>
>>>> On Apr 8, 2015, at 9:50 AM, Tudor Girba <[hidden email]> wrote:
>>>>
>>>> We need a better way of modeling that :)
>>>>
>>>> Doru
>>>>
>>>> On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
>>>> I have cleaned a bit your code with something like:
>>>>
>>>> doExecute: nodeElements
>>>>        self start: nodeElements.
>>>>        self isJobInstalled
>>>>                ifTrue: [ self runLayoutInJob ]
>>>>                ifFalse: [ self runLayoutSimply ].
>>>>        alpha := 0.
>>>>        nodes do: [ :e | translator translateTopLeftOf: e to: e position ]
>>>>
>>>> It is in version .816 of Roassal2.
>>>>
>>>> We should be able to run the layout without job. This is important for us
>>>>
>>>> Thanks!
>>>> Alexandre
>>>>
>>>>
>>>>> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>>>>>
>>>>> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>>>>>
>>>>> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>>>>>
>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>> doExecute: nodeElements
>>>>>      self start: nodeElements.
>>>>>      [ :job |
>>>>>              job
>>>>>                      title: 'Laying out elements';
>>>>>                      min: 1 - alpha;
>>>>>                      max: 1.
>>>>>              nbIterations = 0
>>>>>                      ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>>>>>                      ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>>>>>      ] asJob run.
>>>>>      alpha := 0.
>>>>>      nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>
>>>>> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>>>>>
>>>>>
>>>>> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>>>>>
>>>>> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
>>>>> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>>>>>
>>>>> Peter
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> [hidden email]
>>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> Alexandre Bergel  http://www.bergel.eu
>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> [hidden email]
>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>
>>>>
>>>>
>>>> --
>>>> www.tudorgirba.com
>>>>
>>>> "Every thing has its own flow"
>>>> _______________________________________________
>>>> Moose-dev mailing list
>>>> [hidden email]
>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Force based layout progress bar

Uko2
In pharo it’s essentially the same. Just that all notifications are raised by messages that you send to the job.


> On 08 Apr 2015, at 16:27, Thomas Brodt <[hidden email]> wrote:
>
> There is class Notice for that in Visualworks, with several methods for a simple popup dialog only, or with an overall progress meter, or even a progress bar with an additional message for every step.
>
> You invoke something like:
>
> Notice
>    showProgress: 'Doing layout...'
>    complete: 1000
>    while: [
>        ...do stuff ...
>        IncrementNotification raiseSignal].
>
> The counter is increased by raising the Notification.
>
> So maybe there is a chance to get this handled by TRPlatform.
>
> HTH
>
> Thomas
>
> Am 08.04.2015 um 16:08 schrieb Alexandre Bergel:
>> No idea. We have a platform TRPlatform class that contains platform dependent features. Maybe we could include one to have platform. But I am afraid this may complexify the whole things if progress bars are radically different in VW.
>>
>> Alexandre
>>
>>
>>> On Apr 8, 2015, at 10:38 AM, Yuriy Tymchuk <[hidden email]> wrote:
>>>
>>> How do they display progress in VW?
>>>
>>>> On 08 Apr 2015, at 15:34, Alexandre Bergel <[hidden email]> wrote:
>>>>
>>>> An alternative is to have another subclass, such as RTForceBasedWithProgressBarLayout
>>>> But this is not idea, because the progress bar should be by default Pharo. And on VisualWorks no.
>>>>
>>>> Another alternative, and the cleanest one I believe, is to have event generated to every X steps. You can have whatever you wish as a callback, moving the progress bar or not.
>>>>
>>>> I have added an issue about this:
>>>> https://code.google.com/p/moose-technology/issues/detail?id=1119
>>>>
>>>> Alexandre
>>>>
>>>>
>>>>> On Apr 8, 2015, at 9:50 AM, Tudor Girba <[hidden email]> wrote:
>>>>>
>>>>> We need a better way of modeling that :)
>>>>>
>>>>> Doru
>>>>>
>>>>> On Wed, Apr 8, 2015 at 2:44 PM, Alexandre Bergel <[hidden email]> wrote:
>>>>> I have cleaned a bit your code with something like:
>>>>>
>>>>> doExecute: nodeElements
>>>>>       self start: nodeElements.
>>>>>       self isJobInstalled
>>>>>               ifTrue: [ self runLayoutInJob ]
>>>>>               ifFalse: [ self runLayoutSimply ].
>>>>>       alpha := 0.
>>>>>       nodes do: [ :e | translator translateTopLeftOf: e to: e position ]
>>>>>
>>>>> It is in version .816 of Roassal2.
>>>>>
>>>>> We should be able to run the layout without job. This is important for us
>>>>>
>>>>> Thanks!
>>>>> Alexandre
>>>>>
>>>>>
>>>>>> On Apr 7, 2015, at 5:04 PM, Peter Uhnák <[hidden email]> wrote:
>>>>>>
>>>>>> Out of curiosity I dug a little deeper and was happy to learn about a Job and more about Pharo internals.
>>>>>>
>>>>>> In any case, try replacing RTForceBasedLayout>>doExecute: with this
>>>>>>
>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>> doExecute: nodeElements
>>>>>>     self start: nodeElements.
>>>>>>     [ :job |
>>>>>>             job
>>>>>>                     title: 'Laying out elements';
>>>>>>                     min: 1 - alpha;
>>>>>>                     max: 1.
>>>>>>             nbIterations = 0
>>>>>>                     ifTrue: [ [ alpha := alpha * 0.99. alpha > 0.005 ] whileTrue: [ self step. job currentValue: 1 - alpha ] ]
>>>>>>                     ifFalse: [ nbIterations timesRepeat: [ alpha := alpha * 0.99. self step. job currentValue: 1 - alpha ] ]
>>>>>>     ] asJob run.
>>>>>>     alpha := 0.
>>>>>>     nodes do: [ :e | translator translateTopLeftOf: e to: e position ].
>>>>>> ~~~~~~~~~~~~~~~~~~~~~~~~~
>>>>>>
>>>>>> it's bit messy (and doesn't account for nbIterations), but its a proof of concept.
>>>>>>
>>>>>>
>>>>>> I thing that it makes sense to create execution indicator without progress (with spinner for example)
>>>>>>
>>>>>> What can be done is to display alpha on progress bar. From current value to 0.005 or whatever there is.
>>>>>> I was thinking more something like this http://www.barchart.com/shared/images/progress_bar.gif or thsi https://i.stack.imgur.com/gz9GK.gif
>>>>>>
>>>>>> Peter
>>>>>> _______________________________________________
>>>>>> Moose-dev mailing list
>>>>>> [hidden email]
>>>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>> --
>>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>>> Alexandre Bergel  http://www.bergel.eu
>>>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> [hidden email]
>>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> www.tudorgirba.com
>>>>>
>>>>> "Every thing has its own flow"
>>>>> _______________________________________________
>>>>> Moose-dev mailing list
>>>>> [hidden email]
>>>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>>> --
>>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>>> 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


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

Re: Force based layout progress bar

Peter Uhnak
In reply to this post by abergel
On Wed, Apr 8, 2015 at 2:33 PM, Alexandre Bergel <[hidden email]> wrote:
Wow, I have never heard about this Job.
Me neither, I found it when digging in RTRectanglePackLayout and finding how it works there. :)
 
What is missing in your implementation?
That it uses alpha even when nbIterations > 0, which is wrong - it should use nbIterations instead.

Peter

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