Roassal3 Popups

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

Roassal3 Popups

Evan Donahue
Hello,

Just returning to Pharo after 1000 years and have discovered that Roassal has upgraded to Roassal3. Trying to update my inspector integrations and can't seem to figure out how to get popups working. How can I get popups for the y values in a scatter plot such as the following:

RSChart new addPlot: (RSScatterPlot new y: #(1 2 3)).

Thanks,
Evan
Reply | Threaded
Open this post in threaded view
|

Re: Roassal3 Popups

Pharo Smalltalk Users mailing list
Dear Evan,

Welcome back!
Yes, we moved to Roassal3, and as you may have experienced, not all the features of Roassal2 have been migrated to Roassal3.

Currently, popup in charts are still work in progress. However, you can have something that should do what you expect using:

-=-=-=-=-=-=-=-=
chart := RSChart new.

classes := Collection withAllSubclasses.
dataX := classes collect: #numberOfMethods.
dataY := classes collect: #numberOfLinesOfCode.

plot := RSScatterPlot new x: dataX y: dataY.

plot processBlock: [ :shapes |
    shapes doWithIndex: [ :shape :index |
                        shape model: (classes at: index).
        shape @ (RSPopup text: 'My data: ', (classes at: index) asString)
    ] ].

chart addPlot: plot.

chart xlabel: 'number of methods'.
chart ylabel: 'number of lines of code'.
chart
-=-=-=-=-=-=-=-=

However, be aware that this code may soon not work anymore. In particular, we plan to remove the processBlock: method and replace by something else.

Let us know how it goes

Cheers,
Alexandre

> On 31 Mar 2021, at 05:37, Evan Donahue <[hidden email]> wrote:
>
> Hello,
>
> Just returning to Pharo after 1000 years and have discovered that Roassal has upgraded to Roassal3. Trying to update my inspector integrations and can't seem to figure out how to get popups working. How can I get popups for the y values in a scatter plot such as the following:
>
> RSChart new addPlot: (RSScatterPlot new y: #(1 2 3)).
>
> Thanks,
> Evan