Inexact draiwing in roassal?

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

Inexact draiwing in roassal?

melkyades
Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!

Cheers,
Javier

test
| b ds events |

events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
   7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
   4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
   1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapherBuilder new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisXWithNumberOfTicks: events size.
^b build

Inline image 1
--
Javier Pimás
Ciudad de Buenos Aires
Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

abergel
Hi Javier,

First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.

For example:

-=-=-=-=-=-=-=-=-=-=-=-=
events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapher new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisX noTick; noLabel.
b axisY noTick; noLabel.
b build.

b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
b view
-=-=-=-=-=-=-=-=-=-=-=-=

A deep zoom-in shows everything is okay:

Cheers,
Alexandre


On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:

Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!

Cheers,
Javier

test
| b ds events |

events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapherBuilder new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisXWithNumberOfTicks: events size.
^b build

<image.png>
-- 
Javier Pimás
Ciudad de Buenos Aires

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

stepharo
Alexandre

why don't you communicate it well in the code.
This is really easy to deprecate the new method, put the class in a different package.

We will not use Roassal anymore in our open-devs lectures just because we literally burnt a poor
student that was systematically bumping into deprecated code but non explicit.
It gives a really bad impression of Pharo after this kind of experience.

Stef



First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.

For example:

-=-=-=-=-=-=-=-=-=-=-=-=
events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapher new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisX noTick; noLabel.
b axisY noTick; noLabel.
b build.

b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
b view
-=-=-=-=-=-=-=-=-=-=-=-=

A deep zoom-in shows everything is okay:

Cheers,
Alexandre


On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:

Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!

Cheers,
Javier

test
| b ds events |

events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapherBuilder new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisXWithNumberOfTicks: events size.
^b build

<image.png>
-- 
Javier Pimás
Ciudad de Buenos Aires

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

abergel
The class has been removed some times ago… There is not much I can do if people do not update….

Alexandre


> On Jun 14, 2015, at 3:42 PM, stepharo <[hidden email]> wrote:
>
> Alexandre
>
> why don't you communicate it well in the code.
> This is really easy to deprecate the new method, put the class in a different package.
>
> We will not use Roassal anymore in our open-devs lectures just because we literally burnt a poor
> student that was systematically bumping into deprecated code but non explicit.
> It gives a really bad impression of Pharo after this kind of experience.
>
> Stef
>
>
>>
>> First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
>> I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.
>>
>> For example:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>  events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
>>      7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
>>      4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
>>      1.0 @ 10.0. 0.0 @ 11.0}.
>>
>>  b := RTGrapher new.
>>  b extent: 400 @ 200.
>>
>>  ds := RTDataSet new.
>>  ds dotShape circle color: Color red.
>>  ds interaction fixedPopupText: [ :e | e printString ].
>>
>>  ds points: events.
>>  ds connectColor: Color blue.
>>  ds x: [ :e | e y ].
>>  ds y: [ :e | e x ].
>>  b add: ds.
>>  b axisX noTick; noLabel.
>>  b axisY noTick; noLabel.
>>  b build.
>>  
>>  b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
>>  b view
>> -=-=-=-=-=-=-=-=-=-=-=-=
>>
>> A deep zoom-in shows everything is okay:
>> <Mail Attachment.png>
>>
>> Cheers,
>> Alexandre
>>
>>
>>> On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:
>>>
>>> Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!
>>>
>>> Cheers,
>>> Javier
>>>
>>> test
>>>  | b ds events |
>>>
>>>  events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
>>>      7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
>>>      4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
>>>      1.0 @ 10.0. 0.0 @ 11.0}.
>>>
>>>  b := RTGrapherBuilder new.
>>>  b extent: 400 @ 200.
>>>
>>>  ds := RTDataSet new.
>>>  ds dotShape circle color: Color red.
>>>  ds interaction fixedPopupText: [ :e | e printString ].
>>>
>>>  ds points: events.
>>>  ds connectColor: Color blue.
>>>  ds x: [ :e | e y ].
>>>  ds y: [ :e | e x ].
>>>  b add: ds.
>>>  b axisXWithNumberOfTicks: events size.
>>>  ^b build
>>>
>>> <image.png>
>>> --
>>> Javier Pimás
>>> Ciudad de Buenos Aires
>>
>> --
>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>> Alexandre Bergel  http://www.bergel.eu
>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>
>>
>>
>

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

