Hareeshchandera / jsplumb

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

Self Loop (for Flowchart connectors) #184

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've tried to display self-loop with the following code:

jsPlumb.connect({ 
   source: 'window1', 
   target: 'window1', 
   connector: [ "Flowchart", { stub: 50 } ],
   anchors:["RightMiddle", "TopCenter"]
});

As shown on the picture "issue.png" you can see a line that too long. 

And when I've tried to increase "stub:100", that line is becoming longer and 
longer

Could you please give me a suggestion, how can I get the result like the 
picture "goal.png" ?

Original issue reported on code.google.com by inmindl...@googlemail.com on 19 Jan 2012 at 10:29

Attachments:

GoogleCodeExporter commented 8 years ago
the flowchart connectors don't handle the self loop case properly yet.  we 
could consider this an enhancement request if you like.

Original comment by simon.po...@gmail.com on 19 Jan 2012 at 7:18

GoogleCodeExporter commented 8 years ago
Yes please! I really need this fix. I've to display absolutely many self-loop 
vertices

Original comment by inmindl...@googlemail.com on 19 Jan 2012 at 7:54

GoogleCodeExporter commented 8 years ago
cool.  it will be a nice improvement to jsPlumb. targeting 1.3.5.

Original comment by simon.po...@gmail.com on 19 Jan 2012 at 8:08

GoogleCodeExporter commented 8 years ago

Original comment by simon.po...@gmail.com on 21 Jan 2012 at 6:08

GoogleCodeExporter commented 8 years ago
this is fixed in development now.  screenshot attached.

it always makes an effort to clear the element to which the connection is 
attached (rather than painting itself below the element at all)

this will be in release 1.3.5

Original comment by simon.po...@gmail.com on 22 Jan 2012 at 3:02

Attachments:

GoogleCodeExporter commented 8 years ago
Wow! It looks great. 

When can you release the version 1.3.5?

Original comment by inmindl...@googlemail.com on 22 Jan 2012 at 9:58

GoogleCodeExporter commented 8 years ago
Thanks for your help

Original comment by inmindl...@googlemail.com on 22 Jan 2012 at 10:11

GoogleCodeExporter commented 8 years ago
no problem.  i'm always a fan of fixing things that make the whole project a 
litte bit better...

1.3.5 will be out in about 3-4 weeks. unless someone finds another bug, the 
list of issues is now closed, at least in my head that is (you can see which 
ones are targeted at milestone 1.3.5 in the issue list).

i'll put up a link to the work in progress 1.3.5 sometime later today.

Original comment by simon.po...@gmail.com on 22 Jan 2012 at 10:30

GoogleCodeExporter commented 8 years ago
dev demo:

http://morrisonpitt.com/jsPlumbTest/demo/jquery/flowchartConnectorsDemo

i'm not 100% happy with the way the loopback connections highlight when 
dragging (it would be better if they snapped to the final state on hover), but 
it's looking like those connectors will need some other bits done so i'm 
reluctant to fix that when i might be changing the code.  so this demo might be 
how the connectors behave for 1.3.5.

Original comment by simon.po...@gmail.com on 27 Jan 2012 at 1:22

GoogleCodeExporter commented 8 years ago
I try this code again.

jsPlumb.connect({ 
  source: 'window1', 
  target: 'window1', 
  connector:[ "Flowchart", { stub:40 } ],
  anchors:["BottomCenter", "LeftMiddle"]
});

It looks like the following picture 

Original comment by inmindl...@googlemail.com on 27 Jan 2012 at 8:23

Attachments:

GoogleCodeExporter commented 8 years ago
that's happening with the script from the test page?

Original comment by simon.po...@gmail.com on 29 Jan 2012 at 4:42

GoogleCodeExporter commented 8 years ago
Yes! you have use all scripts on the test page

Original comment by inmindl...@googlemail.com on 29 Jan 2012 at 8:05

Attachments:

GoogleCodeExporter commented 8 years ago
it must be some side effect of the connect method then.

i updated the test page again a couple of hours ago:

http://morrisonpitt.com/jsPlumbTest/demo/jquery/flowchartConnectorsDemo

and both loopback cases work on that page.  i'll investigate a little further.

Original comment by simon.po...@gmail.com on 29 Jan 2012 at 8:24

GoogleCodeExporter commented 8 years ago
i added a qunit test for the case where you use "anchors" and connect some 
element to itself and they definitely get registered correctly.  of course with 
qunit i am unable to see what's happening on the UI itself so there's a slim 
chance they actually weren't painting correctly.

i'd suggest seeing if this problem still exists in the released version of 
1.3.5, and if so, reopen this issue and we'll see what we can do.

Original comment by simon.po...@gmail.com on 30 Jan 2012 at 8:36

GoogleCodeExporter commented 8 years ago
1.3.5 was released today.

Original comment by simon.po...@gmail.com on 1 Feb 2012 at 1:58

GoogleCodeExporter commented 8 years ago
thank you so much for very quick fix! I'll try the new version 1.3.5 today.

