scaling roassal visualizations to fit the screen

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

scaling roassal visualizations to fit the screen

Tudor Girba-2
Hi,

It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.

Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?

Doru

--

"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: scaling roassal visualizations to fit the screen

abergel
Hi Doru,

Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| b |
b := RTGraphBuilder new.

b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).

b edges 
connectTo: #subclasses;
verticalAttachPoint;
useInLayout.

b layout tree.

b global 
minSize: 5;
normalizeColor: #numberOfVariables using: {Color green . Color red}.

b addAll: RTObject withAllSubclasses.
b build.

(RTGroup withAll: b view elements) translateTo: 0 @ 0.
b view canvas camera focusOnCenterScaled: 500.
b view
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

The visualization fits into a 500 x 500 morph.
Here is the screenshot:


If you do not have the last two lines, then you end up with something like:




Cheers,
Alexandre

On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:

Hi,

It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.

Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?

Doru

-- 
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: scaling roassal visualizations to fit the screen

abergel
Within a simple roassal visualization

        | view |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].
       
        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        view open.
        view canvas camera focusOnCenterScaled: 500.


On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:

> Hi Doru,
>
> Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | b |
> b := RTGraphBuilder new.
>
> b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>
> b edges
> connectTo: #subclasses;
> verticalAttachPoint;
> useInLayout.
>
> b layout tree.
>
> b global
> minSize: 5;
> normalizeColor: #numberOfVariables using: {Color green . Color red}.
>
> b addAll: RTObject withAllSubclasses.
> b build.
>
> (RTGroup withAll: b view elements) translateTo: 0 @ 0.
> b view canvas camera focusOnCenterScaled: 500.
> b view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The visualization fits into a 500 x 500 morph.
> Here is the screenshot:
>
> <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>
> If you do not have the last two lines, then you end up with something like:
>
> <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>
>
> https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>
> Cheers,
> Alexandre
>
> On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>
>> Hi,
>>
>> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>>
>> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>>
>> Doru
>>
>> --
>> 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
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: scaling roassal visualizations to fit the screen

Tudor Girba-2
Hi,

I saw this before, but we need a bit more because of two things:
1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
2. ideally, resizing the morph should resize the picture.

Doru




On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <[hidden email]> wrote:
Within a simple roassal visualization

        | view |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].

        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        view open.
        view canvas camera focusOnCenterScaled: 500.


On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:

> Hi Doru,
>
> Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | b |
> b := RTGraphBuilder new.
>
> b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>
> b edges
>       connectTo: #subclasses;
>       verticalAttachPoint;
>       useInLayout.
>
> b layout tree.
>
> b global
>       minSize: 5;
>       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>
> b addAll: RTObject withAllSubclasses.
> b build.
>
> (RTGroup withAll: b view elements) translateTo: 0 @ 0.
> b view canvas camera focusOnCenterScaled: 500.
> b view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The visualization fits into a 500 x 500 morph.
> Here is the screenshot:
>
> <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>
> If you do not have the last two lines, then you end up with something like:
>
> <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>
>
> https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>
> Cheers,
> Alexandre
>
> On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>
>> Hi,
>>
>> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>>
>> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>>
>> Doru
>>
>> --
>> 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
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: scaling roassal visualizations to fit the screen

abergel
True! We will try to work on this today

Alexandre

Le 19-04-2014 à 6:02, Tudor Girba <[hidden email]> a écrit :

Hi,

I saw this before, but we need a bit more because of two things:
1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
2. ideally, resizing the morph should resize the picture.

Doru




On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <[hidden email]> wrote:
Within a simple roassal visualization

        | view |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].

        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        view open.
        view canvas camera focusOnCenterScaled: 500.


On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:

