Several strange behavior in Roassal on a fresh moose 7.1 image
(the behavior with moose 6.1). The following script tries to show classes within their packages, with color according to their numberOfLinesOfCode: |model v| model := MooseModel root allModels last. v := RTMondrian new. v shape rectangle. v nodes: (model allModelNamespaces) forEach: [ :p | v shape rectangle. v nodes: p types. v normalizer normalizeColor: #numberOfLinesOfCode using: {Color white . Color black} min: 0 max: 1000. v layout grid. ]. v layout grid. v The result is that package color changes, not class color:
Now let's add the name of the packages (same script but for the 4th line): |model v| model := MooseModel root allModels last. v := RTMondrian new. v shape rectangle withTextAbove: #mooseName. v nodes: (model allModelNamespaces) forEach: [ :p | v shape rectangle. v nodes: p types. v normalizer normalizeColor: #numberOfLinesOfCode using: {Color white . Color black} min: 0 max: 1000. v layout grid. ]. v layout grid. v The result is that packages are not colored anymore but package names are : So the question is: What's wrong ? thanks nicolas -- Nicolas Anquetil RMod team -- Inria Lille _______________________________________________ Moose-dev mailing list [hidden email] https://www.list.inf.unibe.ch/listinfo/moose-dev |
Hi Nicolas,
You’re right, this is a buggy behavior. Usually, the normalizer is called outside the the nodes:forEach: In your case, you simply need to say which objects you are interested in normalizing. So, your script should be: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= model := MooseModel root allModels last. v := RTMondrian new. v shape rectangle withTextAbove: #mooseName. v nodes: (model allModelNamespaces) forEach: [ :p | v shape rectangle. v nodes: p types. v normalizer objects: p types; “<<- New line" normalizeColor: #numberOfLinesOfCode using: {Color white . Color black} min: 0 max: 1000. v layout grid. ]. v layout grid. v -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Cheers, Alexandre > On Oct 22, 2018, at 12:48 PM, Nicolas Anquetil <[hidden email]> wrote: > > > > Several strange behavior in Roassal on a fresh moose 7.1 image (the behavior with moose 6.1). > > The following script tries to show classes within their packages, with color according to their numberOfLinesOfCode: > > |model v| > model := MooseModel root allModels last. > v := RTMondrian new. > v shape rectangle. > v nodes: (model allModelNamespaces) > forEach: [ :p | > v shape rectangle. > v nodes: p types. > v normalizer > normalizeColor: #numberOfLinesOfCode > using: {Color white . Color black} > min: 0 > max: 1000. > v layout grid. > ]. > v layout grid. > v > > The result is that package color changes, not class color: > > <mnfpfbdjldeheddg.png> > > > > Now let's add the name of the packages (same script but for the 4th line): > > |model v| > model := MooseModel root allModels last. > v := RTMondrian new. > v shape rectangle withTextAbove: #mooseName. > v nodes: (model allModelNamespaces) > forEach: [ :p | > v shape rectangle. > v nodes: p types. > v normalizer > normalizeColor: #numberOfLinesOfCode > using: {Color white . Color black} > min: 0 > max: 1000. > v layout grid. > ]. > v layout grid. > v > > The result is that packages are not colored anymore but package names are : > > <akdjilcbhbgdihef.png> > > So the question is: > > What's wrong ? > How to have package with text above in black and color of inner class depending on their numberOfLinesOfCode ? > > thanks > > nicolas > > -- > Nicolas Anquetil > RMod team -- Inria Lille > > _______________________________________________ > Moose-dev mailing list > [hidden email] > https://www.list.inf.unibe.ch/listinfo/moose-dev _______________________________________________ Moose-dev mailing list [hidden email] https://www.list.inf.unibe.ch/listinfo/moose-dev |
Free forum by Nabble | Edit this page |