Improvement of Grapher

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

Improvement of Grapher

abergel
Hi!

We did a number of improvements of Grapher for Thomas. I am sharing them since some of you may find it relevant.

**************************************
*** Tip: need to shift the Y-axis ***

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b build.


The Y-Axis can be shifted vertically using labelConversion: and a minor translation of the value, as in:
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.



**************************************
*** Improvement 1: Centered labels for bar charts ***

-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
ds barChartWithBarCenteredTitle: [ :value | '##', value asString ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.
-=-=-=-=-=-=-=-=-=-=-=-=


**************************************
*** Improvement 2: Average for X values ***

b := RTGrapher new.
ds := RTDataSet new. 
ds dotShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b addDecorator: (RTHorizontalAverageDecorator new withLabel; labelConvertion: [ :aValue | 'average = ', aValue asFloat asString ]).
b build.


Cheers,
Alexandre
-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Improvement of Grapher

philippeback

cool.

pls make sure the api stays stable.

e.g. changing convertion/conversion bit me hard with a DNU hours before release on my CI.

Maybe have a RTOldAPI package or something.

Phil

Le 30 avr. 2015 20:00, "Alexandre Bergel" <[hidden email]> a écrit :
Hi!

We did a number of improvements of Grapher for Thomas. I am sharing them since some of you may find it relevant.

**************************************
*** Tip: need to shift the Y-axis ***

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b build.


The Y-Axis can be shifted vertically using labelConversion: and a minor translation of the value, as in:
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.



**************************************
*** Improvement 1: Centered labels for bar charts ***

-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
ds barChartWithBarCenteredTitle: [ :value | '##', value asString ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.
-=-=-=-=-=-=-=-=-=-=-=-=


**************************************
*** Improvement 2: Average for X values ***

b := RTGrapher new.
ds := RTDataSet new. 
ds dotShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b addDecorator: (RTHorizontalAverageDecorator new withLabel; labelConvertion: [ :aValue | 'average = ', aValue asFloat asString ]).
b build.


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




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Improvement of Grapher

abergel
Sorry about this. 
The API should remain stable

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



On Apr 30, 2015, at 2:48 PM, [hidden email] wrote:

cool.

pls make sure the api stays stable.

e.g. changing convertion/conversion bit me hard with a DNU hours before release on my CI.

Maybe have a RTOldAPI package or something.

Phil

Le 30 avr. 2015 20:00, "Alexandre Bergel" <[hidden email]> a écrit :
Hi!

We did a number of improvements of Grapher for Thomas. I am sharing them since some of you may find it relevant.

**************************************
*** Tip: need to shift the Y-axis ***

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b build.

<Screen Shot 2015-04-30 at 12.14.09 PM.png>

The Y-Axis can be shifted vertically using labelConversion: and a minor translation of the value, as in:
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.

<Screen Shot 2015-04-30 at 12.15.15 PM.png>


**************************************
*** Improvement 1: Centered labels for bar charts ***

-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
ds barChartWithBarCenteredTitle: [ :value | '##', value asString ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.
-=-=-=-=-=-=-=-=-=-=-=-=

<Screen Shot 2015-04-30 at 12.23.05 PM.png>

**************************************
*** Improvement 2: Average for X values ***

b := RTGrapher new.
ds := RTDataSet new. 
ds dotShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b addDecorator: (RTHorizontalAverageDecorator new withLabel; labelConvertion: [ :aValue | 'average = ', aValue asFloat asString ]).
b build.

<Screen Shot 2015-04-30 at 12.45.02 PM.png>

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




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
cbc
Reply | Threaded
Open this post in threaded view
|

Re: Improvement of Grapher

cbc
In reply to this post by abergel
I very much like these enhancements.

On Thu, Apr 30, 2015 at 11:00 AM, Alexandre Bergel <[hidden email]> wrote:
Hi!

We did a number of improvements of Grapher for Thomas. I am sharing them since some of you may find it relevant.

**************************************
*** Tip: need to shift the Y-axis ***

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
I REALLY like the noDecimal option!
 
<snip>



Is there a way to set the colors differently for above/below the shifted y axis?  Above is green (no issues); below is red (issues).  Or, depending on what is being discussed, the exact opposite?

-cbc

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Improvement of Grapher

abergel
I very much like these enhancements.

Thanks!
And this is just the beginning :-)

Is there a way to set the colors differently for above/below the shifted y axis?  Above is green (no issues); below is red (issues).  Or, depending on what is being discussed, the exact opposite?

Sure!

Try this:

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape
width: 15;
if: [:v | v < 0 ] fillColor: Color red;
if: [:v | v > 0 ] fillColor: Color green.
ds points: #(5 -6 10 20 -9).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b build.




-- 
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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: Improvement of Grapher

Usman Bhatti
In reply to this post by philippeback


On Thu, Apr 30, 2015 at 8:48 PM, [hidden email] <[hidden email]> wrote:

cool.

pls make sure the api stays stable.

e.g. changing convertion/conversion bit me hard with a DNU hours before release on my CI.


+1.
 

Maybe have a RTOldAPI package or something.

Phil

Le 30 avr. 2015 20:00, "Alexandre Bergel" <[hidden email]> a écrit :
Hi!

We did a number of improvements of Grapher for Thomas. I am sharing them since some of you may find it relevant.

**************************************
*** Tip: need to shift the Y-axis ***

b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b build.


The Y-Axis can be shifted vertically using labelConversion: and a minor translation of the value, as in:
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.



**************************************
*** Improvement 1: Centered labels for bar charts ***

-=-=-=-=-=-=-=-=-=-=-=-=
b := RTGrapher new.
ds := RTStackedDataSet new. 
ds barShape color: Color red. 
ds points: #(5 1 20 8).
ds y: [ :v | v - 10 ].
ds barChartWithBarCenteredTitle: [ :value | '##', value asString ].
b add: ds.
b axisX noLabel; noTick. b axisY noDecimal.
b axisY labelConversion: [ :v | v + 10 ].
b build.
-=-=-=-=-=-=-=-=-=-=-=-=


**************************************
*** Improvement 2: Average for X values ***

b := RTGrapher new.
ds := RTDataSet new. 
ds dotShape color: Color red. 
ds points: #(5 1 20 8).
b add: ds.
b addDecorator: (RTHorizontalAverageDecorator new withLabel; labelConvertion: [ :aValue | 'average = ', aValue asFloat asString ]).
b build.


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




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev