Metric normalizer

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

Metric normalizer

abergel
Hi!

I’ve just introduced a metric normalizer. This has been such a need!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
v := RTView new.

es := RTEllipse elementsOn: RTObject withAllSubclasses.
es @ RTPopup.
v addAll: es.

RTMetricNormalizer new
elements: es;
normalizeColor: #numberOfLinesOfCode;
alphaColor: 0.4;
normalizeSize: #numberOfMethods min: 5 max: 15;
normalizeX: #numberOfMethods min: 0 max: 300;
normalizeY: #numberOfVariables min: 0 max: 300.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Here is the rendering:


This will be a nice base when we will build GraphET3

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: Metric normalizer

stepharo
Nice addition
I think that having cool abstractions is the best way to control complexity!

Stef

On 13/7/14 01:28, Alexandre Bergel wrote:
Hi!

I’ve just introduced a metric normalizer. This has been such a need!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
v := RTView new.

es := RTEllipse elementsOn: RTObject withAllSubclasses.
es @ RTPopup.
v addAll: es.

RTMetricNormalizer new
elements: es;
normalizeColor: #numberOfLinesOfCode;
alphaColor: 0.4;
normalizeSize: #numberOfMethods min: 5 max: 15;
normalizeX: #numberOfMethods min: 0 max: 300;
normalizeY: #numberOfVariables min: 0 max: 300.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Here is the rendering:


This will be a nice base when we will build GraphET3

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: Metric normalizer

Tudor Girba-2
In reply to this post by abergel
I am not quite sure I understand the goal of this one.

At this point, some of the normalization works with elements (x, y), and some work with the shapes (there are explicit calls to trachelShape).

Why not have this behavior in the corresponding classes (element and shape)? In this way, for example, a text shape can provide a normalization for fonts as well.

The only benefit I see, is that you are specifying the group of all elements only once.

Cheers,
Doru




On Sun, Jul 13, 2014 at 1:28 AM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I’ve just introduced a metric normalizer. This has been such a need!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
v := RTView new.

es := RTEllipse elementsOn: RTObject withAllSubclasses.
es @ RTPopup.
v addAll: es.

RTMetricNormalizer new
elements: es;
normalizeColor: #numberOfLinesOfCode;
alphaColor: 0.4;
normalizeSize: #numberOfMethods min: 5 max: 15;
normalizeX: #numberOfMethods min: 0 max: 300;
normalizeY: #numberOfVariables min: 0 max: 300.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Here is the rendering:


This will be a nice base when we will build GraphET3

Cheers,
Alexandre

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

abergel
I am not quite sure I understand the goal of this one.

Having an easy way to relate elements from others.

At this point, some of the normalization works with elements (x, y), and some work with the shapes (there are explicit calls to trachelShape).

Yes. Maybe this could be split in two classes.

Why not have this behavior in the corresponding classes (element and shape)? In this way, for example, a text shape can provide a normalization for fonts as well.

Doing a normalization imply an elements know its sibling. Doing this will make the relation between shapes and the view (i.e., the container of elements) too strong in my opinion. 
Currently, the class RTMetricNormalizer is really small (and actually could be refactored to have much less code). If the functionalities would be in the shape, then code will less maintainable. 

The only benefit I see, is that you are specifying the group of all elements only once.

Code is also much simpler!
And I can choose the precise moment when to do the normalization. If shapes will be responsible for the normalization, when do you specify a normalization should be done at a given moment (i.e., when all the elements have been added) ?

Alexandre


On Sun, Jul 13, 2014 at 1:28 AM, Alexandre Bergel <[hidden email]> wrote:
Hi!

I’ve just introduced a metric normalizer. This has been such a need!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
v := RTView new.

es := RTEllipse elementsOn: RTObject withAllSubclasses.
es @ RTPopup.
v addAll: es.

RTMetricNormalizer new
elements: es;
normalizeColor: #numberOfLinesOfCode;
alphaColor: 0.4;
normalizeSize: #numberOfMethods min: 5 max: 15;
normalizeX: #numberOfMethods min: 0 max: 300;
normalizeY: #numberOfVariables min: 0 max: 300.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

Here is the rendering:

<Screen Shot 2014-07-13 at 1.27.33 AM.png>

This will be a nice base when we will build GraphET3

Cheers,
Alexandre

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