Hareeshchandera / jsplumb

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

Snap to grid feature #147

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It would be nice if you could place the elements on a specified grid

Original issue reported on code.google.com by freeyl...@gmail.com on 13 Nov 2011 at 9:07

GoogleCodeExporter commented 8 years ago
do you mean snap the elements you are connecting to a grid?  i suppose it would 
be nice, yeah.  but i have avoided adding layout functionality to jsPlumb so 
far: it's not really a core concern of jsPlumb.  

this is not the first time someone has asked for layout functionality. i think 
i am stil ruling out putting it into the jsPlumb core, but i might be slowly 
coming around to the idea of an add-on library.  but the code required to do 
this doesn't really need to know about jsPlumb at all, except for maybe a 
repaintEverything call at the end; this add-on library would effectively a 
completely new, standalone, thing.

Original comment by simon.po...@gmail.com on 13 Nov 2011 at 9:43

GoogleCodeExporter commented 8 years ago
i'll be closing this out shortly unless i get some more information.

Original comment by simon.po...@gmail.com on 17 Nov 2011 at 9:00

GoogleCodeExporter commented 8 years ago
Sorry for THE late reply. You are correct. I want to snap THE boxes To a grid. 
Can u point me in THE right direction where i can find such à script to add 
this functionality.

Thans for THE feedback

Original comment by freeyl...@gmail.com on 17 Nov 2011 at 9:07

GoogleCodeExporter commented 8 years ago
ok.  jsPlumb doesnt do layouts as of yet, so if you haven't been able to find 
one you might have to do it yourself.

but i don't think it's very much work, surely.  would you not just get the 
width and height of your container, divide it up a little, and then iterate 
through a bunch of elements?

Original comment by simon.po...@gmail.com on 17 Nov 2011 at 10:00

GoogleCodeExporter commented 8 years ago
dont forget, too, that jQuery's draggable stuff lets you constrain elements to 
a grid.

Original comment by simon.po...@gmail.com on 17 Nov 2011 at 10:00

GoogleCodeExporter commented 8 years ago
ok closing this.  won't be doing it.

Original comment by simon.po...@gmail.com on 25 Nov 2011 at 3:44

GoogleCodeExporter commented 8 years ago
HI,

I found this in the code: clampToGrid
IS this the functionality I was requesting? If yes, how to use it?

THanx

Original comment by freeyl...@gmail.com on 3 Dec 2012 at 9:55

GoogleCodeExporter commented 8 years ago
no this is not the functionality you were requesting, at least i don't think it 
is.

i think what you want is to use the grid parameter from jquery draggable.

jsPlumb.draggable($("someSelector"), { grid:[20,20] });

Original comment by simon.po...@gmail.com on 3 Dec 2012 at 9:58

GoogleCodeExporter commented 8 years ago
THanx!!!!

Original comment by freeyl...@gmail.com on 3 Dec 2012 at 11:03

GoogleCodeExporter commented 8 years ago
no problem.  incidentally the clampToGrid stuff is an experiment I am working 
on, which will work in conjunction with this grid stuff, and clamp the 
connector lines to a grid too.  it will make for a good effect i think.  but 
just using the jquery grid stuff for the nodes makes quite a big difference to 
flowchart-y type applications.

Original comment by simon.po...@gmail.com on 3 Dec 2012 at 11:08