tel8618217223380 / jsplumb

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

Looped Back Connectors #48

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load the scenario-loopback_Connector-Django.html file into FF.
2. Move the "page_7" box slightly to the left.
3. See the Connector that used to connect to "page_8" suddenly 
   connect to "page_7".

What is the expected output? What do you see instead?

I expected the Connector to not move itself from "page_8" to "page_7".

What version of the product are you using? On what operating system?

v1.2.4, XP Pro 2002 SP3

Please provide any additional information below.

As you drag one box around the other, in some orientations, the Connector is 
properly displayed, and not in others.  I.e., it seems to mostly dislike 2 
o'clock to 5 o'clock, and is fine in other quadrants.

Original issue reported on code.google.com by tobu...@gmail.com on 1 Dec 2010 at 2:17

GoogleCodeExporter commented 9 years ago
i'm not much of a fan of 2 o'clock to 5 o'clock either: that's siesta time.

Original comment by simon.po...@gmail.com on 1 Dec 2010 at 3:34

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
this is the code:

                myAnchors = [                                                                                  // Intentionally global.
                                jsPlumb.makeAnchor( 0.25, 0.0, 0, -1),   // 3 top ones
                                jsPlumb.makeAnchor( 0.50, 0.0, 0, -1),
//                            jsPlumb.makeAnchor( 0.75, 0.0, 0, -1),
                                jsPlumb.makeAnchor( 1.0, 0.66, 1, 0),     // 2 right ones  
                                jsPlumb.makeAnchor( 1.0, 0.33, 1, 0),
                                jsPlumb.makeAnchor( 0.75, 1.0, 0, 1),     // 3 bottom ones
//                            jsPlumb.makeAnchor( 0.50, 1.0, 0, 1),
                                jsPlumb.makeAnchor( 0.25, 1.0, 0, 1),
                                jsPlumb.makeAnchor( 0.0, 0.66, -1, 0),   // 2 left ones
                                jsPlumb.makeAnchor( 0.0, 0.33, -1, 0)
                ];

    var thisDynamicAnchor = new jsPlumb.makeDynamicAnchor(myAnchors);

    var theseEndpointOptions = {
        anchor:thisDynamicAnchor, dragAllowedWhenFull:true,
        endpoint:new RecessedTriangleEndpoint( myRteOptions)
    };

... looks like you're sharing that anchor between Endpoints.  Anchors cannot be 
static like this.  they break in exactly the way you've described.

suggested solution is:

myAnchors = [
 [ 0.25, 0, 0, -1],
 [ 0.5, 0, 0, -1 ],
etc
]

var theseEndpointOptions = {
  dragAllowedWhenFull:true,
  endpoint:new RecessedTriangleEndpoint(myRteOptions)
};

and then when you do an addEndpoint, configure an Anchor each time:

jsPlumb.addEndpoint("someElement", 
$.extend({anchor:jsPlumb.makeDynamicAnchor(myAnchors)}, theseEndpointOptions));

Original comment by simon.po...@gmail.com on 1 Dec 2010 at 10:56

GoogleCodeExporter commented 9 years ago
Following up on comment#3 above, I confirmed that even switching to:

    myAnchors = [
        [ 0.25, 0, 0, -1],
        [ 0.5, 0, 0, -1 ],
        etc
    ]

does not solve the problem.

The file scenario-loopback_Connector-Django3.html that I e-mailed Simon in a 
.zip file containing all of its supporting files reproduces this problem.

Simon e-mailed me confirming that that using this "Django3" .zip file, he can 
reproduce this too.

My workarounds for the removeEndpoint()-non-functionality in v1.2.3 are very 
clumsy, and I'm eager to migrate to v1.2.4 (or later).

However this "Looping-back Connections" issue prevents me from doing so.

My boss is wondering why my app has all these Connectors going nowhere (my 
workarounds are imperfect, to say the least), so please look at this issue#48 
soon.

Thank you.

My company e-mail has been dead for a week or so, and continues to be so into 
the foreseeable future, so you can contact me at my gmail address that I use to 
post here.

Original comment by tobu...@gmail.com on 8 Dec 2010 at 7:03

GoogleCodeExporter commented 9 years ago
your boss is wondering???  does he or she know there is a donate button on this 
free software? wtf dude.

i confirmed that the file you sent me exhibited strange behaviour, yes - 
because you were sharing anchors between elements.  there is no jsPlumb bug, 
not in 1.2.3 or in 1.2.4.  

check the email i sent to your work email on Monday and forwarded to your gmail 
today.

Original comment by simon.po...@gmail.com on 8 Dec 2010 at 8:45

GoogleCodeExporter commented 9 years ago
Thanks for the e-mail of tips and commenting-out of the disreputable parts of 
my code.  

This let me to discover the following scenario:

1. Create a dynamicAnchor with 10 or so points around the perimeter of a box, 
and use it to create a Connection.

2. Create a static Anchor on one of those 10 points.

3. This is with both #1 and #2 using the [ [ ... ], [ ... ] ] syntax.

4. As you drag one box around the other, the end of the Connector skips from 
dynamicAnchor to dynamicAnchor, _except_ for the one that was "stomped"(?) by 
creating a static Anchor at the same location.

5. For only that "stomped" location, the Connection loops back to the source 
div, as previously discussed.

Does this mean that one can't put a dynamicAnchor and a static Anchor (both 
created with the "[ [ ... ], [ ... ] ]" syntax) at the same location?  

For my application, I hope they can be co-located.

Hope this helps.

Original comment by tobu...@gmail.com on 15 Dec 2010 at 2:42

GoogleCodeExporter commented 9 years ago
i have release version 1.2.5 of jsPlumb now, with a bunch of fixes around the 
dynamic anchors stuff.  if this is still an issue for you i suggest trying 
1.2.5....

Original comment by simon.po...@gmail.com on 23 Jan 2011 at 10:40

GoogleCodeExporter commented 9 years ago
i'm going to close out this issue unless it is a problem for you with 1.2.6 
(latest RC build attached).

could you let me know?  

thanks.

Original comment by simon.po...@gmail.com on 19 Mar 2011 at 11:32

Attachments:

GoogleCodeExporter commented 9 years ago
was fixed in 1.2.5.

Original comment by simon.po...@gmail.com on 20 Apr 2011 at 9:52

GoogleCodeExporter commented 9 years ago

Original comment by simon.po...@gmail.com on 2 Jun 2011 at 4:25