Hareeshchandera / jsplumb

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

Draggable arrows #32

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
First of all, thank you for amazing library!

Ok, I want to create arrow connections using draggable connections feature. 
Maybe I should be able to specify overlay in connectorStyle

var arrowEndpoint = {
                    endpoint:new jsPlumb.Endpoints.Rectangle(),
                    style:{ width:7, height:7, fillStyle:exampleColor },
                    isSource:true,
                    scope:'blue rectangle',
                    connectorStyle : {
                        lineWidth:1,
                        strokeStyle:someColor,
                        overlays:[new jsPlumb.Overlays.Arrow()] //?
                    },
                    isTarget:true,
                };

As far as I can see current implementation doesn't support this

Original issue reported on code.google.com by astro64m@googlemail.com on 18 Oct 2010 at 2:02

GoogleCodeExporter commented 8 years ago
that sounds cool.  i will add this to version 1.2.4.

Original comment by simon.po...@gmail.com on 19 Oct 2010 at 1:03

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 19 Oct 2010 at 1:04

GoogleCodeExporter commented 8 years ago
just looking in the code i realised i will have to implement it slightly 
differently to your suggestion, as the 'connectorStyle' object is applied as-is 
to the Canvas used to paint the connectors.  so it will be a much simpler 
change to do this:

var arrowEndpoint = {
  endpoint:new jsPlumb.Endpoints.Rectangle(),
  style:{ width:7, height:7, fillStyle:exampleColor },
  isSource:true,
  scope:'blue rectangle',
  connectorStyle : {
    lineWidth:1,
    strokeStyle:someColor,                      
  },
  isTarget:true,
  connectorOverlays:[new jsPlumb.Overlays.Arrow()]  <----------------------         
};

i chose 'connectorOverlays' instead of 'overlays' because i want to reserve the 
ability for Endpoints to possibly have overlays at some stage in the future.  
plus it's more explicit like that.

will that be cool for you?

Original comment by simon.po...@gmail.com on 19 Oct 2010 at 3:17

GoogleCodeExporter commented 8 years ago
there's a demo here:

http://morrisonpitt.com/jsPlumb/tests/draggableConnectorsWithArrows.html

take a look in the source at the 'exampleEndpoint' definition.

Original comment by simon.po...@gmail.com on 19 Oct 2010 at 9:08

GoogleCodeExporter commented 8 years ago
many thanks, this is very useful feature

Original comment by astro64m@googlemail.com on 19 Oct 2010 at 10:54

GoogleCodeExporter commented 8 years ago
yeah it was a good suggestion - thanks.  i wasn't planning on releasing 1.2.4 
for a while so hopefully you're ok to use the various dev scripts for the 
moment.

Original comment by simon.po...@gmail.com on 19 Oct 2010 at 9:40

GoogleCodeExporter commented 8 years ago
setting to fixed. will verify after 1.2.4 is released.

Original comment by simon.po...@gmail.com on 25 Oct 2010 at 9:38

GoogleCodeExporter commented 8 years ago
1.2.4 was released tonight.  

Original comment by simon.po...@gmail.com on 27 Nov 2010 at 1:17