Graph current zoom level

458 views
Skip to first unread message

James Song

unread,
May 16, 2012, 5:22:32 AM5/16/12
to JavaScript InfoVis Toolkit
Hi guys,

thanks for the help so far. You guys are awesome. Just a quick
question , is there a variable that i can read that determines the
current level of zoom ? i have scanned through the source and have
found nothing much ...

I want to resize text size based on the level of zoom.

Thanks
James 1

Hamann

unread,
May 16, 2012, 7:37:51 AM5/16/12
to javascript-information...@googlegroups.com
Hi James,

this example below show the resize of text when user Clicked on node
He ask me things about gradients etc. So i help him a little bit. But he has also worked out the resize text thing.
Check it out on:

you might get an idea how to determine  text size based on the level of zoom.  




Op woensdag 16 mei 2012 11:22:32 UTC+2 schreef James Song het volgende:

Hamann

unread,
May 16, 2012, 8:19:00 AM5/16/12
to javascript-information...@googlegroups.com
If u dig in the jit file U see on linenumber: 2620

onMouseWheel: function(e, win, scroll) {
if(!this.config.zooming) return;
$.event.stop($.event.get(e, win));
var val = this.config.zooming / 1000,
ans = 1 + scroll * val;
this.canvas.scale(ans, ans);
},

U see 2 things:
1 the setup Zoonlevel (this.config.zooming)
2 Scaling the canvas

Also, this.canvas.scaleOffsetX and this.canvas.scaleOffsetY returns the current Scale!!


Op woensdag 16 mei 2012 13:37:51 UTC+2 schreef Hamann het volgende:

Chandan

unread,
May 18, 2012, 3:17:14 AM5/18/12
to JavaScript InfoVis Toolkit
hi hamann
please can u tell me the this which is used in this.canvas.zooming.
i am trying to zoom the rgraph by putting buttons .So, can u help me
on this regard..

Thank You
chandu

On May 16, 5:19 pm, Hamann <stev...@gmail.com> wrote:
> If u dig in the jit file U see on linenumber: 2620
>
> onMouseWheel: function(e, win, scroll) {
> if(!this.config.zooming) return;
> $.event.stop($.event.get(e, win));
> var val = this.config.zooming / 1000,
> ans = 1 + scroll * val;
> this.canvas.scale(ans, ans);
>
> },
>
> U see 2 things:
> 1 the setup Zoonlevel (this.config.zooming)
> 2 Scaling the canvas
>
> Also, this.canvas.scaleOffsetX and this.canvas.scaleOffsetY returns the
> current Scale!!
>
> Op woensdag 16 mei 2012 13:37:51 UTC+2 schreef Hamann het volgende:
>
>
>
>
>
>
>
>
>
> > Hi James,
>
> > this example below show the resize of text when user Clicked on node
> > It's a project of Ivan Gasparetto (see post:
> >https://groups.google.com/forum/?fromgroups#!topic/javascript-informa...

Hamann

unread,
May 18, 2012, 4:45:45 AM5/18/12
to javascript-information...@googlegroups.com
if  var rgraph = new $jit.RGraph({   

then this =rgraph
so rgraph.canvas.zooming

Op vrijdag 18 mei 2012 09:17:14 UTC+2 schreef Chandan het volgende:

Chandan

unread,
May 19, 2012, 7:10:39 AM5/19/12
to JavaScript InfoVis Toolkit
hi hamann
i am trying to add buttons for zooming please help me to add the
required code for button event

Hamann

unread,
May 21, 2012, 5:26:53 AM5/21/12
to javascript-information...@googlegroups.com
Hi there,

just tell me exactly what you want ?

Op zaterdag 19 mei 2012 13:10:39 UTC+2 schreef Chandan het volgende:

Rao Imadabattini

unread,
May 21, 2012, 5:55:16 AM5/21/12
to javascript-information...@googlegroups.com
Hi,

I was trying to redraraw the image.

Step 1: 

 I was able to draw the rGraph.

Step 2: 

When I clicked on any node in the rGraph, we will get the relation ships. and trying to redraw the graph. we need to erase or clean the exising graph and redraw the graph with JSON,



Thanks in advance,

Rao Imadabattini

Hamann

unread,
May 24, 2012, 4:45:24 AM5/24/12
to javascript-information...@googlegroups.com
See this POST\
maybe this can help U

Op maandag 21 mei 2012 11:26:53 UTC+2 schreef Hamann het volgende:
Op maandag 21 mei 2012 11:26:53 UTC+2 schreef Hamann het volgende:
Op maandag 21 mei 2012 11:26:53 UTC+2 schreef Hamann het volgende:
Op maandag 21 mei 2012 11:26:53 UTC+2 schreef Hamann het volgende:
Reply all
Reply to author
Forward
0 new messages