Re: BIRDEYE RAViS ZOOM FUNCTIONALITY KEEPS DRAGGGIN SMH

88 views
Skip to first unread message

Billy Schoenberg

unread,
Oct 23, 2010, 12:33:23 AM10/23/10
to Jerome King, flexviz...@googlegroups.com
Hey,

About your zoom problem,

Can you send me some example code, the link to the app?

What layouter are you using?  I use mainly the Hierarchal layouter and the ConcentricRadial one, so those are the ones that I have tested the most.   Which IVisualGraph?  (I only fixed VGraph, not the enhanced one)

Did you build from the latest source?  

Without knowing much I can't say.  I have attached my latest build though, maybe I should see about somehow getting that build onto the googlecode site.  

Also the zoom bug I fixed was different, it had to do with dragging of nodes (you would drag a node, and as you dragged it the node would move out from under the mouse).  I think I can replicate your using the explorer app though, I will see what I can do to fix the bug that I am seeing.

Billy



On Wed, Oct 20, 2010 at 3:18 PM, Jerome King <jerom...@macefusion.com> wrote:
Please write back about this it's bugging me lol.  Thanks a bunch!

libravis.swc

Billy Schoenberg

unread,
Oct 23, 2010, 6:33:10 AM10/23/10
to Jerome King, flexviz...@googlegroups.com
Hey,

Today's your lucky day, I was bored :-)

I fixed what I think your bug is (well a bug anyway).  I have commited it.  The fix was to the scale method of VisualGraph. Much simpler now, and it works ;-)  So if you want to do zooming and have it be relative to the center, do vgraph.scale = XXXXX

public function set scale(s:Number):void {

            

    var w:Number = width - width/s;

    var h:Number = height - height/s;

            

    scroll(-w/2 - _origin.x,-h/2 - _origin.y,false);

    scaleX = s;

    scaleY = s;

    _scale = s;

            

    _forceUpdateEdges = true;

    refresh();

}



Attached is my latest build, but you should be able to get it from SVN and build it.

Billy
libravis.swc

Billy Schoenberg

unread,
Oct 23, 2010, 2:49:06 PM10/23/10
to Jerome King, flexviz...@googlegroups.com
Hey,

Let me know, have a good weekend

Billy

On Sat, Oct 23, 2010 at 8:15 AM, Jerome King <jerom...@macefusion.com> wrote:
Okay bro...I'm not at the office right now but hopefully that works.  Cuz everytime i try to zoom in and out (especially if i do it fast), then my graph completely leaves the stage.  I need that part working cuz I'm trying to make the graph so that when a user opens the app, they start by selecting a node from a big list.  I plan to populate this list by getting all the visible nodes of as many xml files as i want thru that dictionary object (hopefully i can get all visible nodes from all xmls thru that dictionary object).  and when they double click the node name from the list.....the app refreshes wit the graph that node is on centers on that node!  It doesnt center correctly if the zoom is off hehe.  I typically use forced directed (so sick looking) but this zoom problem is happening across all layouts!  ima use the code u sent me and see if it works early monday morning and i will def keep you informed on how it goes. been trying to mess wit that zoom problem for months haha.  besides that i really love this ravis api....its like a mini facebook haahha.  thanx billy i really appreciate this cuz i havent seen many examples using flex.  good thing im relatively smart and pieced all the files together :)  very good work guys it is an impressive piece of API!!!  i was gonna go wit flare but that bullshit dont got no implementation for edge labels (like seriously?? lol)  


I LIVE FOR THIS FLEX SHITTTT....AND MAKIN BEATS HAHHAHAH.  god bless u billy

Billy Schoenberg

unread,
Oct 25, 2010, 10:46:14 AM10/25/10
to Jerome King, flexviz...@googlegroups.com
Hey,

So, my thing just zooms to center (as opposed to the top left, where it used to go) by using the scroll method.  If you want it to zoom to the current mouse coordinates I can do that (or you can), change the scale method call to scroll, but have it go to mouseX, mouseY or some derivation.  Also, you should not call to scroll to center the diagram after a double click if we are having the scale method take care of it.

Billy

public function set scale(s:Number):void {

    

    //difference in apparent width / height due to scale changes        

    var w:Number = width - width/s;

    var h:Number = height - height/s;

    

    //its the -w/2 -h/2 that centers the diagram    

    scroll(-w/2 - _origin.x,-h/2 - _origin.y,false);

    scaleX = s;

    scaleY = s;

    _scale = s;

            

    _forceUpdateEdges = true;

    refresh();

}


On Mon, Oct 25, 2010 at 7:11 AM, Jerome King <jerom...@macefusion.com> wrote:
When i combine the two it's alot better....but still drags lol:




public function set scale(s:Number):void {
            /* get the current value */
            const s0:Number = _canvas.scaleX;
            /* set the new value */
           
            /* Fix Scaling problem (Scrollbar shouldn't scale with graph)*/   
            //scaleX = s;
            //scaleY = s;
            _canvas.scaleX = s;
            _canvas.scaleY = s;
            /* scroll to the center */
            scroll((origin.x) * (1 - s / s0) / s0, origin.y * (1 - s / s0) / s,true);
            /* redraw the edges */
            refresh();
            /* remember the set value, this is probably unnecesary
            * since the getter could just return the value of scaleX
            * but anyway */
            _scale = s;
        }

Billy Schoenberg

unread,
Oct 25, 2010, 1:36:44 PM10/25/10
to Jerome King, flexviz...@googlegroups.com
Hey,

I am glad you are in a place that you are happy with.

Have a good one,

Billy

On Mon, Oct 25, 2010 at 9:23 AM, Jerome King <jerom...@macefusion.com> wrote:
Thanks a bunch Billy....I am going to stick with this version of set scale (the one i posted below).  It is tricky I can agree haha!  Now I am currently trying to populate a big datagrid list of nodes from several different graphs (xml files) through this dictionary object: noOfVisibleNodes().  That way I can double click the node from the list and it will load it's respective graph.  You see why i wanted to center the node on double click now?  Makes for easy access to find the node!

-Jerome







On Mon, Oct 25, 2010 at 12:03 PM, Jerome King <jerom...@macefusion.com> wrote:
This works best when graph is in middle of stage:




public function set scale(s:Number):void {
            /* get the current value */
            const s0:Number = _canvas.scaleX;
            var stageCenter:Point = new Point((FlexGlobals.topLevelApplication.width)/ 2, (FlexGlobals.topLevelApplication.height) / 2);
            var point:Point = localToGlobal(new Point (x,y));
            const s1:Number = _canvas.scaleY;

            /* set the new value */
            
            /* Fix Scaling problem (Scrollbar shouldn't scale with graph)*/    
            //scaleX = s;
            //scaleY = s;
            //Alert.show(point.x.toString());
            //scroll((mouseX) * (1 - s / s0) / s0, mouseY * (1 - s / s0) / s,false);
            //scroll((200) * (1 - s / s0) / s0, (200) * (1 - s / s0) / s,false);
            
            //Alert.show((stageCenter.x - point.x).toString());
            //Alert.show(stageCenter.x.toString());
            //Alert.show(point.x.toString());

            
            
            _canvas.scaleX = s;
            _canvas.scaleY = s;
            /* scroll to the center */
            scroll((stageCenter.x - point.x) * (1 - s / s0) / s0, (stageCenter.y - point.y) * (1 - s / s0) / s,false);

Billy Schoenberg

unread,
Oct 26, 2010, 11:47:54 PM10/26/10
to Jerome King, flexviz...@googlegroups.com
Hey,

Are you good now?  Sorry, just a lot of stuff coming through :-)

Also plz cc <flexviz...@googlegroups.com>,  so that our exchanges are all searchable on Google so I do not need to re-type the same e-mails if others have similar questions.

Glad its all working out for you though (I think??)

Billy


On Tue, Oct 26, 2010 at 2:11 PM, Jerome King <jerom...@macefusion.com> wrote:
THANKS bro its all workin out pretty good so far






On Mon, Oct 25, 2010 at 4:17 PM, Jerome King <jerom...@macefusion.com> wrote:

oh i see wats goin on...the dictionaries aren't getting set till like later.  idk ill mess around wit it....and leave you alone for now lol.  Thanks man





On Mon, Oct 25, 2010 at 2:42 PM, Jerome King <jerom...@macefusion.com> wrote:
all of the dictionaries are empty smh...and vgraph.noVisibleVNodes returns 0.  I really don't know why these are empty makes no sense!



Reply all
Reply to author
Forward
0 new messages