stepharo


Le 15/6/15 02:30, Alexandre Bergel a écrit :
> The class has been removed some times ago… There is not much I can do if people do not update….

Indeed. In my case we used the latest version.

>
> Alexandre
>
>
>> On Jun 14, 2015, at 3:42 PM, stepharo <[hidden email]> wrote:
>>
>> Alexandre
>>
>> why don't you communicate it well in the code.
>> This is really easy to deprecate the new method, put the class in a different package.
>>
>> We will not use Roassal anymore in our open-devs lectures just because we literally burnt a poor
>> student that was systematically bumping into deprecated code but non explicit.
>> It gives a really bad impression of Pharo after this kind of experience.
>>
>> Stef
>>
>>
>>> First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
>>> I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.
>>>
>>> For example:
>>>
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>   events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
>>>       7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
>>>       4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
>>>       1.0 @ 10.0. 0.0 @ 11.0}.
>>>
>>>   b := RTGrapher new.
>>>   b extent: 400 @ 200.
>>>
>>>   ds := RTDataSet new.
>>>   ds dotShape circle color: Color red.
>>>   ds interaction fixedPopupText: [ :e | e printString ].
>>>
>>>   ds points: events.
>>>   ds connectColor: Color blue.
>>>   ds x: [ :e | e y ].
>>>   ds y: [ :e | e x ].
>>>   b add: ds.
>>>   b axisX noTick; noLabel.
>>>   b axisY noTick; noLabel.
>>>   b build.
>>>  
>>>   b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
>>>   b view
>>> -=-=-=-=-=-=-=-=-=-=-=-=
>>>
>>> A deep zoom-in shows everything is okay:
>>> <Mail Attachment.png>
>>>
>>> Cheers,
>>> Alexandre
>>>
>>>
>>>> On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:
>>>>
>>>> Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!
>>>>
>>>> Cheers,
>>>> Javier
>>>>
>>>> test
>>>>   | b ds events |
>>>>
>>>>   events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
>>>>       7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
>>>>       4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
>>>>       1.0 @ 10.0. 0.0 @ 11.0}.
>>>>
>>>>   b := RTGrapherBuilder new.
>>>>   b extent: 400 @ 200.
>>>>
>>>>   ds := RTDataSet new.
>>>>   ds dotShape circle color: Color red.
>>>>   ds interaction fixedPopupText: [ :e | e printString ].
>>>>
>>>>   ds points: events.
>>>>   ds connectColor: Color blue.
>>>>   ds x: [ :e | e y ].
>>>>   ds y: [ :e | e x ].
>>>>   b add: ds.
>>>>   b axisXWithNumberOfTicks: events size.
>>>>   ^b build
>>>>
>>>> <image.png>
>>>> --
>>>> Javier Pimás
>>>> Ciudad de Buenos Aires
>>> --
>>> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
>>> Alexandre Bergel  http://www.bergel.eu
>>> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>>>
>>>
>>>


Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

