Reuben
Reuben

Reputation: 2741

Draw lines to connect divs

I currently have this set up: http://sandbox.brightboxstudios.com/orgmap/

They are draggable and I am trying to find a way to have lines connect them, even when they are dragged. Having an easy way to show how each is related and which should be connected is ideal!

Thanks!!!

Upvotes: 1

Views: 12676

Answers (4)

tforrest
tforrest

Reputation: 11

You can also try jsPlumb, a JavaScript library that can connects divs together. It's really simple to use and there are plenty of demos on that page.

Upvotes: 1

davidbuzatto
davidbuzatto

Reputation: 9424

You may try KineticJS too. I think that it will provide what you want easily. http://www.kineticjs.com/

Here you can find lots of tutorials: http://www.html5canvastutorials.com/kineticjs/html5-canvas-events-tutorials-introduction-with-kineticjs/

Upvotes: 1

Kevin Johnson
Kevin Johnson

Reputation: 935

Take a look at this: jQuery - use canvas to draw lines between divs

I'd start with that code, and just re-draw the lines every time the divs change location.

Upvotes: 2

Glenn Dayton
Glenn Dayton

Reputation: 1430

You should consider using the D3.js library. In particular this example is what I think you are looking for: http://mbostock.github.com/d3/ex/force.html

Upvotes: 3

Related Questions