RTLegendBuilder Questions

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

RTLegendBuilder Questions

Sean P. DeNigris
Administrator
I'm using RTLegendBuilder to compare some insurance options. Cool! I was quickly able to cobble together a reasonable legend and align it to any side of my graph :)



As I tweaked, though, I noticed a few things:
- Luckily, my domain object's printString is what I want for the label of the legend item. Thus I am able to pass it to #addColor:text: (which I took a while to figure out can take any object for "text:"). I want to pass this object, and not just the label text I want, because that would break the GT Inspector flow. I think there is a missing dimension here for when we want the item and the label to be different. In fact, drop lists in Pharo used to work like this. I think the pattern is carried over from less dynamic or OO languages. In Magritte3, I added #display: to field descriptions of the form [ :domainObject | stringFormToUse ]
- #addColoredText:color: and #addColor:text: - do we really need both?

I know it's considered best practice to implement:
  simple:
  simple:intermediate:
  simple:intermediate:complicated:
style APIs, but I strongly prefer one method that takes a domain object which already has all this info, even at the expensive of a pair of parentheses.

OT: Text builders seem inherently restrictive because they always seem to insert a layer between the full power of the underlying objects and the part that's been translated to the builders. I sense that it would be a game changer (and not too hard) to hook the underlying objects together visually a la Lively Kernel instead of implementing a visual or text builder. In fact, I think that's what e.g. Morphic almost-already-is. It was even alluded to in a few papers as right on the horizon. But it's on the Dreams list for now.

Anyway, thanks for Roassal. This is fun!

Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: RTLegendBuilder Questions

abergel
Hi Sean!

- Luckily, my domain object's printString is what I want for the label of
the legend item. Thus I am able to pass it to #addColor:text: (which I took
a while to figure out can take any object for "text:"). I want to pass this
object, and not just the label text I want, because that would break the GT
Inspector flow. I think there is a missing dimension here for when we want
the item and the label to be different. In fact, drop lists in Pharo used to
work like this. I think the pattern is carried over from less dynamic or OO
languages. In Magritte3, I added #display: to field descriptions of the form
[ :domainObject | stringFormToUse ]

I have never thought about having the legend to contains meaningfull object. 
Are you suggesting something like: #addColor:object:text: that will collocate the object being the legend label and colored box?

- #addColoredText:color: and #addColor:text: - do we really need both?

They are two different method. Consider:
b := RTLegendBuilder new.
b addColor: Color red text: 'a legend title'.
b addColoredText: 'a legend title' color: Color red.

It gives:

Maybe the names are not properly chosen. If you have better ones, would be great :-)

OT: Text builders seem inherently restrictive because they always seem to
insert a layer between the full power of the underlying objects and the part
that's been translated to the builders. I sense that it would be a game
changer (and not too hard) to hook the underlying objects together visually
a la Lively Kernel instead of implementing a visual or text builder. In
fact, I think that's what e.g. Morphic almost-already-is. It was even
alluded to in a few papers as right on the horizon. But it's on the Dreams
list for now.

I am not sure to understand. Which text builder are you referring to?

Anyway, thanks for Roassal. This is fun!

Thanks :-)

Alexandre






-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/RTLegendBuilder-Questions-tp4813331.html
Sent from the Moose mailing list archive at Nabble.com.
_______________________________________________
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: RTLegendBuilder Questions

Sean P. DeNigris
Administrator
I have never thought about having the legend to contains meaningfull object. 
Are you suggesting something like: #addColor:object:text: that will collocate the object being the legend label and colored box?
Yes. I'd like a way to specify the object, and either a block or selector to get its display string. It all came quite by accident. Since you can drag the legend around, I started thinking of it as a live object. So I clicked on one of the labels, and the label's text appeared in the right-most pane of the GT Inspector. Then I thought, "if I put the underlying domain objects in the legend, shouldn't I then be able to inspect them in GT?!" And it worked! I made a tiny screencast https://www.youtube.com/watch?v=N1u807ij1p8

Maybe the names are not properly chosen. If you have better ones, would be great :-)
Ah, now I see. I will think about the names...

I am not sure to understand. Which text builder are you referring to?
Sorry, that was /way/ OT. I was dreaming about constructing visualizations by direct manipulation instead of coding.
Cheers,
Sean
Reply | Threaded
Open this post in threaded view
|

Re: RTLegendBuilder Questions

abergel
Cool video!
We have improved RTLegendBuilder.

You can now have for example:
-=-=-=-=-=-=-=-=-=-=
lb := RTLegendBuilder new.
lb addObject: 'hello world' text: [ :str | str substrings first ].
lb.
-=-=-=-=-=-=-=-=-=-=

Let us know whether this fits your need.

> Sorry, that was /way/ OT. I was dreaming about constructing visualizations by direct manipulation instead of coding.

We will reach that dream one day...

Cheers,
Alexandre

> On Mar 20, 2015, at 8:52 AM, Sean P. DeNigris <[hidden email]> wrote:
>
>> I have never thought about having the legend to contains meaningfull object.
>> Are you suggesting something like: #addColor:object:text: that will collocate the object being the legend label and colored box?
> Yes. I'd like a way to specify the object, and either a block or selector to get its display string. It all came quite by accident. Since you can drag the legend around, I started thinking of it as a live object. So I clicked on one of the labels, and the label's text appeared in the right-most pane of the GT Inspector. Then I thought, "if I put the underlying domain objects in the legend, shouldn't I then be able to inspect them in GT?!" And it worked! I made a tiny screencast https://www.youtube.com/watch?v=N1u807ij1p8
>
>>
>> Maybe the names are not properly chosen. If you have better ones, would be great :-)
> Ah, now I see. I will think about the names...
>
>> I am not sure to understand. Which text builder are you referring to?
> Sorry, that was /way/ OT. I was dreaming about constructing visualizations by direct manipulation instead of coding.
> Cheers,
> Sean
>
> View this message in context: Re: RTLegendBuilder Questions
> Sent from the Moose mailing list archive at Nabble.com.
> _______________________________________________
> 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: RTLegendBuilder Questions

Sean P. DeNigris
Administrator
> lb addObject: 'hello world' text: [ :str | str substrings first ].
> …
> Let us know whether this fits your need.
Perfect! Thanks :)
Cheers,
Sean