> Hi Doru,
>
> Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | b |
> b := RTGraphBuilder new.
>
> b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>
> b edges
>       connectTo: #subclasses;
>       verticalAttachPoint;
>       useInLayout.
>
> b layout tree.
>
> b global
>       minSize: 5;
>       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>
> b addAll: RTObject withAllSubclasses.
> b build.
>
> (RTGroup withAll: b view elements) translateTo: 0 @ 0.
> b view canvas camera focusOnCenterScaled: 500.
> b view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The visualization fits into a 500 x 500 morph.
> Here is the screenshot:
>
> <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>
> If you do not have the last two lines, then you end up with something like:
>
> <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>
>
> https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>
> Cheers,
> Alexandre
>
> On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>
>> Hi,
>>
>> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>>
>> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>>
>> Doru
>>
>> --
>> 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
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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

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

Re: scaling roassal visualizations to fit the screen

Tudor Girba-2
Great.

Doru


On Sat, Apr 19, 2014 at 4:46 PM, Alexandre Bergel <[hidden email]> wrote:
True! We will try to work on this today

Alexandre

Le 19-04-2014 à 6:02, Tudor Girba <[hidden email]> a écrit :

Hi,

I saw this before, but we need a bit more because of two things:
1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
2. ideally, resizing the morph should resize the picture.

Doru




On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <[hidden email]> wrote:
Within a simple roassal visualization

        | view |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].

        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        view open.
        view canvas camera focusOnCenterScaled: 500.


On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:

> Hi Doru,
>
> Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | b |
> b := RTGraphBuilder new.
>
> b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>
> b edges
>       connectTo: #subclasses;
>       verticalAttachPoint;
>       useInLayout.
>
> b layout tree.
>
> b global
>       minSize: 5;
>       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>
> b addAll: RTObject withAllSubclasses.
> b build.
>
> (RTGroup withAll: b view elements) translateTo: 0 @ 0.
> b view canvas camera focusOnCenterScaled: 500.
> b view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> The visualization fits into a 500 x 500 morph.
> Here is the screenshot:
>
> <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>
> If you do not have the last two lines, then you end up with something like:
>
> <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>
>
> https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>
> Cheers,
> Alexandre
>
> On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>
>> Hi,
>>
>> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>>
>> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>>
>> Doru
>>
>> --
>> 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
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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

_______________________________________________
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: scaling roassal visualizations to fit the screen

abergel
Actually, all the piece are already there.
Here are some examples:
-=-=-=-=-=-=-=-=-=-=-=-=
        | view window |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].
       
        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        window := view open.
        view canvas camera focusOnCenterScaled: 500.

        window announcer when: WindowResizing do: [ :evt |
                view canvas camera focusOnCenterScaled: (evt newSize x max: evt newSize y).
                view canvas signalUpdate ]
-=-=-=-=-=-=-=-=-=-=-=-=

-=-=-=-=-=-=-=-=-=-=-=-=
| b window |
        b := RTGraphBuilder new.

        b nodes shape: (RTEllipse new size: 13; color: (Color blue alpha: 0.3)).

        b edges
                connectTo: #subclasses.

        b edges
                connectTo: #dependentClasses;
                shape: (RTLine new color: Color lightBlue).


        b layout use: (RTCircleLayout new initialRadius: 230).
        b addAll: (Collection withAllSubclasses).

        window := b open.
       
        (RTGroup withAll: b view elements) translateTo: 0 @ 0.
        b view add: (RTEllipse new color: Color red) element.
        b view canvas camera focusOnCenter.
        b view canvas camera focusOnCenterScaled: 500.

        window announcer when: WindowResizing do: [ :evt |
                b view canvas camera focusOnCenterScaled: (evt newSize x min: evt newSize y).
                b view canvas signalUpdate ]
-=-=-=-=-=-=-=-=-=-=-=-=

Does this help?

Alexandre



On Apr 19, 2014, at 12:08 PM, Tudor Girba <[hidden email]> wrote:

