Step by step jQuery flow designer plug-in goflow (with code), jquerygoflow

Source: Internet
Author: User

Step by step jQuery flow designer plug-in goflow (with code), jquerygoflow

After the process node can be added, connect to the draw node and the node, as shown below:

 

It is easy to fold the line of visio.

First, the connection types are divided into Z (line), N (line), And I (Line). Then, when the two nodes are crossed, determine the line to draw based on the location between the two nodes.

1. Node 2 is on the left of Node 1

2. Node 2 is on the right of Node 1

// Calculate the connection type between two nodes. calcLineType = function (n1, n2) {var x11 = n1.left, x12 = n1.left + n1.width, x21 = n2.left, x22 = n2.left + n2.width; var y11 = n1.top, y12 = n1.top + n1.height, y21 = n2.top, y22 = n2.top + n2.height; var x1m = (x11 + x12)/2, x2m = (x21 + x22)/2, y1m = (y11 + y12)/2, y2m = (y21 + y22)/2; if (x1m> = x22) {// Node 2 is on the left of Node 1 (X axis has an intersection) if (y11> y22) {// Node 2 is on the top left of Node 1 (Y axis has no intersection) return "N "; } Else if (y12 <y21) {// Node 2 returns "N";} else {// the Y axis has an intersection return (Math. abs (y1m-y2m) <20? "I": "Z") ;}} else {// Node 2 is on the right of Node 1 (with an intersection on the X axis) if (y11> y22) {// Node 2 is at the top right of Node 1 (the Y axis has no intersection) return (Math. abs (x1m-x2m) <20? "I": "N");} else if (y12 <y21) {// Node 2 returns (Math. abs (x1m-x2m) <20? "I": "N");} else {// the Y axis has an intersection return (Math. abs (y1m-y2m) <20? "I": "Z ");}}};

Currently, this is a simple implementation of connections. Which of the following friends is willing to help you achieve better performance.

Code: GoFlow_04.zip

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.