Have you fixed the "minStublength" for Bezier too?

Original comment by inmindl...@googlemail.com on 1 Feb 2012 at 2:26

GoogleCodeExporter commented 8 years ago
stub for Bezier didn't make it into 1.3.5.  targeting 1.3.6 for that.

Original comment by simon.po...@gmail.com on 1 Feb 2012 at 6:03

GoogleCodeExporter commented 8 years ago
In version 1.3.9, the selfloopsare also not displayed correctly

Original comment by freeyl...@gmail.com on 22 Jan 2013 at 1:19

GoogleCodeExporter commented 8 years ago
1.3.9 is not supported anymore.  Only the latest version (currently 1.3.16) is 
supported.

Original comment by simon.po...@gmail.com on 22 Jan 2013 at 6:35

GoogleCodeExporter commented 8 years ago
Thanx for the reply but I meant 1.3.16. Find attached a snaphot.
Where you see rejected, it should return back to current window.
Probably I am doing something wrong. Thanx for your help

Original comment by freeyl...@gmail.com on 23 Jan 2013 at 9:40

Attachments:

GoogleCodeExporter commented 8 years ago
Can you provide a code snippet, or reproduce in jsFiddle?  

i've attached a screenshot of a loop in the flowchart connectors demo 
(http://jsplumb.org/jquery/flowchartConnectorsDemo.html)

Original comment by simon.po...@gmail.com on 23 Jan 2013 at 9:50

Attachments:

GoogleCodeExporter commented 8 years ago
If I define the loopback with the code from the flowchart demo it is working
 but when defining the loopback like this:
                                        var connectorStrokeColor = 'rgba(50, 50, 200, 1)',
                            connectorHighlightStrokeColor = 'rgba(180, 180, 200, 1)',
                            hoverPaintStyle = { lineWidth:9,strokeStyle:'#3f9f9f'},
                            conn4Color = '#dega99';

                            var connection= jsPlumb.connect({  
                                    source:'w_AA', 
                                    target:'w_AA', 
                                    connector:'Flowchart',
                                    anchor:['RightMiddle', 'LeftMiddle'],  
                                    paintStyle:{ 
                                        lineWidth:5, 
                                        strokeStyle:conn4Color, 
                                        joinstyle:'round'
                                    },
                                                            detachable:false,
                                    hoverPaintStyle:hoverPaintStyle,
                                                            detachable:false,
                                    endpointsOnTop:true, 
                                    overlays:[
                                        [ 'Label', {
                                            label:'<span class=\'Tips1\' rel=\'".$task['code']."\'>".$connection['onstatus']."</span>', 
                                            id:'label',
                                            cssClass:'label',
                                            location:0.6,
                                            events:{
                                                    mouseenter:function(labelOverlay, originalEvent) { 
                                                      var Tips1 = new Tips($$('.Tips1'),{className: 'toolmini'});
                                                    }
                                            }
                                        }],
                                        ['Arrow',{
                                            width:30
                                        }]
                                    ],

                            });
It is not working. I would like to use the code from the example but I don't 
know how to define a different color for each connecter in the following code:
   jsPlumb.connect({uuids:['w_AARightMiddle', 'wAABottomCenter']}); 
It looks like as soon as you defined the endpoint you can not adapt anymore the 
color of the connector.

I've tried to do this but it is not working:
jsPlumb.connect({uuids:['w_AARightMiddle', 'wAABottomCenter'],paintStyle:{ 
                                        lineWidth:5, 
                                        strokeStyle:conn4Color, 
                                        joinstyle:'round'
                                    });

Original comment by freeyl...@gmail.com on 24 Jan 2013 at 9:19

GoogleCodeExporter commented 8 years ago
um, in the first code snipper you have this:

anchor:['RightMiddle', 'LeftMiddle'],

that defines a dynamic anchor that both ends of the connection will use. i 
suspect that both ends might choose to use the same value.

you might want to try:

anchors:['RightMiddle', 'LeftMiddle'],

which will assign a different value for each end of the connection.

Original comment by simon.po...@gmail.com on 24 Jan 2013 at 9:23

GoogleCodeExporter commented 8 years ago
I love you :)
All working fine now

Original comment by freeyl...@gmail.com on 24 Jan 2013 at 10:40

GoogleCodeExporter commented 8 years ago
Hi i have similar issue in "State Machine". There should not be any Self 
Connections and How do I achieve "One to One connection".

Original comment by canucan...@gmail.com on 12 Apr 2013 at 7:47

GoogleCodeExporter commented 8 years ago
Thanks in advance.

Original comment by canucan...@gmail.com on 12 Apr 2013 at 7:48

GoogleCodeExporter commented 8 years ago
The state machine connectors draw a loop if they detect that the connection is 
a loopback; you can not, unfortunately, control this behaviour with anchors in 
the same way that you can with the flowchart connectors.

Original comment by simon.po...@gmail.com on 12 Apr 2013 at 7:53