> Great.
>
> Doru
>
>
> On Sat, Apr 19, 2014 at 4:46 PM, Alexandre Bergel <[hidden email]> wrote:
> True! We will try to work on this today
>
> Alexandre
>
> Le 19-04-2014 à 6:02, Tudor Girba <[hidden email]> a écrit :
>
>> Hi,
>>
>> I saw this before, but we need a bit more because of two things:
>> 1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
>> 2. ideally, resizing the morph should resize the picture.
>>
>> Doru
>>
>>
>>
>>
>> On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <[hidden email]> wrote:
>> Within a simple roassal visualization
>>
>>         | view |
>>         view := RTView new.
>>         view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
>>         RTEdge
>>                 buildEdgesFromObjects: Collection
>>                 withAllSubclasses from: #superclass to: #yourself inView: view.
>>         RTTreeLayout on: view elements edges: view edges.
>>         view @ RTDraggableView.
>>         view edges do: [ :e | e trachelShape pushBack ].
>>
>>         (RTGroup withAll: view elements) translateTo: 0 @ 0.
>>         view open.
>>         view canvas camera focusOnCenterScaled: 500.
>>
>>
>> On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:
>>
>> > Hi Doru,
>> >
>> > Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>> >
>> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> > | b |
>> > b := RTGraphBuilder new.
>> >
>> > b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>> >
>> > b edges
>> >       connectTo: #subclasses;
>> >       verticalAttachPoint;
>> >       useInLayout.
>> >
>> > b layout tree.
>> >
>> > b global
>> >       minSize: 5;
>> >       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>> >
>> > b addAll: RTObject withAllSubclasses.
>> > b build.
>> >
>> > (RTGroup withAll: b view elements) translateTo: 0 @ 0.
>> > b view canvas camera focusOnCenterScaled: 500.
>> > b view
>> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> >
>> > The visualization fits into a 500 x 500 morph.
>> > Here is the screenshot:
>> >
>> > <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>> >
>> > If you do not have the last two lines, then you end up with something like:
>> >
>> > <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>> >
>> >
>> > https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>> >
>> > Cheers,
>> > Alexandre
>> >
>> > On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>> >
>> >> Hi,
>> >>
>> >> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>> >>
>> >> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>> >>
>> >> Doru
>> >>
>> >> --
>> >> 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
>> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> >
>> >
>> >
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> 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
>
> _______________________________________________
> 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: scaling roassal visualizations to fit the screen

Tudor Girba-2
Pretty nice. It is almost there. The only problem is 500. The issue is that focusOnCenterScaled: does not know about the size of the visible canvas. This should be a piece of information that should be maintained probably in camera.

Possibly we should make the camera listen to the WindowResizing event and maintain that size.

Doru




On Sat, Apr 19, 2014 at 8:42 PM, Alexandre Bergel <[hidden email]> wrote:
Actually, all the piece are already there.
Here are some examples:
-=-=-=-=-=-=-=-=-=-=-=-=
        | view window |
        view := RTView new.
        view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
        RTEdge
                buildEdgesFromObjects: Collection
                withAllSubclasses from: #superclass to: #yourself inView: view.
        RTTreeLayout on: view elements edges: view edges.
        view @ RTDraggableView.
        view edges do: [ :e | e trachelShape pushBack ].

        (RTGroup withAll: view elements) translateTo: 0 @ 0.
        window := view open.
        view canvas camera focusOnCenterScaled: 500.

        window announcer when: WindowResizing do: [ :evt |
                view canvas camera focusOnCenterScaled: (evt newSize x max: evt newSize y).
                view canvas signalUpdate ]
-=-=-=-=-=-=-=-=-=-=-=-=

-=-=-=-=-=-=-=-=-=-=-=-=
| b window |
        b := RTGraphBuilder new.

        b nodes shape: (RTEllipse new size: 13; color: (Color blue alpha: 0.3)).

        b edges
                connectTo: #subclasses.

        b edges
                connectTo: #dependentClasses;
                shape: (RTLine new color: Color lightBlue).


        b layout use: (RTCircleLayout new initialRadius: 230).
        b addAll: (Collection withAllSubclasses).

        window := b open.

        (RTGroup withAll: b view elements) translateTo: 0 @ 0.
        b view add: (RTEllipse new color: Color red) element.
        b view canvas camera focusOnCenter.
        b view canvas camera focusOnCenterScaled: 500.

        window announcer when: WindowResizing do: [ :evt |
                b view canvas camera focusOnCenterScaled: (evt newSize x min: evt newSize y).
                b view canvas signalUpdate ]
