You can simply send the message focusOnCenter to the “builder view canvas camera”.
Try the “center” button in this example:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| movies builder table |
table := GET2Table from: 'Movie;Genre;Production Budget;Total Domestic Box
Office;Rating IMDB
Avatar;Action;425000000;760507625; 8.0
The Blind Side;Drama;35000000;255959475; 7.6
The Chronicles of Narnia: The Lion, the Witch and the
Wardrobe;Adventure;180000000;291710957; 6.9
The Dark Knight;Action;185000000;533345358; 9.0
ET: The Extra-Terrestrial;Drama;10500000;435110554; 7.9
Finding Nemo;Adventure;94000000;380529370; 8.1
Ghostbusters;Comedy;30000000;238632124; 7.8
The Hunger Games;Thriller/Suspense;80000000;408010692; 7.2
Iron Man 3;Action;200000000;396702239; 7.6
Jurassic Park;Action;63000000;395708305; 8.0
King Kong;Adventure;207000000;218080025; 7.3
The Lion King;Adventure;79300000;422780140; 8.4
Monsters Inc.;Adventure;115000000;289423425; 8.0
The Twilight Saga: New Moon;Drama;50000000;296623634; 4.5
Oz the Great and Powerful;Adventure;200000000;233671832; 6.6
Pirates of the Caribbean: Dead Mans Chest;Adventure;225000000;423315812; 7.3
Quantum of Solace;Action;230000000;169368427; 6.7
Raiders of the Lost Ark;Adventure;20000000;248159971; 8.7
Star Wars Ep. I: The Phantom Menace;Adventure;115000000;474544677; 6.5
Titanic;Thriller/Suspense;200000000;658672302; 7.6
Up;Adventure;175000000;293004164; 8.3
The Vow;Drama;30000000;125014030; 6.7
The War of the Worlds;Action;132000000;234280354; 6.5
X-Men: The Last Stand;Action;210000000;234362462; 6.8
Youve Got Mail;Drama;65000000;115821495; 6.3
Zookeeper;Romantic Comedy;80000000;80360866; 5.0'.
movies := table asDataSet.
builder := GET2Scatterplot data: movies.
builder
x: [:m | (m at: 'Production Budget') / 1000000];
y: [:m | (m at: 'Total Domestic Box Office') / 1000000];
r: [:m | (m at: 'Rating IMDB') * 5];
color: (Color brown alpha:0.4);
height: 400;
width: 800.
builder xAxis title: 'Production Budget'.
builder yAxis title: 'Total Domestic Box Office'.
builder showValues: [:m | m at: 'Movie'].
builder interaction strongHighlightWhenOver.
builder view canvas addMenu: 'center' callback: [ builder view canvas camera
focusOnCenter. builder view signalUpdate ].
builder open.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Does this help?
Cheers,
Alexandre
On May 19, 2014, at 5:03 PM, Fabrice Atrevi <atrevifabrice(a)gmail.com> wrote:
> Hi,
> I added the height and the width but this not resolve the problem.
> I got for height 70 the first screen shot and for 140 the second. The problem is that
when i increase the height, part of graph hidden and i must to zoom. How can i center the
graph in the middle of panel?
>
> thanks
>
>
> 2014-05-19 23:39 GMT+07:00 <moose-dev-request(a)iam.unibe.ch>ch>:
> Send Moose-dev mailing list submissions to
> moose-dev(a)iam.unibe.ch
>
> To subscribe or unsubscribe via the World Wide Web, visit
>
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
> or, via email, send a message with subject or body 'help' to
> moose-dev-request(a)iam.unibe.ch
>
> You can reach the person managing the list at
> moose-dev-owner(a)iam.unibe.ch
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Moose-dev digest..."
>
>
> Today's Topics:
>
> 1. Jenkins build is back to stable : moose-5.0 #1424
> (admin(a)moosetechnology.org)
> 2. Re: please stop using strings :) (Alexandre Bergel)
> 3. Re: view of graph in glamour (Alexandre Bergel)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 19 May 2014 15:55:39 +0200 (CEST)
> From: admin(a)moosetechnology.org
> Subject: [Moose-dev] Jenkins build is back to stable : moose-5.0 #1424
> To: moose-dev(a)iam.unibe.ch
> Message-ID:
> <718878653.102.1400507739022.JavaMail.jenk_moose(a)ci-jenkins3.inria.fr>
> Content-Type: text/plain; charset=UTF-8
>
> See <https://ci.inria.fr/moose/job/moose-5.0/1424/>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 19 May 2014 12:33:45 -0400
> From: Alexandre Bergel <alexandre.bergel(a)me.com>
> Subject: [Moose-dev] Re: please stop using strings :)
> To: Moose-related development <moose-dev(a)iam.unibe.ch>
> Message-ID: <0A1C5508-3DDD-4DED-80AA-303F661A3E9A(a)me.com>
> Content-Type: text/plain; CHARSET=US-ASCII
>
> I perfectly agree. I think Pablo did this because of an algorithm he found and copied
it. Untangling the whole thing is relatively straight forward.
> The starting point is to look at the implementation of #rawPalette in the subclasses
of ColorPalette.
>
> I will put this on our todo list.
>
> Alexandre
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel
http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> On May 18, 2014, at 8:46 AM, Tudor Girba <tudor(a)tudorgirba.com> wrote:
>
> > Hi,
> >
> > The ColorPalette in Roassal2 is quite cool, but we should refactor the code to
not rely on strings.
> >
> > An example:
> > |n elements view|
> > n := RTBucketColor numberOfColors: 5 command: #asInteger scope: ($a to:
$z).
> > n colorScheme: 'Blues'.
> > elements := (RTBox new size: 20; color: n) elementsOn: ($a to: $z).
> > view := RTView new.
> > view addAll: elements.
> > RTGridLayout on: view elements.
> > view open.
> >
> > 'Blues' is actually an identifier that is looked up in all the
rawPalette keys returned by the subclasses of ColorPalette.
> >
> > This is not nice. We should have for each palette a method with the same name,
and the colorScheme: should work with an object like:
> > n colorScheme: CPSequential blues
> >
> > Do we agree on this?
> >
> > Doru
> >
> > --
> >
www.tudorgirba.com
> >
> > "Every thing has its own flow"
> > _______________________________________________
> > Moose-dev mailing list
> > Moose-dev(a)iam.unibe.ch
> >
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 19 May 2014 12:39:18 -0400
> From: Alexandre Bergel <alexandre.bergel(a)me.com>
> Subject: [Moose-dev] Re: view of graph in glamour
> To: Moose-related development <moose-dev(a)iam.unibe.ch>
> Message-ID: <E26A3FFE-2275-412D-BAD1-ABCBF6600212(a)me.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> You can use #height: and #width: to a builder to set a particular size. Try this:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | builder normalizer data |
> data := (1 to: 100) collect: [ :i | Array with: i with: 20 atRandom + 30 ].
>
> normalizer := RTNColorLinearNormalizer
> inContext: data withCommand: #second
lowColor: Color paleRed highColor: Color blue.
>
> builder := GET2Line data: data.
> builder
> x: #first;
> y: #second;
> lineWidth: 2;
> dotColor: [ :v | (normalizer rtValue: v) alpha: 0.5];
> dotSize: 15;
> height: 100;
> width: 150.
>
>
> builder build.
> builder view
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
>
> Without specifying height: and width: gives you something like:
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel
http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> On May 19, 2014, at 4:42 AM, Fabrice Atrevi <atrevifabrice(a)gmail.com> wrote:
>
> > hi,
> > i build a graph in glamour. But, when i run my browser, the graph not be at the
center of the panel (like in the screen shot) and there are not the scroll bar for view
properly. Also, i want to label the axis, how can i do it?
> >
> > thanks!
> > --
> > ATREVI D. Fabrice
> > Master en Informatique A l'Institut de la Francophonie pour
l'Informatique (IFI/Hano?)
> > <pb_barre_deroulant.PNG>_______________________________________________
> > Moose-dev mailing list
> > Moose-dev(a)iam.unibe.ch
> >
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>