smalltalkpharomoose-technologyroassal

How to get vertical labels with Roassal?


I could not find a way to get vertical labels in a Roassal visualization. Is there a way? Or a general way to rotate elements?

Vertical Labels


Solution

  • The new version, Roassal2, does supports rotated labels. In the case of the example above, now you can do:

    | view |
    view := RTView new.
    -15 to: 10 do: [ :i |
        view add: ((RTRotatedLabel new angleInDegree: -90) elementOn: 'hello world').
    ].
    RTHorizontalLineLayout on: view elements.
    view open
    

    You will get:

    enter image description here

    Another example:

    | v shape |
    v := RTView new.
    shape := RTRotatedLabel new.
    shape angleInDegree: [ :cls | cls numberOfMethods negated / 1.5 ].
    shape text: [ :cls | ' ', cls name ].
    shape color: (Color black alpha: 0.2).
    v addAll: (shape elementsOn: Collection withAllSubclasses).
    
    v canvas color: Color white.
    v open
    

    You will have:

    enter image description here

    I hope it helps :-)