SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: prototype: help on computing the placement of flowchart elements

Threaded View

  1. #1
    SitePoint Member
    Join Date
    Mar 2011
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    prototype: help on computing the placement of flowchart elements

    hi guys we're doing a project wherein we have to write the code for the placement of flowchart elements. there is just one problem with the sorting of the elements.

    ideally, it should look like this:


    but right now it looks like this:


    attached is the code. and the function that causes the boxes to sort wrong is this:
    Code JavaScript:
    	shiftDownElements: function(currentY){
    		this.elementsWithPositions.each(function(element){
    			var parallelProcess = this.getParallelElements(this._currentElement);
    			var tempPos = {};
     
    				if (element.value.Y >= currentY) {
    						debugger;
    						tempPos.X = element.value.X;
    						tempPos.Y = element.value.Y + this._flowchart.ELEMENTHEIGHT + this._flowchart.SPACEBTWELEMENT;
    						this.elementsWithPositions.set(element.key, tempPos);
    					}
    		}, this);
    	},

    anyone help?
    Attached Images
    Attached Files

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •