PDA

View Full Version : Node Chart?


vwphillips
08-17-2009, 01:59 PM
I am not sure what to call it, what it may be for or who would need one (suggestions appreciated)

but after http://209.188.89.109/showthread.php?t=174223

see

http://www.vicsjavascripts.org.uk/NodeChart/090817A.htm

feedback appreciated.

Trinithis
08-18-2009, 01:14 AM
Nice code.

Here's a demo of a couple of issues: http://www.youtube.com/watch?v=aHxu0hIpcaM

FYI things like

this.dx=dxy.indexOf('x')>-1?true:false;

can be expressed equivalently as

this.dx=dxy.indexOf('x')>-1;


EDIT: Also, I think the boxes should be able to be stacked over one another.

Alex Vincent
08-18-2009, 01:14 AM
What's the diagram supposed to say? In Firefox 3.5, it's rather blank. :-)

Trinithis
08-18-2009, 02:05 AM
Here's a more comprehensive glitch demo:
http://www.youtube.com/watch?v=0BnDMygMg1I

vwphillips
08-18-2009, 01:06 PM
Trinithis thankyou for the feedback.

Thjink I have fixed a number of issues, see updated code

http://www.vicsjavascripts.org.uk/NodeChart/090818A.htm

Alex Vincent

it works with Gecko/2009073022 Firefox/3.0.13

I will need to get 3.5

abduraooft
08-18-2009, 01:24 PM
Wow.. nice to play with it :)
However the arrow never reappears when I drag any node and release them by touching its edge with the edge of #tst

vwphillips
08-18-2009, 02:14 PM
thanks abduraooft

the link(090818A) has been updated

abduraooft
08-18-2009, 02:37 PM
Um.. now the "help box" stays behind the node which is placed as touching the boundary.
Also, wouldn't it be nice to reset the position of that "help box" each time, when we click the ?, (after relocating it in the previous take)? :)

vwphillips
08-18-2009, 02:52 PM
Um.. now the "help box" stays behind the node, which is placed as touching the boundary.


Fixed


Also, wouldn't it be nice to reset the position of that "help box" each time, when we click the ?, (after relocating it in the previous take)?

subjective but I am assuming that if the user moves the notes that is his prefered position.


Thank again abduraooft

VIPStephan
08-18-2009, 06:23 PM
The node is losing focus (being deselected) when I move it to the edge, and I have to click it again to continue moving it. That kinda annoys me.

vwphillips
08-19-2009, 10:22 AM
Thank for the feed back VIPStephan

This modified drag move function will prevent the loss of focus but I am not sure which is best

zxcDrag.prototype.down=function(ev){
if (!this.drag){
document.onselectstart=function(event){ window.event.returnValue=false; };
this.lastX=ev.clientX;
this.lastY=ev.clientY;
this.drag=true;
this.dobj.style.zIndex=zxcLTZ(this.dobj,'z-Index')+10+'';
this.pos=[zxcLTZ(this.dobj,this.xmde),zxcLTZ(this.dobj,this.ymde)];
if (this.df) this.df(this,ev);
}
if (ev.target) ev.preventDefault();
return false;
}

zxcDrag.prototype.move=function(ev){
if (this.drag){
var msex=ev.clientX,msey=ev.clientY;
var x=this.pos[0]+(msex-this.lastX),y=this.pos[1]+(msey-this.lastY)
if (this.dx&&x>this.mm[0]&&x<this.mm[1]){
this.pos[0]=x*(this.xmde=='left'?1:-1);
this.dobj.style[this.xmde]=this.pos[0]+'px';
this.lastX=msex;
}
if (this.dy&&y>this.mm[2]&&y<this.mm[3]){
this.pos[1]=y*(this.ymde=='top'?1:-1);
this.dobj.style[this.ymde]=this.pos[1]+'px';
this.lastY=msey;
}
if (this.mf) this.mf(this,ev);
}
if (ev.target) ev.preventDefault();
return false;
}



Edit I have decided retaining focus is best.

vwphillips
08-20-2009, 01:29 PM
I have published the Node Chart(I'm sure there must be a better name)

http://www.vicsjavascripts.org.uk/NodeChart/NodeChart.htm

Many thanks to all those why have helped in debugging and made suggestions.