Hareeshchandera / jsplumb

Automatically exported from code.google.com/p/jsplumb
0 stars 0 forks source link

Enhancement Request: Setting EndPoints by pixel instead of percentage. #144

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like to be able to set an endpoint by pixels on the x or y axis, instead of 
a percentage (0.0 to 1). The idea is that I want to create a variable number of 
endpoints on a div whose height will change depending on the number of divs. 
So, calculating a value of X when what you have is N number of boxes M tall 
with a static header B pixels high... 

Well, I suck at math and doing this would make me cry :'(

Example:
jsPlumb.connect({...., anchor:[ '72px', '250px', 0, 1 ], ... });

Mixing both should be possible:
jsPlumb.connect({...., anchor:[ '72px', 1, 0, 1 ], ... });

Etc.

Original issue reported on code.google.com by eslacha...@gmail.com on 29 Oct 2011 at 1:18

GoogleCodeExporter commented 8 years ago

at some stage in jsPlumb's history, anchors supported the concept of an 
'offset', which was exactly what you want, i think.  so it would be something 
like:

anchor:[0,0,0,-1,34,0]

to put the anchor at 34 pixels from the left on the top edge.  but i haven't 
used this for such a long time that i don't even know if it's been refactored 
out, to be honest! maybe you could give it a try.  if it has been refactored 
out then i will reinstate it.  well, even if it hasn't been, there have been a 
bunch of changes with anchors over the last year that will warrant me taking a 
look at the whole thing anyway.

Original comment by simon.po...@gmail.com on 29 Oct 2011 at 1:28

GoogleCodeExporter commented 8 years ago
Well would you look at that! It works great!

Thanks a bunch Simon!

Original comment by eslacha...@gmail.com on 29 Oct 2011 at 2:45

GoogleCodeExporter commented 8 years ago
ha, cool!  i'll leave this open to remind me to check through the code and make 
sure that the offset stuff is always honoured.

Original comment by simon.po...@gmail.com on 29 Oct 2011 at 3:12

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 6 Nov 2011 at 2:39

GoogleCodeExporter commented 8 years ago
closing out.  this seems to be handled by the code ok.

Original comment by simon.po...@gmail.com on 2 Dec 2011 at 1:11