-=-=-=-=-=-=-=-=-=-=-=-=

Does this help?

Alexandre



On Apr 19, 2014, at 12:08 PM, Tudor Girba <[hidden email]> wrote:

> Great.
>
> Doru
>
>
> On Sat, Apr 19, 2014 at 4:46 PM, Alexandre Bergel <[hidden email]> wrote:
> True! We will try to work on this today
>
> Alexandre
>
> Le 19-04-2014 à 6:02, Tudor Girba <[hidden email]> a écrit :
>
>> Hi,
>>
>> I saw this before, but we need a bit more because of two things:
>> 1. focusOnCenterScaled: takes a hardcoded fix factor that is applied only to the encompassingRectangle, but we need something that also depends on the current size of the visible canvas.
>> 2. ideally, resizing the morph should resize the picture.
>>
>> Doru
>>
>>
>>
>>
>> On Fri, Apr 18, 2014 at 8:48 PM, Alexandre Bergel <[hidden email]> wrote:
>> Within a simple roassal visualization
>>
>>         | view |
>>         view := RTView new.
>>         view addAll: (RTBox elementsOn: Collection withAllSubclasses) @ RTDraggable.
>>         RTEdge
>>                 buildEdgesFromObjects: Collection
>>                 withAllSubclasses from: #superclass to: #yourself inView: view.
>>         RTTreeLayout on: view elements edges: view edges.
>>         view @ RTDraggableView.
>>         view edges do: [ :e | e trachelShape pushBack ].
>>
>>         (RTGroup withAll: view elements) translateTo: 0 @ 0.
>>         view open.
>>         view canvas camera focusOnCenterScaled: 500.
>>
>>
>> On Apr 18, 2014, at 3:45 PM, Alexandre Bergel <[hidden email]> wrote:
>>
>> > Hi Doru,
>> >
>> > Yes, there is definitely an interest in that. Actually, we already provide a way to fit the visualization into the morph. Check this example (using our new graph builder):
>> >
>> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> > | b |
>> > b := RTGraphBuilder new.
>> >
>> > b nodes shape: (RTBox new width: [ :cls | 6 * cls numberOfVariables]; height: #numberOfMethods).
>> >
>> > b edges
>> >       connectTo: #subclasses;
>> >       verticalAttachPoint;
>> >       useInLayout.
>> >
>> > b layout tree.
>> >
>> > b global
>> >       minSize: 5;
>> >       normalizeColor: #numberOfVariables using: {Color green . Color red}.
>> >
>> > b addAll: RTObject withAllSubclasses.
>> > b build.
>> >
>> > (RTGroup withAll: b view elements) translateTo: 0 @ 0.
>> > b view canvas camera focusOnCenterScaled: 500.
>> > b view
>> > -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> >
>> > The visualization fits into a 500 x 500 morph.
>> > Here is the screenshot:
>> >
>> > <Screen Shot 2014-04-18 at 3.23.19 PM.png>
>> >
>> > If you do not have the last two lines, then you end up with something like:
>> >
>> > <Screen Shot 2014-04-18 at 3.24.17 PM.png>
>> >
>> >
>> > https://www.facebook.com/ObjectProfile/posts/619537244799543?stream_ref=10
>> >
>> > Cheers,
>> > Alexandre
>> >
>> > On Apr 18, 2014, at 5:30 AM, Tudor Girba <[hidden email]> wrote:
>> >
>> >> Hi,
>> >>
>> >> It would be great to have a straightforward way to zoom the visualization to fit the current screen. This would be particularly useful within the context of the inspector.
>> >>
>> >> Essentially, we would need a RTZoomToFit animation. Would there be of interest to provide this?
>> >>
>> >> Doru
>> >>
>> >> --
>> >> 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
>> > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>> >
>> >
>> >
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> 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
>
> _______________________________________________
> 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



--

"Every thing has its own flow"

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