melkyades
In reply to this post by abergel
Thanks for the quick answer, it now works as expected. I updated to a clean pharo 4 image and loaded roassal2 again (my previous image was just 2 months old). I had to change the ConfigurationOfGlamourCore to point from version 1.2.14 to version 1.2.10 of rubrick (don't know what rubrick is but changing the version allowed loading everything).

Still some things don't work as expected: export to svg and png in inspector. pngs are exported with the wrong viewport, svg are distorted, like with the old version.

As for the code, just copy-pasted from the docs in agilevisualization.com or examples in image can't remember exactly though. I took them 2 or 3 months ago, but these same examples seem to be up-to-date now in both places.

Cheers

On Sun, Jun 14, 2015 at 9:53 AM, Alexandre Bergel <[hidden email]> wrote:
Hi Javier,

First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.

For example:

-=-=-=-=-=-=-=-=-=-=-=-=
events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapher new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisX noTick; noLabel.
b axisY noTick; noLabel.
b build.

b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
b view
-=-=-=-=-=-=-=-=-=-=-=-=

A deep zoom-in shows everything is okay:

Cheers,
Alexandre


On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:

Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!

Cheers,
Javier

test
| b ds events |

events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapherBuilder new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisXWithNumberOfTicks: events size.
^b build

<image.png>
-- 
Javier Pimás
Ciudad de Buenos Aires

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






--
Javier Pimás
Ciudad de Buenos Aires

new-good.png (100K) Download Attachment
old-bad.png (99K) Download Attachment
new-bad-export-svg.svg (44K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inexact draiwing in roassal?

abergel
Ok, so everything is okay I understand

Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.



On Jun 15, 2015, at 10:58 AM, Javier Pimás <[hidden email]> wrote:

Thanks for the quick answer, it now works as expected. I updated to a clean pharo 4 image and loaded roassal2 again (my previous image was just 2 months old). I had to change the ConfigurationOfGlamourCore to point from version 1.2.14 to version 1.2.10 of rubrick (don't know what rubrick is but changing the version allowed loading everything).

Still some things don't work as expected: export to svg and png in inspector. pngs are exported with the wrong viewport, svg are distorted, like with the old version.

As for the code, just copy-pasted from the docs in agilevisualization.com or examples in image can't remember exactly though. I took them 2 or 3 months ago, but these same examples seem to be up-to-date now in both places.

Cheers

On Sun, Jun 14, 2015 at 9:53 AM, Alexandre Bergel <[hidden email]> wrote:
Hi Javier,

First of all, RTGrapherBuilder has been obsoleted. Use RTGrapher instead.
I guess this is a problem with rounding with RTGrapherBuilder. With RTGrapher, I do not see this behavior.

For example:

-=-=-=-=-=-=-=-=-=-=-=-=
events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapher new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisX noTick; noLabel.
b axisY noTick; noLabel.
b build.

b view add: ((RTLine new width: 0.02; color: Color yellow) edgeFrom: b view elements fifth to: b view elements last).
b view
-=-=-=-=-=-=-=-=-=-=-=-=

A deep zoom-in shows everything is okay:
<Screen Shot 2015-06-14 at 9.53.15 AM.png>

Cheers,
Alexandre


On Jun 13, 2015, at 8:00 PM, Javier Pimás <[hidden email]> wrote:

Hi guys, I'm drawing a chart with roassal2 and just discovered that lines are not being drawn exactly as expected. Maybe this is a known problem? I'm running on a few months old pharo4beta image, in linux. Here I attach a screenshot corresponding to the code below. There are more evident examples but this one is easier to debug as it is a straight line made of many segments (zooming a bit you'll see the thin reference line and notice the blue line "bends"). Thanks for reading!

Cheers,
Javier

test
| b ds events |

events := { 10.0 @ 1.0. 9.0 @ 2.0. 8.0 @ 3.0.
    7.0 @ 4.0. 6.0 @ 5.0. 5.0 @ 6.0.
    4.0 @ 7.0. 3.0 @ 8.0. 2.0 @ 9.0.
    1.0 @ 10.0. 0.0 @ 11.0}.

b := RTGrapherBuilder new.
b extent: 400 @ 200.

ds := RTDataSet new.
ds dotShape circle color: Color red.
ds interaction fixedPopupText: [ :e | e printString ].

ds points: events.
ds connectColor: Color blue.
ds x: [ :e | e y ].
ds y: [ :e | e x ].
b add: ds. 
b axisXWithNumberOfTicks: events size.
^b build

<image.png>
-- 
Javier Pimás
Ciudad de Buenos Aires

-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.






--
Javier Pimás
Ciudad de Buenos Aires
<new-good.png><old-bad.png><new-bad-export-svg.svg>