q?($=["L",Q.x+2*B,V],Y.splice(F+1,0,$),$=["C",Q.x+2*B,V,Q.x,V-4*B,Q.x-2*B,V],Y.splice(F+2,0,$),r.attr("path",Y)):($=["L",Q.x-2*B,V],Y.splice(F+1,0,$),$=["C",Q.x-2*B,V,Q.x,V-4*B,Q.x+2*B,V],Y.splice(F+2,0,$),r.attr("path",Y)):V>G?($=["L",N,Q.y+2*B],Y.splice(F+1,0,$),$=["C",N,Q.y+2*B,N+4*B,Q.y,N,Q.y-2*B],Y.splice(F+2,0,$),r.attr("path",Y)):($=["L",N,Q.y-2*B],Y.splice(F+1,0,$),$=["C",N,Q.y-2*B,N+4*B,Q.y,N,Q.y+2*B],Y.splice(F+2,0,$),r.attr("path",Y)),F+=2,O+=2}}}this.chart.lines.push(r)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&k>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=k)},t.exports=r},function(t,i){function e(t,i,e){var r,s,o="M{0},{1}";for(r=2,s=2*e.length+2;rc.x?i.x-(i.x-c.x)/2:c.x-(c.x-i.x)/2,d=i.y>c.y?i.y-(i.y-c.y)/2:c.y-(c.y-i.y)/2,p?(u-=f.getBBox().width/2,d-=t.options["text-margin"]):(u+=t.options["text-margin"],d-=f.getBBox().height/2)):(u=i.x,d=i.y,p?(u+=t.options["text-margin"]/2,d-=t.options["text-margin"]):(u+=t.options["text-margin"]/2,d+=t.options["text-margin"])),f.attr({"text-anchor":"start","font-size":t.options["font-size"],fill:t.options["font-color"],x:u,y:d}),x&&f.attr({font:x}),y&&f.attr({"font-family":y}),l&&f.attr({"font-weight":l})}return a}function s(t,i,e,r,s,o,n,h){var a,x,y,l,g,f={x:null,y:null,onLine1:!1,onLine2:!1};return a=(h-o)*(e-t)-(n-s)*(r-i),0===a?f:(x=i-o,y=t-s,l=(n-s)*x-(h-o)*y,g=(e-t)*x-(r-i)*y,x=l/a,y=g/a,f.x=t+x*(e-t),f.y=i+x*(r-i),x>0&&x<1&&(f.onLine1=!0),y>0&&y<1&&(f.onLine2=!0),f)}t.exports={drawPath:e,drawLine:r,checkLineIntersection:s}},function(t,i,e){function r(t){function i(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?r.symbols[t.substring(0,i-1)]:r.symbols[t]}function e(t){var i="next",e=t.indexOf("(")+1,r=t.indexOf(")");return e>=0&&r>=0&&(i=X.substring(e,r),i.indexOf(",")<0&&"yes"!==i&&"no"!==i&&(i="next, "+i)),i}t=t||"",t=t.trim();for(var r={symbols:{},start:null,drawSVG:function(t,i){function e(t){if(g[t.key])return g[t.key];switch(t.symbolType){case"start":g[t.key]=new o(l,t);break;case"end":g[t.key]=new n(l,t);break;case"operation":g[t.key]=new h(l,t);break;case"inputoutput":g[t.key]=new a(l,t);break;case"subroutine":g[t.key]=new x(l,t);break;case"condition":g[t.key]=new y(l,t);break;default:return new Error("Wrong symbol type!")}return g[t.key]}var r=this;this.diagram&&this.diagram.clean();var l=new s(t,i);this.diagram=l;var g={};!function f(t,i,s){var o=e(t);return r.start===t?l.startWith(o):i&&s&&!i.pathOk&&(i instanceof y?(s.yes===t&&i.yes(o),s.no===t&&i.no(o)):i.then(o)),o.pathOk?o:(o instanceof y?(t.yes&&f(t.yes,o,t),t.no&&f(t.no,o,t)):t.next&&f(t.next,o,t),o)}(this.start),l.render()},clean:function(){this.diagram.clean()}},l=[],g=0,f=1,p=t.length;f")<0&&m.indexOf("=>")<0?(l[u-1]+="\n"+m,l.splice(u,1),d--):u++}for(;l.length>0;){var b=l.splice(0,1)[0].trim();if(b.indexOf("=>")>=0){var v,w=b.split("=>"),k={key:w[0],symbolType:w[1],text:null,link:null,target:null,flowstate:null};if(k.symbolType.indexOf(": ")>=0&&(v=k.symbolType.split(": "),k.symbolType=v.shift(),k.text=v.join(": ")),k.text&&k.text.indexOf(":>")>=0?(v=k.text.split(":>"),k.text=v.shift(),k.link=v.join(":>")):k.symbolType.indexOf(":>")>=0&&(v=k.symbolType.split(":>"),k.symbolType=v.shift(),k.link=v.join(":>")),k.symbolType.indexOf("\n")>=0&&(k.symbolType=k.symbolType.split("\n")[0]),k.link){var _=k.link.indexOf("[")+1,B=k.link.indexOf("]");_>=0&&B>=0&&(k.target=k.link.substring(_,B),k.link=k.link.substring(0,_-1))}if(k.text&&k.text.indexOf("|")>=0){var A=k.text.split("|");k.flowstate=A.pop().trim(),k.text=A.join("|")}r.symbols[k.key]=k}else if(b.indexOf("->")>=0)for(var L=b.split("->"),M=0,O=L.length;M=0){var S=Y.split(",");Y=S[0],C=S[1].trim()}if(r.start||(r.start=T),M+1r.right_symbol.getCenter().y&&h<=r.right_symbol.width/2){e=!0;break}}e&&(r.right_symbol.setX(i.getX()+i.width+t),s())}(),this.right_symbol.isPositioned=!0,this.right_symbol.render()}}},r.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.getAttr("no-text"),this.no_direction)},t.exports=r},function(t,i,e){function r(t,i){i=i||{},this.paper=new s(t),this.options=o(i,n),this.symbols=[],this.lines=[],this.start=null}var s=e(15),o=e(1).defaults,n=e(7),h=e(5);r.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var i=this;return t instanceof h?(t.yes=function(e){return t.yes_symbol=e,t.no_symbol&&(t.pathOk=!0),i.handle(e)},t.no=function(e){return t.no_symbol=e,t.yes_symbol&&(t.pathOk=!0),i.handle(e)}):t.then=function(e){return t.next=e,t.pathOk=!0,i.handle(e)},t},r.prototype.startWith=function(t){return this.start=t,this.handle(t)},r.prototype.render=function(){var t,i,e=0,r=0,s=0,o=0,n=0,h=0,a=0,x=0;for(s=0,o=this.symbols.length;se&&(e=t.width),t.height>r&&(r=t.height);for(s=0,o=this.symbols.length;sn&&(n=y),l>h&&(h=l);for(s=0,o=this.lines.length;sn&&(n=g),f>h&&(h=f)}var p=this.options.scale,c=this.options["line-width"];a<0&&(a-=c),x<0&&(x-=c);var u=n+c-a,d=h+c-x;this.paper.setSize(u*p,d*p),this.paper.setViewBox(a,x,u,d,!0)},r.prototype.clean=function(){if(this.paper){var t=this.paper.canvas;t.parentNode.removeChild(t)}},t.exports=r},function(t,i){t.exports={x:0,y:0,"line-width":3,"line-length":50,"text-margin":10,"font-size":14,"font-color":"black","line-color":"black","element-color":"black",fill:"white","yes-text":"yes","no-text":"no","arrow-end":"block","class":"flowchart",scale:1,symbols:{start:{},end:{},condition:{},inputoutput:{},operation:{},subroutine:{}}}},function(t,i){Array.prototype.indexOf||(Array.prototype.indexOf=function(t){"use strict";if(null===this)throw new TypeError;var i=Object(this),e=i.length>>>0;if(0===e)return-1;var r=0;if(arguments.length>0&&(r=Number(arguments[1]),r!=r?r=0:0!==r&&r!=1/0&&r!=-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r)))),r>=e)return-1;for(var s=r>=0?r:Math.max(e-Math.abs(r),0);s>>0;if(0===e)return-1;var r=e;arguments.length>1&&(r=Number(arguments[1]),r!=r?r=0:0!==r&&r!=1/0&&r!=-(1/0)&&(r=(r>0||-1)*Math.floor(Math.abs(r))));for(var s=r>=0?Math.min(r,e-1):e-Math.abs(r);s>=0;s--)if(s in i&&i[s]===t)return s;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},function(t,i,e){function r(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"End",s.call(this,t,i,e)}var s=e(2),o=e(1).inherits;o(r,s),t.exports=r},function(t,i,e){function r(t,i){i=i||{},s.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,r=this.text.getBBox().height+2*this.textMargin,o=this.textMargin,n=r/2,a={x:o,y:n},x=[{x:o-this.textMargin,y:r},{x:o-this.textMargin+e,y:r},{x:o-this.textMargin+e+2*this.textMargin,y:0},{x:o-this.textMargin+2*this.textMargin,y:0},{x:o,y:n}],y=h(t,a,x);y.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&y.attr("href",i.link),i.target&&y.attr("target",i.target),i.key&&(y.node.id=i.key),y.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:y.getBBox().height/2}),this.group.push(y),y.insertBefore(this.text),this.initialize()}var s=e(2),o=e(1).inherits,n=e(3),h=n.drawPath;o(r,s),r.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},r.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=r},function(t,i,e){function r(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},s.call(this,t,i,e)}var s=e(2),o=e(1).inherits;o(r,s),t.exports=r},function(t,i,e){function r(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"Start",s.call(this,t,i,e)}var s=e(2),o=e(1).inherits;o(r,s),t.exports=r},function(t,i,e){function r(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},s.call(this,t,i,e),e.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var r=t.paper.rect(0,0,0,0);r.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),i.key&&(r.node.id=i.key+"i");var o=this.getAttr("font"),n=this.getAttr("font-family"),h=this.getAttr("font-weight");o&&r.attr({font:o}),n&&r.attr({"font-family":n}),h&&r.attr({"font-weight":h}),i.link&&r.attr("href",i.link),i.target&&r.attr("target",i.target),this.group.push(r),r.insertBefore(this.text),this.initialize()}var s=e(2),o=e(1).inherits;o(r,s),t.exports=r},function(t,i,e){if("undefined"!=typeof jQuery){var r=e(4);!function(t){t.fn.flowChart=function(i){return this.each(function(){var e=t(this),s=r(e.text());e.html(""),s.drawSVG(this,i)})}}(jQuery)}},function(i,e){i.exports=t}])});
+!function(t,i){if("object"==typeof exports&&"object"==typeof module)module.exports=i(require("Raphael"));else if("function"==typeof define&&define.amd)define(["Raphael"],i);else{var e=i("object"==typeof exports?require("Raphael"):t.Raphael);for(var s in e)("object"==typeof exports?exports:t)[s]=e[s]}}(this,function(t){return function(t){function i(s){if(e[s])return e[s].exports;var n=e[s]={exports:{},id:s,loaded:!1};return t[s].call(n.exports,n,n.exports,i),n.loaded=!0,n.exports}var e={};return i.m=t,i.c=e,i.p="",i(0)}([function(t,i,e){e(9);var s=e(4);e(17);var n={parse:s};"undefined"!=typeof window&&(window.flowchart=n),t.exports=n},function(t,i){function e(t,i){if(!t||"function"==typeof t)return i;var s={};for(var n in i)s[n]=i[n];for(n in t)t[n]&&("object"==typeof s[n]?s[n]=e(s[n],t[n]):s[n]=t[n]);return s}function s(t,i){if("function"==typeof Object.create)t.super_=i,t.prototype=Object.create(i.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}});else{t.super_=i;var e=function(){};e.prototype=i.prototype,t.prototype=new e,t.prototype.constructor=t}}t.exports={defaults:e,inherits:s}},function(t,i,e){function s(t,i,e){this.chart=t,this.group=this.chart.paper.set(),this.symbol=e,this.connectedTo=[],this.symbolType=i.symbolType,this.flowstate=i.flowstate||"future",this.lineStyle=i.lineStyle||{},this.key=i.key||"",this.leftLines=[],this.rightLines=[],this.topLines=[],this.bottomLines=[],this.params=i.params,this.next_direction=i.next&&i.direction_next?i.direction_next:void 0,this.text=this.chart.paper.text(0,0,i.text),i.key&&(this.text.node.id=i.key+"t"),this.text.node.setAttribute("class",this.getAttr("class")+"t"),this.text.attr({"text-anchor":"start",x:this.getAttr("text-margin"),fill:this.getAttr("font-color"),"font-size":this.getAttr("font-size")});var s=this.getAttr("font"),n=this.getAttr("font-family"),h=this.getAttr("font-weight");s&&this.text.attr({font:s}),n&&this.text.attr({"font-family":n}),h&&this.text.attr({"font-weight":h}),i.link&&this.text.attr("href",i.link),i.function&&(this.text.attr({cursor:"pointer"}),this.text.node.addEventListener("click",function(t){window[i.function](t,i)},!1)),i.target&&this.text.attr("target",i.target);var r=this.getAttr("maxWidth");if(r){for(var o=i.text.split(" "),a="",l=0,p=o.length;lr?"\n"+x:" "+x}this.text.attr("text",a.substring(1))}if(this.group.push(this.text),e){var y=this.getAttr("text-margin");e.attr({fill:this.getAttr("fill"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*y,height:this.text.getBBox().height+2*y}),e.node.setAttribute("class",this.getAttr("class"));var g=this.getAttr("roundness");isNaN(g)||(e.node.setAttribute("ry",g),e.node.setAttribute("rx",g)),i.link&&e.attr("href",i.link),i.target&&e.attr("target",i.target),i.function&&(e.node.addEventListener("click",function(t){window[i.function](t,i)},!1),e.attr({cursor:"pointer"})),i.key&&(e.node.id=i.key),this.group.push(e),e.insertBefore(this.text),this.text.attr({y:e.getBBox().height/2}),this.initialize()}}var n=e(3),h=n.drawLine,r=n.checkLineIntersection;s.prototype.getAttr=function(t){if(this.chart){var i,e=this.chart.options?this.chart.options[t]:void 0,s=this.chart.options.symbols?this.chart.options.symbols[this.symbolType][t]:void 0;return this.chart.options.flowstate&&this.chart.options.flowstate[this.flowstate]&&(i=this.chart.options.flowstate[this.flowstate][t]),i||s||e}},s.prototype.initialize=function(){this.group.transform("t"+this.getAttr("line-width")+","+this.getAttr("line-width")),this.width=this.group.getBBox().width,this.height=this.group.getBBox().height},s.prototype.getCenter=function(){return{x:this.getX()+this.width/2,y:this.getY()+this.height/2}},s.prototype.getX=function(){return this.group.getBBox().x},s.prototype.getY=function(){return this.group.getBBox().y},s.prototype.shiftX=function(t){this.group.transform("t"+(this.getX()+t)+","+this.getY())},s.prototype.setX=function(t){this.group.transform("t"+t+","+this.getY())},s.prototype.shiftY=function(t){this.group.transform("t"+this.getX()+","+(this.getY()+t))},s.prototype.setY=function(t){this.group.transform("t"+this.getX()+","+t)},s.prototype.getTop=function(){var t=this.getY(),i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getBottom=function(){var t=this.getY()+this.height,i=this.getX()+this.width/2;return{x:i,y:t}},s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX();return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width;return{x:i,y:t}},s.prototype.render=function(){if(this.next){var t=this,i=this.getAttr("line-length");if("right"===this.next_direction){var e=this.getRight();this.next.isPositioned||(this.next.setY(e.y-this.next.height/2),this.next.shiftX(this.group.getBBox().x+this.width+i),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.next.getCenter().y&&o<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else if("left"===this.next_direction){var s=this.getLeft();this.next.isPositioned||(this.next.setY(s.y-this.next.height/2),this.next.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.next.getCenter().y&&o<=t.next.width/2){n=!0;break}}if(n){if("end"===t.next.symbolType)return;t.next.setX(s.getX()+s.width+i),e()}}(),this.next.isPositioned=!0,this.next.render())}else{var n=this.getBottom();this.next.isPositioned||(this.next.shiftY(this.getY()+this.height+i),this.next.setX(n.x-this.next.width/2),this.next.isPositioned=!0,this.next.render())}}},s.prototype.renderLines=function(){this.next&&(this.next_direction?this.drawLineTo(this.next,this.getAttr("arrow-text")||"",this.next_direction):this.drawLineTo(this.next,this.getAttr("arrow-text")||""))},s.prototype.drawLineTo=function(t,i,e){this.connectedTo.indexOf(t)<0&&this.connectedTo.push(t);var s,n,o=this.getCenter().x,a=this.getCenter().y,l=this.getRight(),p=this.getBottom(),x=this.getTop(),y=this.getLeft(),g=t.getCenter().x,f=t.getCenter().y,c=t.getTop(),d=t.getRight(),m=t.getLeft(),u=o===g,b=a===f,_=af||this===t,w=o>g,L=ok&&(k=c.x);else n=10*Math.max(t.topLines.length,this.bottomLines.length),s=this.leftEnd&&v?h(this.chart,p,[{x:p.x,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:p.y+B/2-n},{x:p.x+(p.x-c.x)/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i):h(this.chart,p,[{x:p.x,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x+(p.x-c.x)/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else n=10*Math.max(t.topLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x+B/2,y:l.y-n},{x:l.x+B/2,y:c.y-B/2-n},{x:c.x,y:c.y-B/2-n},{x:c.x,y:c.y}],i),this.rightLines.push(s),t.topLines.push(s),this.rightStart=!0,t.topEnd=!0,k=l.x+B/2;else 0===t.rightLines.length&&0===this.leftLines.length?s=h(this.chart,y,d,i):(n=10*Math.max(t.rightLines.length,this.leftLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:d.y-n},{x:d.x,y:d.y-n},{x:d.x,y:d.y}],i)),this.leftLines.push(s),t.rightLines.push(s),this.leftStart=!0,t.rightEnd=!0,k=d.x;else 0===t.leftLines.length&&0===this.rightLines.length?s=h(this.chart,l,m,i):(n=10*Math.max(t.leftLines.length,this.rightLines.length),s=h(this.chart,l,[{x:l.x,y:l.y-n},{x:l.x,y:m.y-n},{x:m.x,y:m.y-n},{x:m.x,y:m.y}],i)),this.rightLines.push(s),t.leftLines.push(s),this.rightStart=!0,t.leftEnd=!0,k=m.x;else 0===t.topLines.length&&0===this.bottomLines.length?s=h(this.chart,p,c,i):(n=10*Math.max(t.topLines.length,this.bottomLines.length),s=h(this.chart,p,[{x:c.x,y:c.y-n},{x:c.x,y:c.y}],i)),this.bottomLines.push(s),t.topLines.push(s),this.bottomStart=!0,t.topEnd=!0,k=p.x;if(this.lineStyle[t.key]&&s&&s.attr(this.lineStyle[t.key]),s){for(var O=0,X=this.chart.lines.length;OW?(J=["L",q.x+2*M,I],C.splice(N+1,0,J),J=["C",q.x+2*M,I,q.x,I-4*M,q.x-2*M,I],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",q.x-2*M,I],C.splice(N+1,0,J),J=["C",q.x-2*M,I,q.x,I-4*M,q.x+2*M,I],C.splice(N+2,0,J),s.attr("path",C)):I>Q?(J=["L",G,q.y+2*M],C.splice(N+1,0,J),J=["C",G,q.y+2*M,G+4*M,q.y,G,q.y-2*M],C.splice(N+2,0,J),s.attr("path",C)):(J=["L",G,q.y-2*M],C.splice(N+1,0,J),J=["C",G,q.y-2*M,G+4*M,q.y,G,q.y+2*M],C.splice(N+2,0,J),s.attr("path",C)),N+=2}}}this.chart.lines.push(s),(void 0===this.chart.minXFromSymbols||this.chart.minXFromSymbols>y.x)&&(this.chart.minXFromSymbols=y.x)}(!this.chart.maxXFromLine||this.chart.maxXFromLine&&k>this.chart.maxXFromLine)&&(this.chart.maxXFromLine=k)},t.exports=s},function(t,i){function e(t,i,e){var s,n,h="M{0},{1}";for(s=2,n=2*e.length+2;sd.x?i.x-(i.x-d.x)/2:d.x-(d.x-i.x)/2,u=i.y>d.y?i.y-(i.y-d.y)/2:d.y-(d.y-i.y)/2,c?(m-=g.getBBox().width/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"],u-=g.getBBox().height/2)):(m=i.x,u=i.y,c?(i.x>d.x?(m-=t.options["text-margin"]/2,f="end"):m+=t.options["text-margin"]/2,u-=t.options["text-margin"]):(m+=t.options["text-margin"]/2,u+=t.options["text-margin"],i.y>d.y&&(u-=2*t.options["text-margin"]))),g.attr({"text-anchor":f,"font-size":t.options["font-size"],fill:t.options["font-color"],x:m,y:u}),l&&g.attr({font:l}),p&&g.attr({"font-family":p}),x&&g.attr({"font-weight":x})}return a}function n(t,i,e,s,n,h,r,o){var a,l,p,x,y,g={x:null,y:null,onLine1:!1,onLine2:!1};return a=(o-h)*(e-t)-(r-n)*(s-i),0===a?g:(l=i-h,p=t-n,x=(r-n)*l-(o-h)*p,y=(e-t)*l-(s-i)*p,l=x/a,p=y/a,g.x=t+l*(e-t),g.y=i+l*(s-i),l>0&&l<1&&(g.onLine1=!0),p>0&&p<1&&(g.onLine2=!0),g)}t.exports={drawPath:e,drawLine:s,checkLineIntersection:n}},function(t,i,e){function s(t){function i(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):"{}"}function e(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?t.substring(i,e):""}function s(t){var i=t.indexOf("(")+1,e=t.indexOf(")");return i>=0&&e>=0?d.symbols[t.substring(0,i-1)]:d.symbols[t]}function f(t){var i="next",e=t.indexOf("(")+1,s=t.indexOf(")");return e>=0&&s>=0&&(i=N.substring(e,s),i.indexOf(",")<0&&"yes"!==i&&"no"!==i&&(i="next, "+i)),i}function c(t){var i=t.indexOf("(")+1,e=t.indexOf(")"),s=t.substring(i,e);s.indexOf(",")>0&&(s=s.substring(0,s.indexOf(",")));var n=s.split("@");if(n.length>1)return i>=0&&e>=0?n[1]:""}t=t||"",t=t.trim();for(var d={symbols:{},start:null,drawSVG:function(t,i){function e(t){if(c[t.key])return c[t.key];switch(t.symbolType){case"start":c[t.key]=new h(f,t);break;case"end":c[t.key]=new r(f,t);break;case"operation":c[t.key]=new o(f,t);break;case"inputoutput":c[t.key]=new a(f,t);break;case"input":c[t.key]=new l(f,t);break;case"output":c[t.key]=new p(f,t);break;case"subroutine":c[t.key]=new x(f,t);break;case"condition":c[t.key]=new y(f,t);break;case"parallel":c[t.key]=new g(f,t);break;default:return new Error("Wrong symbol type!")}return c[t.key]}var s=this;this.diagram&&this.diagram.clean();var f=new n(t,i);this.diagram=f;var c={};!function t(i,n,h){var r=e(i);return s.start===i?f.startWith(r):n&&h&&!n.pathOk&&(n instanceof y?(h.yes===i&&n.yes(r),h.no===i&&n.no(r)):n instanceof g?(h.path1===i&&n.path1(r),h.path2===i&&n.path2(r),h.path3===i&&n.path3(r)):n.then(r)),r.pathOk?r:(r instanceof y?(i.yes&&t(i.yes,r,i),i.no&&t(i.no,r,i)):r instanceof g?(i.path1&&t(i.path1,r,i),i.path2&&t(i.path2,r,i),i.path3&&t(i.path3,r,i)):i.next&&t(i.next,r,i),r)}(this.start),f.render()},clean:function(){this.diagram.clean()},options:function(){return this.diagram.options}},m=[],u=0,b=1,_=t.length;b<_;b++)if("\n"===t[b]&&"\\"!==t[b-1]){var v=t.substring(u,b);u=b+1,m.push(v.replace(/\\\n/g,"\n"))}u")<0&&k.indexOf("=>")<0&&k.indexOf("@>")<0?(m[w-1]+="\n"+k,m.splice(w,1),L--):w++}for(;m.length>0;){var B=m.splice(0,1)[0].trim();if(B.indexOf("=>")>=0){var M=B.split("=>"),A={key:M[0].replace(/\(.*\)/,""),symbolType:M[1],text:null,link:null,target:null,flowstate:null,function:null,lineStyle:{},params:{}},O=M[0].match(/\((.*)\)/);if(O&&O.length>1)for(var X=O[1].split(","),T=0;T=0&&(C=A.symbolType.split(": "),A.symbolType=C.shift(),A.text=C.join(": ")),A.text&&A.text.indexOf(":$")>=0?(C=A.text.split(":$"),A.text=C.shift(),A.function=C.join(":$")):A.symbolType.indexOf(":$")>=0?(C=A.symbolType.split(":$"),A.symbolType=C.shift(),A.function=C.join(":$")):A.text&&A.text.indexOf(":>")>=0?(C=A.text.split(":>"),A.text=C.shift(),A.link=C.join(":>")):A.symbolType.indexOf(":>")>=0&&(C=A.symbolType.split(":>"),A.symbolType=C.shift(),A.link=C.join(":>")),A.symbolType.indexOf("\n")>=0&&(A.symbolType=A.symbolType.split("\n")[0]),A.link){var Y=A.link.indexOf("[")+1,P=A.link.indexOf("]");Y>=0&&P>=0&&(A.target=A.link.substring(Y,P),A.link=A.link.substring(0,Y-1))}if(A.text&&A.text.indexOf("|")>=0){var j=A.text.split("|");A.flowstate=j.pop().trim(),A.text=j.join("|")}d.symbols[A.key]=A}else if(B.indexOf("->")>=0){var E=c(B);E&&(B=B.replace("@"+E,""));for(var z=B.split("->"),R=0,F=z.length;R=0){var W=V.split(",");V=W[0],I=W[1].trim()}if(E&&("condition"===G.symbolType?"yes"===V||"true"===V?G.yes_annotation=E:G.no_annotation=E:"parallel"===G.symbolType&&("path1"===V?G.path1_annotation=E:"path2"===V?G.path2_annotation=E:"path3"===V&&(G.path3_annotation=E)),E=null),d.start||(d.start=G),R+1")>=0)for(var q=B.split("@>"),J=0,D=q.length;Jt.right_symbol.getCenter().y&&o<=t.right_symbol.width/2){n=!0;break}}if(n){if("end"===t.right_symbol.symbolType)return;t.right_symbol.setX(s.getX()+s.width+i),e()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+i)),function e(){for(var s,n=!1,h=0,r=t.chart.symbols.length;ht.left_symbol.getCenter().y&&o<=t.left_symbol.width/2){n=!0;break}}if(n){if("end"===t.left_symbol.symbolType)return;t.left_symbol.setX(s.getX()+s.width+i),e()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}},s.prototype.renderLines=function(){this.yes_symbol&&this.drawLineTo(this.yes_symbol,this.yes_annotation?this.yes_annotation:this.getAttr("yes-text"),this.yes_direction),this.no_symbol&&this.drawLineTo(this.no_symbol,this.no_annotation?this.no_annotation:this.getAttr("no-text"),this.no_direction)},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),this.path1_annotation=i.path1_annotation||"",this.path2_annotation=i.path2_annotation||"",this.path3_annotation=i.path3_annotation||"",this.textMargin=this.getAttr("text-margin"),this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top",this.params=i.params,"path1"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path2"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),"path3"===i.direction_next&&!i[i.direction_next]&&i.next&&(i[i.direction_next]=i.next),i.path1&&i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path1?(this.path2_direction="bottom",this.path1_direction="right",this.path3_direction="top"):"top"===i.direction_path1?(this.path2_direction="right",this.path1_direction="top",this.path3_direction="bottom"):"left"===i.direction_path1?(this.path2_direction="right",this.path1_direction="left",this.path3_direction="bottom"):(this.path2_direction="right",this.path1_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&i.direction_path2&&i.path3&&!i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="top"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="left",this.path3_direction="right"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):i.path1&&!i.direction_path1&&i.path2&&!i.direction_path2&&i.path3&&i.direction_path3?"right"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="top",this.path3_direction="right"):"left"===i.direction_path2?(this.path1_direction="bottom",this.path2_direction="right",this.path3_direction="left"):(this.path1_direction="right",this.path2_direction="bottom",this.path3_direction="top"):(this.path1_direction=i.direction_path1,this.path2_direction=i.direction_path2,this.path3_direction=i.direction_path3),this.path1_direction=this.path1_direction||"bottom",this.path2_direction=this.path2_direction||"right",this.path3_direction=this.path3_direction||"top",this.initialize()}var n=e(2),h=e(1).inherits;h(s,n),s.prototype.render=function(){this.path1_direction&&(this[this.path1_direction+"_symbol"]=this.path1_symbol),this.path2_direction&&(this[this.path2_direction+"_symbol"]=this.path2_symbol),this.path3_direction&&(this[this.path3_direction+"_symbol"]=this.path3_symbol);var t=this.getAttr("line-length");if(this.bottom_symbol){var i=this.getBottom();this.bottom_symbol.isPositioned||(this.bottom_symbol.shiftY(this.getY()+this.height+t),this.bottom_symbol.setX(i.x-this.bottom_symbol.width/2),this.bottom_symbol.isPositioned=!0,this.bottom_symbol.render())}if(this.top_symbol){var e=this.getTop();this.top_symbol.isPositioned||(this.top_symbol.shiftY(this.getY()-this.top_symbol.height-t),this.top_symbol.setX(e.x+this.top_symbol.width),this.top_symbol.isPositioned=!0,this.top_symbol.render())}var s=this;if(this.left_symbol){var n=this.getLeft();this.left_symbol.isPositioned||(this.left_symbol.setY(n.y-this.left_symbol.height/2),this.left_symbol.shiftX(-(this.group.getBBox().x+this.width+t)),function i(){for(var e,n=!1,h=0,r=s.chart.symbols.length;hs.left_symbol.getCenter().y&&o<=s.left_symbol.width/2){n=!0;break}}if(n){if("end"===s.left_symbol.symbolType)return;s.left_symbol.setX(e.getX()+e.width+t),i()}}(),this.left_symbol.isPositioned=!0,this.left_symbol.render())}if(this.right_symbol){var h=this.getRight();this.right_symbol.isPositioned||(this.right_symbol.setY(h.y-this.right_symbol.height/2),this.right_symbol.shiftX(this.group.getBBox().x+this.width+t),function i(){for(var e,n=!1,h=0,r=s.chart.symbols.length;hs.right_symbol.getCenter().y&&o<=s.right_symbol.width/2){n=!0;break}}if(n){if("end"===s.right_symbol.symbolType)return;s.right_symbol.setX(e.getX()+e.width+t),i()}}(),this.right_symbol.isPositioned=!0,this.right_symbol.render())}},s.prototype.renderLines=function(){this.path1_symbol&&this.drawLineTo(this.path1_symbol,this.path1_annotation,this.path1_direction),this.path2_symbol&&this.drawLineTo(this.path2_symbol,this.path2_annotation,this.path2_direction),this.path3_symbol&&this.drawLineTo(this.path3_symbol,this.path3_annotation,this.path3_direction)},t.exports=s},function(t,i,e){function s(t,i){i=i||{},this.paper=new n(t),this.options=h(i,r),this.symbols=[],this.lines=[],this.start=null}var n=e(18),h=e(1).defaults,r=e(8),o=e(5),a=e(6);s.prototype.handle=function(t){this.symbols.indexOf(t)<=-1&&this.symbols.push(t);var i=this;return t instanceof o?(t.yes=function(e){return t.yes_symbol=e,t.no_symbol&&(t.pathOk=!0),i.handle(e)},t.no=function(e){return t.no_symbol=e,t.yes_symbol&&(t.pathOk=!0),i.handle(e)}):t instanceof a?(t.path1=function(e){return t.path1_symbol=e,t.path2_symbol&&(t.pathOk=!0),i.handle(e)},t.path2=function(e){return t.path2_symbol=e,t.path3_symbol&&(t.pathOk=!0),i.handle(e)},t.path3=function(e){return t.path3_symbol=e,t.path1_symbol&&(t.pathOk=!0),i.handle(e)}):t.then=function(e){return t.next=e,t.pathOk=!0,i.handle(e)},t},s.prototype.startWith=function(t){return this.start=t,this.handle(t)},s.prototype.render=function(){var t,i,e=0,s=0,n=0,h=0,r=0,o=0,a=0,l=0;for(n=0,h=this.symbols.length;ne&&(e=t.width),t.height>s&&(s=t.height);for(n=0,h=this.symbols.length;nr&&(r=p),x>o&&(o=x)}for(n=0,h=this.lines.length;nr&&(r=g),f>o&&(o=f)}var c=this.options.scale,d=this.options["line-width"];this.minXFromSymbols>>0;if(0===e)return-1;var s=0;if(arguments.length>0&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s)))),s>=e)return-1;for(var n=s>=0?s:Math.max(e-Math.abs(s),0);n>>0;if(0===e)return-1;var s=e;arguments.length>1&&(s=Number(arguments[1]),s!=s?s=0:0!==s&&s!=1/0&&s!=-(1/0)&&(s=(s>0||-1)*Math.floor(Math.abs(s))));for(var n=s>=0?Math.min(s,e-1):e-Math.abs(s);n>=0;n--)if(n in i&&i[n]===t)return n;return-1}),String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^\s+|\s+$/g,"")})},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"End",n.call(this,t,i,e)}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin+2*this.textMargin,y:s},{x:h-this.textMargin+e,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:0},{x:h-this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin,y:s},{x:h-this.textMargin+e,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:0},{x:h-this.textMargin+2*this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e)}var n=e(2),h=e(1).inherits;
+h(s,n),t.exports=s},function(t,i,e){function s(t,i){i=i||{},n.call(this,t,i),this.textMargin=this.getAttr("text-margin"),this.text.attr({x:3*this.textMargin});var e=this.text.getBBox().width+4*this.textMargin,s=this.text.getBBox().height+2*this.textMargin,h=this.textMargin,r=s/2,a={x:h,y:r},l=[{x:h-this.textMargin,y:s},{x:h-this.textMargin+e+2*this.textMargin,y:s},{x:h-this.textMargin+e,y:0},{x:h-this.textMargin+2*this.textMargin,y:0},{x:h,y:r}],p=o(t,a,l);p.attr({stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),fill:this.getAttr("fill")}),i.link&&p.attr("href",i.link),i.target&&p.attr("target",i.target),i.key&&(p.node.id=i.key),p.node.setAttribute("class",this.getAttr("class")),this.text.attr({y:p.getBBox().height/2}),this.group.push(p),p.insertBefore(this.text),this.symbol=p,this.initialize()}var n=e(2),h=e(1).inherits,r=e(3),o=r.drawPath;h(s,n),s.prototype.getLeft=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.textMargin;return{x:i,y:t}},s.prototype.getRight=function(){var t=this.getY()+this.group.getBBox().height/2,i=this.getX()+this.group.getBBox().width-this.textMargin;return{x:i,y:t}},t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0,20);i=i||{},i.text=i.text||"Start",n.call(this,t,i,e)}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){function s(t,i){var e=t.paper.rect(0,0,0,0);i=i||{},n.call(this,t,i,e),e.attr({width:this.text.getBBox().width+4*this.getAttr("text-margin")}),this.text.attr({x:2*this.getAttr("text-margin")});var s=t.paper.rect(0,0,0,0);s.attr({x:this.getAttr("text-margin"),stroke:this.getAttr("element-color"),"stroke-width":this.getAttr("line-width"),width:this.text.getBBox().width+2*this.getAttr("text-margin"),height:this.text.getBBox().height+2*this.getAttr("text-margin"),fill:this.getAttr("fill")}),i.key&&(s.node.id=i.key+"i");var h=this.getAttr("font"),r=this.getAttr("font-family"),o=this.getAttr("font-weight");h&&s.attr({font:h}),r&&s.attr({"font-family":r}),o&&s.attr({"font-weight":o}),i.link&&s.attr("href",i.link),i.target&&s.attr("target",i.target),this.group.push(s),s.insertBefore(this.text),this.initialize()}var n=e(2),h=e(1).inherits;h(s,n),t.exports=s},function(t,i,e){if("undefined"!=typeof jQuery){var s=e(4);!function(t){function i(t,i){return t==i||Array.isArray(i)&&(i.includes(t)||i.includes(Number(t)))}var e={init:function(i){return this.each(function(){var e=t(this);this.chart=s(e.text()),e.html(""),this.chart.drawSVG(this,i)})},setFlowStateByParam:function(t,e,s){return this.each(function(){var n=this.chart,h=["next","yes","no","path1","path2","path3"];for(var r in n.symbols)if(n.symbols.hasOwnProperty(r)){var o=n.symbols[r],a=o.params[t];if(i(a,e)){o.flowstate=s;for(var l=0;l maxWidth) {\n\t tempText += \"\\n\" + word;\n\t } else {\n\t tempText += \" \" + word;\n\t }\n\t }\n\t this.text.attr(\"text\", tempText.substring(1));\n\t }\n\t\n\t this.group.push(this.text);\n\t\n\t if (symbol) {\n\t var tmpMargin = this.getAttr('text-margin');\n\t\n\t symbol.attr({\n\t 'fill' : this.getAttr('fill'),\n\t 'stroke' : this.getAttr('element-color'),\n\t 'stroke-width' : this.getAttr('line-width'),\n\t 'width' : this.text.getBBox().width + 2 * tmpMargin,\n\t 'height' : this.text.getBBox().height + 2 * tmpMargin\n\t });\n\t\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t\n\t this.text.attr({\n\t 'y': symbol.getBBox().height/2\n\t });\n\t\n\t this.initialize();\n\t }\n\t\n\t}\n\t\n\t/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\n\tSymbol.prototype.getAttr = function(attName) {\n\t if (!this.chart) {\n\t return undefined;\n\t }\n\t var opt3 = (this.chart.options) ? this.chart.options[attName] : undefined;\n\t var opt2 = (this.chart.options.symbols) ? this.chart.options.symbols[this.symbolType][attName] : undefined;\n\t var opt1;\n\t if (this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate]) {\n\t opt1 = this.chart.options.flowstate[this.flowstate][attName];\n\t }\n\t return (opt1 || opt2 || opt3);\n\t};\n\t\n\tSymbol.prototype.initialize = function() {\n\t this.group.transform('t' + this.getAttr('line-width') + ',' + this.getAttr('line-width'));\n\t\n\t this.width = this.group.getBBox().width;\n\t this.height = this.group.getBBox().height;\n\t};\n\t\n\tSymbol.prototype.getCenter = function() {\n\t return {x: this.getX() + this.width/2,\n\t y: this.getY() + this.height/2};\n\t};\n\t\n\tSymbol.prototype.getX = function() {\n\t return this.group.getBBox().x;\n\t};\n\t\n\tSymbol.prototype.getY = function() {\n\t return this.group.getBBox().y;\n\t};\n\t\n\tSymbol.prototype.shiftX = function(x) {\n\t this.group.transform('t' + (this.getX() + x) + ',' + this.getY());\n\t};\n\t\n\tSymbol.prototype.setX = function(x) {\n\t this.group.transform('t' + x + ',' + this.getY());\n\t};\n\t\n\tSymbol.prototype.shiftY = function(y) {\n\t this.group.transform('t' + this.getX() + ',' + (this.getY() + y));\n\t};\n\t\n\tSymbol.prototype.setY = function(y) {\n\t this.group.transform('t' + this.getX() + ',' + y);\n\t};\n\t\n\tSymbol.prototype.getTop = function() {\n\t var y = this.getY();\n\t var x = this.getX() + this.width/2;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getBottom = function() {\n\t var y = this.getY() + this.height;\n\t var x = this.getX() + this.width/2;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX();\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.render = function() {\n\t if (this.next) {\n\t\n\t var lineLength = this.getAttr('line-length');\n\t\n\t if (this.next_direction === 'right') {\n\t\n\t var rightPoint = this.getRight();\n\t\n\t if (!this.next.isPositioned) {\n\t\n\t this.next.setY(rightPoint.y - this.next.height/2);\n\t this.next.shiftX(this.group.getBBox().x + this.width + lineLength);\n\t\n\t var self = this;\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n\t if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t self.next.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.next.isPositioned = true;\n\t\n\t this.next.render();\n\t }\n\t } else {\n\t var bottomPoint = this.getBottom();\n\t\n\t if (!this.next.isPositioned) {\n\t this.next.shiftY(this.getY() + this.height + lineLength);\n\t this.next.setX(bottomPoint.x - this.next.width/2);\n\t this.next.isPositioned = true;\n\t\n\t this.next.render();\n\t }\n\t }\n\t }\n\t};\n\t\n\tSymbol.prototype.renderLines = function() {\n\t if (this.next) {\n\t if (this.next_direction) {\n\t this.drawLineTo(this.next, '', this.next_direction);\n\t } else {\n\t this.drawLineTo(this.next);\n\t }\n\t }\n\t};\n\t\n\tSymbol.prototype.drawLineTo = function(symbol, text, origin) {\n\t if (this.connectedTo.indexOf(symbol) < 0) {\n\t this.connectedTo.push(symbol);\n\t }\n\t\n\t var x = this.getCenter().x,\n\t y = this.getCenter().y,\n\t right = this.getRight(),\n\t bottom = this.getBottom(),\n\t left = this.getLeft();\n\t\n\t var symbolX = symbol.getCenter().x,\n\t symbolY = symbol.getCenter().y,\n\t symbolTop = symbol.getTop(),\n\t symbolRight = symbol.getRight(),\n\t symbolLeft = symbol.getLeft();\n\t\n\t var isOnSameColumn = x === symbolX,\n\t isOnSameLine = y === symbolY,\n\t isUnder = y < symbolY,\n\t isUpper = y > symbolY || this === symbol,\n\t isLeft = x > symbolX,\n\t isRight = x < symbolX;\n\t\n\t var maxX = 0,\n\t line,\n\t lineLength = this.getAttr('line-length'),\n\t lineWith = this.getAttr('line-width');\n\t\n\t if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {\n\t line = drawLine(this.chart, bottom, symbolTop, text);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x;\n\t } else if ((!origin || origin === 'right') && isOnSameLine && isRight) {\n\t line = drawLine(this.chart, right, symbolLeft, text);\n\t this.rightStart = true;\n\t symbol.leftEnd = true;\n\t maxX = symbolLeft.x;\n\t } else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {\n\t line = drawLine(this.chart, left, symbolRight, text);\n\t this.leftStart = true;\n\t symbol.rightEnd = true;\n\t maxX = symbolRight.x;\n\t } else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((!origin || origin === 'bottom') && isLeft) {\n\t if (this.leftEnd && isUpper) {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t } else {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t }\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n\t } else if ((!origin || origin === 'bottom') && isRight) {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n\t } else if ((origin && origin === 'right') && isLeft) {\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((origin && origin === 'right') && isRight) {\n\t line = drawLine(this.chart, right, [\n\t {x: symbolTop.x, y: right.y},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2},\n\t {x: right.x + lineLength/2, y: bottom.y + lineLength/2},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + lineLength/2;\n\t } else if ((origin === 'left') && isOnSameColumn && isUpper) {\n\t var diffX = left.x - lineLength/2;\n\t if (symbolLeft.x < left.x) {\n\t diffX = symbolLeft.x - lineLength/2;\n\t }\n\t line = drawLine(this.chart, left, [\n\t {x: diffX, y: left.y},\n\t {x: diffX, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.leftStart = true;\n\t symbol.topEnd = true;\n\t maxX = left.x;\n\t } else if ((origin === 'left')) {\n\t line = drawLine(this.chart, left, [\n\t {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: left.y},\n\t {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.leftStart = true;\n\t symbol.topEnd = true;\n\t maxX = left.x;\n\t }\n\t\n\t if (line) {\n\t for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {\n\t var otherLine = this.chart.lines[l];\n\t var len;\n\t\n\t var ePath = otherLine.attr('path'),\n\t lPath = line.attr('path');\n\t\n\t for (var iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n\t var newPath = [];\n\t newPath.push(['M', ePath[iP][1], ePath[iP][2]]);\n\t newPath.push(['L', ePath[iP + 1][1], ePath[iP + 1][2]]);\n\t\n\t var line1_from_x = newPath[0][1];\n\t var line1_from_y = newPath[0][2];\n\t var line1_to_x = newPath[1][1];\n\t var line1_to_y = newPath[1][2];\n\t\n\t for (var lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n\t var newLinePath = [];\n\t newLinePath.push(['M', lPath[lP][1], lPath[lP][2]]);\n\t newLinePath.push(['L', lPath[lP + 1][1], lPath[lP + 1][2]]);\n\t\n\t var line2_from_x = newLinePath[0][1];\n\t var line2_from_y = newLinePath[0][2];\n\t var line2_to_x = newLinePath[1][1];\n\t var line2_to_y = newLinePath[1][2];\n\t\n\t var res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n\t if (res.onLine1 && res.onLine2) {\n\t\n\t var newSegment;\n\t if (line2_from_y === line2_to_y) {\n\t if (line2_from_x > line2_to_x) {\n\t newSegment = ['L', res.x + lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', res.x + lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x - lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t } else {\n\t newSegment = ['L', res.x - lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', res.x - lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x + lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t }\n\t } else {\n\t if (line2_from_y > line2_to_y) {\n\t newSegment = ['L', line2_from_x, res.y + lineWith * 2];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', line2_from_x, res.y + lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y - lineWith * 2];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t } else {\n\t newSegment = ['L', line2_from_x, res.y - lineWith * 2];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', line2_from_x, res.y - lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y + lineWith * 2];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t }\n\t }\n\t\n\t lP += 2;\n\t len += 2;\n\t }\n\t }\n\t }\n\t }\n\t\n\t this.chart.lines.push(line);\n\t }\n\t\n\t if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {\n\t this.chart.maxXFromLine = maxX;\n\t }\n\t};\n\t\n\tmodule.exports = Symbol;\n\n\n/***/ },\n/* 3 */\n/*!************************************!*\\\n !*** ./src/flowchart.functions.js ***!\n \\************************************/\n/***/ function(module, exports) {\n\n\tfunction drawPath(chart, location, points) {\n\t var i, len;\n\t var path = 'M{0},{1}';\n\t for (i = 2, len = 2 * points.length + 2; i < len; i+=2) {\n\t path += ' L{' + i + '},{' + (i + 1) + '}';\n\t }\n\t var pathValues = [location.x, location.y];\n\t for (i = 0, len = points.length; i < len; i++) {\n\t pathValues.push(points[i].x);\n\t pathValues.push(points[i].y);\n\t }\n\t var symbol = chart.paper.path(path, pathValues);\n\t symbol.attr('stroke', chart.options['element-color']);\n\t symbol.attr('stroke-width', chart.options['line-width']);\n\t\n\t var font = chart.options.font;\n\t var fontF = chart.options['font-family'];\n\t var fontW = chart.options['font-weight'];\n\t\n\t if (font) symbol.attr({ 'font': font });\n\t if (fontF) symbol.attr({ 'font-family': fontF });\n\t if (fontW) symbol.attr({ 'font-weight': fontW });\n\t\n\t return symbol;\n\t}\n\t\n\tfunction drawLine(chart, from, to, text) {\n\t var i, len;\n\t\n\t if (Object.prototype.toString.call(to) !== '[object Array]') {\n\t to = [to];\n\t }\n\t\n\t var path = 'M{0},{1}';\n\t for (i = 2, len = 2 * to.length + 2; i < len; i+=2) {\n\t path += ' L{' + i + '},{' + (i + 1) + '}';\n\t }\n\t var pathValues = [from.x, from.y];\n\t for (i = 0, len = to.length; i < len; i++) {\n\t pathValues.push(to[i].x);\n\t pathValues.push(to[i].y);\n\t }\n\t\n\t var line = chart.paper.path(path, pathValues);\n\t line.attr({\n\t stroke: chart.options['line-color'],\n\t 'stroke-width': chart.options['line-width'],\n\t 'arrow-end': chart.options['arrow-end']\n\t });\n\t\n\t var font = chart.options.font;\n\t var fontF = chart.options['font-family'];\n\t var fontW = chart.options['font-weight'];\n\t\n\t if (font) line.attr({ 'font': font });\n\t if (fontF) line.attr({ 'font-family': fontF });\n\t if (fontW) line.attr({ 'font-weight': fontW });\n\t\n\t if (text) {\n\t\n\t var centerText = false;\n\t\n\t var textPath = chart.paper.text(0, 0, text);\n\t\n\t var isHorizontal = false;\n\t var firstTo = to[0];\n\t\n\t if (from.y === firstTo.y) {\n\t isHorizontal = true;\n\t }\n\t\n\t var x = 0,\n\t y = 0;\n\t\n\t if (centerText) {\n\t if (from.x > firstTo.x) {\n\t x = from.x - (from.x - firstTo.x)/2;\n\t } else {\n\t x = firstTo.x - (firstTo.x - from.x)/2;\n\t }\n\t\n\t if (from.y > firstTo.y) {\n\t y = from.y - (from.y - firstTo.y)/2;\n\t } else {\n\t y = firstTo.y - (firstTo.y - from.y)/2;\n\t }\n\t\n\t if (isHorizontal) {\n\t x -= textPath.getBBox().width/2;\n\t y -= chart.options['text-margin'];\n\t } else {\n\t x += chart.options['text-margin'];\n\t y -= textPath.getBBox().height/2;\n\t }\n\t } else {\n\t x = from.x;\n\t y = from.y;\n\t\n\t if (isHorizontal) {\n\t x += chart.options['text-margin']/2;\n\t y -= chart.options['text-margin'];\n\t } else {\n\t x += chart.options['text-margin']/2;\n\t y += chart.options['text-margin'];\n\t }\n\t }\n\t\n\t textPath.attr({\n\t 'text-anchor': 'start',\n\t 'font-size': chart.options['font-size'],\n\t 'fill': chart.options['font-color'],\n\t x: x,\n\t y: y\n\t });\n\t\n\t if (font) textPath.attr({ 'font': font });\n\t if (fontF) textPath.attr({ 'font-family': fontF });\n\t if (fontW) textPath.attr({ 'font-weight': fontW });\n\t }\n\t\n\t return line;\n\t}\n\t\n\tfunction checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n\t // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n\t var denominator, a, b, numerator1, numerator2, result = {\n\t x: null,\n\t y: null,\n\t onLine1: false,\n\t onLine2: false\n\t };\n\t denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n\t if (denominator === 0) {\n\t return result;\n\t }\n\t a = line1StartY - line2StartY;\n\t b = line1StartX - line2StartX;\n\t numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n\t numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n\t a = numerator1 / denominator;\n\t b = numerator2 / denominator;\n\t\n\t // if we cast these lines infinitely in both directions, they intersect here:\n\t result.x = line1StartX + (a * (line1EndX - line1StartX));\n\t result.y = line1StartY + (a * (line1EndY - line1StartY));\n\t /*\n\t // it is worth noting that this should be the same as:\n\t x = line2StartX + (b * (line2EndX - line2StartX));\n\t y = line2StartX + (b * (line2EndY - line2StartY));\n\t */\n\t // if line1 is a segment and line2 is infinite, they intersect if:\n\t if (a > 0 && a < 1) {\n\t result.onLine1 = true;\n\t }\n\t // if line2 is a segment and line1 is infinite, they intersect if:\n\t if (b > 0 && b < 1) {\n\t result.onLine2 = true;\n\t }\n\t // if line1 and line2 are segments, they intersect if both of the above are true\n\t return result;\n\t}\n\t\n\tmodule.exports = {\n\t\tdrawPath: drawPath,\n\t\tdrawLine: drawLine,\n\t\tcheckLineIntersection: checkLineIntersection\n\t};\n\n\n/***/ },\n/* 4 */\n/*!********************************!*\\\n !*** ./src/flowchart.parse.js ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar FlowChart = __webpack_require__(/*! ./flowchart.chart */ 6);\n\tvar Start = __webpack_require__(/*! ./flowchart.symbol.start */ 12);\n\tvar End = __webpack_require__(/*! ./flowchart.symbol.end */ 9);\n\tvar Operation = __webpack_require__(/*! ./flowchart.symbol.operation */ 11);\n\tvar InputOutput = __webpack_require__(/*! ./flowchart.symbol.inputoutput */ 10);\n\tvar Subroutine = __webpack_require__(/*! ./flowchart.symbol.subroutine */ 13);\n\tvar Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);\n\t\n\tfunction parse(input) {\n\t input = input || '';\n\t input = input.trim();\n\t\n\t var chart = {\n\t symbols: {},\n\t start: null,\n\t drawSVG: function(container, options) {\n\t var self = this;\n\t\n\t if (this.diagram) {\n\t this.diagram.clean();\n\t }\n\t\n\t var diagram = new FlowChart(container, options);\n\t this.diagram = diagram;\n\t var dispSymbols = {};\n\t\n\t function getDisplaySymbol(s) {\n\t if (dispSymbols[s.key]) {\n\t return dispSymbols[s.key];\n\t }\n\t\n\t switch (s.symbolType) {\n\t case 'start':\n\t dispSymbols[s.key] = new Start(diagram, s);\n\t break;\n\t case 'end':\n\t dispSymbols[s.key] = new End(diagram, s);\n\t break;\n\t case 'operation':\n\t dispSymbols[s.key] = new Operation(diagram, s);\n\t break;\n\t case 'inputoutput':\n\t dispSymbols[s.key] = new InputOutput(diagram, s);\n\t break;\n\t case 'subroutine':\n\t dispSymbols[s.key] = new Subroutine(diagram, s);\n\t break;\n\t case 'condition':\n\t dispSymbols[s.key] = new Condition(diagram, s);\n\t break;\n\t default:\n\t return new Error('Wrong symbol type!');\n\t }\n\t\n\t return dispSymbols[s.key];\n\t }\n\t\n\t (function constructChart(s, prevDisp, prev) {\n\t var dispSymb = getDisplaySymbol(s);\n\t\n\t if (self.start === s) {\n\t diagram.startWith(dispSymb);\n\t } else if (prevDisp && prev && !prevDisp.pathOk) {\n\t if (prevDisp instanceof(Condition)) {\n\t if (prev.yes === s) {\n\t prevDisp.yes(dispSymb);\n\t }\n\t if (prev.no === s) {\n\t prevDisp.no(dispSymb);\n\t }\n\t } else {\n\t prevDisp.then(dispSymb);\n\t }\n\t }\n\t\n\t if (dispSymb.pathOk) {\n\t return dispSymb;\n\t }\n\t\n\t if (dispSymb instanceof(Condition)) {\n\t if (s.yes) {\n\t constructChart(s.yes, dispSymb, s);\n\t }\n\t if (s.no) {\n\t constructChart(s.no, dispSymb, s);\n\t }\n\t } else if (s.next) {\n\t constructChart(s.next, dispSymb, s);\n\t }\n\t\n\t return dispSymb;\n\t })(this.start);\n\t\n\t diagram.render();\n\t },\n\t clean: function() {\n\t this.diagram.clean();\n\t }\n\t };\n\t\n\t var lines = [];\n\t var prevBreak = 0;\n\t for (var i0 = 1, i0len = input.length; i0 < i0len; i0++) {\n\t if(input[i0] === '\\n' && input[i0 - 1] !== '\\\\') {\n\t var line0 = input.substring(prevBreak, i0);\n\t prevBreak = i0 + 1;\n\t lines.push(line0.replace(/\\\\\\n/g, '\\n'));\n\t }\n\t }\n\t\n\t if(prevBreak < input.length) {\n\t lines.push(input.substr(prevBreak));\n\t }\n\t\n\t for (var l = 1, len = lines.length; l < len;) {\n\t var currentLine = lines[l];\n\t\n\t if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0) {\n\t lines[l - 1] += '\\n' + currentLine;\n\t lines.splice(l, 1);\n\t len--;\n\t } else {\n\t l++;\n\t }\n\t }\n\t\n\t function getSymbol(s) {\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t return chart.symbols[s.substring(0, startIndex - 1)];\n\t }\n\t return chart.symbols[s];\n\t }\n\t\n\t function getNextPath(s) {\n\t var next = 'next';\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t next = flowSymb.substring(startIndex, endIndex);\n\t if (next.indexOf(',') < 0) {\n\t if (next !== 'yes' && next !== 'no') {\n\t next = 'next, ' + next;\n\t }\n\t }\n\t }\n\t return next;\n\t }\n\t\n\t while (lines.length > 0) {\n\t var line = lines.splice(0, 1)[0].trim();\n\t\n\t if (line.indexOf('=>') >= 0) {\n\t // definition\n\t var parts = line.split('=>');\n\t var symbol = {\n\t key: parts[0],\n\t symbolType: parts[1],\n\t text: null,\n\t link: null,\n\t target: null,\n\t flowstate: null\n\t };\n\t\n\t var sub;\n\t\n\t if (symbol.symbolType.indexOf(': ') >= 0) {\n\t sub = symbol.symbolType.split(': ');\n\t symbol.symbolType = sub.shift();\n\t symbol.text = sub.join(': ');\n\t }\n\t\n\t if (symbol.text && symbol.text.indexOf(':>') >= 0) {\n\t sub = symbol.text.split(':>');\n\t symbol.text = sub.shift();\n\t symbol.link = sub.join(':>');\n\t } else if (symbol.symbolType.indexOf(':>') >= 0) {\n\t sub = symbol.symbolType.split(':>');\n\t symbol.symbolType = sub.shift();\n\t symbol.link = sub.join(':>');\n\t }\n\t\n\t if (symbol.symbolType.indexOf('\\n') >= 0) {\n\t symbol.symbolType = symbol.symbolType.split('\\n')[0];\n\t }\n\t\n\t /* adding support for links */\n\t if (symbol.link) {\n\t var startIndex = symbol.link.indexOf('[') + 1;\n\t var endIndex = symbol.link.indexOf(']');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t symbol.target = symbol.link.substring(startIndex, endIndex);\n\t symbol.link = symbol.link.substring(0, startIndex - 1);\n\t }\n\t }\n\t /* end of link support */\n\t\n\t /* adding support for flowstates */\n\t if (symbol.text) {\n\t if (symbol.text.indexOf('|') >= 0) {\n\t var txtAndState = symbol.text.split('|');\n\t symbol.flowstate = txtAndState.pop().trim();\n\t symbol.text = txtAndState.join('|');\n\t }\n\t }\n\t /* end of flowstate support */\n\t\n\t chart.symbols[symbol.key] = symbol;\n\t\n\t } else if (line.indexOf('->') >= 0) {\n\t // flow\n\t var flowSymbols = line.split('->');\n\t for (var i = 0, lenS = flowSymbols.length; i < lenS; i++) {\n\t var flowSymb = flowSymbols[i];\n\t\n\t var realSymb = getSymbol(flowSymb);\n\t var next = getNextPath(flowSymb);\n\t\n\t var direction = null;\n\t if (next.indexOf(',') >= 0) {\n\t var condOpt = next.split(',');\n\t next = condOpt[0];\n\t direction = condOpt[1].trim();\n\t }\n\t\n\t if (!chart.start) {\n\t chart.start = realSymb;\n\t }\n\t\n\t if (i + 1 < lenS) {\n\t var nextSymb = flowSymbols[i + 1];\n\t realSymb[next] = getSymbol(nextSymb);\n\t realSymb['direction_' + next] = direction;\n\t direction = null;\n\t }\n\t }\n\t }\n\t\n\t }\n\t return chart;\n\t}\n\t\n\tmodule.exports = parse;\n\n\n/***/ },\n/* 5 */\n/*!*******************************************!*\\\n !*** ./src/flowchart.symbol.condition.js ***!\n \\*******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction Condition(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.textMargin = this.getAttr('text-margin');\n\t this.yes_direction = 'bottom';\n\t this.no_direction = 'right';\n\t if (options.yes && options.direction_yes && options.no && !options.direction_no) {\n\t if (options.direction_yes === 'right') {\n\t this.no_direction = 'bottom';\n\t this.yes_direction = 'right';\n\t } else {\n\t this.no_direction = 'right';\n\t this.yes_direction = 'bottom';\n\t }\n\t } else if (options.yes && !options.direction_yes && options.no && options.direction_no) {\n\t if (options.direction_no === 'right') {\n\t this.yes_direction = 'bottom';\n\t this.no_direction = 'right';\n\t } else {\n\t this.yes_direction = 'right';\n\t this.no_direction = 'bottom';\n\t }\n\t } else {\n\t this.yes_direction = 'bottom';\n\t this.no_direction = 'right';\n\t }\n\t\n\t this.yes_direction = this.yes_direction || 'bottom';\n\t this.no_direction = this.no_direction || 'right';\n\t\n\t this.text.attr({\n\t x: this.textMargin * 2\n\t });\n\t\n\t var width = this.text.getBBox().width + 3 * this.textMargin;\n\t width += width/2;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t height += height/2;\n\t height = Math.max(width * 0.5, height);\n\t var startX = width/4;\n\t var startY = height/4;\n\t\n\t this.text.attr({\n\t x: startX + this.textMargin/2\n\t });\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - width/4, y: startY + height/4},\n\t {x: startX - width/4 + width/2, y: startY + height/4 + height/2},\n\t {x: startX - width/4 + width, y: startY + height/4},\n\t {x: startX - width/4 + width/2, y: startY + height/4 - height/2},\n\t {x: startX - width/4, y: startY + height/4}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t\n\t this.initialize();\n\t}\n\tinherits(Condition, Symbol);\n\t\n\tCondition.prototype.render = function() {\n\t\n\t if (this.yes_direction) {\n\t this[this.yes_direction + '_symbol'] = this.yes_symbol;\n\t }\n\t\n\t if (this.no_direction) {\n\t this[this.no_direction + '_symbol'] = this.no_symbol;\n\t }\n\t\n\t var lineLength = this.getAttr('line-length');\n\t\n\t if (this.bottom_symbol) {\n\t var bottomPoint = this.getBottom();\n\t\n\t if (!this.bottom_symbol.isPositioned) {\n\t this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n\t this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width/2);\n\t this.bottom_symbol.isPositioned = true;\n\t\n\t this.bottom_symbol.render();\n\t }\n\t }\n\t\n\t if (this.right_symbol) {\n\t var rightPoint = this.getRight();\n\t\n\t if (!this.right_symbol.isPositioned) {\n\t\n\t this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);\n\t this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\t\n\t var self = this;\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n\t if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.right_symbol.isPositioned = true;\n\t\n\t this.right_symbol.render();\n\t }\n\t }\n\t};\n\t\n\tCondition.prototype.renderLines = function() {\n\t if (this.yes_symbol) {\n\t this.drawLineTo(this.yes_symbol, this.getAttr('yes-text'), this.yes_direction);\n\t }\n\t\n\t if (this.no_symbol) {\n\t this.drawLineTo(this.no_symbol, this.getAttr('no-text'), this.no_direction);\n\t }\n\t};\n\t\n\tmodule.exports = Condition;\n\n\n/***/ },\n/* 6 */\n/*!********************************!*\\\n !*** ./src/flowchart.chart.js ***!\n \\********************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Raphael = __webpack_require__(/*! raphael */ 15);\n\tvar defaults = __webpack_require__(/*! ./flowchart.helpers */ 1).defaults;\n\tvar defaultOptions = __webpack_require__(/*! ./flowchart.defaults */ 7);\n\tvar Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);\n\t\n\tfunction FlowChart(container, options) {\n\t options = options || {};\n\t\n\t this.paper = new Raphael(container);\n\t\n\t this.options = defaults(options, defaultOptions);\n\t\n\t this.symbols = [];\n\t this.lines = [];\n\t this.start = null;\n\t}\n\t\n\tFlowChart.prototype.handle = function(symbol) {\n\t if (this.symbols.indexOf(symbol) <= -1) {\n\t this.symbols.push(symbol);\n\t }\n\t\n\t var flowChart = this;\n\t\n\t if (symbol instanceof(Condition)) {\n\t symbol.yes = function(nextSymbol) {\n\t symbol.yes_symbol = nextSymbol;\n\t if(symbol.no_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t symbol.no = function(nextSymbol) {\n\t symbol.no_symbol = nextSymbol;\n\t if(symbol.yes_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t } else {\n\t symbol.then = function(nextSymbol) {\n\t symbol.next = nextSymbol;\n\t symbol.pathOk = true;\n\t return flowChart.handle(nextSymbol);\n\t };\n\t }\n\t\n\t return symbol;\n\t};\n\t\n\tFlowChart.prototype.startWith = function(symbol) {\n\t this.start = symbol;\n\t return this.handle(symbol);\n\t};\n\t\n\tFlowChart.prototype.render = function() {\n\t var maxWidth = 0,\n\t maxHeight = 0,\n\t i = 0,\n\t len = 0,\n\t maxX = 0,\n\t maxY = 0,\n\t minX = 0,\n\t minY = 0,\n\t symbol,\n\t line;\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t if (symbol.width > maxWidth) {\n\t maxWidth = symbol.width;\n\t }\n\t if (symbol.height > maxHeight) {\n\t maxHeight = symbol.height;\n\t }\n\t }\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t symbol.shiftX(this.options.x + (maxWidth - symbol.width)/2 + this.options['line-width']);\n\t symbol.shiftY(this.options.y + (maxHeight - symbol.height)/2 + this.options['line-width']);\n\t }\n\t\n\t this.start.render();\n\t // for (i = 0, len = this.symbols.length; i < len; i++) {\n\t // symbol = this.symbols[i];\n\t // symbol.render();\n\t // }\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t symbol.renderLines();\n\t }\n\t\n\t maxX = this.maxXFromLine;\n\t\n\t var x;\n\t var y;\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t x = symbol.getX() + symbol.width;\n\t y = symbol.getY() + symbol.height;\n\t if (x > maxX) {\n\t maxX = x;\n\t }\n\t if (y > maxY) {\n\t maxY = y;\n\t }\n\t }\n\t\n\t for (i = 0, len = this.lines.length; i < len; i++) {\n\t line = this.lines[i].getBBox();\n\t x = line.x;\n\t y = line.y;\n\t var x2 = line.x2;\n\t var y2 = line.y2;\n\t if (x < minX) {\n\t minX = x;\n\t }\n\t if (y < minY) {\n\t minY = y;\n\t }\n\t if (x2 > maxX) {\n\t maxX = x2;\n\t }\n\t if (y2 > maxY) {\n\t maxY = y2;\n\t }\n\t }\n\t\n\t var scale = this.options['scale'];\n\t var lineWidth = this.options['line-width'];\n\t\n\t if (minX < 0) minX -= lineWidth;\n\t if (minY < 0) minY -= lineWidth;\n\t\n\t var width = maxX + lineWidth - minX;\n\t var height = maxY + lineWidth - minY;\n\t\n\t this.paper.setSize(width * scale, height * scale);\n\t this.paper.setViewBox(minX, minY, width, height, true);\n\t};\n\t\n\tFlowChart.prototype.clean = function() {\n\t if (this.paper) {\n\t var paperDom = this.paper.canvas;\n\t paperDom.parentNode.removeChild(paperDom);\n\t }\n\t};\n\t\n\tmodule.exports = FlowChart;\n\n\n/***/ },\n/* 7 */\n/*!***********************************!*\\\n !*** ./src/flowchart.defaults.js ***!\n \\***********************************/\n/***/ function(module, exports) {\n\n\t// defaults\n\tmodule.exports = {\n\t 'x': 0,\n\t 'y': 0,\n\t 'line-width': 3,\n\t 'line-length': 50,\n\t 'text-margin': 10,\n\t 'font-size': 14,\n\t 'font-color': 'black',\n\t // 'font': 'normal',\n\t // 'font-family': 'calibri',\n\t // 'font-weight': 'normal',\n\t 'line-color': 'black',\n\t 'element-color': 'black',\n\t 'fill': 'white',\n\t 'yes-text': 'yes',\n\t 'no-text': 'no',\n\t 'arrow-end': 'block',\n\t 'class': 'flowchart',\n\t 'scale': 1,\n\t 'symbols': {\n\t 'start': {},\n\t 'end': {},\n\t 'condition': {},\n\t 'inputoutput': {},\n\t 'operation': {},\n\t 'subroutine': {}\n\t }//,\n\t // 'flowstate' : {\n\t // 'past' : { 'fill': '#CCCCCC', 'font-size': 12},\n\t // 'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},\n\t // 'future' : { 'fill': '#FFFF99'},\n\t // 'invalid': {'fill': '#444444'}\n\t // }\n\t};\n\n\n/***/ },\n/* 8 */\n/*!*******************************!*\\\n !*** ./src/flowchart.shim.js ***!\n \\*******************************/\n/***/ function(module, exports) {\n\n\t// add indexOf to non ECMA-262 standard compliant browsers\n\tif (!Array.prototype.indexOf) {\n\t Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n\t \"use strict\";\n\t if (this === null) {\n\t throw new TypeError();\n\t }\n\t var t = Object(this);\n\t var len = t.length >>> 0;\n\t if (len === 0) {\n\t return -1;\n\t }\n\t var n = 0;\n\t if (arguments.length > 0) {\n\t n = Number(arguments[1]);\n\t if (n != n) { // shortcut for verifying if it's NaN\n\t n = 0;\n\t } else if (n !== 0 && n != Infinity && n != -Infinity) {\n\t n = (n > 0 || -1) * Math.floor(Math.abs(n));\n\t }\n\t }\n\t if (n >= len) {\n\t return -1;\n\t }\n\t var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n\t for (; k < len; k++) {\n\t if (k in t && t[k] === searchElement) {\n\t return k;\n\t }\n\t }\n\t return -1;\n\t };\n\t}\n\t\n\t// add lastIndexOf to non ECMA-262 standard compliant browsers\n\tif (!Array.prototype.lastIndexOf) {\n\t Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/) {\n\t \"use strict\";\n\t if (this === null) {\n\t throw new TypeError();\n\t }\n\t var t = Object(this);\n\t var len = t.length >>> 0;\n\t if (len === 0) {\n\t return -1;\n\t }\n\t var n = len;\n\t if (arguments.length > 1) {\n\t n = Number(arguments[1]);\n\t if (n != n) {\n\t n = 0;\n\t } else if (n !== 0 && n != (1 / 0) && n != -(1 / 0)) {\n\t n = (n > 0 || -1) * Math.floor(Math.abs(n));\n\t }\n\t }\n\t var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);\n\t for (; k >= 0; k--) {\n\t if (k in t && t[k] === searchElement) {\n\t return k;\n\t }\n\t }\n\t return -1;\n\t };\n\t}\n\t\n\tif (!String.prototype.trim) {\n\t String.prototype.trim = function() {\n\t return this.replace(/^\\s+|\\s+$/g, '');\n\t };\n\t}\n\n/***/ },\n/* 9 */\n/*!*************************************!*\\\n !*** ./src/flowchart.symbol.end.js ***!\n \\*************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction End(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n\t options = options || {};\n\t options.text = options.text || 'End';\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(End, Symbol);\n\t\n\tmodule.exports = End;\n\n\n/***/ },\n/* 10 */\n/*!*********************************************!*\\\n !*** ./src/flowchart.symbol.inputoutput.js ***!\n \\*********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction InputOutput(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.textMargin = this.getAttr('text-margin');\n\t\n\t this.text.attr({\n\t x: this.textMargin * 3\n\t });\n\t\n\t var width = this.text.getBBox().width + 4 * this.textMargin;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t var startX = this.textMargin;\n\t var startY = height/2;\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - this.textMargin, y: height},\n\t {x: startX - this.textMargin + width, y: height},\n\t {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n\t {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n\t {x: startX, y: startY}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t\n\t this.initialize();\n\t}\n\tinherits(InputOutput, Symbol);\n\t\n\tInputOutput.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tInputOutput.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width - this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tmodule.exports = InputOutput;\n\n\n/***/ },\n/* 11 */\n/*!*******************************************!*\\\n !*** ./src/flowchart.symbol.operation.js ***!\n \\*******************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Operation(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0);\n\t options = options || {};\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(Operation, Symbol);\n\t\n\tmodule.exports = Operation;\n\n\n/***/ },\n/* 12 */\n/*!***************************************!*\\\n !*** ./src/flowchart.symbol.start.js ***!\n \\***************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Start(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n\t options = options || {};\n\t options.text = options.text || 'Start';\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(Start, Symbol);\n\t\n\tmodule.exports = Start;\n\t\n\t// Start.prototype.render = function() {\n\t// if (this.next) {\n\t// var lineLength = this.chart.options.symbols[this.symbolType]['line-length'] || this.chart.options['line-length'];\n\t\n\t// var bottomPoint = this.getBottom();\n\t// var topPoint = this.next.getTop();\n\t\n\t// if (!this.next.isPositioned) {\n\t// this.next.shiftY(this.getY() + this.height + lineLength);\n\t// this.next.setX(bottomPoint.x - this.next.width/2);\n\t// this.next.isPositioned = true;\n\t\n\t// this.next.render();\n\t// }\n\t// }\n\t// };\n\t\n\t// Start.prototype.renderLines = function() {\n\t// if (this.next) {\n\t// this.drawLineTo(this.next);\n\t// }\n\t// };\n\n\n/***/ },\n/* 13 */\n/*!********************************************!*\\\n !*** ./src/flowchart.symbol.subroutine.js ***!\n \\********************************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Subroutine(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0);\n\t options = options || {};\n\t Symbol.call(this, chart, options, symbol);\n\t\n\t symbol.attr({\n\t width: this.text.getBBox().width + 4 * this.getAttr('text-margin')\n\t });\n\t\n\t this.text.attr({\n\t 'x': 2 * this.getAttr('text-margin')\n\t });\n\t\n\t var innerWrap = chart.paper.rect(0, 0, 0, 0);\n\t innerWrap.attr({\n\t x: this.getAttr('text-margin'),\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t width: this.text.getBBox().width + 2 * this.getAttr('text-margin'),\n\t height: this.text.getBBox().height + 2 * this.getAttr('text-margin'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.key) { innerWrap.node.id = options.key + 'i'; }\n\t\n\t var font = this.getAttr('font');\n\t var fontF = this.getAttr('font-family');\n\t var fontW = this.getAttr('font-weight');\n\t\n\t if (font) innerWrap.attr({ 'font': font });\n\t if (fontF) innerWrap.attr({ 'font-family': fontF });\n\t if (fontW) innerWrap.attr({ 'font-weight': fontW });\n\t\n\t if (options.link) { innerWrap.attr('href', options.link); }\n\t if (options.target) { innerWrap.attr('target', options.target); }\n\t this.group.push(innerWrap);\n\t innerWrap.insertBefore(this.text);\n\t\n\t this.initialize();\n\t}\n\tinherits(Subroutine, Symbol);\n\t\n\tmodule.exports = Subroutine;\n\n\n/***/ },\n/* 14 */\n/*!******************************!*\\\n !*** ./src/jquery-plugin.js ***!\n \\******************************/\n/***/ function(module, exports, __webpack_require__) {\n\n\tif (typeof jQuery != 'undefined') {\n\t\tvar parse = __webpack_require__(/*! ./flowchart.parse */ 4);\n\t\t(function( $ ) {\n\t\t\t$.fn.flowChart = function( options ) {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tvar chart = parse($this.text());\n\t\t\t\t\t$this.html('');\n\t\t\t\t\tchart.drawSVG(this, options);\n\t\t\t\t});\n\t\t\t};\n\t\t})(jQuery); // eslint-disable-line\n\t}\n\n\n/***/ },\n/* 15 */\n/*!**************************!*\\\n !*** external \"Raphael\" ***!\n \\**************************/\n/***/ function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_15__;\n\n/***/ }\n/******/ ])\n});\n;\n\n\n/** WEBPACK FOOTER **\n ** flowchart.min.js\n **/"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n/** WEBPACK FOOTER **\n ** webpack/bootstrap fa31ed635fd738c1296d\n **/","require('./src/flowchart.shim');\nvar parse = require('./src/flowchart.parse');\nrequire('./src/jquery-plugin');\n\nvar FlowChart = {\n\tparse: parse\n};\n\nif (typeof window !== 'undefined') {\n\twindow.flowchart = FlowChart;\n}\n\nmodule.exports = FlowChart;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./index.js\n ** module id = 0\n ** module chunks = 0\n **/","function _defaults(options, defaultOptions) {\n if (!options || typeof options === 'function') {\n return defaultOptions;\n }\n\n var merged = {};\n for (var attrname in defaultOptions) {\n merged[attrname] = defaultOptions[attrname];\n }\n\n for (attrname in options) {\n if (options[attrname]) {\n if (typeof merged[attrname] === 'object') {\n merged[attrname] = _defaults(merged[attrname], options[attrname]);\n } else {\n merged[attrname] = options[attrname];\n }\n }\n }\n return merged;\n}\n\nfunction _inherits(ctor, superCtor) {\n if (typeof(Object.create) === 'function') {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n } else {\n // old school shim for old browsers\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n}\n\n// move dependent functions to a container so that\n// they can be overriden easier in no jquery environment (node.js)\nmodule.exports = {\n defaults: _defaults,\n inherits: _inherits\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.helpers.js\n ** module id = 1\n ** module chunks = 0\n **/","var drawAPI = require('./flowchart.functions');\nvar drawLine = drawAPI.drawLine;\nvar checkLineIntersection = drawAPI.checkLineIntersection;\n\nfunction Symbol(chart, options, symbol) {\n this.chart = chart;\n this.group = this.chart.paper.set();\n this.symbol = symbol;\n this.connectedTo = [];\n this.symbolType = options.symbolType;\n this.flowstate = (options.flowstate || 'future');\n\n this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;\n\n this.text = this.chart.paper.text(0, 0, options.text);\n //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t\n if (options.key) { this.text.node.id = options.key + 't'; }\n this.text.node.setAttribute('class', this.getAttr('class') + 't');\n\n this.text.attr({\n 'text-anchor': 'start',\n 'x' : this.getAttr('text-margin'),\n 'fill' : this.getAttr('font-color'),\n 'font-size' : this.getAttr('font-size')\n });\n\n var font = this.getAttr('font');\n var fontF = this.getAttr('font-family');\n var fontW = this.getAttr('font-weight');\n\n if (font) this.text.attr({ 'font': font });\n if (fontF) this.text.attr({ 'font-family': fontF });\n if (fontW) this.text.attr({ 'font-weight': fontW });\n\n if (options.link) { this.text.attr('href', options.link); }\n if (options.target) { this.text.attr('target', options.target); }\n\n var maxWidth = this.getAttr('maxWidth');\n if (maxWidth) {\n // using this approach: http://stackoverflow.com/a/3153457/22466\n var words = options.text.split(' ');\n var tempText = \"\";\n for (var i=0, ii=words.length; i maxWidth) {\n tempText += \"\\n\" + word;\n } else {\n tempText += \" \" + word;\n }\n }\n this.text.attr(\"text\", tempText.substring(1));\n }\n\n this.group.push(this.text);\n\n if (symbol) {\n var tmpMargin = this.getAttr('text-margin');\n\n symbol.attr({\n 'fill' : this.getAttr('fill'),\n 'stroke' : this.getAttr('element-color'),\n 'stroke-width' : this.getAttr('line-width'),\n 'width' : this.text.getBBox().width + 2 * tmpMargin,\n 'height' : this.text.getBBox().height + 2 * tmpMargin\n });\n\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n\n this.text.attr({\n 'y': symbol.getBBox().height/2\n });\n\n this.initialize();\n }\n\n}\n\n/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\nSymbol.prototype.getAttr = function(attName) {\n if (!this.chart) {\n return undefined;\n }\n var opt3 = (this.chart.options) ? this.chart.options[attName] : undefined;\n var opt2 = (this.chart.options.symbols) ? this.chart.options.symbols[this.symbolType][attName] : undefined;\n var opt1;\n if (this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate]) {\n opt1 = this.chart.options.flowstate[this.flowstate][attName];\n }\n return (opt1 || opt2 || opt3);\n};\n\nSymbol.prototype.initialize = function() {\n this.group.transform('t' + this.getAttr('line-width') + ',' + this.getAttr('line-width'));\n\n this.width = this.group.getBBox().width;\n this.height = this.group.getBBox().height;\n};\n\nSymbol.prototype.getCenter = function() {\n return {x: this.getX() + this.width/2,\n y: this.getY() + this.height/2};\n};\n\nSymbol.prototype.getX = function() {\n return this.group.getBBox().x;\n};\n\nSymbol.prototype.getY = function() {\n return this.group.getBBox().y;\n};\n\nSymbol.prototype.shiftX = function(x) {\n this.group.transform('t' + (this.getX() + x) + ',' + this.getY());\n};\n\nSymbol.prototype.setX = function(x) {\n this.group.transform('t' + x + ',' + this.getY());\n};\n\nSymbol.prototype.shiftY = function(y) {\n this.group.transform('t' + this.getX() + ',' + (this.getY() + y));\n};\n\nSymbol.prototype.setY = function(y) {\n this.group.transform('t' + this.getX() + ',' + y);\n};\n\nSymbol.prototype.getTop = function() {\n var y = this.getY();\n var x = this.getX() + this.width/2;\n return {x: x, y: y};\n};\n\nSymbol.prototype.getBottom = function() {\n var y = this.getY() + this.height;\n var x = this.getX() + this.width/2;\n return {x: x, y: y};\n};\n\nSymbol.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX();\n return {x: x, y: y};\n};\n\nSymbol.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width;\n return {x: x, y: y};\n};\n\nSymbol.prototype.render = function() {\n if (this.next) {\n\n var lineLength = this.getAttr('line-length');\n\n if (this.next_direction === 'right') {\n\n var rightPoint = this.getRight();\n\n if (!this.next.isPositioned) {\n\n this.next.setY(rightPoint.y - this.next.height/2);\n this.next.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n var self = this;\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n hasSymbolUnder = true;\n break;\n }\n }\n\n if (hasSymbolUnder) {\n self.next.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.next.isPositioned = true;\n\n this.next.render();\n }\n } else {\n var bottomPoint = this.getBottom();\n\n if (!this.next.isPositioned) {\n this.next.shiftY(this.getY() + this.height + lineLength);\n this.next.setX(bottomPoint.x - this.next.width/2);\n this.next.isPositioned = true;\n\n this.next.render();\n }\n }\n }\n};\n\nSymbol.prototype.renderLines = function() {\n if (this.next) {\n if (this.next_direction) {\n this.drawLineTo(this.next, '', this.next_direction);\n } else {\n this.drawLineTo(this.next);\n }\n }\n};\n\nSymbol.prototype.drawLineTo = function(symbol, text, origin) {\n if (this.connectedTo.indexOf(symbol) < 0) {\n this.connectedTo.push(symbol);\n }\n\n var x = this.getCenter().x,\n y = this.getCenter().y,\n right = this.getRight(),\n bottom = this.getBottom(),\n left = this.getLeft();\n\n var symbolX = symbol.getCenter().x,\n symbolY = symbol.getCenter().y,\n symbolTop = symbol.getTop(),\n symbolRight = symbol.getRight(),\n symbolLeft = symbol.getLeft();\n\n var isOnSameColumn = x === symbolX,\n isOnSameLine = y === symbolY,\n isUnder = y < symbolY,\n isUpper = y > symbolY || this === symbol,\n isLeft = x > symbolX,\n isRight = x < symbolX;\n\n var maxX = 0,\n line,\n lineLength = this.getAttr('line-length'),\n lineWith = this.getAttr('line-width');\n\n if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {\n line = drawLine(this.chart, bottom, symbolTop, text);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x;\n } else if ((!origin || origin === 'right') && isOnSameLine && isRight) {\n line = drawLine(this.chart, right, symbolLeft, text);\n this.rightStart = true;\n symbol.leftEnd = true;\n maxX = symbolLeft.x;\n } else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {\n line = drawLine(this.chart, left, symbolRight, text);\n this.leftStart = true;\n symbol.rightEnd = true;\n maxX = symbolRight.x;\n } else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((!origin || origin === 'bottom') && isLeft) {\n if (this.leftEnd && isUpper) {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n } else {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n }\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n } else if ((!origin || origin === 'bottom') && isRight) {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n } else if ((origin && origin === 'right') && isLeft) {\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((origin && origin === 'right') && isRight) {\n line = drawLine(this.chart, right, [\n {x: symbolTop.x, y: right.y},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2},\n {x: right.x + lineLength/2, y: bottom.y + lineLength/2},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + lineLength/2;\n } else if ((origin === 'left') && isOnSameColumn && isUpper) {\n var diffX = left.x - lineLength/2;\n if (symbolLeft.x < left.x) {\n diffX = symbolLeft.x - lineLength/2;\n }\n line = drawLine(this.chart, left, [\n {x: diffX, y: left.y},\n {x: diffX, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.leftStart = true;\n symbol.topEnd = true;\n maxX = left.x;\n } else if ((origin === 'left')) {\n line = drawLine(this.chart, left, [\n {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: left.y},\n {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.leftStart = true;\n symbol.topEnd = true;\n maxX = left.x;\n }\n\n if (line) {\n for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {\n var otherLine = this.chart.lines[l];\n var len;\n\n var ePath = otherLine.attr('path'),\n lPath = line.attr('path');\n\n for (var iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n var newPath = [];\n newPath.push(['M', ePath[iP][1], ePath[iP][2]]);\n newPath.push(['L', ePath[iP + 1][1], ePath[iP + 1][2]]);\n\n var line1_from_x = newPath[0][1];\n var line1_from_y = newPath[0][2];\n var line1_to_x = newPath[1][1];\n var line1_to_y = newPath[1][2];\n\n for (var lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n var newLinePath = [];\n newLinePath.push(['M', lPath[lP][1], lPath[lP][2]]);\n newLinePath.push(['L', lPath[lP + 1][1], lPath[lP + 1][2]]);\n\n var line2_from_x = newLinePath[0][1];\n var line2_from_y = newLinePath[0][2];\n var line2_to_x = newLinePath[1][1];\n var line2_to_y = newLinePath[1][2];\n\n var res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n if (res.onLine1 && res.onLine2) {\n\n var newSegment;\n if (line2_from_y === line2_to_y) {\n if (line2_from_x > line2_to_x) {\n newSegment = ['L', res.x + lineWith * 2, line2_from_y];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', res.x + lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x - lineWith * 2, line2_from_y];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n } else {\n newSegment = ['L', res.x - lineWith * 2, line2_from_y];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', res.x - lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x + lineWith * 2, line2_from_y];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n }\n } else {\n if (line2_from_y > line2_to_y) {\n newSegment = ['L', line2_from_x, res.y + lineWith * 2];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', line2_from_x, res.y + lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y - lineWith * 2];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n } else {\n newSegment = ['L', line2_from_x, res.y - lineWith * 2];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', line2_from_x, res.y - lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y + lineWith * 2];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n }\n }\n\n lP += 2;\n len += 2;\n }\n }\n }\n }\n\n this.chart.lines.push(line);\n }\n\n if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {\n this.chart.maxXFromLine = maxX;\n }\n};\n\nmodule.exports = Symbol;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.js\n ** module id = 2\n ** module chunks = 0\n **/","function drawPath(chart, location, points) {\n var i, len;\n var path = 'M{0},{1}';\n for (i = 2, len = 2 * points.length + 2; i < len; i+=2) {\n path += ' L{' + i + '},{' + (i + 1) + '}';\n }\n var pathValues = [location.x, location.y];\n for (i = 0, len = points.length; i < len; i++) {\n pathValues.push(points[i].x);\n pathValues.push(points[i].y);\n }\n var symbol = chart.paper.path(path, pathValues);\n symbol.attr('stroke', chart.options['element-color']);\n symbol.attr('stroke-width', chart.options['line-width']);\n\n var font = chart.options.font;\n var fontF = chart.options['font-family'];\n var fontW = chart.options['font-weight'];\n\n if (font) symbol.attr({ 'font': font });\n if (fontF) symbol.attr({ 'font-family': fontF });\n if (fontW) symbol.attr({ 'font-weight': fontW });\n\n return symbol;\n}\n\nfunction drawLine(chart, from, to, text) {\n var i, len;\n\n if (Object.prototype.toString.call(to) !== '[object Array]') {\n to = [to];\n }\n\n var path = 'M{0},{1}';\n for (i = 2, len = 2 * to.length + 2; i < len; i+=2) {\n path += ' L{' + i + '},{' + (i + 1) + '}';\n }\n var pathValues = [from.x, from.y];\n for (i = 0, len = to.length; i < len; i++) {\n pathValues.push(to[i].x);\n pathValues.push(to[i].y);\n }\n\n var line = chart.paper.path(path, pathValues);\n line.attr({\n stroke: chart.options['line-color'],\n 'stroke-width': chart.options['line-width'],\n 'arrow-end': chart.options['arrow-end']\n });\n\n var font = chart.options.font;\n var fontF = chart.options['font-family'];\n var fontW = chart.options['font-weight'];\n\n if (font) line.attr({ 'font': font });\n if (fontF) line.attr({ 'font-family': fontF });\n if (fontW) line.attr({ 'font-weight': fontW });\n\n if (text) {\n\n var centerText = false;\n\n var textPath = chart.paper.text(0, 0, text);\n\n var isHorizontal = false;\n var firstTo = to[0];\n\n if (from.y === firstTo.y) {\n isHorizontal = true;\n }\n\n var x = 0,\n y = 0;\n\n if (centerText) {\n if (from.x > firstTo.x) {\n x = from.x - (from.x - firstTo.x)/2;\n } else {\n x = firstTo.x - (firstTo.x - from.x)/2;\n }\n\n if (from.y > firstTo.y) {\n y = from.y - (from.y - firstTo.y)/2;\n } else {\n y = firstTo.y - (firstTo.y - from.y)/2;\n }\n\n if (isHorizontal) {\n x -= textPath.getBBox().width/2;\n y -= chart.options['text-margin'];\n } else {\n x += chart.options['text-margin'];\n y -= textPath.getBBox().height/2;\n }\n } else {\n x = from.x;\n y = from.y;\n\n if (isHorizontal) {\n x += chart.options['text-margin']/2;\n y -= chart.options['text-margin'];\n } else {\n x += chart.options['text-margin']/2;\n y += chart.options['text-margin'];\n }\n }\n\n textPath.attr({\n 'text-anchor': 'start',\n 'font-size': chart.options['font-size'],\n 'fill': chart.options['font-color'],\n x: x,\n y: y\n });\n\n if (font) textPath.attr({ 'font': font });\n if (fontF) textPath.attr({ 'font-family': fontF });\n if (fontW) textPath.attr({ 'font-weight': fontW });\n }\n\n return line;\n}\n\nfunction checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n onLine1: false,\n onLine2: false\n };\n denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n if (denominator === 0) {\n return result;\n }\n a = line1StartY - line2StartY;\n b = line1StartX - line2StartX;\n numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1StartX + (a * (line1EndX - line1StartX));\n result.y = line1StartY + (a * (line1EndY - line1StartY));\n /*\n // it is worth noting that this should be the same as:\n x = line2StartX + (b * (line2EndX - line2StartX));\n y = line2StartX + (b * (line2EndY - line2StartY));\n */\n // if line1 is a segment and line2 is infinite, they intersect if:\n if (a > 0 && a < 1) {\n result.onLine1 = true;\n }\n // if line2 is a segment and line1 is infinite, they intersect if:\n if (b > 0 && b < 1) {\n result.onLine2 = true;\n }\n // if line1 and line2 are segments, they intersect if both of the above are true\n return result;\n}\n\nmodule.exports = {\n\tdrawPath: drawPath,\n\tdrawLine: drawLine,\n\tcheckLineIntersection: checkLineIntersection\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.functions.js\n ** module id = 3\n ** module chunks = 0\n **/","var FlowChart = require('./flowchart.chart');\nvar Start = require('./flowchart.symbol.start');\nvar End = require('./flowchart.symbol.end');\nvar Operation = require('./flowchart.symbol.operation');\nvar InputOutput = require('./flowchart.symbol.inputoutput');\nvar Subroutine = require('./flowchart.symbol.subroutine');\nvar Condition = require('./flowchart.symbol.condition');\n\nfunction parse(input) {\n input = input || '';\n input = input.trim();\n\n var chart = {\n symbols: {},\n start: null,\n drawSVG: function(container, options) {\n var self = this;\n\n if (this.diagram) {\n this.diagram.clean();\n }\n\n var diagram = new FlowChart(container, options);\n this.diagram = diagram;\n var dispSymbols = {};\n\n function getDisplaySymbol(s) {\n if (dispSymbols[s.key]) {\n return dispSymbols[s.key];\n }\n\n switch (s.symbolType) {\n case 'start':\n dispSymbols[s.key] = new Start(diagram, s);\n break;\n case 'end':\n dispSymbols[s.key] = new End(diagram, s);\n break;\n case 'operation':\n dispSymbols[s.key] = new Operation(diagram, s);\n break;\n case 'inputoutput':\n dispSymbols[s.key] = new InputOutput(diagram, s);\n break;\n case 'subroutine':\n dispSymbols[s.key] = new Subroutine(diagram, s);\n break;\n case 'condition':\n dispSymbols[s.key] = new Condition(diagram, s);\n break;\n default:\n return new Error('Wrong symbol type!');\n }\n\n return dispSymbols[s.key];\n }\n\n (function constructChart(s, prevDisp, prev) {\n var dispSymb = getDisplaySymbol(s);\n\n if (self.start === s) {\n diagram.startWith(dispSymb);\n } else if (prevDisp && prev && !prevDisp.pathOk) {\n if (prevDisp instanceof(Condition)) {\n if (prev.yes === s) {\n prevDisp.yes(dispSymb);\n }\n if (prev.no === s) {\n prevDisp.no(dispSymb);\n }\n } else {\n prevDisp.then(dispSymb);\n }\n }\n\n if (dispSymb.pathOk) {\n return dispSymb;\n }\n\n if (dispSymb instanceof(Condition)) {\n if (s.yes) {\n constructChart(s.yes, dispSymb, s);\n }\n if (s.no) {\n constructChart(s.no, dispSymb, s);\n }\n } else if (s.next) {\n constructChart(s.next, dispSymb, s);\n }\n\n return dispSymb;\n })(this.start);\n\n diagram.render();\n },\n clean: function() {\n this.diagram.clean();\n }\n };\n\n var lines = [];\n var prevBreak = 0;\n for (var i0 = 1, i0len = input.length; i0 < i0len; i0++) {\n if(input[i0] === '\\n' && input[i0 - 1] !== '\\\\') {\n var line0 = input.substring(prevBreak, i0);\n prevBreak = i0 + 1;\n lines.push(line0.replace(/\\\\\\n/g, '\\n'));\n }\n }\n\n if(prevBreak < input.length) {\n lines.push(input.substr(prevBreak));\n }\n\n for (var l = 1, len = lines.length; l < len;) {\n var currentLine = lines[l];\n\n if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0) {\n lines[l - 1] += '\\n' + currentLine;\n lines.splice(l, 1);\n len--;\n } else {\n l++;\n }\n }\n\n function getSymbol(s) {\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n return chart.symbols[s.substring(0, startIndex - 1)];\n }\n return chart.symbols[s];\n }\n\n function getNextPath(s) {\n var next = 'next';\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n next = flowSymb.substring(startIndex, endIndex);\n if (next.indexOf(',') < 0) {\n if (next !== 'yes' && next !== 'no') {\n next = 'next, ' + next;\n }\n }\n }\n return next;\n }\n\n while (lines.length > 0) {\n var line = lines.splice(0, 1)[0].trim();\n\n if (line.indexOf('=>') >= 0) {\n // definition\n var parts = line.split('=>');\n var symbol = {\n key: parts[0],\n symbolType: parts[1],\n text: null,\n link: null,\n target: null,\n flowstate: null\n };\n\n var sub;\n\n if (symbol.symbolType.indexOf(': ') >= 0) {\n sub = symbol.symbolType.split(': ');\n symbol.symbolType = sub.shift();\n symbol.text = sub.join(': ');\n }\n\n if (symbol.text && symbol.text.indexOf(':>') >= 0) {\n sub = symbol.text.split(':>');\n symbol.text = sub.shift();\n symbol.link = sub.join(':>');\n } else if (symbol.symbolType.indexOf(':>') >= 0) {\n sub = symbol.symbolType.split(':>');\n symbol.symbolType = sub.shift();\n symbol.link = sub.join(':>');\n }\n\n if (symbol.symbolType.indexOf('\\n') >= 0) {\n symbol.symbolType = symbol.symbolType.split('\\n')[0];\n }\n\n /* adding support for links */\n if (symbol.link) {\n var startIndex = symbol.link.indexOf('[') + 1;\n var endIndex = symbol.link.indexOf(']');\n if (startIndex >= 0 && endIndex >= 0) {\n symbol.target = symbol.link.substring(startIndex, endIndex);\n symbol.link = symbol.link.substring(0, startIndex - 1);\n }\n }\n /* end of link support */\n\n /* adding support for flowstates */\n if (symbol.text) {\n if (symbol.text.indexOf('|') >= 0) {\n var txtAndState = symbol.text.split('|');\n symbol.flowstate = txtAndState.pop().trim();\n symbol.text = txtAndState.join('|');\n }\n }\n /* end of flowstate support */\n\n chart.symbols[symbol.key] = symbol;\n\n } else if (line.indexOf('->') >= 0) {\n // flow\n var flowSymbols = line.split('->');\n for (var i = 0, lenS = flowSymbols.length; i < lenS; i++) {\n var flowSymb = flowSymbols[i];\n\n var realSymb = getSymbol(flowSymb);\n var next = getNextPath(flowSymb);\n\n var direction = null;\n if (next.indexOf(',') >= 0) {\n var condOpt = next.split(',');\n next = condOpt[0];\n direction = condOpt[1].trim();\n }\n\n if (!chart.start) {\n chart.start = realSymb;\n }\n\n if (i + 1 < lenS) {\n var nextSymb = flowSymbols[i + 1];\n realSymb[next] = getSymbol(nextSymb);\n realSymb['direction_' + next] = direction;\n direction = null;\n }\n }\n }\n\n }\n return chart;\n}\n\nmodule.exports = parse;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.parse.js\n ** module id = 4\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Condition(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.textMargin = this.getAttr('text-margin');\n this.yes_direction = 'bottom';\n this.no_direction = 'right';\n if (options.yes && options.direction_yes && options.no && !options.direction_no) {\n if (options.direction_yes === 'right') {\n this.no_direction = 'bottom';\n this.yes_direction = 'right';\n } else {\n this.no_direction = 'right';\n this.yes_direction = 'bottom';\n }\n } else if (options.yes && !options.direction_yes && options.no && options.direction_no) {\n if (options.direction_no === 'right') {\n this.yes_direction = 'bottom';\n this.no_direction = 'right';\n } else {\n this.yes_direction = 'right';\n this.no_direction = 'bottom';\n }\n } else {\n this.yes_direction = 'bottom';\n this.no_direction = 'right';\n }\n\n this.yes_direction = this.yes_direction || 'bottom';\n this.no_direction = this.no_direction || 'right';\n\n this.text.attr({\n x: this.textMargin * 2\n });\n\n var width = this.text.getBBox().width + 3 * this.textMargin;\n width += width/2;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n height += height/2;\n height = Math.max(width * 0.5, height);\n var startX = width/4;\n var startY = height/4;\n\n this.text.attr({\n x: startX + this.textMargin/2\n });\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - width/4, y: startY + height/4},\n {x: startX - width/4 + width/2, y: startY + height/4 + height/2},\n {x: startX - width/4 + width, y: startY + height/4},\n {x: startX - width/4 + width/2, y: startY + height/4 - height/2},\n {x: startX - width/4, y: startY + height/4}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n\n this.initialize();\n}\ninherits(Condition, Symbol);\n\nCondition.prototype.render = function() {\n\n if (this.yes_direction) {\n this[this.yes_direction + '_symbol'] = this.yes_symbol;\n }\n\n if (this.no_direction) {\n this[this.no_direction + '_symbol'] = this.no_symbol;\n }\n\n var lineLength = this.getAttr('line-length');\n\n if (this.bottom_symbol) {\n var bottomPoint = this.getBottom();\n\n if (!this.bottom_symbol.isPositioned) {\n this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width/2);\n this.bottom_symbol.isPositioned = true;\n\n this.bottom_symbol.render();\n }\n }\n\n if (this.right_symbol) {\n var rightPoint = this.getRight();\n\n if (!this.right_symbol.isPositioned) {\n\n this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);\n this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n var self = this;\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {\n hasSymbolUnder = true;\n break;\n }\n }\n\n if (hasSymbolUnder) {\n self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.right_symbol.isPositioned = true;\n\n this.right_symbol.render();\n }\n }\n};\n\nCondition.prototype.renderLines = function() {\n if (this.yes_symbol) {\n this.drawLineTo(this.yes_symbol, this.getAttr('yes-text'), this.yes_direction);\n }\n\n if (this.no_symbol) {\n this.drawLineTo(this.no_symbol, this.getAttr('no-text'), this.no_direction);\n }\n};\n\nmodule.exports = Condition;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.condition.js\n ** module id = 5\n ** module chunks = 0\n **/","var Raphael = require('raphael');\nvar defaults = require('./flowchart.helpers').defaults;\nvar defaultOptions = require('./flowchart.defaults');\nvar Condition = require('./flowchart.symbol.condition');\n\nfunction FlowChart(container, options) {\n options = options || {};\n\n this.paper = new Raphael(container);\n\n this.options = defaults(options, defaultOptions);\n\n this.symbols = [];\n this.lines = [];\n this.start = null;\n}\n\nFlowChart.prototype.handle = function(symbol) {\n if (this.symbols.indexOf(symbol) <= -1) {\n this.symbols.push(symbol);\n }\n\n var flowChart = this;\n\n if (symbol instanceof(Condition)) {\n symbol.yes = function(nextSymbol) {\n symbol.yes_symbol = nextSymbol;\n if(symbol.no_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n symbol.no = function(nextSymbol) {\n symbol.no_symbol = nextSymbol;\n if(symbol.yes_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n } else {\n symbol.then = function(nextSymbol) {\n symbol.next = nextSymbol;\n symbol.pathOk = true;\n return flowChart.handle(nextSymbol);\n };\n }\n\n return symbol;\n};\n\nFlowChart.prototype.startWith = function(symbol) {\n this.start = symbol;\n return this.handle(symbol);\n};\n\nFlowChart.prototype.render = function() {\n var maxWidth = 0,\n maxHeight = 0,\n i = 0,\n len = 0,\n maxX = 0,\n maxY = 0,\n minX = 0,\n minY = 0,\n symbol,\n line;\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n if (symbol.width > maxWidth) {\n maxWidth = symbol.width;\n }\n if (symbol.height > maxHeight) {\n maxHeight = symbol.height;\n }\n }\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n symbol.shiftX(this.options.x + (maxWidth - symbol.width)/2 + this.options['line-width']);\n symbol.shiftY(this.options.y + (maxHeight - symbol.height)/2 + this.options['line-width']);\n }\n\n this.start.render();\n // for (i = 0, len = this.symbols.length; i < len; i++) {\n // symbol = this.symbols[i];\n // symbol.render();\n // }\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n symbol.renderLines();\n }\n\n maxX = this.maxXFromLine;\n\n var x;\n var y;\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n x = symbol.getX() + symbol.width;\n y = symbol.getY() + symbol.height;\n if (x > maxX) {\n maxX = x;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n\n for (i = 0, len = this.lines.length; i < len; i++) {\n line = this.lines[i].getBBox();\n x = line.x;\n y = line.y;\n var x2 = line.x2;\n var y2 = line.y2;\n if (x < minX) {\n minX = x;\n }\n if (y < minY) {\n minY = y;\n }\n if (x2 > maxX) {\n maxX = x2;\n }\n if (y2 > maxY) {\n maxY = y2;\n }\n }\n\n var scale = this.options['scale'];\n var lineWidth = this.options['line-width'];\n\n if (minX < 0) minX -= lineWidth;\n if (minY < 0) minY -= lineWidth;\n\n var width = maxX + lineWidth - minX;\n var height = maxY + lineWidth - minY;\n\n this.paper.setSize(width * scale, height * scale);\n this.paper.setViewBox(minX, minY, width, height, true);\n};\n\nFlowChart.prototype.clean = function() {\n if (this.paper) {\n var paperDom = this.paper.canvas;\n paperDom.parentNode.removeChild(paperDom);\n }\n};\n\nmodule.exports = FlowChart;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.chart.js\n ** module id = 6\n ** module chunks = 0\n **/","// defaults\nmodule.exports = {\n 'x': 0,\n 'y': 0,\n 'line-width': 3,\n 'line-length': 50,\n 'text-margin': 10,\n 'font-size': 14,\n 'font-color': 'black',\n // 'font': 'normal',\n // 'font-family': 'calibri',\n // 'font-weight': 'normal',\n 'line-color': 'black',\n 'element-color': 'black',\n 'fill': 'white',\n 'yes-text': 'yes',\n 'no-text': 'no',\n 'arrow-end': 'block',\n 'class': 'flowchart',\n 'scale': 1,\n 'symbols': {\n 'start': {},\n 'end': {},\n 'condition': {},\n 'inputoutput': {},\n 'operation': {},\n 'subroutine': {}\n }//,\n // 'flowstate' : {\n // 'past' : { 'fill': '#CCCCCC', 'font-size': 12},\n // 'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},\n // 'future' : { 'fill': '#FFFF99'},\n // 'invalid': {'fill': '#444444'}\n // }\n};\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.defaults.js\n ** module id = 7\n ** module chunks = 0\n **/","// add indexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n \"use strict\";\n if (this === null) {\n throw new TypeError();\n }\n var t = Object(this);\n var len = t.length >>> 0;\n if (len === 0) {\n return -1;\n }\n var n = 0;\n if (arguments.length > 0) {\n n = Number(arguments[1]);\n if (n != n) { // shortcut for verifying if it's NaN\n n = 0;\n } else if (n !== 0 && n != Infinity && n != -Infinity) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n }\n if (n >= len) {\n return -1;\n }\n var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n for (; k < len; k++) {\n if (k in t && t[k] === searchElement) {\n return k;\n }\n }\n return -1;\n };\n}\n\n// add lastIndexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.lastIndexOf) {\n Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/) {\n \"use strict\";\n if (this === null) {\n throw new TypeError();\n }\n var t = Object(this);\n var len = t.length >>> 0;\n if (len === 0) {\n return -1;\n }\n var n = len;\n if (arguments.length > 1) {\n n = Number(arguments[1]);\n if (n != n) {\n n = 0;\n } else if (n !== 0 && n != (1 / 0) && n != -(1 / 0)) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n }\n var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);\n for (; k >= 0; k--) {\n if (k in t && t[k] === searchElement) {\n return k;\n }\n }\n return -1;\n };\n}\n\nif (!String.prototype.trim) {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n };\n}\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.shim.js\n ** module id = 8\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction End(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n options = options || {};\n options.text = options.text || 'End';\n Symbol.call(this, chart, options, symbol);\n}\ninherits(End, Symbol);\n\nmodule.exports = End;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.end.js\n ** module id = 9\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction InputOutput(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.textMargin = this.getAttr('text-margin');\n\n this.text.attr({\n x: this.textMargin * 3\n });\n\n var width = this.text.getBBox().width + 4 * this.textMargin;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n var startX = this.textMargin;\n var startY = height/2;\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - this.textMargin, y: height},\n {x: startX - this.textMargin + width, y: height},\n {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n {x: startX, y: startY}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n\n this.initialize();\n}\ninherits(InputOutput, Symbol);\n\nInputOutput.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.textMargin;\n return {x: x, y: y};\n};\n\nInputOutput.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width - this.textMargin;\n return {x: x, y: y};\n};\n\nmodule.exports = InputOutput;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.inputoutput.js\n ** module id = 10\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Operation(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0);\n options = options || {};\n Symbol.call(this, chart, options, symbol);\n}\ninherits(Operation, Symbol);\n\nmodule.exports = Operation;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.operation.js\n ** module id = 11\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Start(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n options = options || {};\n options.text = options.text || 'Start';\n Symbol.call(this, chart, options, symbol);\n}\ninherits(Start, Symbol);\n\nmodule.exports = Start;\n\n// Start.prototype.render = function() {\n// if (this.next) {\n// var lineLength = this.chart.options.symbols[this.symbolType]['line-length'] || this.chart.options['line-length'];\n\n// var bottomPoint = this.getBottom();\n// var topPoint = this.next.getTop();\n\n// if (!this.next.isPositioned) {\n// this.next.shiftY(this.getY() + this.height + lineLength);\n// this.next.setX(bottomPoint.x - this.next.width/2);\n// this.next.isPositioned = true;\n\n// this.next.render();\n// }\n// }\n// };\n\n// Start.prototype.renderLines = function() {\n// if (this.next) {\n// this.drawLineTo(this.next);\n// }\n// };\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.start.js\n ** module id = 12\n ** module chunks = 0\n **/","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Subroutine(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0);\n options = options || {};\n Symbol.call(this, chart, options, symbol);\n\n symbol.attr({\n width: this.text.getBBox().width + 4 * this.getAttr('text-margin')\n });\n\n this.text.attr({\n 'x': 2 * this.getAttr('text-margin')\n });\n\n var innerWrap = chart.paper.rect(0, 0, 0, 0);\n innerWrap.attr({\n x: this.getAttr('text-margin'),\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n width: this.text.getBBox().width + 2 * this.getAttr('text-margin'),\n height: this.text.getBBox().height + 2 * this.getAttr('text-margin'),\n fill: this.getAttr('fill')\n });\n if (options.key) { innerWrap.node.id = options.key + 'i'; }\n\n var font = this.getAttr('font');\n var fontF = this.getAttr('font-family');\n var fontW = this.getAttr('font-weight');\n\n if (font) innerWrap.attr({ 'font': font });\n if (fontF) innerWrap.attr({ 'font-family': fontF });\n if (fontW) innerWrap.attr({ 'font-weight': fontW });\n\n if (options.link) { innerWrap.attr('href', options.link); }\n if (options.target) { innerWrap.attr('target', options.target); }\n this.group.push(innerWrap);\n innerWrap.insertBefore(this.text);\n\n this.initialize();\n}\ninherits(Subroutine, Symbol);\n\nmodule.exports = Subroutine;\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/flowchart.symbol.subroutine.js\n ** module id = 13\n ** module chunks = 0\n **/","if (typeof jQuery != 'undefined') {\n\tvar parse = require('./flowchart.parse');\n\t(function( $ ) {\n\t\t$.fn.flowChart = function( options ) {\n\t\t\treturn this.each(function() {\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvar chart = parse($this.text());\n\t\t\t\t$this.html('');\n\t\t\t\tchart.drawSVG(this, options);\n\t\t\t});\n\t\t};\n\t})(jQuery); // eslint-disable-line\n}\n\n\n\n/*****************\n ** WEBPACK FOOTER\n ** ./src/jquery-plugin.js\n ** module id = 14\n ** module chunks = 0\n **/","module.exports = __WEBPACK_EXTERNAL_MODULE_15__;\n\n\n/*****************\n ** WEBPACK FOOTER\n ** external \"Raphael\"\n ** module id = 15\n ** module chunks = 0\n **/"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///flowchart.min.js","webpack:///webpack/bootstrap 0c167881307e9f1b2ebf","webpack:///./index.js","webpack:///./src/flowchart.helpers.js","webpack:///./src/flowchart.symbol.js","webpack:///./src/flowchart.functions.js","webpack:///./src/flowchart.parse.js","webpack:///./src/flowchart.symbol.condition.js","webpack:///./src/flowchart.symbol.parallel.js","webpack:///./src/flowchart.chart.js","webpack:///./src/flowchart.defaults.js","webpack:///./src/flowchart.shim.js","webpack:///./src/flowchart.symbol.end.js","webpack:///./src/flowchart.symbol.input.js","webpack:///./src/flowchart.symbol.inputoutput.js","webpack:///./src/flowchart.symbol.operation.js","webpack:///./src/flowchart.symbol.output.js","webpack:///./src/flowchart.symbol.start.js","webpack:///./src/flowchart.symbol.subroutine.js","webpack:///./src/jquery-plugin.js","webpack:///external \"Raphael\""],"names":["root","factory","exports","module","require","define","amd","a","i","this","__WEBPACK_EXTERNAL_MODULE_18__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","parse","FlowChart","window","flowchart","_defaults","options","defaultOptions","merged","attrname","_inherits","ctor","superCtor","Object","super_","prototype","create","constructor","value","enumerable","writable","configurable","TempCtor","defaults","inherits","Symbol","chart","symbol","group","paper","set","connectedTo","symbolType","flowstate","lineStyle","key","leftLines","rightLines","topLines","bottomLines","params","next_direction","next","undefined","text","node","setAttribute","getAttr","attr","text-anchor","x","fill","font-size","font","fontF","fontW","font-family","font-weight","link","function","cursor","addEventListener","evt","target","maxWidth","words","split","tempText","ii","length","word","getBBox","width","substring","push","tmpMargin","stroke","stroke-width","height","roundness","isNaN","insertBefore","y","initialize","drawAPI","drawLine","checkLineIntersection","attName","opt1","opt3","opt2","symbols","transform","getCenter","getX","getY","shiftX","setX","shiftY","setY","getTop","getBottom","getLeft","getRight","render","self","lineLength","rightPoint","isPositioned","shift","symb","hasSymbolUnder","len","diff","Math","abs","leftPoint","bottomPoint","renderLines","drawLineTo","origin","indexOf","line","yOffset","right","bottom","top","left","symbolX","symbolY","symbolTop","symbolRight","symbolLeft","isOnSameColumn","isOnSameLine","isUnder","isUpper","isLeft","isRight","maxX","lineWith","max","rightStart","topEnd","bottomStart","diffX","leftStart","topStart","leftEnd","rightEnd","l","llen","lines","otherLine","ePath","lPath","iP","lenP","newPath","line1_from_x","line1_from_y","line1_to_x","line1_to_y","lP","lenlP","newLinePath","line2_from_x","line2_from_y","line2_to_x","line2_to_y","res","onLine1","onLine2","newSegment","splice","minXFromSymbols","maxXFromLine","drawPath","location","points","path","pathValues","from","to","toString","arrow-end","centerText","textPath","textAnchor","isHorizontal","firstTo","line1StartX","line1StartY","line1EndX","line1EndY","line2StartX","line2StartY","line2EndX","line2EndY","denominator","b","numerator1","numerator2","result","input","getStyle","s","startIndex","endIndex","getSymbValue","getSymbol","getNextPath","flowSymb","getAnnotation","tmp","tmp_split","trim","start","drawSVG","container","getDisplaySymbol","dispSymbols","Start","diagram","End","Operation","InputOutput","Input","Output","Subroutine","Condition","Parallel","Error","clean","constructChart","prevDisp","prev","dispSymb","startWith","pathOk","yes","no","path1","path2","path3","then","prevBreak","i0","i0len","line0","replace","substr","currentLine","parts","match","entries","entry","sub","join","txtAndState","pop","ann","flowSymbols","iS","lenS","symbVal","realSymb","direction","condOpt","yes_annotation","no_annotation","path1_annotation","path2_annotation","path3_annotation","nextSymb","lineStyleSymbols","iSS","lenSS","curSymb","nextSymbol","JSON","textMargin","yes_direction","direction_yes","no_direction","direction_no","startX","startY","yes_symbol","no_symbol","bottom_symbol","right_symbol","left_symbol","rect","path1_direction","path2_direction","path3_direction","direction_next","direction_path1","direction_path2","direction_path3","path1_symbol","path2_symbol","path3_symbol","top_symbol","topPoint","Raphael","handle","flowChart","maxHeight","maxY","minX","minY","leftX","x2","y2","scale","lineWidth","setSize","setViewBox","paperDom","canvas","parentNode","removeChild","line-width","line-length","text-margin","font-color","line-color","element-color","yes-text","no-text","class","end","condition","inputoutput","output","operation","subroutine","parallel","Array","searchElement","TypeError","t","n","arguments","Number","Infinity","floor","k","lastIndexOf","min","String","innerWrap","jQuery","$","paramFit","needle","haystack","isArray","includes","methods","init","each","$this","html","setFlowStateByParam","param","paramValue","newFlowState","nextSymbolKeys","property","hasOwnProperty","val","nski","nextSymbolKey","clearFlowState","fn","methodOrOptions","apply","slice","error"],"mappings":";;;;;CAAA,SAAAA,EAAAC,GACA,mBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,gBACA,sBAAAC,gBAAAC,IACAD,QAAA,WAAAJ,OACA,CACA,GAAAM,GAAAN,EAAA,gBAAAC,SAAAE,QAAA,WAAAJ,EAAA,QACA,QAAAQ,KAAAD,IAAA,gBAAAL,iBAAAF,GAAAQ,GAAAD,EAAAC,KAECC,KAAA,SAAAC,GACD,MCAgB,UAAUC,GCN1B,QAAAC,GAAAC,GAGA,GAAAC,EAAAD,GACA,MAAAC,GAAAD,GAAAX,OAGA,IAAAC,GAAAW,EAAAD,IACAX,WACAa,GAAAF,EACAG,QAAA,EAUA,OANAL,GAAAE,GAAAI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AyR,eAAAD,GAAA,CACA,GAAAxV,GAAAD,EAAAiE,QAAAwR,GACAE,EAAA1V,EAAAa,OAAAuU,EACA,IAAAX,EAAAiB,EAAAL,GAAA,CACArV,EAAAM,UAAAgV,CACA,QAAAK,GAAA,EAAAA,EAAAJ,EAAA7S,OAAAiT,IAAA,CACA,GAAAC,GAAAL,EAAAI,EAEA3V,GAAA4V,IACA5V,EAAA4V,GAAA,QACA5V,EAAA4V,GAAA,OAAAR,IACAX,EAAAzU,EAAA4V,GAAA,OAAAR,GAAAC,KAEArV,EAAAO,UAAAP,EAAA4V,GAAA,MAAA3S,OAAAlD,EAAApB,UAAA,UAAA2W,GAAA,SAOAvV,EAAA+M,QACA/M,EAAAgM,QAAArO,SAIAmY,eAAA,WACA,MAAAnY,MAAAsX,KAAA,WACA,GAAAjV,GAAArC,KAAAqC,KAEA,QAAAyV,KAAAzV,GAAAiE,QACA,GAAAjE,EAAAiE,QAAAyR,eAAAD,GAAA,CACA,GAAAtU,GAAAnB,EAAAiE,QAAAwR,EACAtU,GAAAZ,UAAA,GAIAP,EAAA+M,QACA/M,EAAAgM,QAAArO,SAKA8W,GAAAsB,GAAArE,UAAA,SAAAsE,GACA,MAAAjB,GAAAiB,GACAjB,EAAAiB,GAAAC,MAAAtY,KAAA+V,MAAArU,UAAA6W,MAAA/X,KAAA4V,UAAA,IACA,gBAAAiC,UAIAvB,GAAA0B,MAAA,UAAAH,EAAA,uCAFAjB,EAAAC,KAAAiB,MAAAtY,KAAAoW,aAMAS,UnBo6EM,SAAUnX,EAAQD,GoBl/ExBC,EAAAD,QAAAQ","file":"flowchart.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"Raphael\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"Raphael\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"Raphael\")) : factory(root[\"Raphael\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_18__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"Raphael\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"Raphael\"], factory);\n\telse {\n\t\tvar a = typeof exports === 'object' ? factory(require(\"Raphael\")) : factory(root[\"Raphael\"]);\n\t\tfor(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];\n\t}\n})(this, function(__WEBPACK_EXTERNAL_MODULE_18__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/*!******************!*\\\n !*** ./index.js ***!\n \\******************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\t__webpack_require__(/*! ./src/flowchart.shim */ 9);\n\tvar parse = __webpack_require__(/*! ./src/flowchart.parse */ 4);\n\t__webpack_require__(/*! ./src/jquery-plugin */ 17);\n\t\n\tvar FlowChart = {\n\t\tparse: parse\n\t};\n\t\n\tif (typeof window !== 'undefined') {\n\t\twindow.flowchart = FlowChart;\n\t}\n\t\n\tmodule.exports = FlowChart;\n\n\n/***/ }),\n/* 1 */\n/*!**********************************!*\\\n !*** ./src/flowchart.helpers.js ***!\n \\**********************************/\n/***/ (function(module, exports) {\n\n\tfunction _defaults(options, defaultOptions) {\n\t if (!options || typeof options === 'function') {\n\t return defaultOptions;\n\t }\n\t\n\t var merged = {};\n\t for (var attrname in defaultOptions) {\n\t merged[attrname] = defaultOptions[attrname];\n\t }\n\t\n\t for (attrname in options) {\n\t if (options[attrname]) {\n\t if (typeof merged[attrname] === 'object') {\n\t merged[attrname] = _defaults(merged[attrname], options[attrname]);\n\t } else {\n\t merged[attrname] = options[attrname];\n\t }\n\t }\n\t }\n\t return merged;\n\t}\n\t\n\tfunction _inherits(ctor, superCtor) {\n\t if (typeof(Object.create) === 'function') {\n\t // implementation from standard node.js 'util' module\n\t ctor.super_ = superCtor;\n\t ctor.prototype = Object.create(superCtor.prototype, {\n\t constructor: {\n\t value: ctor,\n\t enumerable: false,\n\t writable: true,\n\t configurable: true\n\t }\n\t });\n\t } else {\n\t // old school shim for old browsers\n\t ctor.super_ = superCtor;\n\t var TempCtor = function () {};\n\t TempCtor.prototype = superCtor.prototype;\n\t ctor.prototype = new TempCtor();\n\t ctor.prototype.constructor = ctor;\n\t }\n\t}\n\t\n\t// move dependent functions to a container so that\n\t// they can be overriden easier in no jquery environment (node.js)\n\tmodule.exports = {\n\t defaults: _defaults,\n\t inherits: _inherits\n\t};\n\n\n/***/ }),\n/* 2 */\n/*!*********************************!*\\\n !*** ./src/flowchart.symbol.js ***!\n \\*********************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawLine = drawAPI.drawLine;\n\tvar checkLineIntersection = drawAPI.checkLineIntersection;\n\t\n\tfunction Symbol(chart, options, symbol) {\n\t this.chart = chart;\n\t this.group = this.chart.paper.set();\n\t this.symbol = symbol;\n\t this.connectedTo = [];\n\t this.symbolType = options.symbolType;\n\t this.flowstate = (options.flowstate || 'future');\n\t this.lineStyle = (options.lineStyle || {});\n\t this.key = (options.key || '');\n\t this.leftLines = [];\n\t this.rightLines = [];\n\t this.topLines = [];\n\t this.bottomLines = [];\n\t this.params = options.params;\n\t\n\t this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;\n\t\n\t this.text = this.chart.paper.text(0, 0, options.text);\n\t //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t\n\t if (options.key) { this.text.node.id = options.key + 't'; }\n\t this.text.node.setAttribute('class', this.getAttr('class') + 't');\n\t\n\t this.text.attr({\n\t 'text-anchor': 'start',\n\t 'x' : this.getAttr('text-margin'),\n\t 'fill' : this.getAttr('font-color'),\n\t 'font-size' : this.getAttr('font-size')\n\t });\n\t\n\t var font = this.getAttr('font');\n\t var fontF = this.getAttr('font-family');\n\t var fontW = this.getAttr('font-weight');\n\t\n\t if (font) this.text.attr({ 'font': font });\n\t if (fontF) this.text.attr({ 'font-family': fontF });\n\t if (fontW) this.text.attr({ 'font-weight': fontW });\n\t\n\t if (options.link) { this.text.attr('href', options.link); }\n\t \n\t //ndrqu Add click function with event and options params\n\t if (options.function) { \n\t this.text.attr({ 'cursor' : 'pointer' });\n\t\n\t this.text.node.addEventListener(\"click\", function(evt) {\n\t window[options.function](evt,options);\n\t }, false);\n\t }\n\t\n\t if (options.target) { this.text.attr('target', options.target); }\n\t\n\t var maxWidth = this.getAttr('maxWidth');\n\t if (maxWidth) {\n\t // using this approach: http://stackoverflow.com/a/3153457/22466\n\t var words = options.text.split(' ');\n\t var tempText = \"\";\n\t for (var i=0, ii=words.length; i maxWidth) {\n\t tempText += \"\\n\" + word;\n\t } else {\n\t tempText += \" \" + word;\n\t }\n\t }\n\t this.text.attr(\"text\", tempText.substring(1));\n\t }\n\t\n\t this.group.push(this.text);\n\t\n\t if (symbol) {\n\t var tmpMargin = this.getAttr('text-margin');\n\t\n\t symbol.attr({\n\t 'fill' : this.getAttr('fill'),\n\t 'stroke' : this.getAttr('element-color'),\n\t 'stroke-width' : this.getAttr('line-width'),\n\t 'width' : this.text.getBBox().width + 2 * tmpMargin,\n\t 'height' : this.text.getBBox().height + 2 * tmpMargin\n\t });\n\t\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t var roundness = this.getAttr('roundness');\n\t if (!isNaN(roundness)) {\n\t symbol.node.setAttribute('ry', roundness);\n\t symbol.node.setAttribute('rx', roundness);\n\t }\n\t\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t\n\t //ndrqu Add click function with event and options params\n\t if (options.function) { \n\t symbol.node.addEventListener(\"click\", function(evt) {\n\t window[options.function](evt,options);\n\t }, false);\n\t symbol.attr({ 'cursor' : 'pointer' });\n\t }\n\t if (options.key) { symbol.node.id = options.key; }\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t\n\t this.text.attr({\n\t 'y': symbol.getBBox().height/2\n\t });\n\t\n\t this.initialize();\n\t }\n\t\n\t}\n\t\n\t/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\n\tSymbol.prototype.getAttr = function(attName) {\n\t if (!this.chart) {\n\t return undefined;\n\t }\n\t var opt3 = (this.chart.options) ? this.chart.options[attName] : undefined;\n\t var opt2 = (this.chart.options.symbols) ? this.chart.options.symbols[this.symbolType][attName] : undefined;\n\t var opt1;\n\t if (this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate]) {\n\t opt1 = this.chart.options.flowstate[this.flowstate][attName];\n\t }\n\t return (opt1 || opt2 || opt3);\n\t};\n\t\n\tSymbol.prototype.initialize = function() {\n\t this.group.transform('t' + this.getAttr('line-width') + ',' + this.getAttr('line-width'));\n\t\n\t this.width = this.group.getBBox().width;\n\t this.height = this.group.getBBox().height;\n\t};\n\t\n\tSymbol.prototype.getCenter = function() {\n\t return {x: this.getX() + this.width/2,\n\t y: this.getY() + this.height/2};\n\t};\n\t\n\tSymbol.prototype.getX = function() {\n\t return this.group.getBBox().x;\n\t};\n\t\n\tSymbol.prototype.getY = function() {\n\t return this.group.getBBox().y;\n\t};\n\t\n\tSymbol.prototype.shiftX = function(x) {\n\t this.group.transform('t' + (this.getX() + x) + ',' + this.getY());\n\t};\n\t\n\tSymbol.prototype.setX = function(x) {\n\t this.group.transform('t' + x + ',' + this.getY());\n\t};\n\t\n\tSymbol.prototype.shiftY = function(y) {\n\t this.group.transform('t' + this.getX() + ',' + (this.getY() + y));\n\t};\n\t\n\tSymbol.prototype.setY = function(y) {\n\t this.group.transform('t' + this.getX() + ',' + y);\n\t};\n\t\n\tSymbol.prototype.getTop = function() {\n\t var y = this.getY();\n\t var x = this.getX() + this.width/2;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getBottom = function() {\n\t var y = this.getY() + this.height;\n\t var x = this.getX() + this.width/2;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX();\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width;\n\t return {x: x, y: y};\n\t};\n\t\n\tSymbol.prototype.render = function() {\n\t if (this.next) {\n\t\n\t var self = this;\n\t var lineLength = this.getAttr('line-length');\n\t\n\t if (this.next_direction === 'right') {\n\t\n\t var rightPoint = this.getRight();\n\t\n\t if (!this.next.isPositioned) {\n\t this.next.setY(rightPoint.y - this.next.height/2);\n\t this.next.shiftX(this.group.getBBox().x + this.width + lineLength);\n\t\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n\t if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t if (self.next.symbolType === 'end') return;\n\t self.next.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.next.isPositioned = true;\n\t\n\t this.next.render();\n\t }\n\t } else if (this.next_direction === 'left') {\n\t\n\t var leftPoint = this.getLeft();\n\t\n\t if (!this.next.isPositioned) {\n\t this.next.setY(leftPoint.y - this.next.height/2);\n\t this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\t\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n\t if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t if (self.next.symbolType === 'end') return;\n\t self.next.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.next.isPositioned = true;\n\t\n\t this.next.render();\n\t }\n\t } else {\n\t var bottomPoint = this.getBottom();\n\t\n\t if (!this.next.isPositioned) {\n\t this.next.shiftY(this.getY() + this.height + lineLength);\n\t this.next.setX(bottomPoint.x - this.next.width/2);\n\t this.next.isPositioned = true;\n\t\n\t this.next.render();\n\t }\n\t }\n\t }\n\t};\n\t\n\tSymbol.prototype.renderLines = function() {\n\t if (this.next) {\n\t if (this.next_direction) {\n\t this.drawLineTo(this.next, this.getAttr('arrow-text') || '', this.next_direction);\n\t } else {\n\t this.drawLineTo(this.next, this.getAttr('arrow-text') || '');\n\t }\n\t }\n\t};\n\t\n\tSymbol.prototype.drawLineTo = function(symbol, text, origin) {\n\t if (this.connectedTo.indexOf(symbol) < 0) {\n\t this.connectedTo.push(symbol);\n\t }\n\t\n\t var x = this.getCenter().x,\n\t y = this.getCenter().y,\n\t right = this.getRight(),\n\t bottom = this.getBottom(),\n\t top = this.getTop(),\n\t left = this.getLeft();\n\t\n\t var symbolX = symbol.getCenter().x,\n\t symbolY = symbol.getCenter().y,\n\t symbolTop = symbol.getTop(),\n\t symbolRight = symbol.getRight(),\n\t symbolLeft = symbol.getLeft();\n\t\n\t var isOnSameColumn = x === symbolX,\n\t isOnSameLine = y === symbolY,\n\t isUnder = y < symbolY,\n\t isUpper = y > symbolY || this === symbol,\n\t isLeft = x > symbolX,\n\t isRight = x < symbolX;\n\t\n\t var maxX = 0,\n\t line,\n\t yOffset,\n\t lineLength = this.getAttr('line-length'),\n\t lineWith = this.getAttr('line-width');\n\t\n\t if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {\n\t if (symbol.topLines.length === 0 && this.bottomLines.length === 0) {\n\t line = drawLine(this.chart, bottom, symbolTop, text);\n\t } else {\n\t yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n\t line = drawLine(this.chart, bottom, [\n\t {x: symbolTop.x, y: symbolTop.y - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t }\n\t this.bottomLines.push(line);\n\t symbol.topLines.push(line);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x;\n\t } else if ((!origin || origin === 'right') && isOnSameLine && isRight) {\n\t if (symbol.leftLines.length === 0 && this.rightLines.length === 0) {\n\t line = drawLine(this.chart, right, symbolLeft, text);\n\t } else {\n\t yOffset = Math.max(symbol.leftLines.length, this.rightLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: right.x, y: right.y - yOffset},\n\t {x: right.x, y: symbolLeft.y - yOffset},\n\t {x: symbolLeft.x, y: symbolLeft.y - yOffset},\n\t {x: symbolLeft.x, y: symbolLeft.y}\n\t ], text);\n\t }\n\t this.rightLines.push(line);\n\t symbol.leftLines.push(line);\n\t this.rightStart = true;\n\t symbol.leftEnd = true;\n\t maxX = symbolLeft.x;\n\t } else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {\n\t if (symbol.rightLines.length === 0 && this.leftLines.length === 0) {\n\t line = drawLine(this.chart, left, symbolRight, text);\n\t } else {\n\t yOffset = Math.max(symbol.rightLines.length, this.leftLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: right.x, y: right.y - yOffset},\n\t {x: right.x, y: symbolRight.y - yOffset},\n\t {x: symbolRight.x, y: symbolRight.y - yOffset},\n\t {x: symbolRight.x, y: symbolRight.y}\n\t ], text);\n\t }\n\t this.leftLines.push(line);\n\t symbol.rightLines.push(line);\n\t this.leftStart = true;\n\t symbol.rightEnd = true;\n\t maxX = symbolRight.x;\n\t } else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {\n\t yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y - yOffset},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightLines.push(line);\n\t symbol.topLines.push(line);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {\n\t yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y - yOffset},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightLines.push(line);\n\t symbol.topLines.push(line);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((!origin || origin === 'bottom') && isLeft) {\n\t yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n\t if (this.leftEnd && isUpper) {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t } else {\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t }\n\t this.bottomLines.push(line);\n\t symbol.topLines.push(line);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n\t } else if ((!origin || origin === 'bottom') && isRight && isUnder) {\n\t yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.bottomLines.push(line);\n\t symbol.topLines.push(line);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x;\n\t if (symbolTop.x > maxX) maxX = symbolTop.x;\n\t } else if ((!origin || origin === 'bottom') && isRight) {\n\t yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n\t {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.bottomLines.push(line);\n\t symbol.topLines.push(line);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n\t } else if ((origin && origin === 'right') && isLeft) {\n\t yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: right.x + lineLength/2, y: right.y},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.rightLines.push(line);\n\t symbol.topLines.push(line);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((origin && origin === 'right') && isRight) {\n\t yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n\t line = drawLine(this.chart, right, [\n\t {x: symbolTop.x, y: right.y - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - yOffset}\n\t ], text);\n\t this.rightLines.push(line);\n\t symbol.topLines.push(line);\n\t this.rightStart = true;\n\t symbol.topEnd = true;\n\t maxX = right.x + lineLength/2;\n\t } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {\n\t yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n\t line = drawLine(this.chart, bottom, [\n\t {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n\t {x: right.x + lineLength/2, y: bottom.y + lineLength/2 - yOffset},\n\t {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.bottomLines.push(line);\n\t symbol.topLines.push(line);\n\t this.bottomStart = true;\n\t symbol.topEnd = true;\n\t maxX = bottom.x + lineLength/2;\n\t } else if ((origin === 'left') && isOnSameColumn && isUpper) {\n\t var diffX = left.x - lineLength/2;\n\t if (symbolLeft.x < left.x) {\n\t diffX = symbolLeft.x - lineLength/2;\n\t }\n\t yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n\t line = drawLine(this.chart, left, [\n\t {x: diffX, y: left.y - yOffset},\n\t {x: diffX, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.leftLines.push(line);\n\t symbol.topLines.push(line);\n\t this.leftStart = true;\n\t symbol.topEnd = true;\n\t maxX = left.x;\n\t } else if ((origin === 'left')) {\n\t yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n\t line = drawLine(this.chart, left, [\n\t {x: symbolTop.x + (left.x - symbolTop.x)/2, y: left.y},\n\t {x: symbolTop.x + (left.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.leftLines.push(line);\n\t symbol.topLines.push(line);\n\t this.leftStart = true;\n\t symbol.topEnd = true;\n\t maxX = left.x;\n\t } else if ((origin === 'top')) {\n\t yOffset = Math.max(symbol.topLines.length, this.topLines.length) * 10;\n\t line = drawLine(this.chart, top, [\n\t {x: top.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n\t {x: symbolTop.x, y: symbolTop.y}\n\t ], text);\n\t this.topLines.push(line);\n\t symbol.topLines.push(line);\n\t this.topStart = true;\n\t symbol.topEnd = true;\n\t maxX = top.x;\n\t }\n\t\n\t //update line style\n\t if (this.lineStyle[symbol.key] && line){\n\t line.attr(this.lineStyle[symbol.key]);\n\t }\n\t\n\t if (line) {\n\t for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {\n\t var otherLine = this.chart.lines[l];\n\t\n\t var ePath = otherLine.attr('path'),\n\t lPath = line.attr('path');\n\t\n\t for (var iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n\t var newPath = [];\n\t newPath.push(['M', ePath[iP][1], ePath[iP][2]]);\n\t newPath.push(['L', ePath[iP + 1][1], ePath[iP + 1][2]]);\n\t\n\t var line1_from_x = newPath[0][1];\n\t var line1_from_y = newPath[0][2];\n\t var line1_to_x = newPath[1][1];\n\t var line1_to_y = newPath[1][2];\n\t\n\t for (var lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n\t var newLinePath = [];\n\t newLinePath.push(['M', lPath[lP][1], lPath[lP][2]]);\n\t newLinePath.push(['L', lPath[lP + 1][1], lPath[lP + 1][2]]);\n\t\n\t var line2_from_x = newLinePath[0][1];\n\t var line2_from_y = newLinePath[0][2];\n\t var line2_to_x = newLinePath[1][1];\n\t var line2_to_y = newLinePath[1][2];\n\t\n\t var res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n\t if (res.onLine1 && res.onLine2) {\n\t\n\t var newSegment;\n\t if (line2_from_y === line2_to_y) {\n\t if (line2_from_x > line2_to_x) {\n\t newSegment = ['L', res.x + lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', res.x + lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x - lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t } else {\n\t newSegment = ['L', res.x - lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', res.x - lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x + lineWith * 2, line2_from_y];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t }\n\t } else {\n\t if (line2_from_y > line2_to_y) {\n\t newSegment = ['L', line2_from_x, res.y + lineWith * 2];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', line2_from_x, res.y + lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y - lineWith * 2];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t } else {\n\t newSegment = ['L', line2_from_x, res.y - lineWith * 2];\n\t lPath.splice(lP + 1, 0, newSegment);\n\t newSegment = ['C', line2_from_x, res.y - lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y + lineWith * 2];\n\t lPath.splice(lP + 2, 0, newSegment);\n\t line.attr('path', lPath);\n\t }\n\t }\n\t\n\t lP += 2;\n\t }\n\t }\n\t }\n\t }\n\t\n\t this.chart.lines.push(line);\n\t if (this.chart.minXFromSymbols === undefined || this.chart.minXFromSymbols > left.x) {\n\t this.chart.minXFromSymbols = left.x;\n\t }\n\t }\n\t\n\t if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {\n\t this.chart.maxXFromLine = maxX;\n\t }\n\t};\n\t\n\tmodule.exports = Symbol;\n\n\n/***/ }),\n/* 3 */\n/*!************************************!*\\\n !*** ./src/flowchart.functions.js ***!\n \\************************************/\n/***/ (function(module, exports) {\n\n\tfunction drawPath(chart, location, points) {\n\t var i, len;\n\t var path = 'M{0},{1}';\n\t for (i = 2, len = 2 * points.length + 2; i < len; i+=2) {\n\t path += ' L{' + i + '},{' + (i + 1) + '}';\n\t }\n\t var pathValues = [location.x, location.y];\n\t for (i = 0, len = points.length; i < len; i++) {\n\t pathValues.push(points[i].x);\n\t pathValues.push(points[i].y);\n\t }\n\t var symbol = chart.paper.path(path, pathValues);\n\t symbol.attr('stroke', chart.options['element-color']);\n\t symbol.attr('stroke-width', chart.options['line-width']);\n\t\n\t var font = chart.options.font;\n\t var fontF = chart.options['font-family'];\n\t var fontW = chart.options['font-weight'];\n\t\n\t if (font) symbol.attr({ 'font': font });\n\t if (fontF) symbol.attr({ 'font-family': fontF });\n\t if (fontW) symbol.attr({ 'font-weight': fontW });\n\t\n\t return symbol;\n\t}\n\t\n\tfunction drawLine(chart, from, to, text) {\n\t var i, len;\n\t\n\t if (Object.prototype.toString.call(to) !== '[object Array]') {\n\t to = [to];\n\t }\n\t\n\t var path = 'M{0},{1}';\n\t for (i = 2, len = 2 * to.length + 2; i < len; i+=2) {\n\t path += ' L{' + i + '},{' + (i + 1) + '}';\n\t }\n\t var pathValues = [from.x, from.y];\n\t for (i = 0, len = to.length; i < len; i++) {\n\t pathValues.push(to[i].x);\n\t pathValues.push(to[i].y);\n\t }\n\t\n\t var line = chart.paper.path(path, pathValues);\n\t line.attr({\n\t stroke: chart.options['line-color'],\n\t 'stroke-width': chart.options['line-width'],\n\t 'arrow-end': chart.options['arrow-end']\n\t });\n\t\n\t var font = chart.options.font;\n\t var fontF = chart.options['font-family'];\n\t var fontW = chart.options['font-weight'];\n\t\n\t if (font) line.attr({ 'font': font });\n\t if (fontF) line.attr({ 'font-family': fontF });\n\t if (fontW) line.attr({ 'font-weight': fontW });\n\t\n\t if (text) {\n\t\n\t var centerText = false;\n\t\n\t var textPath = chart.paper.text(0, 0, text);\n\t var textAnchor = 'start';\n\t\n\t var isHorizontal = false;\n\t var firstTo = to[0];\n\t\n\t if (from.y === firstTo.y) {\n\t isHorizontal = true;\n\t }\n\t\n\t var x = 0,\n\t y = 0;\n\t\n\t if (centerText) {\n\t if (from.x > firstTo.x) {\n\t x = from.x - (from.x - firstTo.x)/2;\n\t } else {\n\t x = firstTo.x - (firstTo.x - from.x)/2;\n\t }\n\t\n\t if (from.y > firstTo.y) {\n\t y = from.y - (from.y - firstTo.y)/2;\n\t } else {\n\t y = firstTo.y - (firstTo.y - from.y)/2;\n\t }\n\t\n\t if (isHorizontal) {\n\t x -= textPath.getBBox().width/2;\n\t y -= chart.options['text-margin'];\n\t } else {\n\t x += chart.options['text-margin'];\n\t y -= textPath.getBBox().height/2;\n\t }\n\t } else {\n\t x = from.x;\n\t y = from.y;\n\t\n\t if (isHorizontal) {\n\t if (from.x > firstTo.x) {\n\t x -= chart.options['text-margin']/2;\n\t textAnchor = 'end';\n\t } else {\n\t x += chart.options['text-margin']/2;\n\t }\n\t y -= chart.options['text-margin'];\n\t } else {\n\t x += chart.options['text-margin']/2;\n\t y += chart.options['text-margin'];\n\t if (from.y > firstTo.y) {\n\t y -= chart.options['text-margin']*2;\n\t }\n\t }\n\t }\n\t\n\t textPath.attr({\n\t 'text-anchor': textAnchor,\n\t 'font-size': chart.options['font-size'],\n\t 'fill': chart.options['font-color'],\n\t x: x,\n\t y: y\n\t });\n\t\n\t if (font) textPath.attr({ 'font': font });\n\t if (fontF) textPath.attr({ 'font-family': fontF });\n\t if (fontW) textPath.attr({ 'font-weight': fontW });\n\t }\n\t\n\t return line;\n\t}\n\t\n\tfunction checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n\t // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n\t var denominator, a, b, numerator1, numerator2, result = {\n\t x: null,\n\t y: null,\n\t onLine1: false,\n\t onLine2: false\n\t };\n\t denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n\t if (denominator === 0) {\n\t return result;\n\t }\n\t a = line1StartY - line2StartY;\n\t b = line1StartX - line2StartX;\n\t numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n\t numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n\t a = numerator1 / denominator;\n\t b = numerator2 / denominator;\n\t\n\t // if we cast these lines infinitely in both directions, they intersect here:\n\t result.x = line1StartX + (a * (line1EndX - line1StartX));\n\t result.y = line1StartY + (a * (line1EndY - line1StartY));\n\t /*\n\t // it is worth noting that this should be the same as:\n\t x = line2StartX + (b * (line2EndX - line2StartX));\n\t y = line2StartX + (b * (line2EndY - line2StartY));\n\t */\n\t // if line1 is a segment and line2 is infinite, they intersect if:\n\t if (a > 0 && a < 1) {\n\t result.onLine1 = true;\n\t }\n\t // if line2 is a segment and line1 is infinite, they intersect if:\n\t if (b > 0 && b < 1) {\n\t result.onLine2 = true;\n\t }\n\t // if line1 and line2 are segments, they intersect if both of the above are true\n\t return result;\n\t}\n\t\n\tmodule.exports = {\n\t\tdrawPath: drawPath,\n\t\tdrawLine: drawLine,\n\t\tcheckLineIntersection: checkLineIntersection\n\t};\n\n\n/***/ }),\n/* 4 */\n/*!********************************!*\\\n !*** ./src/flowchart.parse.js ***!\n \\********************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar FlowChart = __webpack_require__(/*! ./flowchart.chart */ 7);\n\tvar Start = __webpack_require__(/*! ./flowchart.symbol.start */ 15);\n\tvar End = __webpack_require__(/*! ./flowchart.symbol.end */ 10);\n\tvar Operation = __webpack_require__(/*! ./flowchart.symbol.operation */ 13);\n\tvar InputOutput = __webpack_require__(/*! ./flowchart.symbol.inputoutput */ 12);\n\tvar Input = __webpack_require__(/*! ./flowchart.symbol.input */ 11); //tds\n\tvar Output = __webpack_require__(/*! ./flowchart.symbol.output */ 14); //tds\n\tvar Subroutine = __webpack_require__(/*! ./flowchart.symbol.subroutine */ 16);\n\tvar Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);\n\tvar Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);\n\t\n\t\n\tfunction parse(input) {\n\t input = input || '';\n\t input = input.trim();\n\t\n\t var chart = {\n\t symbols: {},\n\t start: null,\n\t drawSVG: function(container, options) {\n\t var self = this;\n\t\n\t if (this.diagram) {\n\t this.diagram.clean();\n\t }\n\t\n\t var diagram = new FlowChart(container, options);\n\t this.diagram = diagram;\n\t var dispSymbols = {};\n\t\n\t function getDisplaySymbol(s) {\n\t if (dispSymbols[s.key]) {\n\t return dispSymbols[s.key];\n\t }\n\t\n\t switch (s.symbolType) {\n\t case 'start':\n\t dispSymbols[s.key] = new Start(diagram, s);\n\t break;\n\t case 'end':\n\t dispSymbols[s.key] = new End(diagram, s);\n\t break;\n\t case 'operation':\n\t dispSymbols[s.key] = new Operation(diagram, s);\n\t break;\n\t case 'inputoutput':\n\t dispSymbols[s.key] = new InputOutput(diagram, s);\n\t break;\n\t case 'input':\n\t dispSymbols[s.key] = new Input(diagram, s); //tds\n\t break; \n\t case 'output':\n\t dispSymbols[s.key] = new Output(diagram, s); //tds\n\t break; \n\t case 'subroutine':\n\t dispSymbols[s.key] = new Subroutine(diagram, s);\n\t break;\n\t case 'condition':\n\t dispSymbols[s.key] = new Condition(diagram, s);\n\t break;\n\t case 'parallel':\n\t dispSymbols[s.key] = new Parallel(diagram, s);\n\t break;\n\t default:\n\t return new Error('Wrong symbol type!');\n\t }\n\t\n\t return dispSymbols[s.key];\n\t }\n\t\n\t (function constructChart(s, prevDisp, prev) {\n\t var dispSymb = getDisplaySymbol(s);\n\t\n\t if (self.start === s) {\n\t diagram.startWith(dispSymb);\n\t } else if (prevDisp && prev && !prevDisp.pathOk) {\n\t if (prevDisp instanceof(Condition)) {\n\t if (prev.yes === s) {\n\t prevDisp.yes(dispSymb);\n\t }\n\t if (prev.no === s) {\n\t prevDisp.no(dispSymb);\n\t }\n\t } else if (prevDisp instanceof(Parallel)) {\n\t if (prev.path1 === s) {\n\t prevDisp.path1(dispSymb);\n\t }\n\t if (prev.path2 === s) {\n\t prevDisp.path2(dispSymb);\n\t }\n\t if (prev.path3 === s) {\n\t prevDisp.path3(dispSymb);\n\t }\n\t } else {\n\t prevDisp.then(dispSymb);\n\t }\n\t }\n\t\n\t if (dispSymb.pathOk) {\n\t return dispSymb;\n\t }\n\t\n\t if (dispSymb instanceof(Condition)) {\n\t if (s.yes) {\n\t constructChart(s.yes, dispSymb, s);\n\t }\n\t if (s.no) {\n\t constructChart(s.no, dispSymb, s);\n\t }\n\t } else if (dispSymb instanceof(Parallel)) {\n\t if (s.path1) {\n\t constructChart(s.path1, dispSymb, s);\n\t }\n\t if (s.path2) {\n\t constructChart(s.path2, dispSymb, s);\n\t }\n\t if (s.path3) {\n\t constructChart(s.path3, dispSymb, s);\n\t }\n\t } else if (s.next) {\n\t constructChart(s.next, dispSymb, s);\n\t }\n\t\n\t return dispSymb;\n\t })(this.start);\n\t\n\t diagram.render();\n\t },\n\t clean: function() {\n\t this.diagram.clean();\n\t },\n\t options: function() {\n\t return this.diagram.options;\n\t }\n\t };\n\t\n\t var lines = [];\n\t var prevBreak = 0;\n\t for (var i0 = 1, i0len = input.length; i0 < i0len; i0++) {\n\t if(input[i0] === '\\n' && input[i0 - 1] !== '\\\\') {\n\t var line0 = input.substring(prevBreak, i0);\n\t prevBreak = i0 + 1;\n\t lines.push(line0.replace(/\\\\\\n/g, '\\n'));\n\t }\n\t }\n\t\n\t if (prevBreak < input.length) {\n\t lines.push(input.substr(prevBreak));\n\t }\n\t\n\t for (var l = 1, len = lines.length; l < len;) {\n\t var currentLine = lines[l];\n\t\n\t if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0 && currentLine.indexOf('@>') < 0) {\n\t lines[l - 1] += '\\n' + currentLine;\n\t lines.splice(l, 1);\n\t len--;\n\t } else {\n\t l++;\n\t }\n\t }\n\t\n\t function getStyle(s){\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t return s.substring(startIndex,endIndex);\n\t }\n\t return '{}';\n\t }\n\t\n\t function getSymbValue(s){\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t return s.substring(startIndex,endIndex);\n\t }\n\t return '';\n\t }\n\t\n\t function getSymbol(s) {\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t return chart.symbols[s.substring(0, startIndex - 1)];\n\t }\n\t return chart.symbols[s];\n\t }\n\t\n\t function getNextPath(s) {\n\t var next = 'next';\n\t var startIndex = s.indexOf('(') + 1;\n\t var endIndex = s.indexOf(')');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t next = flowSymb.substring(startIndex, endIndex);\n\t if (next.indexOf(',') < 0) {\n\t if (next !== 'yes' && next !== 'no') {\n\t next = 'next, ' + next;\n\t }\n\t }\n\t }\n\t return next;\n\t }\n\t \n\t function getAnnotation(s) {\n\t\tvar startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n\t\tvar tmp = s.substring(startIndex, endIndex);\n\t\tif(tmp.indexOf(\",\") > 0) { tmp = tmp.substring(0, tmp.indexOf(\",\")); }\n\t\tvar tmp_split = tmp.split(\"@\");\n\t\tif(tmp_split.length > 1)\n\t\t\treturn startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : \"\";\n\t }\n\t\n\t while (lines.length > 0) {\n\t var line = lines.splice(0, 1)[0].trim();\n\t\n\t if (line.indexOf('=>') >= 0) {\n\t // definition\n\t var parts = line.split('=>');\n\t var symbol = {\n\t key: parts[0].replace(/\\(.*\\)/, ''),\n\t symbolType: parts[1],\n\t text: null,\n\t link: null,\n\t target: null,\n\t flowstate: null,\n\t function: null,\n\t lineStyle: {},\n\t params: {}\n\t };\n\t\n\t //parse parameters\n\t var params = parts[0].match(/\\((.*)\\)/);\n\t if (params && params.length > 1){\n\t var entries = params[1].split(',');\n\t for(var i = 0; i < entries.length; i++) {\n\t var entry = entries[i].split('=');\n\t if (entry.length == 2) {\n\t symbol.params[entry[0]] = entry[1];\n\t }\n\t }\n\t }\n\t\n\t var sub;\n\t\n\t if (symbol.symbolType.indexOf(': ') >= 0) {\n\t sub = symbol.symbolType.split(': ');\n\t symbol.symbolType = sub.shift();\n\t symbol.text = sub.join(': ');\n\t }\n\t\n\t if (symbol.text && symbol.text.indexOf(':$') >= 0) {\n\t sub = symbol.text.split(':$');\n\t symbol.text = sub.shift();\n\t symbol.function = sub.join(':$');\n\t } else if (symbol.symbolType.indexOf(':$') >= 0) {\n\t sub = symbol.symbolType.split(':$');\n\t symbol.symbolType = sub.shift();\n\t symbol.function = sub.join(':$');\n\t } else if (symbol.text && symbol.text.indexOf(':>') >= 0) {\n\t sub = symbol.text.split(':>');\n\t symbol.text = sub.shift();\n\t symbol.link = sub.join(':>');\n\t } else if (symbol.symbolType.indexOf(':>') >= 0) {\n\t sub = symbol.symbolType.split(':>');\n\t symbol.symbolType = sub.shift();\n\t symbol.link = sub.join(':>');\n\t }\n\t\n\t if (symbol.symbolType.indexOf('\\n') >= 0) {\n\t symbol.symbolType = symbol.symbolType.split('\\n')[0];\n\t }\n\t\n\t /* adding support for links */\n\t if (symbol.link) {\n\t var startIndex = symbol.link.indexOf('[') + 1;\n\t var endIndex = symbol.link.indexOf(']');\n\t if (startIndex >= 0 && endIndex >= 0) {\n\t symbol.target = symbol.link.substring(startIndex, endIndex);\n\t symbol.link = symbol.link.substring(0, startIndex - 1);\n\t }\n\t }\n\t /* end of link support */\n\t\n\t /* adding support for flowstates */\n\t if (symbol.text) {\n\t if (symbol.text.indexOf('|') >= 0) {\n\t var txtAndState = symbol.text.split('|');\n\t symbol.flowstate = txtAndState.pop().trim();\n\t symbol.text = txtAndState.join('|');\n\t }\n\t }\n\t /* end of flowstate support */\n\t\n\t chart.symbols[symbol.key] = symbol;\n\t\n\t } else if (line.indexOf('->') >= 0) {\n\t var ann = getAnnotation(line);\n\t if (ann) {\n\t line = line.replace('@' + ann, ''); \n\t }\n\t // flow\n\t var flowSymbols = line.split('->');\n\t for (var iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {\n\t var flowSymb = flowSymbols[iS];\n\t var symbVal = getSymbValue(flowSymb);\n\t\n\t if (symbVal === 'true' || symbVal === 'false') {\n\t // map true or false to yes or no respectively\n\t flowSymb = flowSymb.replace('true', 'yes');\n\t flowSymb = flowSymb.replace('false', 'no');\n\t }\n\t \n\t var next = getNextPath(flowSymb);\n\t var realSymb = getSymbol(flowSymb);\n\t\n\t var direction = null;\n\t if (next.indexOf(',') >= 0) {\n\t var condOpt = next.split(',');\n\t next = condOpt[0];\n\t direction = condOpt[1].trim();\n\t }\n\t\n\t if (ann) {\n\t if (realSymb.symbolType === 'condition') {\n\t if (next === \"yes\" || next === \"true\") {\n\t realSymb.yes_annotation = ann;\n\t } else {\n\t realSymb.no_annotation = ann;\n\t }\n\t } else if (realSymb.symbolType === 'parallel') {\n\t if (next === 'path1') {\n\t realSymb.path1_annotation = ann;\n\t } else if (next === 'path2') {\n\t realSymb.path2_annotation = ann;\n\t } else if (next === 'path3') {\n\t realSymb.path3_annotation = ann;\n\t }\n\t }\n\t ann = null;\n\t }\n\t\n\t if (!chart.start) {\n\t chart.start = realSymb;\n\t }\n\t\n\t if (iS + 1 < lenS) {\n\t var nextSymb = flowSymbols[iS + 1];\n\t realSymb[next] = getSymbol(nextSymb);\n\t realSymb['direction_' + next] = direction;\n\t direction = null;\n\t }\n\t }\n\t } else if (line.indexOf('@>') >= 0) {\n\t\n\t // line style\n\t var lineStyleSymbols = line.split('@>');\n\t for (var iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) {\n\t if ((iSS + 1) !== lenSS) {\n\t var curSymb = getSymbol(lineStyleSymbols[iSS]);\n\t var nextSymbol = getSymbol(lineStyleSymbols[iSS+1]);\n\t\n\t curSymb['lineStyle'][nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));\n\t }\n\t }\n\t }\n\t\n\t }\n\t return chart;\n\t}\n\t\n\tmodule.exports = parse;\n\n\n/***/ }),\n/* 5 */\n/*!*******************************************!*\\\n !*** ./src/flowchart.symbol.condition.js ***!\n \\*******************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction Condition(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.yes_annotation = options.yes_annotation;\n\t this.no_annotation = options.no_annotation;\n\t this.textMargin = this.getAttr('text-margin');\n\t this.yes_direction = options.direction_yes;\n\t this.no_direction = options.direction_no;\n\t if (!this.no_direction && this.yes_direction === 'right') {\n\t this.no_direction = 'bottom';\n\t } else if (!this.yes_direction && this.no_direction === 'bottom') {\n\t this.yes_direction = 'right'\n\t }\n\t this.yes_direction = this.yes_direction || 'bottom';\n\t this.no_direction = this.no_direction || 'right';\n\t\n\t this.text.attr({\n\t x: this.textMargin * 2\n\t });\n\t\n\t var width = this.text.getBBox().width + 3 * this.textMargin;\n\t width += width/2;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t height += height/2;\n\t height = Math.max(width * 0.5, height);\n\t var startX = width/4;\n\t var startY = height/4;\n\t\n\t this.text.attr({\n\t x: startX + this.textMargin/2\n\t });\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - width/4, y: startY + height/4},\n\t {x: startX - width/4 + width/2, y: startY + height/4 + height/2},\n\t {x: startX - width/4 + width, y: startY + height/4},\n\t {x: startX - width/4 + width/2, y: startY + height/4 - height/2},\n\t {x: startX - width/4, y: startY + height/4}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t this.symbol = symbol\n\t\n\t this.initialize();\n\t}\n\tinherits(Condition, Symbol);\n\t\n\tCondition.prototype.render = function() {\n\t var self = this;\n\t if (this.yes_direction) {\n\t this[this.yes_direction + '_symbol'] = this.yes_symbol;\n\t }\n\t\n\t if (this.no_direction) {\n\t this[this.no_direction + '_symbol'] = this.no_symbol;\n\t }\n\t\n\t var lineLength = this.getAttr('line-length');\n\t\n\t if (this.bottom_symbol) {\n\t var bottomPoint = this.getBottom();\n\t\n\t if (!this.bottom_symbol.isPositioned) {\n\t this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n\t this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width/2);\n\t this.bottom_symbol.isPositioned = true;\n\t\n\t this.bottom_symbol.render();\n\t }\n\t }\n\t\n\t if (this.right_symbol) {\n\t var rightPoint = this.getRight();\n\t\n\t if (!this.right_symbol.isPositioned) {\n\t\n\t this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);\n\t this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\t\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t if (!self.params['align-next'] || self.params['align-next'] !== 'no') { \n\t var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n\t if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t if (self.right_symbol.symbolType === 'end') return;\n\t self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.right_symbol.isPositioned = true;\n\t\n\t this.right_symbol.render();\n\t }\n\t }\n\t \n\t if (this.left_symbol) {\n\t var leftPoint = this.getLeft();\n\t \n\t if (!this.left_symbol.isPositioned) {\n\t this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n\t this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\t\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t \n\t if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n\t var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n\t if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t }\n\t \n\t if (hasSymbolUnder) {\n\t if (self.left_symbol.symbolType === 'end') return;\n\t self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t \n\t this.left_symbol.isPositioned = true;\n\t \n\t this.left_symbol.render();\n\t }\n\t }\n\t};\n\t\n\tCondition.prototype.renderLines = function() {\n\t if (this.yes_symbol) {\n\t this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr('yes-text'), this.yes_direction);\n\t }\n\t\n\t if (this.no_symbol) {\n\t this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr('no-text'), this.no_direction);\n\t }\n\t};\n\t\n\tmodule.exports = Condition;\n\n\n/***/ }),\n/* 6 */\n/*!******************************************!*\\\n !*** ./src/flowchart.symbol.parallel.js ***!\n \\******************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Parallel(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0);\n\t options = options || {};\n\t Symbol.call(this, chart, options, symbol);\n\t this.path1_annotation = options.path1_annotation || '';\n\t this.path2_annotation = options.path2_annotation || '';\n\t this.path3_annotation = options.path3_annotation || '';\n\t this.textMargin = this.getAttr('text-margin');\n\t this.path1_direction = 'bottom';\n\t this.path2_direction = 'right';\n\t this.path3_direction = 'top';\n\t this.params = options.params;\n\t if (options.direction_next === 'path1' && !options[options.direction_next] && options.next) {\n\t options[options.direction_next] = options.next;\n\t }\n\t if (options.direction_next === 'path2' && !options[options.direction_next] && options.next) {\n\t options[options.direction_next] = options.next;\n\t }\n\t if (options.direction_next === 'path3' && !options[options.direction_next] && options.next) {\n\t options[options.direction_next] = options.next;\n\t }\n\t\n\t if (options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3) {\n\t if (options.direction_path1 === 'right') {\n\t this.path2_direction = 'bottom';\n\t this.path1_direction = 'right';\n\t this.path3_direction = 'top';\n\t } else if (options.direction_path1 === 'top') {\n\t this.path2_direction = 'right';\n\t this.path1_direction = 'top';\n\t this.path3_direction = 'bottom';\n\t } else if (options.direction_path1 === 'left') {\n\t this.path2_direction = 'right';\n\t this.path1_direction = 'left';\n\t this.path3_direction = 'bottom';\n\t } else {\n\t this.path2_direction = 'right';\n\t this.path1_direction = 'bottom';\n\t this.path3_direction = 'top';\n\t }\n\t } else if (options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3) {\n\t if (options.direction_path2 === 'right') {\n\t this.path1_direction = 'bottom';\n\t this.path2_direction = 'right';\n\t this.path3_direction = 'top';\n\t } else if (options.direction_path2 === 'left') {\n\t this.path1_direction = 'bottom';\n\t this.path2_direction = 'left';\n\t this.path3_direction = 'right';\n\t } else {\n\t this.path1_direction = 'right';\n\t this.path2_direction = 'bottom';\n\t this.path3_direction = 'top';\n\t }\n\t } else if (options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3) {\n\t if (options.direction_path2 === 'right') {\n\t this.path1_direction = 'bottom';\n\t this.path2_direction = 'top';\n\t this.path3_direction = 'right';\n\t } else if (options.direction_path2 === 'left') {\n\t this.path1_direction = 'bottom';\n\t this.path2_direction = 'right';\n\t this.path3_direction = 'left';\n\t } else {\n\t this.path1_direction = 'right';\n\t this.path2_direction = 'bottom';\n\t this.path3_direction = 'top';\n\t }\n\t } else {\n\t this.path1_direction = options.direction_path1;\n\t this.path2_direction = options.direction_path2;\n\t this.path3_direction = options.direction_path3;\n\t }\n\t\n\t this.path1_direction = this.path1_direction || 'bottom';\n\t this.path2_direction = this.path2_direction || 'right';\n\t this.path3_direction = this.path3_direction || 'top';\n\t\n\t this.initialize();\n\t}\n\tinherits(Parallel, Symbol);\n\t\n\tParallel.prototype.render = function() {\n\t if (this.path1_direction) {\n\t this[this.path1_direction + '_symbol'] = this.path1_symbol;\n\t }\n\t\n\t if (this.path2_direction) {\n\t this[this.path2_direction + '_symbol'] = this.path2_symbol;\n\t }\n\t\n\t if (this.path3_direction) {\n\t this[this.path3_direction + '_symbol'] = this.path3_symbol;\n\t }\n\t\n\t var lineLength = this.getAttr('line-length');\n\t\n\t if (this.bottom_symbol) {\n\t var bottomPoint = this.getBottom();\n\t\n\t if (!this.bottom_symbol.isPositioned) {\n\t this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n\t this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2);\n\t this.bottom_symbol.isPositioned = true;\n\t\n\t this.bottom_symbol.render();\n\t }\n\t }\n\t\n\t if (this.top_symbol) {\n\t var topPoint = this.getTop();\n\t\n\t if (!this.top_symbol.isPositioned) {\n\t this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength);\n\t this.top_symbol.setX(topPoint.x + this.top_symbol.width);\n\t this.top_symbol.isPositioned = true;\n\t\n\t this.top_symbol.render();\n\t }\n\t }\n\t\n\t var self = this;\n\t\n\t if (this.left_symbol) {\n\t var leftPoint = this.getLeft();\n\t\n\t if (!this.left_symbol.isPositioned) {\n\t this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n\t this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n\t var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n\t if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t if (self.left_symbol.symbolType === 'end') return;\n\t self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.left_symbol.isPositioned = true;\n\t\n\t this.left_symbol.render();\n\t }\n\t }\n\t\n\t if (this.right_symbol) {\n\t var rightPoint = this.getRight();\n\t\n\t if (!this.right_symbol.isPositioned) {\n\t this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2);\n\t this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\t (function shift() {\n\t var hasSymbolUnder = false;\n\t var symb;\n\t for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n\t symb = self.chart.symbols[i];\n\t\n\t if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n\t var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n\t if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {\n\t hasSymbolUnder = true;\n\t break;\n\t }\n\t }\n\t }\n\t\n\t if (hasSymbolUnder) {\n\t if (self.right_symbol.symbolType === 'end') return;\n\t self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n\t shift();\n\t }\n\t })();\n\t\n\t this.right_symbol.isPositioned = true;\n\t\n\t this.right_symbol.render();\n\t }\n\t }\n\t};\n\t\n\tParallel.prototype.renderLines = function() {\n\t if (this.path1_symbol) {\n\t this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction);\n\t }\n\t\n\t if (this.path2_symbol) {\n\t this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction);\n\t }\n\t\n\t if (this.path3_symbol) {\n\t this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);\n\t }\n\t};\n\t\n\tmodule.exports = Parallel;\n\n/***/ }),\n/* 7 */\n/*!********************************!*\\\n !*** ./src/flowchart.chart.js ***!\n \\********************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Raphael = __webpack_require__(/*! raphael */ 18);\n\tvar defaults = __webpack_require__(/*! ./flowchart.helpers */ 1).defaults;\n\tvar defaultOptions = __webpack_require__(/*! ./flowchart.defaults */ 8);\n\tvar Condition = __webpack_require__(/*! ./flowchart.symbol.condition */ 5);\n\tvar Parallel = __webpack_require__(/*! ./flowchart.symbol.parallel */ 6);\n\t\n\tfunction FlowChart(container, options) {\n\t options = options || {};\n\t\n\t this.paper = new Raphael(container);\n\t\n\t this.options = defaults(options, defaultOptions);\n\t\n\t this.symbols = [];\n\t this.lines = [];\n\t this.start = null;\n\t}\n\t\n\tFlowChart.prototype.handle = function(symbol) {\n\t if (this.symbols.indexOf(symbol) <= -1) {\n\t this.symbols.push(symbol);\n\t }\n\t\n\t var flowChart = this;\n\t\n\t if (symbol instanceof(Condition)) {\n\t symbol.yes = function(nextSymbol) {\n\t symbol.yes_symbol = nextSymbol;\n\t if(symbol.no_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t symbol.no = function(nextSymbol) {\n\t symbol.no_symbol = nextSymbol;\n\t if (symbol.yes_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t } else if (symbol instanceof(Parallel)) {\n\t symbol.path1 = function(nextSymbol) {\n\t symbol.path1_symbol = nextSymbol;\n\t if (symbol.path2_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t symbol.path2 = function(nextSymbol) {\n\t symbol.path2_symbol = nextSymbol;\n\t if (symbol.path3_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t symbol.path3 = function(nextSymbol) {\n\t symbol.path3_symbol = nextSymbol;\n\t if (symbol.path1_symbol) {\n\t symbol.pathOk = true;\n\t }\n\t return flowChart.handle(nextSymbol);\n\t };\n\t } else {\n\t symbol.then = function(nextSymbol) {\n\t symbol.next = nextSymbol;\n\t symbol.pathOk = true;\n\t return flowChart.handle(nextSymbol);\n\t };\n\t }\n\t\n\t return symbol;\n\t};\n\t\n\tFlowChart.prototype.startWith = function(symbol) {\n\t this.start = symbol;\n\t return this.handle(symbol);\n\t};\n\t\n\tFlowChart.prototype.render = function() {\n\t var maxWidth = 0,\n\t maxHeight = 0,\n\t i = 0,\n\t len = 0,\n\t maxX = 0,\n\t maxY = 0,\n\t minX = 0,\n\t minY = 0,\n\t symbol,\n\t line;\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t if (symbol.width > maxWidth) {\n\t maxWidth = symbol.width;\n\t }\n\t if (symbol.height > maxHeight) {\n\t maxHeight = symbol.height;\n\t }\n\t }\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t symbol.shiftX(this.options.x + (maxWidth - symbol.width)/2 + this.options['line-width']);\n\t symbol.shiftY(this.options.y + (maxHeight - symbol.height)/2 + this.options['line-width']);\n\t }\n\t\n\t this.start.render();\n\t // for (i = 0, len = this.symbols.length; i < len; i++) {\n\t // symbol = this.symbols[i];\n\t // symbol.render();\n\t // }\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t symbol.renderLines();\n\t }\n\t\n\t maxX = this.maxXFromLine;\n\t\n\t var x;\n\t var y;\n\t\n\t for (i = 0, len = this.symbols.length; i < len; i++) {\n\t symbol = this.symbols[i];\n\t var leftX = symbol.getX()\n\t x = leftX + symbol.width;\n\t y = symbol.getY() + symbol.height;\n\t if (leftX < minX) {\n\t minX = leftX;\n\t }\n\t if (x > maxX) {\n\t maxX = x;\n\t }\n\t if (y > maxY) {\n\t maxY = y;\n\t }\n\t }\n\t\n\t for (i = 0, len = this.lines.length; i < len; i++) {\n\t line = this.lines[i].getBBox();\n\t x = line.x;\n\t y = line.y;\n\t var x2 = line.x2;\n\t var y2 = line.y2;\n\t if (x < minX) {\n\t minX = x;\n\t }\n\t if (y < minY) {\n\t minY = y;\n\t }\n\t if (x2 > maxX) {\n\t maxX = x2;\n\t }\n\t if (y2 > maxY) {\n\t maxY = y2;\n\t }\n\t }\n\t\n\t var scale = this.options['scale'];\n\t var lineWidth = this.options['line-width'];\n\t\n\t if (this.minXFromSymbols < minX) minX = this.minXFromSymbols;\n\t\n\t if (minX < 0) minX -= lineWidth;\n\t if (minY < 0) minY -= lineWidth;\n\t\n\t var width = maxX + lineWidth - minX;\n\t var height = maxY + lineWidth - minY;\n\t\n\t this.paper.setSize(width * scale, height * scale);\n\t this.paper.setViewBox(minX, minY, width, height, true);\n\t};\n\t\n\tFlowChart.prototype.clean = function() {\n\t if (this.paper) {\n\t var paperDom = this.paper.canvas;\n\t paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);\n\t }\n\t};\n\t\n\tmodule.exports = FlowChart;\n\n/***/ }),\n/* 8 */\n/*!***********************************!*\\\n !*** ./src/flowchart.defaults.js ***!\n \\***********************************/\n/***/ (function(module, exports) {\n\n\t// defaults\n\tmodule.exports = {\n\t 'x': 0,\n\t 'y': 0,\n\t // 'roundness': 0,\n\t 'line-width': 3,\n\t 'line-length': 50,\n\t 'text-margin': 10,\n\t 'font-size': 14,\n\t 'font-color': 'black',\n\t // 'font': 'normal',\n\t // 'font-family': 'calibri',\n\t // 'font-weight': 'normal',\n\t 'line-color': 'black',\n\t 'element-color': 'black',\n\t 'fill': 'white',\n\t 'yes-text': 'yes',\n\t 'no-text': 'no',\n\t 'arrow-end': 'block',\n\t 'class': 'flowchart',\n\t 'scale': 1,\n\t 'symbols': {\n\t 'start': {},\n\t 'end': {},\n\t 'condition': {},\n\t 'inputoutput': {},\n\t 'input': {}, //tds\n\t 'output': {}, //tds \n\t 'operation': {},\n\t 'subroutine': {},\n\t 'parallel': {}\n\t } //,\n\t // 'flowstate' : {\n\t // 'past' : { 'fill': '#CCCCCC', 'font-size': 12},\n\t // 'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},\n\t // 'future' : { 'fill': '#FFFF99'},\n\t // 'invalid': {'fill': '#444444'}\n\t // }\n\t};\n\n/***/ }),\n/* 9 */\n/*!*******************************!*\\\n !*** ./src/flowchart.shim.js ***!\n \\*******************************/\n/***/ (function(module, exports) {\n\n\t// add indexOf to non ECMA-262 standard compliant browsers\n\tif (!Array.prototype.indexOf) {\n\t Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n\t \"use strict\";\n\t if (this === null) {\n\t throw new TypeError();\n\t }\n\t var t = Object(this);\n\t var len = t.length >>> 0;\n\t if (len === 0) {\n\t return -1;\n\t }\n\t var n = 0;\n\t if (arguments.length > 0) {\n\t n = Number(arguments[1]);\n\t if (n != n) { // shortcut for verifying if it's NaN\n\t n = 0;\n\t } else if (n !== 0 && n != Infinity && n != -Infinity) {\n\t n = (n > 0 || -1) * Math.floor(Math.abs(n));\n\t }\n\t }\n\t if (n >= len) {\n\t return -1;\n\t }\n\t var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n\t for (; k < len; k++) {\n\t if (k in t && t[k] === searchElement) {\n\t return k;\n\t }\n\t }\n\t return -1;\n\t };\n\t}\n\t\n\t// add lastIndexOf to non ECMA-262 standard compliant browsers\n\tif (!Array.prototype.lastIndexOf) {\n\t Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/) {\n\t \"use strict\";\n\t if (this === null) {\n\t throw new TypeError();\n\t }\n\t var t = Object(this);\n\t var len = t.length >>> 0;\n\t if (len === 0) {\n\t return -1;\n\t }\n\t var n = len;\n\t if (arguments.length > 1) {\n\t n = Number(arguments[1]);\n\t if (n != n) {\n\t n = 0;\n\t } else if (n !== 0 && n != (1 / 0) && n != -(1 / 0)) {\n\t n = (n > 0 || -1) * Math.floor(Math.abs(n));\n\t }\n\t }\n\t var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);\n\t for (; k >= 0; k--) {\n\t if (k in t && t[k] === searchElement) {\n\t return k;\n\t }\n\t }\n\t return -1;\n\t };\n\t}\n\t\n\tif (!String.prototype.trim) {\n\t String.prototype.trim = function() {\n\t return this.replace(/^\\s+|\\s+$/g, '');\n\t };\n\t}\n\n/***/ }),\n/* 10 */\n/*!*************************************!*\\\n !*** ./src/flowchart.symbol.end.js ***!\n \\*************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction End(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n\t options = options || {};\n\t options.text = options.text || 'End';\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(End, Symbol);\n\t\n\tmodule.exports = End;\n\n\n/***/ }),\n/* 11 */\n/*!***************************************!*\\\n !*** ./src/flowchart.symbol.input.js ***!\n \\***************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction Input(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.textMargin = this.getAttr('text-margin');\n\t\n\t this.text.attr({\n\t x: this.textMargin * 3\n\t });\n\t\n\t var width = this.text.getBBox().width + 4 * this.textMargin;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t var startX = this.textMargin;\n\t var startY = height/2;\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n\t {x: startX - this.textMargin + width, y: height},\n\t {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n\t {x: startX - this.textMargin, y: 0},\n\t {x: startX, y: startY}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t this.symbol = symbol\n\t\n\t this.initialize();\n\t}\n\tinherits(Input, Symbol);\n\t\n\tInput.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tInput.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width - this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tmodule.exports = Input;\n\t\n\t\n\n\n/***/ }),\n/* 12 */\n/*!*********************************************!*\\\n !*** ./src/flowchart.symbol.inputoutput.js ***!\n \\*********************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction InputOutput(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.textMargin = this.getAttr('text-margin');\n\t\n\t this.text.attr({\n\t x: this.textMargin * 3\n\t });\n\t\n\t var width = this.text.getBBox().width + 4 * this.textMargin;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t var startX = this.textMargin;\n\t var startY = height/2;\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - this.textMargin, y: height},\n\t {x: startX - this.textMargin + width, y: height},\n\t {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n\t {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n\t {x: startX, y: startY}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t this.symbol = symbol\n\t\n\t this.initialize();\n\t}\n\tinherits(InputOutput, Symbol);\n\t\n\tInputOutput.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tInputOutput.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width - this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tmodule.exports = InputOutput;\n\n\n/***/ }),\n/* 13 */\n/*!*******************************************!*\\\n !*** ./src/flowchart.symbol.operation.js ***!\n \\*******************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Operation(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0);\n\t options = options || {};\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(Operation, Symbol);\n\t\n\tmodule.exports = Operation;\n\n\n/***/ }),\n/* 14 */\n/*!****************************************!*\\\n !*** ./src/flowchart.symbol.output.js ***!\n \\****************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\tvar drawAPI = __webpack_require__(/*! ./flowchart.functions */ 3);\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction Output(chart, options) {\n\t options = options || {};\n\t Symbol.call(this, chart, options);\n\t this.textMargin = this.getAttr('text-margin');\n\t\n\t this.text.attr({\n\t x: this.textMargin * 3\n\t });\n\t\n\t var width = this.text.getBBox().width + 4 * this.textMargin;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t var startX = this.textMargin;\n\t var startY = height/2;\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - this.textMargin, y: height},\n\t {x: startX - this.textMargin + width + 2 * this.textMargin, y: height},\n\t {x: startX - this.textMargin + width, y: 0},\n\t {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n\t {x: startX, y: startY}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t this.symbol = symbol\n\t\n\t this.initialize();\n\t}\n\tinherits(Output, Symbol);\n\t\n\tOutput.prototype.getLeft = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tOutput.prototype.getRight = function() {\n\t var y = this.getY() + this.group.getBBox().height/2;\n\t var x = this.getX() + this.group.getBBox().width - this.textMargin;\n\t return {x: x, y: y};\n\t};\n\t\n\tmodule.exports = Output;\n\t\n\t\n\t\n\t/*\n\t//var Symbol = require('./flowchart.symbol');\n\tvar inherits = require('./flowchart.helpers').inherits;\n\tvar drawAPI = require('./flowchart.functions');\n\tvar InputOutput = require('./flowchart.symbol.inputoutput');\n\tvar drawPath = drawAPI.drawPath;\n\t\n\tfunction Output(chart, options) {\n\t options = options || {};\n\t InputOutput.call(this, chart, options);\n\t\n\t var width = this.text.getBBox().width + 4 * this.textMargin;\n\t var height = this.text.getBBox().height + 2 * this.textMargin;\n\t var startX = this.textMargin;\n\t var startY = height/2;\n\t\n\t var start = {x: startX, y: startY};\n\t var points = [\n\t {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n\t {x: startX - this.textMargin + width, y: height},\n\t {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n\t {x: startX - this.textMargin, y: 0},\n\t {x: startX, y: startY}\n\t ];\n\t\n\t var symbol = drawPath(chart, start, points);\n\t\n\t symbol.attr({\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.link) { symbol.attr('href', options.link); }\n\t if (options.target) { symbol.attr('target', options.target); }\n\t if (options.key) { symbol.node.id = options.key; }\n\t symbol.node.setAttribute('class', this.getAttr('class'));\n\t\n\t this.text.attr({\n\t y: symbol.getBBox().height/2\n\t });\n\t\n\t this.group.push(symbol);\n\t symbol.insertBefore(this.text);\n\t \n\t if (this.symbol){\n\t this.group.remove(this.symbol); //tds\n\t this.symbol.parentNode.removeChild(this.symbol); //tds\n\t }\n\t this.symbol = symbol\n\t\n\t this.initialize();\n\t}\n\tinherits(Output, InputOutput);\n\t\n\tmodule.exports = Output;\n\t*/\n\n\n/***/ }),\n/* 15 */\n/*!***************************************!*\\\n !*** ./src/flowchart.symbol.start.js ***!\n \\***************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Start(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n\t options = options || {};\n\t options.text = options.text || 'Start';\n\t Symbol.call(this, chart, options, symbol);\n\t}\n\tinherits(Start, Symbol);\n\t\n\tmodule.exports = Start;\n\t\n\t// Start.prototype.render = function() {\n\t// if (this.next) {\n\t// var lineLength = this.chart.options.symbols[this.symbolType]['line-length'] || this.chart.options['line-length'];\n\t\n\t// var bottomPoint = this.getBottom();\n\t// var topPoint = this.next.getTop();\n\t\n\t// if (!this.next.isPositioned) {\n\t// this.next.shiftY(this.getY() + this.height + lineLength);\n\t// this.next.setX(bottomPoint.x - this.next.width/2);\n\t// this.next.isPositioned = true;\n\t\n\t// this.next.render();\n\t// }\n\t// }\n\t// };\n\t\n\t// Start.prototype.renderLines = function() {\n\t// if (this.next) {\n\t// this.drawLineTo(this.next);\n\t// }\n\t// };\n\n\n/***/ }),\n/* 16 */\n/*!********************************************!*\\\n !*** ./src/flowchart.symbol.subroutine.js ***!\n \\********************************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tvar Symbol = __webpack_require__(/*! ./flowchart.symbol */ 2);\n\tvar inherits = __webpack_require__(/*! ./flowchart.helpers */ 1).inherits;\n\t\n\tfunction Subroutine(chart, options) {\n\t var symbol = chart.paper.rect(0, 0, 0, 0);\n\t options = options || {};\n\t Symbol.call(this, chart, options, symbol);\n\t\n\t symbol.attr({\n\t width: this.text.getBBox().width + 4 * this.getAttr('text-margin')\n\t });\n\t\n\t this.text.attr({\n\t 'x': 2 * this.getAttr('text-margin')\n\t });\n\t\n\t var innerWrap = chart.paper.rect(0, 0, 0, 0);\n\t innerWrap.attr({\n\t x: this.getAttr('text-margin'),\n\t stroke: this.getAttr('element-color'),\n\t 'stroke-width': this.getAttr('line-width'),\n\t width: this.text.getBBox().width + 2 * this.getAttr('text-margin'),\n\t height: this.text.getBBox().height + 2 * this.getAttr('text-margin'),\n\t fill: this.getAttr('fill')\n\t });\n\t if (options.key) { innerWrap.node.id = options.key + 'i'; }\n\t\n\t var font = this.getAttr('font');\n\t var fontF = this.getAttr('font-family');\n\t var fontW = this.getAttr('font-weight');\n\t\n\t if (font) innerWrap.attr({ 'font': font });\n\t if (fontF) innerWrap.attr({ 'font-family': fontF });\n\t if (fontW) innerWrap.attr({ 'font-weight': fontW });\n\t\n\t if (options.link) { innerWrap.attr('href', options.link); }\n\t if (options.target) { innerWrap.attr('target', options.target); }\n\t this.group.push(innerWrap);\n\t innerWrap.insertBefore(this.text);\n\t\n\t this.initialize();\n\t}\n\tinherits(Subroutine, Symbol);\n\t\n\tmodule.exports = Subroutine;\n\n\n/***/ }),\n/* 17 */\n/*!******************************!*\\\n !*** ./src/jquery-plugin.js ***!\n \\******************************/\n/***/ (function(module, exports, __webpack_require__) {\n\n\tif (typeof jQuery != 'undefined') {\n\t\tvar parse = __webpack_require__(/*! ./flowchart.parse */ 4);\n\t\n\t\t(function( $ ) {\n\t\t\tfunction paramFit(needle, haystack) {\n\t\t\t\treturn needle == haystack ||\n\t\t\t\t( Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)) ))\n\t\t\t}\n\t\t\tvar methods = {\n\t\t\t\tinit : function(options) {\n\t\t\t\t\treturn this.each(function() {\n\t\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\t\tthis.chart = parse($this.text());\n\t\t\t\t\t\t$this.html('');\n\t\t\t\t\t\tthis.chart.drawSVG(this, options);\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tsetFlowStateByParam : function(param, paramValue, newFlowState) {\n\t\t\t\t\treturn this.each(function() {\n\t\t\t\t\t\tvar chart = this.chart;\n\t\n\t\t\t\t\t\t// @todo this should be part of Symbol API\n\t\t\t\t\t\tvar nextSymbolKeys = ['next', 'yes', 'no', 'path1', 'path2', 'path3'];\n\t\n\t\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\t\tvar symbol = chart.symbols[property];\n\t\t\t\t\t\t\t\tvar val = symbol.params[param];\n\t\t\t\t\t\t\t\tif (paramFit(val, paramValue)) {\n\t\t\t\t\t\t\t\t\tsymbol.flowstate = newFlowState;\n\t\t\t\t\t\t\t\t\tfor (var nski = 0; nski < nextSymbolKeys.length; nski++) {\n\t\t\t\t\t\t\t\t\t\tvar nextSymbolKey = nextSymbolKeys[nski];\n\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey] &&\n\t\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'] &&\n\t\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'][param] &&\n\t\t\t\t\t\t\t\t\t\t\tparamFit(symbol[nextSymbolKey]['params'][param], paramValue)\n\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\tsymbol.lineStyle[symbol[nextSymbolKey]['key']] = {stroke: chart.options()['flowstate'][newFlowState]['fill']};\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tchart.clean();\n\t\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t\t});\n\t\n\t\t\t\t},\n\t\t\t\tclearFlowState: function () {\n\t\t\t\t\treturn this.each(function() {\n\t\t\t\t\t\tvar chart = this.chart;\n\t\n\t\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\t\tvar node = chart.symbols[property];\n\t\t\t\t\t\t\t\tnode.flowstate = '';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\tchart.clean();\n\t\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t};\n\t\n\t\t\t$.fn.flowChart = function(methodOrOptions) {\n\t\t\t\tif ( methods[methodOrOptions] ) {\n\t\t\t\t\treturn methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n\t\t\t\t} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n\t\t\t\t\t// Default to \"init\"\n\t\t\t\t\treturn methods.init.apply( this, arguments );\n\t\t\t\t} else {\n\t\t\t\t\t$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.flowChart' );\n\t\t\t\t}\n\t\t\t};\n\t\n\t\t})(jQuery); // eslint-disable-line\n\t}\n\n\n/***/ }),\n/* 18 */\n/*!**************************!*\\\n !*** external \"Raphael\" ***!\n \\**************************/\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_18__;\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// flowchart.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 0c167881307e9f1b2ebf","require('./src/flowchart.shim');\nvar parse = require('./src/flowchart.parse');\nrequire('./src/jquery-plugin');\n\nvar FlowChart = {\n\tparse: parse\n};\n\nif (typeof window !== 'undefined') {\n\twindow.flowchart = FlowChart;\n}\n\nmodule.exports = FlowChart;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./index.js\n// module id = 0\n// module chunks = 0","function _defaults(options, defaultOptions) {\n if (!options || typeof options === 'function') {\n return defaultOptions;\n }\n\n var merged = {};\n for (var attrname in defaultOptions) {\n merged[attrname] = defaultOptions[attrname];\n }\n\n for (attrname in options) {\n if (options[attrname]) {\n if (typeof merged[attrname] === 'object') {\n merged[attrname] = _defaults(merged[attrname], options[attrname]);\n } else {\n merged[attrname] = options[attrname];\n }\n }\n }\n return merged;\n}\n\nfunction _inherits(ctor, superCtor) {\n if (typeof(Object.create) === 'function') {\n // implementation from standard node.js 'util' module\n ctor.super_ = superCtor;\n ctor.prototype = Object.create(superCtor.prototype, {\n constructor: {\n value: ctor,\n enumerable: false,\n writable: true,\n configurable: true\n }\n });\n } else {\n // old school shim for old browsers\n ctor.super_ = superCtor;\n var TempCtor = function () {};\n TempCtor.prototype = superCtor.prototype;\n ctor.prototype = new TempCtor();\n ctor.prototype.constructor = ctor;\n }\n}\n\n// move dependent functions to a container so that\n// they can be overriden easier in no jquery environment (node.js)\nmodule.exports = {\n defaults: _defaults,\n inherits: _inherits\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.helpers.js\n// module id = 1\n// module chunks = 0","var drawAPI = require('./flowchart.functions');\nvar drawLine = drawAPI.drawLine;\nvar checkLineIntersection = drawAPI.checkLineIntersection;\n\nfunction Symbol(chart, options, symbol) {\n this.chart = chart;\n this.group = this.chart.paper.set();\n this.symbol = symbol;\n this.connectedTo = [];\n this.symbolType = options.symbolType;\n this.flowstate = (options.flowstate || 'future');\n this.lineStyle = (options.lineStyle || {});\n this.key = (options.key || '');\n this.leftLines = [];\n this.rightLines = [];\n this.topLines = [];\n this.bottomLines = [];\n this.params = options.params;\n\n this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;\n\n this.text = this.chart.paper.text(0, 0, options.text);\n //Raphael does not support the svg group tag so setting the text node id to the symbol node id plus t\n if (options.key) { this.text.node.id = options.key + 't'; }\n this.text.node.setAttribute('class', this.getAttr('class') + 't');\n\n this.text.attr({\n 'text-anchor': 'start',\n 'x' : this.getAttr('text-margin'),\n 'fill' : this.getAttr('font-color'),\n 'font-size' : this.getAttr('font-size')\n });\n\n var font = this.getAttr('font');\n var fontF = this.getAttr('font-family');\n var fontW = this.getAttr('font-weight');\n\n if (font) this.text.attr({ 'font': font });\n if (fontF) this.text.attr({ 'font-family': fontF });\n if (fontW) this.text.attr({ 'font-weight': fontW });\n\n if (options.link) { this.text.attr('href', options.link); }\n \n //ndrqu Add click function with event and options params\n if (options.function) { \n this.text.attr({ 'cursor' : 'pointer' });\n\n this.text.node.addEventListener(\"click\", function(evt) {\n window[options.function](evt,options);\n }, false);\n }\n\n if (options.target) { this.text.attr('target', options.target); }\n\n var maxWidth = this.getAttr('maxWidth');\n if (maxWidth) {\n // using this approach: http://stackoverflow.com/a/3153457/22466\n var words = options.text.split(' ');\n var tempText = \"\";\n for (var i=0, ii=words.length; i maxWidth) {\n tempText += \"\\n\" + word;\n } else {\n tempText += \" \" + word;\n }\n }\n this.text.attr(\"text\", tempText.substring(1));\n }\n\n this.group.push(this.text);\n\n if (symbol) {\n var tmpMargin = this.getAttr('text-margin');\n\n symbol.attr({\n 'fill' : this.getAttr('fill'),\n 'stroke' : this.getAttr('element-color'),\n 'stroke-width' : this.getAttr('line-width'),\n 'width' : this.text.getBBox().width + 2 * tmpMargin,\n 'height' : this.text.getBBox().height + 2 * tmpMargin\n });\n\n symbol.node.setAttribute('class', this.getAttr('class'));\n var roundness = this.getAttr('roundness');\n if (!isNaN(roundness)) {\n symbol.node.setAttribute('ry', roundness);\n symbol.node.setAttribute('rx', roundness);\n }\n\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n\n //ndrqu Add click function with event and options params\n if (options.function) { \n symbol.node.addEventListener(\"click\", function(evt) {\n window[options.function](evt,options);\n }, false);\n symbol.attr({ 'cursor' : 'pointer' });\n }\n if (options.key) { symbol.node.id = options.key; }\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n\n this.text.attr({\n 'y': symbol.getBBox().height/2\n });\n\n this.initialize();\n }\n\n}\n\n/* Gets the attribute based on Flowstate, Symbol-Name and default, first found wins */\nSymbol.prototype.getAttr = function(attName) {\n if (!this.chart) {\n return undefined;\n }\n var opt3 = (this.chart.options) ? this.chart.options[attName] : undefined;\n var opt2 = (this.chart.options.symbols) ? this.chart.options.symbols[this.symbolType][attName] : undefined;\n var opt1;\n if (this.chart.options.flowstate && this.chart.options.flowstate[this.flowstate]) {\n opt1 = this.chart.options.flowstate[this.flowstate][attName];\n }\n return (opt1 || opt2 || opt3);\n};\n\nSymbol.prototype.initialize = function() {\n this.group.transform('t' + this.getAttr('line-width') + ',' + this.getAttr('line-width'));\n\n this.width = this.group.getBBox().width;\n this.height = this.group.getBBox().height;\n};\n\nSymbol.prototype.getCenter = function() {\n return {x: this.getX() + this.width/2,\n y: this.getY() + this.height/2};\n};\n\nSymbol.prototype.getX = function() {\n return this.group.getBBox().x;\n};\n\nSymbol.prototype.getY = function() {\n return this.group.getBBox().y;\n};\n\nSymbol.prototype.shiftX = function(x) {\n this.group.transform('t' + (this.getX() + x) + ',' + this.getY());\n};\n\nSymbol.prototype.setX = function(x) {\n this.group.transform('t' + x + ',' + this.getY());\n};\n\nSymbol.prototype.shiftY = function(y) {\n this.group.transform('t' + this.getX() + ',' + (this.getY() + y));\n};\n\nSymbol.prototype.setY = function(y) {\n this.group.transform('t' + this.getX() + ',' + y);\n};\n\nSymbol.prototype.getTop = function() {\n var y = this.getY();\n var x = this.getX() + this.width/2;\n return {x: x, y: y};\n};\n\nSymbol.prototype.getBottom = function() {\n var y = this.getY() + this.height;\n var x = this.getX() + this.width/2;\n return {x: x, y: y};\n};\n\nSymbol.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX();\n return {x: x, y: y};\n};\n\nSymbol.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width;\n return {x: x, y: y};\n};\n\nSymbol.prototype.render = function() {\n if (this.next) {\n\n var self = this;\n var lineLength = this.getAttr('line-length');\n\n if (this.next_direction === 'right') {\n\n var rightPoint = this.getRight();\n\n if (!this.next.isPositioned) {\n this.next.setY(rightPoint.y - this.next.height/2);\n this.next.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n hasSymbolUnder = true;\n break;\n }\n }\n\n if (hasSymbolUnder) {\n if (self.next.symbolType === 'end') return;\n self.next.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.next.isPositioned = true;\n\n this.next.render();\n }\n } else if (this.next_direction === 'left') {\n\n var leftPoint = this.getLeft();\n\n if (!this.next.isPositioned) {\n this.next.setY(leftPoint.y - this.next.height/2);\n this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);\n if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {\n hasSymbolUnder = true;\n break;\n }\n }\n\n if (hasSymbolUnder) {\n if (self.next.symbolType === 'end') return;\n self.next.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.next.isPositioned = true;\n\n this.next.render();\n }\n } else {\n var bottomPoint = this.getBottom();\n\n if (!this.next.isPositioned) {\n this.next.shiftY(this.getY() + this.height + lineLength);\n this.next.setX(bottomPoint.x - this.next.width/2);\n this.next.isPositioned = true;\n\n this.next.render();\n }\n }\n }\n};\n\nSymbol.prototype.renderLines = function() {\n if (this.next) {\n if (this.next_direction) {\n this.drawLineTo(this.next, this.getAttr('arrow-text') || '', this.next_direction);\n } else {\n this.drawLineTo(this.next, this.getAttr('arrow-text') || '');\n }\n }\n};\n\nSymbol.prototype.drawLineTo = function(symbol, text, origin) {\n if (this.connectedTo.indexOf(symbol) < 0) {\n this.connectedTo.push(symbol);\n }\n\n var x = this.getCenter().x,\n y = this.getCenter().y,\n right = this.getRight(),\n bottom = this.getBottom(),\n top = this.getTop(),\n left = this.getLeft();\n\n var symbolX = symbol.getCenter().x,\n symbolY = symbol.getCenter().y,\n symbolTop = symbol.getTop(),\n symbolRight = symbol.getRight(),\n symbolLeft = symbol.getLeft();\n\n var isOnSameColumn = x === symbolX,\n isOnSameLine = y === symbolY,\n isUnder = y < symbolY,\n isUpper = y > symbolY || this === symbol,\n isLeft = x > symbolX,\n isRight = x < symbolX;\n\n var maxX = 0,\n line,\n yOffset,\n lineLength = this.getAttr('line-length'),\n lineWith = this.getAttr('line-width');\n\n if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {\n if (symbol.topLines.length === 0 && this.bottomLines.length === 0) {\n line = drawLine(this.chart, bottom, symbolTop, text);\n } else {\n yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n line = drawLine(this.chart, bottom, [\n {x: symbolTop.x, y: symbolTop.y - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n }\n this.bottomLines.push(line);\n symbol.topLines.push(line);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x;\n } else if ((!origin || origin === 'right') && isOnSameLine && isRight) {\n if (symbol.leftLines.length === 0 && this.rightLines.length === 0) {\n line = drawLine(this.chart, right, symbolLeft, text);\n } else {\n yOffset = Math.max(symbol.leftLines.length, this.rightLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: right.x, y: right.y - yOffset},\n {x: right.x, y: symbolLeft.y - yOffset},\n {x: symbolLeft.x, y: symbolLeft.y - yOffset},\n {x: symbolLeft.x, y: symbolLeft.y}\n ], text);\n }\n this.rightLines.push(line);\n symbol.leftLines.push(line);\n this.rightStart = true;\n symbol.leftEnd = true;\n maxX = symbolLeft.x;\n } else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {\n if (symbol.rightLines.length === 0 && this.leftLines.length === 0) {\n line = drawLine(this.chart, left, symbolRight, text);\n } else {\n yOffset = Math.max(symbol.rightLines.length, this.leftLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: right.x, y: right.y - yOffset},\n {x: right.x, y: symbolRight.y - yOffset},\n {x: symbolRight.x, y: symbolRight.y - yOffset},\n {x: symbolRight.x, y: symbolRight.y}\n ], text);\n }\n this.leftLines.push(line);\n symbol.rightLines.push(line);\n this.leftStart = true;\n symbol.rightEnd = true;\n maxX = symbolRight.x;\n } else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {\n yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y - yOffset},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightLines.push(line);\n symbol.topLines.push(line);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {\n yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y - yOffset},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightLines.push(line);\n symbol.topLines.push(line);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((!origin || origin === 'bottom') && isLeft) {\n yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n if (this.leftEnd && isUpper) {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n } else {\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n }\n this.bottomLines.push(line);\n symbol.topLines.push(line);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n } else if ((!origin || origin === 'bottom') && isRight && isUnder) {\n yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.bottomLines.push(line);\n symbol.topLines.push(line);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x;\n if (symbolTop.x > maxX) maxX = symbolTop.x;\n } else if ((!origin || origin === 'bottom') && isRight) {\n yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},\n {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.bottomLines.push(line);\n symbol.topLines.push(line);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + (bottom.x - symbolTop.x)/2;\n } else if ((origin && origin === 'right') && isLeft) {\n yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: right.x + lineLength/2, y: right.y},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.rightLines.push(line);\n symbol.topLines.push(line);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((origin && origin === 'right') && isRight) {\n yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;\n line = drawLine(this.chart, right, [\n {x: symbolTop.x, y: right.y - yOffset},\n {x: symbolTop.x, y: symbolTop.y - yOffset}\n ], text);\n this.rightLines.push(line);\n symbol.topLines.push(line);\n this.rightStart = true;\n symbol.topEnd = true;\n maxX = right.x + lineLength/2;\n } else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {\n yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;\n line = drawLine(this.chart, bottom, [\n {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},\n {x: right.x + lineLength/2, y: bottom.y + lineLength/2 - yOffset},\n {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.bottomLines.push(line);\n symbol.topLines.push(line);\n this.bottomStart = true;\n symbol.topEnd = true;\n maxX = bottom.x + lineLength/2;\n } else if ((origin === 'left') && isOnSameColumn && isUpper) {\n var diffX = left.x - lineLength/2;\n if (symbolLeft.x < left.x) {\n diffX = symbolLeft.x - lineLength/2;\n }\n yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n line = drawLine(this.chart, left, [\n {x: diffX, y: left.y - yOffset},\n {x: diffX, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.leftLines.push(line);\n symbol.topLines.push(line);\n this.leftStart = true;\n symbol.topEnd = true;\n maxX = left.x;\n } else if ((origin === 'left')) {\n yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;\n line = drawLine(this.chart, left, [\n {x: symbolTop.x + (left.x - symbolTop.x)/2, y: left.y},\n {x: symbolTop.x + (left.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.leftLines.push(line);\n symbol.topLines.push(line);\n this.leftStart = true;\n symbol.topEnd = true;\n maxX = left.x;\n } else if ((origin === 'top')) {\n yOffset = Math.max(symbol.topLines.length, this.topLines.length) * 10;\n line = drawLine(this.chart, top, [\n {x: top.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},\n {x: symbolTop.x, y: symbolTop.y}\n ], text);\n this.topLines.push(line);\n symbol.topLines.push(line);\n this.topStart = true;\n symbol.topEnd = true;\n maxX = top.x;\n }\n\n //update line style\n if (this.lineStyle[symbol.key] && line){\n line.attr(this.lineStyle[symbol.key]);\n }\n\n if (line) {\n for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {\n var otherLine = this.chart.lines[l];\n\n var ePath = otherLine.attr('path'),\n lPath = line.attr('path');\n\n for (var iP = 0, lenP = ePath.length - 1; iP < lenP; iP++) {\n var newPath = [];\n newPath.push(['M', ePath[iP][1], ePath[iP][2]]);\n newPath.push(['L', ePath[iP + 1][1], ePath[iP + 1][2]]);\n\n var line1_from_x = newPath[0][1];\n var line1_from_y = newPath[0][2];\n var line1_to_x = newPath[1][1];\n var line1_to_y = newPath[1][2];\n\n for (var lP = 0, lenlP = lPath.length - 1; lP < lenlP; lP++) {\n var newLinePath = [];\n newLinePath.push(['M', lPath[lP][1], lPath[lP][2]]);\n newLinePath.push(['L', lPath[lP + 1][1], lPath[lP + 1][2]]);\n\n var line2_from_x = newLinePath[0][1];\n var line2_from_y = newLinePath[0][2];\n var line2_to_x = newLinePath[1][1];\n var line2_to_y = newLinePath[1][2];\n\n var res = checkLineIntersection(line1_from_x, line1_from_y, line1_to_x, line1_to_y, line2_from_x, line2_from_y, line2_to_x, line2_to_y);\n if (res.onLine1 && res.onLine2) {\n\n var newSegment;\n if (line2_from_y === line2_to_y) {\n if (line2_from_x > line2_to_x) {\n newSegment = ['L', res.x + lineWith * 2, line2_from_y];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', res.x + lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x - lineWith * 2, line2_from_y];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n } else {\n newSegment = ['L', res.x - lineWith * 2, line2_from_y];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', res.x - lineWith * 2, line2_from_y, res.x, line2_from_y - lineWith * 4, res.x + lineWith * 2, line2_from_y];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n }\n } else {\n if (line2_from_y > line2_to_y) {\n newSegment = ['L', line2_from_x, res.y + lineWith * 2];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', line2_from_x, res.y + lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y - lineWith * 2];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n } else {\n newSegment = ['L', line2_from_x, res.y - lineWith * 2];\n lPath.splice(lP + 1, 0, newSegment);\n newSegment = ['C', line2_from_x, res.y - lineWith * 2, line2_from_x + lineWith * 4, res.y, line2_from_x, res.y + lineWith * 2];\n lPath.splice(lP + 2, 0, newSegment);\n line.attr('path', lPath);\n }\n }\n\n lP += 2;\n }\n }\n }\n }\n\n this.chart.lines.push(line);\n if (this.chart.minXFromSymbols === undefined || this.chart.minXFromSymbols > left.x) {\n this.chart.minXFromSymbols = left.x;\n }\n }\n\n if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {\n this.chart.maxXFromLine = maxX;\n }\n};\n\nmodule.exports = Symbol;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.js\n// module id = 2\n// module chunks = 0","function drawPath(chart, location, points) {\n var i, len;\n var path = 'M{0},{1}';\n for (i = 2, len = 2 * points.length + 2; i < len; i+=2) {\n path += ' L{' + i + '},{' + (i + 1) + '}';\n }\n var pathValues = [location.x, location.y];\n for (i = 0, len = points.length; i < len; i++) {\n pathValues.push(points[i].x);\n pathValues.push(points[i].y);\n }\n var symbol = chart.paper.path(path, pathValues);\n symbol.attr('stroke', chart.options['element-color']);\n symbol.attr('stroke-width', chart.options['line-width']);\n\n var font = chart.options.font;\n var fontF = chart.options['font-family'];\n var fontW = chart.options['font-weight'];\n\n if (font) symbol.attr({ 'font': font });\n if (fontF) symbol.attr({ 'font-family': fontF });\n if (fontW) symbol.attr({ 'font-weight': fontW });\n\n return symbol;\n}\n\nfunction drawLine(chart, from, to, text) {\n var i, len;\n\n if (Object.prototype.toString.call(to) !== '[object Array]') {\n to = [to];\n }\n\n var path = 'M{0},{1}';\n for (i = 2, len = 2 * to.length + 2; i < len; i+=2) {\n path += ' L{' + i + '},{' + (i + 1) + '}';\n }\n var pathValues = [from.x, from.y];\n for (i = 0, len = to.length; i < len; i++) {\n pathValues.push(to[i].x);\n pathValues.push(to[i].y);\n }\n\n var line = chart.paper.path(path, pathValues);\n line.attr({\n stroke: chart.options['line-color'],\n 'stroke-width': chart.options['line-width'],\n 'arrow-end': chart.options['arrow-end']\n });\n\n var font = chart.options.font;\n var fontF = chart.options['font-family'];\n var fontW = chart.options['font-weight'];\n\n if (font) line.attr({ 'font': font });\n if (fontF) line.attr({ 'font-family': fontF });\n if (fontW) line.attr({ 'font-weight': fontW });\n\n if (text) {\n\n var centerText = false;\n\n var textPath = chart.paper.text(0, 0, text);\n var textAnchor = 'start';\n\n var isHorizontal = false;\n var firstTo = to[0];\n\n if (from.y === firstTo.y) {\n isHorizontal = true;\n }\n\n var x = 0,\n y = 0;\n\n if (centerText) {\n if (from.x > firstTo.x) {\n x = from.x - (from.x - firstTo.x)/2;\n } else {\n x = firstTo.x - (firstTo.x - from.x)/2;\n }\n\n if (from.y > firstTo.y) {\n y = from.y - (from.y - firstTo.y)/2;\n } else {\n y = firstTo.y - (firstTo.y - from.y)/2;\n }\n\n if (isHorizontal) {\n x -= textPath.getBBox().width/2;\n y -= chart.options['text-margin'];\n } else {\n x += chart.options['text-margin'];\n y -= textPath.getBBox().height/2;\n }\n } else {\n x = from.x;\n y = from.y;\n\n if (isHorizontal) {\n if (from.x > firstTo.x) {\n x -= chart.options['text-margin']/2;\n textAnchor = 'end';\n } else {\n x += chart.options['text-margin']/2;\n }\n y -= chart.options['text-margin'];\n } else {\n x += chart.options['text-margin']/2;\n y += chart.options['text-margin'];\n if (from.y > firstTo.y) {\n y -= chart.options['text-margin']*2;\n }\n }\n }\n\n textPath.attr({\n 'text-anchor': textAnchor,\n 'font-size': chart.options['font-size'],\n 'fill': chart.options['font-color'],\n x: x,\n y: y\n });\n\n if (font) textPath.attr({ 'font': font });\n if (fontF) textPath.attr({ 'font-family': fontF });\n if (fontW) textPath.attr({ 'font-weight': fontW });\n }\n\n return line;\n}\n\nfunction checkLineIntersection(line1StartX, line1StartY, line1EndX, line1EndY, line2StartX, line2StartY, line2EndX, line2EndY) {\n // if the lines intersect, the result contains the x and y of the intersection (treating the lines as infinite) and booleans for whether line segment 1 or line segment 2 contain the point\n var denominator, a, b, numerator1, numerator2, result = {\n x: null,\n y: null,\n onLine1: false,\n onLine2: false\n };\n denominator = ((line2EndY - line2StartY) * (line1EndX - line1StartX)) - ((line2EndX - line2StartX) * (line1EndY - line1StartY));\n if (denominator === 0) {\n return result;\n }\n a = line1StartY - line2StartY;\n b = line1StartX - line2StartX;\n numerator1 = ((line2EndX - line2StartX) * a) - ((line2EndY - line2StartY) * b);\n numerator2 = ((line1EndX - line1StartX) * a) - ((line1EndY - line1StartY) * b);\n a = numerator1 / denominator;\n b = numerator2 / denominator;\n\n // if we cast these lines infinitely in both directions, they intersect here:\n result.x = line1StartX + (a * (line1EndX - line1StartX));\n result.y = line1StartY + (a * (line1EndY - line1StartY));\n /*\n // it is worth noting that this should be the same as:\n x = line2StartX + (b * (line2EndX - line2StartX));\n y = line2StartX + (b * (line2EndY - line2StartY));\n */\n // if line1 is a segment and line2 is infinite, they intersect if:\n if (a > 0 && a < 1) {\n result.onLine1 = true;\n }\n // if line2 is a segment and line1 is infinite, they intersect if:\n if (b > 0 && b < 1) {\n result.onLine2 = true;\n }\n // if line1 and line2 are segments, they intersect if both of the above are true\n return result;\n}\n\nmodule.exports = {\n\tdrawPath: drawPath,\n\tdrawLine: drawLine,\n\tcheckLineIntersection: checkLineIntersection\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.functions.js\n// module id = 3\n// module chunks = 0","var FlowChart = require('./flowchart.chart');\nvar Start = require('./flowchart.symbol.start');\nvar End = require('./flowchart.symbol.end');\nvar Operation = require('./flowchart.symbol.operation');\nvar InputOutput = require('./flowchart.symbol.inputoutput');\nvar Input = require('./flowchart.symbol.input'); //tds\nvar Output = require('./flowchart.symbol.output'); //tds\nvar Subroutine = require('./flowchart.symbol.subroutine');\nvar Condition = require('./flowchart.symbol.condition');\nvar Parallel = require('./flowchart.symbol.parallel');\n\n\nfunction parse(input) {\n input = input || '';\n input = input.trim();\n\n var chart = {\n symbols: {},\n start: null,\n drawSVG: function(container, options) {\n var self = this;\n\n if (this.diagram) {\n this.diagram.clean();\n }\n\n var diagram = new FlowChart(container, options);\n this.diagram = diagram;\n var dispSymbols = {};\n\n function getDisplaySymbol(s) {\n if (dispSymbols[s.key]) {\n return dispSymbols[s.key];\n }\n\n switch (s.symbolType) {\n case 'start':\n dispSymbols[s.key] = new Start(diagram, s);\n break;\n case 'end':\n dispSymbols[s.key] = new End(diagram, s);\n break;\n case 'operation':\n dispSymbols[s.key] = new Operation(diagram, s);\n break;\n case 'inputoutput':\n dispSymbols[s.key] = new InputOutput(diagram, s);\n break;\n case 'input':\n dispSymbols[s.key] = new Input(diagram, s); //tds\n break; \n case 'output':\n dispSymbols[s.key] = new Output(diagram, s); //tds\n break; \n case 'subroutine':\n dispSymbols[s.key] = new Subroutine(diagram, s);\n break;\n case 'condition':\n dispSymbols[s.key] = new Condition(diagram, s);\n break;\n case 'parallel':\n dispSymbols[s.key] = new Parallel(diagram, s);\n break;\n default:\n return new Error('Wrong symbol type!');\n }\n\n return dispSymbols[s.key];\n }\n\n (function constructChart(s, prevDisp, prev) {\n var dispSymb = getDisplaySymbol(s);\n\n if (self.start === s) {\n diagram.startWith(dispSymb);\n } else if (prevDisp && prev && !prevDisp.pathOk) {\n if (prevDisp instanceof(Condition)) {\n if (prev.yes === s) {\n prevDisp.yes(dispSymb);\n }\n if (prev.no === s) {\n prevDisp.no(dispSymb);\n }\n } else if (prevDisp instanceof(Parallel)) {\n if (prev.path1 === s) {\n prevDisp.path1(dispSymb);\n }\n if (prev.path2 === s) {\n prevDisp.path2(dispSymb);\n }\n if (prev.path3 === s) {\n prevDisp.path3(dispSymb);\n }\n } else {\n prevDisp.then(dispSymb);\n }\n }\n\n if (dispSymb.pathOk) {\n return dispSymb;\n }\n\n if (dispSymb instanceof(Condition)) {\n if (s.yes) {\n constructChart(s.yes, dispSymb, s);\n }\n if (s.no) {\n constructChart(s.no, dispSymb, s);\n }\n } else if (dispSymb instanceof(Parallel)) {\n if (s.path1) {\n constructChart(s.path1, dispSymb, s);\n }\n if (s.path2) {\n constructChart(s.path2, dispSymb, s);\n }\n if (s.path3) {\n constructChart(s.path3, dispSymb, s);\n }\n } else if (s.next) {\n constructChart(s.next, dispSymb, s);\n }\n\n return dispSymb;\n })(this.start);\n\n diagram.render();\n },\n clean: function() {\n this.diagram.clean();\n },\n options: function() {\n return this.diagram.options;\n }\n };\n\n var lines = [];\n var prevBreak = 0;\n for (var i0 = 1, i0len = input.length; i0 < i0len; i0++) {\n if(input[i0] === '\\n' && input[i0 - 1] !== '\\\\') {\n var line0 = input.substring(prevBreak, i0);\n prevBreak = i0 + 1;\n lines.push(line0.replace(/\\\\\\n/g, '\\n'));\n }\n }\n\n if (prevBreak < input.length) {\n lines.push(input.substr(prevBreak));\n }\n\n for (var l = 1, len = lines.length; l < len;) {\n var currentLine = lines[l];\n\n if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0 && currentLine.indexOf('@>') < 0) {\n lines[l - 1] += '\\n' + currentLine;\n lines.splice(l, 1);\n len--;\n } else {\n l++;\n }\n }\n\n function getStyle(s){\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n return s.substring(startIndex,endIndex);\n }\n return '{}';\n }\n\n function getSymbValue(s){\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n return s.substring(startIndex,endIndex);\n }\n return '';\n }\n\n function getSymbol(s) {\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n return chart.symbols[s.substring(0, startIndex - 1)];\n }\n return chart.symbols[s];\n }\n\n function getNextPath(s) {\n var next = 'next';\n var startIndex = s.indexOf('(') + 1;\n var endIndex = s.indexOf(')');\n if (startIndex >= 0 && endIndex >= 0) {\n next = flowSymb.substring(startIndex, endIndex);\n if (next.indexOf(',') < 0) {\n if (next !== 'yes' && next !== 'no') {\n next = 'next, ' + next;\n }\n }\n }\n return next;\n }\n \n function getAnnotation(s) {\n\tvar startIndex = s.indexOf(\"(\") + 1, endIndex = s.indexOf(\")\");\n\tvar tmp = s.substring(startIndex, endIndex);\n\tif(tmp.indexOf(\",\") > 0) { tmp = tmp.substring(0, tmp.indexOf(\",\")); }\n\tvar tmp_split = tmp.split(\"@\");\n\tif(tmp_split.length > 1)\n\t\treturn startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : \"\";\n }\n\n while (lines.length > 0) {\n var line = lines.splice(0, 1)[0].trim();\n\n if (line.indexOf('=>') >= 0) {\n // definition\n var parts = line.split('=>');\n var symbol = {\n key: parts[0].replace(/\\(.*\\)/, ''),\n symbolType: parts[1],\n text: null,\n link: null,\n target: null,\n flowstate: null,\n function: null,\n lineStyle: {},\n params: {}\n };\n\n //parse parameters\n var params = parts[0].match(/\\((.*)\\)/);\n if (params && params.length > 1){\n var entries = params[1].split(',');\n for(var i = 0; i < entries.length; i++) {\n var entry = entries[i].split('=');\n if (entry.length == 2) {\n symbol.params[entry[0]] = entry[1];\n }\n }\n }\n\n var sub;\n\n if (symbol.symbolType.indexOf(': ') >= 0) {\n sub = symbol.symbolType.split(': ');\n symbol.symbolType = sub.shift();\n symbol.text = sub.join(': ');\n }\n\n if (symbol.text && symbol.text.indexOf(':$') >= 0) {\n sub = symbol.text.split(':$');\n symbol.text = sub.shift();\n symbol.function = sub.join(':$');\n } else if (symbol.symbolType.indexOf(':$') >= 0) {\n sub = symbol.symbolType.split(':$');\n symbol.symbolType = sub.shift();\n symbol.function = sub.join(':$');\n } else if (symbol.text && symbol.text.indexOf(':>') >= 0) {\n sub = symbol.text.split(':>');\n symbol.text = sub.shift();\n symbol.link = sub.join(':>');\n } else if (symbol.symbolType.indexOf(':>') >= 0) {\n sub = symbol.symbolType.split(':>');\n symbol.symbolType = sub.shift();\n symbol.link = sub.join(':>');\n }\n\n if (symbol.symbolType.indexOf('\\n') >= 0) {\n symbol.symbolType = symbol.symbolType.split('\\n')[0];\n }\n\n /* adding support for links */\n if (symbol.link) {\n var startIndex = symbol.link.indexOf('[') + 1;\n var endIndex = symbol.link.indexOf(']');\n if (startIndex >= 0 && endIndex >= 0) {\n symbol.target = symbol.link.substring(startIndex, endIndex);\n symbol.link = symbol.link.substring(0, startIndex - 1);\n }\n }\n /* end of link support */\n\n /* adding support for flowstates */\n if (symbol.text) {\n if (symbol.text.indexOf('|') >= 0) {\n var txtAndState = symbol.text.split('|');\n symbol.flowstate = txtAndState.pop().trim();\n symbol.text = txtAndState.join('|');\n }\n }\n /* end of flowstate support */\n\n chart.symbols[symbol.key] = symbol;\n\n } else if (line.indexOf('->') >= 0) {\n var ann = getAnnotation(line);\n if (ann) {\n line = line.replace('@' + ann, ''); \n }\n // flow\n var flowSymbols = line.split('->');\n for (var iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {\n var flowSymb = flowSymbols[iS];\n var symbVal = getSymbValue(flowSymb);\n\n if (symbVal === 'true' || symbVal === 'false') {\n // map true or false to yes or no respectively\n flowSymb = flowSymb.replace('true', 'yes');\n flowSymb = flowSymb.replace('false', 'no');\n }\n \n var next = getNextPath(flowSymb);\n var realSymb = getSymbol(flowSymb);\n\n var direction = null;\n if (next.indexOf(',') >= 0) {\n var condOpt = next.split(',');\n next = condOpt[0];\n direction = condOpt[1].trim();\n }\n\n if (ann) {\n if (realSymb.symbolType === 'condition') {\n if (next === \"yes\" || next === \"true\") {\n realSymb.yes_annotation = ann;\n } else {\n realSymb.no_annotation = ann;\n }\n } else if (realSymb.symbolType === 'parallel') {\n if (next === 'path1') {\n realSymb.path1_annotation = ann;\n } else if (next === 'path2') {\n realSymb.path2_annotation = ann;\n } else if (next === 'path3') {\n realSymb.path3_annotation = ann;\n }\n }\n ann = null;\n }\n\n if (!chart.start) {\n chart.start = realSymb;\n }\n\n if (iS + 1 < lenS) {\n var nextSymb = flowSymbols[iS + 1];\n realSymb[next] = getSymbol(nextSymb);\n realSymb['direction_' + next] = direction;\n direction = null;\n }\n }\n } else if (line.indexOf('@>') >= 0) {\n\n // line style\n var lineStyleSymbols = line.split('@>');\n for (var iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) {\n if ((iSS + 1) !== lenSS) {\n var curSymb = getSymbol(lineStyleSymbols[iSS]);\n var nextSymbol = getSymbol(lineStyleSymbols[iSS+1]);\n\n curSymb['lineStyle'][nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));\n }\n }\n }\n\n }\n return chart;\n}\n\nmodule.exports = parse;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.parse.js\n// module id = 4\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Condition(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.yes_annotation = options.yes_annotation;\n this.no_annotation = options.no_annotation;\n this.textMargin = this.getAttr('text-margin');\n this.yes_direction = options.direction_yes;\n this.no_direction = options.direction_no;\n if (!this.no_direction && this.yes_direction === 'right') {\n this.no_direction = 'bottom';\n } else if (!this.yes_direction && this.no_direction === 'bottom') {\n this.yes_direction = 'right'\n }\n this.yes_direction = this.yes_direction || 'bottom';\n this.no_direction = this.no_direction || 'right';\n\n this.text.attr({\n x: this.textMargin * 2\n });\n\n var width = this.text.getBBox().width + 3 * this.textMargin;\n width += width/2;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n height += height/2;\n height = Math.max(width * 0.5, height);\n var startX = width/4;\n var startY = height/4;\n\n this.text.attr({\n x: startX + this.textMargin/2\n });\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - width/4, y: startY + height/4},\n {x: startX - width/4 + width/2, y: startY + height/4 + height/2},\n {x: startX - width/4 + width, y: startY + height/4},\n {x: startX - width/4 + width/2, y: startY + height/4 - height/2},\n {x: startX - width/4, y: startY + height/4}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n this.symbol = symbol\n\n this.initialize();\n}\ninherits(Condition, Symbol);\n\nCondition.prototype.render = function() {\n var self = this;\n if (this.yes_direction) {\n this[this.yes_direction + '_symbol'] = this.yes_symbol;\n }\n\n if (this.no_direction) {\n this[this.no_direction + '_symbol'] = this.no_symbol;\n }\n\n var lineLength = this.getAttr('line-length');\n\n if (this.bottom_symbol) {\n var bottomPoint = this.getBottom();\n\n if (!this.bottom_symbol.isPositioned) {\n this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width/2);\n this.bottom_symbol.isPositioned = true;\n\n this.bottom_symbol.render();\n }\n }\n\n if (this.right_symbol) {\n var rightPoint = this.getRight();\n\n if (!this.right_symbol.isPositioned) {\n\n this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);\n this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n if (!self.params['align-next'] || self.params['align-next'] !== 'no') { \n var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {\n hasSymbolUnder = true;\n break;\n }\n }\n }\n\n if (hasSymbolUnder) {\n if (self.right_symbol.symbolType === 'end') return;\n self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.right_symbol.isPositioned = true;\n\n this.right_symbol.render();\n }\n }\n \n if (this.left_symbol) {\n var leftPoint = this.getLeft();\n \n if (!this.left_symbol.isPositioned) {\n this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n \n if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n hasSymbolUnder = true;\n break;\n }\n }\n }\n \n if (hasSymbolUnder) {\n if (self.left_symbol.symbolType === 'end') return;\n self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n \n this.left_symbol.isPositioned = true;\n \n this.left_symbol.render();\n }\n }\n};\n\nCondition.prototype.renderLines = function() {\n if (this.yes_symbol) {\n this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr('yes-text'), this.yes_direction);\n }\n\n if (this.no_symbol) {\n this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr('no-text'), this.no_direction);\n }\n};\n\nmodule.exports = Condition;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.condition.js\n// module id = 5\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Parallel(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0);\n options = options || {};\n Symbol.call(this, chart, options, symbol);\n this.path1_annotation = options.path1_annotation || '';\n this.path2_annotation = options.path2_annotation || '';\n this.path3_annotation = options.path3_annotation || '';\n this.textMargin = this.getAttr('text-margin');\n this.path1_direction = 'bottom';\n this.path2_direction = 'right';\n this.path3_direction = 'top';\n this.params = options.params;\n if (options.direction_next === 'path1' && !options[options.direction_next] && options.next) {\n options[options.direction_next] = options.next;\n }\n if (options.direction_next === 'path2' && !options[options.direction_next] && options.next) {\n options[options.direction_next] = options.next;\n }\n if (options.direction_next === 'path3' && !options[options.direction_next] && options.next) {\n options[options.direction_next] = options.next;\n }\n\n if (options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3) {\n if (options.direction_path1 === 'right') {\n this.path2_direction = 'bottom';\n this.path1_direction = 'right';\n this.path3_direction = 'top';\n } else if (options.direction_path1 === 'top') {\n this.path2_direction = 'right';\n this.path1_direction = 'top';\n this.path3_direction = 'bottom';\n } else if (options.direction_path1 === 'left') {\n this.path2_direction = 'right';\n this.path1_direction = 'left';\n this.path3_direction = 'bottom';\n } else {\n this.path2_direction = 'right';\n this.path1_direction = 'bottom';\n this.path3_direction = 'top';\n }\n } else if (options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3) {\n if (options.direction_path2 === 'right') {\n this.path1_direction = 'bottom';\n this.path2_direction = 'right';\n this.path3_direction = 'top';\n } else if (options.direction_path2 === 'left') {\n this.path1_direction = 'bottom';\n this.path2_direction = 'left';\n this.path3_direction = 'right';\n } else {\n this.path1_direction = 'right';\n this.path2_direction = 'bottom';\n this.path3_direction = 'top';\n }\n } else if (options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3) {\n if (options.direction_path2 === 'right') {\n this.path1_direction = 'bottom';\n this.path2_direction = 'top';\n this.path3_direction = 'right';\n } else if (options.direction_path2 === 'left') {\n this.path1_direction = 'bottom';\n this.path2_direction = 'right';\n this.path3_direction = 'left';\n } else {\n this.path1_direction = 'right';\n this.path2_direction = 'bottom';\n this.path3_direction = 'top';\n }\n } else {\n this.path1_direction = options.direction_path1;\n this.path2_direction = options.direction_path2;\n this.path3_direction = options.direction_path3;\n }\n\n this.path1_direction = this.path1_direction || 'bottom';\n this.path2_direction = this.path2_direction || 'right';\n this.path3_direction = this.path3_direction || 'top';\n\n this.initialize();\n}\ninherits(Parallel, Symbol);\n\nParallel.prototype.render = function() {\n if (this.path1_direction) {\n this[this.path1_direction + '_symbol'] = this.path1_symbol;\n }\n\n if (this.path2_direction) {\n this[this.path2_direction + '_symbol'] = this.path2_symbol;\n }\n\n if (this.path3_direction) {\n this[this.path3_direction + '_symbol'] = this.path3_symbol;\n }\n\n var lineLength = this.getAttr('line-length');\n\n if (this.bottom_symbol) {\n var bottomPoint = this.getBottom();\n\n if (!this.bottom_symbol.isPositioned) {\n this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);\n this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2);\n this.bottom_symbol.isPositioned = true;\n\n this.bottom_symbol.render();\n }\n }\n\n if (this.top_symbol) {\n var topPoint = this.getTop();\n\n if (!this.top_symbol.isPositioned) {\n this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength);\n this.top_symbol.setX(topPoint.x + this.top_symbol.width);\n this.top_symbol.isPositioned = true;\n\n this.top_symbol.render();\n }\n }\n\n var self = this;\n\n if (this.left_symbol) {\n var leftPoint = this.getLeft();\n\n if (!this.left_symbol.isPositioned) {\n this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);\n this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);\n if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {\n hasSymbolUnder = true;\n break;\n }\n }\n }\n\n if (hasSymbolUnder) {\n if (self.left_symbol.symbolType === 'end') return;\n self.left_symbol.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.left_symbol.isPositioned = true;\n\n this.left_symbol.render();\n }\n }\n\n if (this.right_symbol) {\n var rightPoint = this.getRight();\n\n if (!this.right_symbol.isPositioned) {\n this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2);\n this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);\n (function shift() {\n var hasSymbolUnder = false;\n var symb;\n for (var i = 0, len = self.chart.symbols.length; i < len; i++) {\n symb = self.chart.symbols[i];\n\n if (!self.params['align-next'] || self.params['align-next'] !== 'no') {\n var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);\n if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {\n hasSymbolUnder = true;\n break;\n }\n }\n }\n\n if (hasSymbolUnder) {\n if (self.right_symbol.symbolType === 'end') return;\n self.right_symbol.setX(symb.getX() + symb.width + lineLength);\n shift();\n }\n })();\n\n this.right_symbol.isPositioned = true;\n\n this.right_symbol.render();\n }\n }\n};\n\nParallel.prototype.renderLines = function() {\n if (this.path1_symbol) {\n this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction);\n }\n\n if (this.path2_symbol) {\n this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction);\n }\n\n if (this.path3_symbol) {\n this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);\n }\n};\n\nmodule.exports = Parallel;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.parallel.js\n// module id = 6\n// module chunks = 0","var Raphael = require('raphael');\nvar defaults = require('./flowchart.helpers').defaults;\nvar defaultOptions = require('./flowchart.defaults');\nvar Condition = require('./flowchart.symbol.condition');\nvar Parallel = require('./flowchart.symbol.parallel');\n\nfunction FlowChart(container, options) {\n options = options || {};\n\n this.paper = new Raphael(container);\n\n this.options = defaults(options, defaultOptions);\n\n this.symbols = [];\n this.lines = [];\n this.start = null;\n}\n\nFlowChart.prototype.handle = function(symbol) {\n if (this.symbols.indexOf(symbol) <= -1) {\n this.symbols.push(symbol);\n }\n\n var flowChart = this;\n\n if (symbol instanceof(Condition)) {\n symbol.yes = function(nextSymbol) {\n symbol.yes_symbol = nextSymbol;\n if(symbol.no_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n symbol.no = function(nextSymbol) {\n symbol.no_symbol = nextSymbol;\n if (symbol.yes_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n } else if (symbol instanceof(Parallel)) {\n symbol.path1 = function(nextSymbol) {\n symbol.path1_symbol = nextSymbol;\n if (symbol.path2_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n symbol.path2 = function(nextSymbol) {\n symbol.path2_symbol = nextSymbol;\n if (symbol.path3_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n symbol.path3 = function(nextSymbol) {\n symbol.path3_symbol = nextSymbol;\n if (symbol.path1_symbol) {\n symbol.pathOk = true;\n }\n return flowChart.handle(nextSymbol);\n };\n } else {\n symbol.then = function(nextSymbol) {\n symbol.next = nextSymbol;\n symbol.pathOk = true;\n return flowChart.handle(nextSymbol);\n };\n }\n\n return symbol;\n};\n\nFlowChart.prototype.startWith = function(symbol) {\n this.start = symbol;\n return this.handle(symbol);\n};\n\nFlowChart.prototype.render = function() {\n var maxWidth = 0,\n maxHeight = 0,\n i = 0,\n len = 0,\n maxX = 0,\n maxY = 0,\n minX = 0,\n minY = 0,\n symbol,\n line;\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n if (symbol.width > maxWidth) {\n maxWidth = symbol.width;\n }\n if (symbol.height > maxHeight) {\n maxHeight = symbol.height;\n }\n }\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n symbol.shiftX(this.options.x + (maxWidth - symbol.width)/2 + this.options['line-width']);\n symbol.shiftY(this.options.y + (maxHeight - symbol.height)/2 + this.options['line-width']);\n }\n\n this.start.render();\n // for (i = 0, len = this.symbols.length; i < len; i++) {\n // symbol = this.symbols[i];\n // symbol.render();\n // }\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n symbol.renderLines();\n }\n\n maxX = this.maxXFromLine;\n\n var x;\n var y;\n\n for (i = 0, len = this.symbols.length; i < len; i++) {\n symbol = this.symbols[i];\n var leftX = symbol.getX()\n x = leftX + symbol.width;\n y = symbol.getY() + symbol.height;\n if (leftX < minX) {\n minX = leftX;\n }\n if (x > maxX) {\n maxX = x;\n }\n if (y > maxY) {\n maxY = y;\n }\n }\n\n for (i = 0, len = this.lines.length; i < len; i++) {\n line = this.lines[i].getBBox();\n x = line.x;\n y = line.y;\n var x2 = line.x2;\n var y2 = line.y2;\n if (x < minX) {\n minX = x;\n }\n if (y < minY) {\n minY = y;\n }\n if (x2 > maxX) {\n maxX = x2;\n }\n if (y2 > maxY) {\n maxY = y2;\n }\n }\n\n var scale = this.options['scale'];\n var lineWidth = this.options['line-width'];\n\n if (this.minXFromSymbols < minX) minX = this.minXFromSymbols;\n\n if (minX < 0) minX -= lineWidth;\n if (minY < 0) minY -= lineWidth;\n\n var width = maxX + lineWidth - minX;\n var height = maxY + lineWidth - minY;\n\n this.paper.setSize(width * scale, height * scale);\n this.paper.setViewBox(minX, minY, width, height, true);\n};\n\nFlowChart.prototype.clean = function() {\n if (this.paper) {\n var paperDom = this.paper.canvas;\n paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);\n }\n};\n\nmodule.exports = FlowChart;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.chart.js\n// module id = 7\n// module chunks = 0","// defaults\nmodule.exports = {\n 'x': 0,\n 'y': 0,\n // 'roundness': 0,\n 'line-width': 3,\n 'line-length': 50,\n 'text-margin': 10,\n 'font-size': 14,\n 'font-color': 'black',\n // 'font': 'normal',\n // 'font-family': 'calibri',\n // 'font-weight': 'normal',\n 'line-color': 'black',\n 'element-color': 'black',\n 'fill': 'white',\n 'yes-text': 'yes',\n 'no-text': 'no',\n 'arrow-end': 'block',\n 'class': 'flowchart',\n 'scale': 1,\n 'symbols': {\n 'start': {},\n 'end': {},\n 'condition': {},\n 'inputoutput': {},\n 'input': {}, //tds\n 'output': {}, //tds \n 'operation': {},\n 'subroutine': {},\n 'parallel': {}\n } //,\n // 'flowstate' : {\n // 'past' : { 'fill': '#CCCCCC', 'font-size': 12},\n // 'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},\n // 'future' : { 'fill': '#FFFF99'},\n // 'invalid': {'fill': '#444444'}\n // }\n};\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.defaults.js\n// module id = 8\n// module chunks = 0","// add indexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.indexOf) {\n Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {\n \"use strict\";\n if (this === null) {\n throw new TypeError();\n }\n var t = Object(this);\n var len = t.length >>> 0;\n if (len === 0) {\n return -1;\n }\n var n = 0;\n if (arguments.length > 0) {\n n = Number(arguments[1]);\n if (n != n) { // shortcut for verifying if it's NaN\n n = 0;\n } else if (n !== 0 && n != Infinity && n != -Infinity) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n }\n if (n >= len) {\n return -1;\n }\n var k = n >= 0 ? n : Math.max(len - Math.abs(n), 0);\n for (; k < len; k++) {\n if (k in t && t[k] === searchElement) {\n return k;\n }\n }\n return -1;\n };\n}\n\n// add lastIndexOf to non ECMA-262 standard compliant browsers\nif (!Array.prototype.lastIndexOf) {\n Array.prototype.lastIndexOf = function(searchElement /*, fromIndex*/) {\n \"use strict\";\n if (this === null) {\n throw new TypeError();\n }\n var t = Object(this);\n var len = t.length >>> 0;\n if (len === 0) {\n return -1;\n }\n var n = len;\n if (arguments.length > 1) {\n n = Number(arguments[1]);\n if (n != n) {\n n = 0;\n } else if (n !== 0 && n != (1 / 0) && n != -(1 / 0)) {\n n = (n > 0 || -1) * Math.floor(Math.abs(n));\n }\n }\n var k = n >= 0 ? Math.min(n, len - 1) : len - Math.abs(n);\n for (; k >= 0; k--) {\n if (k in t && t[k] === searchElement) {\n return k;\n }\n }\n return -1;\n };\n}\n\nif (!String.prototype.trim) {\n String.prototype.trim = function() {\n return this.replace(/^\\s+|\\s+$/g, '');\n };\n}\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.shim.js\n// module id = 9\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction End(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n options = options || {};\n options.text = options.text || 'End';\n Symbol.call(this, chart, options, symbol);\n}\ninherits(End, Symbol);\n\nmodule.exports = End;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.end.js\n// module id = 10\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Input(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.textMargin = this.getAttr('text-margin');\n\n this.text.attr({\n x: this.textMargin * 3\n });\n\n var width = this.text.getBBox().width + 4 * this.textMargin;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n var startX = this.textMargin;\n var startY = height/2;\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n {x: startX - this.textMargin + width, y: height},\n {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n {x: startX - this.textMargin, y: 0},\n {x: startX, y: startY}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n this.symbol = symbol\n\n this.initialize();\n}\ninherits(Input, Symbol);\n\nInput.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.textMargin;\n return {x: x, y: y};\n};\n\nInput.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width - this.textMargin;\n return {x: x, y: y};\n};\n\nmodule.exports = Input;\n\n\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.input.js\n// module id = 11\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction InputOutput(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.textMargin = this.getAttr('text-margin');\n\n this.text.attr({\n x: this.textMargin * 3\n });\n\n var width = this.text.getBBox().width + 4 * this.textMargin;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n var startX = this.textMargin;\n var startY = height/2;\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - this.textMargin, y: height},\n {x: startX - this.textMargin + width, y: height},\n {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n {x: startX, y: startY}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n this.symbol = symbol\n\n this.initialize();\n}\ninherits(InputOutput, Symbol);\n\nInputOutput.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.textMargin;\n return {x: x, y: y};\n};\n\nInputOutput.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width - this.textMargin;\n return {x: x, y: y};\n};\n\nmodule.exports = InputOutput;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.inputoutput.js\n// module id = 12\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Operation(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0);\n options = options || {};\n Symbol.call(this, chart, options, symbol);\n}\ninherits(Operation, Symbol);\n\nmodule.exports = Operation;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.operation.js\n// module id = 13\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar drawPath = drawAPI.drawPath;\n\nfunction Output(chart, options) {\n options = options || {};\n Symbol.call(this, chart, options);\n this.textMargin = this.getAttr('text-margin');\n\n this.text.attr({\n x: this.textMargin * 3\n });\n\n var width = this.text.getBBox().width + 4 * this.textMargin;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n var startX = this.textMargin;\n var startY = height/2;\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - this.textMargin, y: height},\n {x: startX - this.textMargin + width + 2 * this.textMargin, y: height},\n {x: startX - this.textMargin + width, y: 0},\n {x: startX - this.textMargin + 2 * this.textMargin, y: 0},\n {x: startX, y: startY}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n this.symbol = symbol\n\n this.initialize();\n}\ninherits(Output, Symbol);\n\nOutput.prototype.getLeft = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.textMargin;\n return {x: x, y: y};\n};\n\nOutput.prototype.getRight = function() {\n var y = this.getY() + this.group.getBBox().height/2;\n var x = this.getX() + this.group.getBBox().width - this.textMargin;\n return {x: x, y: y};\n};\n\nmodule.exports = Output;\n\n\n\n/*\n//var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\nvar drawAPI = require('./flowchart.functions');\nvar InputOutput = require('./flowchart.symbol.inputoutput');\nvar drawPath = drawAPI.drawPath;\n\nfunction Output(chart, options) {\n options = options || {};\n InputOutput.call(this, chart, options);\n\n var width = this.text.getBBox().width + 4 * this.textMargin;\n var height = this.text.getBBox().height + 2 * this.textMargin;\n var startX = this.textMargin;\n var startY = height/2;\n\n var start = {x: startX, y: startY};\n var points = [\n {x: startX - this.textMargin + 2 * this.textMargin, y: height},\n {x: startX - this.textMargin + width, y: height},\n {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},\n {x: startX - this.textMargin, y: 0},\n {x: startX, y: startY}\n ];\n\n var symbol = drawPath(chart, start, points);\n\n symbol.attr({\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n fill: this.getAttr('fill')\n });\n if (options.link) { symbol.attr('href', options.link); }\n if (options.target) { symbol.attr('target', options.target); }\n if (options.key) { symbol.node.id = options.key; }\n symbol.node.setAttribute('class', this.getAttr('class'));\n\n this.text.attr({\n y: symbol.getBBox().height/2\n });\n\n this.group.push(symbol);\n symbol.insertBefore(this.text);\n \n if (this.symbol){\n this.group.remove(this.symbol); //tds\n this.symbol.parentNode.removeChild(this.symbol); //tds\n }\n this.symbol = symbol\n\n this.initialize();\n}\ninherits(Output, InputOutput);\n\nmodule.exports = Output;\n*/\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.output.js\n// module id = 14\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Start(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0, 20);\n options = options || {};\n options.text = options.text || 'Start';\n Symbol.call(this, chart, options, symbol);\n}\ninherits(Start, Symbol);\n\nmodule.exports = Start;\n\n// Start.prototype.render = function() {\n// if (this.next) {\n// var lineLength = this.chart.options.symbols[this.symbolType]['line-length'] || this.chart.options['line-length'];\n\n// var bottomPoint = this.getBottom();\n// var topPoint = this.next.getTop();\n\n// if (!this.next.isPositioned) {\n// this.next.shiftY(this.getY() + this.height + lineLength);\n// this.next.setX(bottomPoint.x - this.next.width/2);\n// this.next.isPositioned = true;\n\n// this.next.render();\n// }\n// }\n// };\n\n// Start.prototype.renderLines = function() {\n// if (this.next) {\n// this.drawLineTo(this.next);\n// }\n// };\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.start.js\n// module id = 15\n// module chunks = 0","var Symbol = require('./flowchart.symbol');\nvar inherits = require('./flowchart.helpers').inherits;\n\nfunction Subroutine(chart, options) {\n var symbol = chart.paper.rect(0, 0, 0, 0);\n options = options || {};\n Symbol.call(this, chart, options, symbol);\n\n symbol.attr({\n width: this.text.getBBox().width + 4 * this.getAttr('text-margin')\n });\n\n this.text.attr({\n 'x': 2 * this.getAttr('text-margin')\n });\n\n var innerWrap = chart.paper.rect(0, 0, 0, 0);\n innerWrap.attr({\n x: this.getAttr('text-margin'),\n stroke: this.getAttr('element-color'),\n 'stroke-width': this.getAttr('line-width'),\n width: this.text.getBBox().width + 2 * this.getAttr('text-margin'),\n height: this.text.getBBox().height + 2 * this.getAttr('text-margin'),\n fill: this.getAttr('fill')\n });\n if (options.key) { innerWrap.node.id = options.key + 'i'; }\n\n var font = this.getAttr('font');\n var fontF = this.getAttr('font-family');\n var fontW = this.getAttr('font-weight');\n\n if (font) innerWrap.attr({ 'font': font });\n if (fontF) innerWrap.attr({ 'font-family': fontF });\n if (fontW) innerWrap.attr({ 'font-weight': fontW });\n\n if (options.link) { innerWrap.attr('href', options.link); }\n if (options.target) { innerWrap.attr('target', options.target); }\n this.group.push(innerWrap);\n innerWrap.insertBefore(this.text);\n\n this.initialize();\n}\ninherits(Subroutine, Symbol);\n\nmodule.exports = Subroutine;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/flowchart.symbol.subroutine.js\n// module id = 16\n// module chunks = 0","if (typeof jQuery != 'undefined') {\n\tvar parse = require('./flowchart.parse');\n\n\t(function( $ ) {\n\t\tfunction paramFit(needle, haystack) {\n\t\t\treturn needle == haystack ||\n\t\t\t( Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)) ))\n\t\t}\n\t\tvar methods = {\n\t\t\tinit : function(options) {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tthis.chart = parse($this.text());\n\t\t\t\t\t$this.html('');\n\t\t\t\t\tthis.chart.drawSVG(this, options);\n\t\t\t\t});\n\t\t\t},\n\t\t\tsetFlowStateByParam : function(param, paramValue, newFlowState) {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar chart = this.chart;\n\n\t\t\t\t\t// @todo this should be part of Symbol API\n\t\t\t\t\tvar nextSymbolKeys = ['next', 'yes', 'no', 'path1', 'path2', 'path3'];\n\n\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\tvar symbol = chart.symbols[property];\n\t\t\t\t\t\t\tvar val = symbol.params[param];\n\t\t\t\t\t\t\tif (paramFit(val, paramValue)) {\n\t\t\t\t\t\t\t\tsymbol.flowstate = newFlowState;\n\t\t\t\t\t\t\t\tfor (var nski = 0; nski < nextSymbolKeys.length; nski++) {\n\t\t\t\t\t\t\t\t\tvar nextSymbolKey = nextSymbolKeys[nski];\n\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey] &&\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'] &&\n\t\t\t\t\t\t\t\t\t\tsymbol[nextSymbolKey]['params'][param] &&\n\t\t\t\t\t\t\t\t\t\tparamFit(symbol[nextSymbolKey]['params'][param], paramValue)\n\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\tsymbol.lineStyle[symbol[nextSymbolKey]['key']] = {stroke: chart.options()['flowstate'][newFlowState]['fill']};\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tchart.clean();\n\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t});\n\n\t\t\t},\n\t\t\tclearFlowState: function () {\n\t\t\t\treturn this.each(function() {\n\t\t\t\t\tvar chart = this.chart;\n\n\t\t\t\t\tfor (var property in chart.symbols) {\n\t\t\t\t\t\tif (chart.symbols.hasOwnProperty(property)) {\n\t\t\t\t\t\t\tvar node = chart.symbols[property];\n\t\t\t\t\t\t\tnode.flowstate = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tchart.clean();\n\t\t\t\t\tchart.drawSVG(this);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\t$.fn.flowChart = function(methodOrOptions) {\n\t\t\tif ( methods[methodOrOptions] ) {\n\t\t\t\treturn methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));\n\t\t\t} else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {\n\t\t\t\t// Default to \"init\"\n\t\t\t\treturn methods.init.apply( this, arguments );\n\t\t\t} else {\n\t\t\t\t$.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.flowChart' );\n\t\t\t}\n\t\t};\n\n\t})(jQuery); // eslint-disable-line\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./src/jquery-plugin.js\n// module id = 17\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_18__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"Raphael\"\n// module id = 18\n// module chunks = 0"],"sourceRoot":""}
\ No newline at end of file
diff --git a/releasenotes.md b/releasenotes.md
index 7e97e477..b23ca65d 100644
--- a/releasenotes.md
+++ b/releasenotes.md
@@ -1,6 +1,98 @@
+### v1.18.0
+
+- introduce input and output [#251](https://github.com/adrai/flowchart.js/pull/251)
+
+### v1.17.1
+
+- fix start and end roundness introduced in [#227](https://github.com/adrai/flowchart.js/pull/227)
+
+### v1.17.0
+
+- Styling to allow rounded corners [#227](https://github.com/adrai/flowchart.js/pull/227)
+
+### v1.16.0
+
+- Custom annotations for parallel [#225](https://github.com/adrai/flowchart.js/issues/225)
+
+### v1.15.0
+
+- Introduce types [#214](https://github.com/adrai/flowchart.js/pull/214) thanks to [Mister-Hope](https://github.com/Mister-Hope)
+
+### v1.14.3
+
+- Removed types introduced in [#212](https://github.com/adrai/flowchart.js/pull/212) again
+
+### v1.14.2
+
+- Basic types [#212](https://github.com/adrai/flowchart.js/pull/212) thanks to [DerMolly](https://github.com/DerMolly)
+
+### v1.14.1
+
+- Corrected condition behavior and fixed layout [#211](https://github.com/adrai/flowchart.js/pull/211) thanks to [AlexanderMisel](https://github.com/AlexanderMisel)
+
+### v1.14.0
+
+- Custom annotations [#209](https://github.com/adrai/flowchart.js/pull/209) thanks to [serpent-charmer](https://github.com/serpent-charmer)
+
+
+### v1.13.0
+
+- Provide low cost means of lines not colliding until they converge [#191](https://github.com/adrai/flowchart.js/pull/191) thanks to [robertleeplummerjr](https://github.com/robertleeplummerjr)
+- update raphael dependency
+
+
+### v1.12.3
+
+- Cleaning error fix, Linestyle parsing cycle fix, Dynamic flowState update [#188](https://github.com/adrai/flowchart.js/pull/188) thanks to [murich](https://github.com/murich)
+
+
+### v1.12.2
+
+- shrink npm package
+
+
+### v1.12.1
+
+- Fix params bug [#173](https://github.com/adrai/flowchart.js/pull/173) thanks to [leo108](https://github.com/leo108)
+
+
+### v1.12.0
+
+- onclick function binding to chart nodes [#172](https://github.com/adrai/flowchart.js/pull/172) thanks to [ndrqu](https://github.com/ndrqu)
+
+
+### v1.11.3
+
+- try to optimize horizontal rendering for end symbols [#155](https://github.com/adrai/flowchart.js/issues/155)
+
+### v1.11.2
+
+- try to optimize left handling [#152](https://github.com/adrai/flowchart.js/issues/152)
+
+### v1.11.1
+
+- fix direction issue for condition [#151](https://github.com/adrai/flowchart.js/issues/151)
+
+### v1.11.0
+
+- Add parallel component [#145](https://github.com/adrai/flowchart.js/pull/145) thanks to [sudhakar-sekar](https://github.com/sudhakar-sekar)
+
+### v1.9.0
+
+- Add arrow-text attribute to symbols [#141](https://github.com/adrai/flowchart.js/pull/141) thanks to [josephtocci](https://github.com/josephtocci)
+
+### v1.8.0
+
+- Allow Conditional to support 'true' or 'false' along with 'yes' and 'no' [#128](https://github.com/adrai/flowchart.js/pull/128) thanks to [bhedge](https://github.com/bhedge)
+
+### v1.7.0
+
+- add parameter to disable vertical alignment of condition symbol [#115](https://github.com/adrai/flowchart.js/pull/115) thanks to [bertrandmartel](https://github.com/bertrandmartel)
+- add line style flow support [#113](https://github.com/adrai/flowchart.js/pull/115) thanks to [bertrandmartel](https://github.com/bertrandmartel)
+
### v1.6.6
-- Fix disruptive space char when parsing [##105](https://github.com/adrai/flowchart.js/pull/#105)
+- Fix disruptive space char when parsing [#105](https://github.com/adrai/flowchart.js/pull/105)
### v1.6.5
@@ -12,15 +104,15 @@
### v1.6.3
-- Allow going to same symbol thanks to [nonylene](https://github.com/nonylene) [##83](https://github.com/adrai/flowchart.js/pull/#83)
+- Allow going to same symbol thanks to [nonylene](https://github.com/nonylene) [#83](https://github.com/adrai/flowchart.js/pull/83)
### v1.6.2
-- Fixed not calculate viewBox and size properly thanks to [jackycute](https://github.com/jackycute) [##74](https://github.com/adrai/flowchart.js/issues/#74)
+- Fixed not calculate viewBox and size properly thanks to [jackycute](https://github.com/jackycute) [#74](https://github.com/adrai/flowchart.js/issues/#74)
### v1.6.1
-- Fixed lines are not included in the calculation of viewBox and size thanks to [jackycute](https://github.com/jackycute) [##72](https://github.com/adrai/flowchart.js/issues/#72) [##67](https://github.com/adrai/flowchart.js/issues/#67)
+- Fixed lines are not included in the calculation of viewBox and size thanks to [jackycute](https://github.com/jackycute) [#72](https://github.com/adrai/flowchart.js/issues/#72) [#67](https://github.com/adrai/flowchart.js/issues/#67)
### v1.6.0
diff --git a/site b/site
index 02d75774..63921d93 160000
--- a/site
+++ b/site
@@ -1 +1 @@
-Subproject commit 02d7577472e5e170ca453653fa22175a5e444d18
+Subproject commit 63921d93a0b949df86d73f669155e188704b75b5
diff --git a/src/flowchart.chart.js b/src/flowchart.chart.js
index e8d4d90c..db00d821 100644
--- a/src/flowchart.chart.js
+++ b/src/flowchart.chart.js
@@ -2,6 +2,7 @@ var Raphael = require('raphael');
var defaults = require('./flowchart.helpers').defaults;
var defaultOptions = require('./flowchart.defaults');
var Condition = require('./flowchart.symbol.condition');
+var Parallel = require('./flowchart.symbol.parallel');
function FlowChart(container, options) {
options = options || {};
@@ -32,7 +33,29 @@ FlowChart.prototype.handle = function(symbol) {
};
symbol.no = function(nextSymbol) {
symbol.no_symbol = nextSymbol;
- if(symbol.yes_symbol) {
+ if (symbol.yes_symbol) {
+ symbol.pathOk = true;
+ }
+ return flowChart.handle(nextSymbol);
+ };
+ } else if (symbol instanceof(Parallel)) {
+ symbol.path1 = function(nextSymbol) {
+ symbol.path1_symbol = nextSymbol;
+ if (symbol.path2_symbol) {
+ symbol.pathOk = true;
+ }
+ return flowChart.handle(nextSymbol);
+ };
+ symbol.path2 = function(nextSymbol) {
+ symbol.path2_symbol = nextSymbol;
+ if (symbol.path3_symbol) {
+ symbol.pathOk = true;
+ }
+ return flowChart.handle(nextSymbol);
+ };
+ symbol.path3 = function(nextSymbol) {
+ symbol.path3_symbol = nextSymbol;
+ if (symbol.path1_symbol) {
symbol.pathOk = true;
}
return flowChart.handle(nextSymbol);
@@ -55,15 +78,15 @@ FlowChart.prototype.startWith = function(symbol) {
FlowChart.prototype.render = function() {
var maxWidth = 0,
- maxHeight = 0,
- i = 0,
- len = 0,
- maxX = 0,
- maxY = 0,
- minX = 0,
- minY = 0,
- symbol,
- line;
+ maxHeight = 0,
+ i = 0,
+ len = 0,
+ maxX = 0,
+ maxY = 0,
+ minX = 0,
+ minY = 0,
+ symbol,
+ line;
for (i = 0, len = this.symbols.length; i < len; i++) {
symbol = this.symbols[i];
@@ -99,8 +122,12 @@ FlowChart.prototype.render = function() {
for (i = 0, len = this.symbols.length; i < len; i++) {
symbol = this.symbols[i];
- x = symbol.getX() + symbol.width;
+ var leftX = symbol.getX()
+ x = leftX + symbol.width;
y = symbol.getY() + symbol.height;
+ if (leftX < minX) {
+ minX = leftX;
+ }
if (x > maxX) {
maxX = x;
}
@@ -132,6 +159,8 @@ FlowChart.prototype.render = function() {
var scale = this.options['scale'];
var lineWidth = this.options['line-width'];
+ if (this.minXFromSymbols < minX) minX = this.minXFromSymbols;
+
if (minX < 0) minX -= lineWidth;
if (minY < 0) minY -= lineWidth;
@@ -145,8 +174,8 @@ FlowChart.prototype.render = function() {
FlowChart.prototype.clean = function() {
if (this.paper) {
var paperDom = this.paper.canvas;
- paperDom.parentNode.removeChild(paperDom);
+ paperDom.parentNode && paperDom.parentNode.removeChild(paperDom);
}
};
-module.exports = FlowChart;
+module.exports = FlowChart;
\ No newline at end of file
diff --git a/src/flowchart.defaults.js b/src/flowchart.defaults.js
index 5303530e..e10dac07 100644
--- a/src/flowchart.defaults.js
+++ b/src/flowchart.defaults.js
@@ -2,6 +2,7 @@
module.exports = {
'x': 0,
'y': 0,
+ // 'roundness': 0,
'line-width': 3,
'line-length': 50,
'text-margin': 10,
@@ -23,13 +24,16 @@ module.exports = {
'end': {},
'condition': {},
'inputoutput': {},
+ 'input': {}, //tds
+ 'output': {}, //tds
'operation': {},
- 'subroutine': {}
- }//,
+ 'subroutine': {},
+ 'parallel': {}
+ } //,
// 'flowstate' : {
// 'past' : { 'fill': '#CCCCCC', 'font-size': 12},
// 'current' : {'fill': 'yellow', 'font-color': 'red', 'font-weight': 'bold'},
// 'future' : { 'fill': '#FFFF99'},
// 'invalid': {'fill': '#444444'}
// }
-};
+};
\ No newline at end of file
diff --git a/src/flowchart.functions.js b/src/flowchart.functions.js
index 23c62a86..073f0d37 100644
--- a/src/flowchart.functions.js
+++ b/src/flowchart.functions.js
@@ -61,6 +61,7 @@ function drawLine(chart, from, to, text) {
var centerText = false;
var textPath = chart.paper.text(0, 0, text);
+ var textAnchor = 'start';
var isHorizontal = false;
var firstTo = to[0];
@@ -97,16 +98,24 @@ function drawLine(chart, from, to, text) {
y = from.y;
if (isHorizontal) {
- x += chart.options['text-margin']/2;
+ if (from.x > firstTo.x) {
+ x -= chart.options['text-margin']/2;
+ textAnchor = 'end';
+ } else {
+ x += chart.options['text-margin']/2;
+ }
y -= chart.options['text-margin'];
} else {
x += chart.options['text-margin']/2;
y += chart.options['text-margin'];
+ if (from.y > firstTo.y) {
+ y -= chart.options['text-margin']*2;
+ }
}
}
textPath.attr({
- 'text-anchor': 'start',
+ 'text-anchor': textAnchor,
'font-size': chart.options['font-size'],
'fill': chart.options['font-color'],
x: x,
diff --git a/src/flowchart.parse.js b/src/flowchart.parse.js
index 79086a9e..03e941fa 100644
--- a/src/flowchart.parse.js
+++ b/src/flowchart.parse.js
@@ -3,8 +3,12 @@ var Start = require('./flowchart.symbol.start');
var End = require('./flowchart.symbol.end');
var Operation = require('./flowchart.symbol.operation');
var InputOutput = require('./flowchart.symbol.inputoutput');
+var Input = require('./flowchart.symbol.input'); //tds
+var Output = require('./flowchart.symbol.output'); //tds
var Subroutine = require('./flowchart.symbol.subroutine');
var Condition = require('./flowchart.symbol.condition');
+var Parallel = require('./flowchart.symbol.parallel');
+
function parse(input) {
input = input || '';
@@ -42,12 +46,21 @@ function parse(input) {
case 'inputoutput':
dispSymbols[s.key] = new InputOutput(diagram, s);
break;
+ case 'input':
+ dispSymbols[s.key] = new Input(diagram, s); //tds
+ break;
+ case 'output':
+ dispSymbols[s.key] = new Output(diagram, s); //tds
+ break;
case 'subroutine':
dispSymbols[s.key] = new Subroutine(diagram, s);
break;
case 'condition':
dispSymbols[s.key] = new Condition(diagram, s);
break;
+ case 'parallel':
+ dispSymbols[s.key] = new Parallel(diagram, s);
+ break;
default:
return new Error('Wrong symbol type!');
}
@@ -68,6 +81,16 @@ function parse(input) {
if (prev.no === s) {
prevDisp.no(dispSymb);
}
+ } else if (prevDisp instanceof(Parallel)) {
+ if (prev.path1 === s) {
+ prevDisp.path1(dispSymb);
+ }
+ if (prev.path2 === s) {
+ prevDisp.path2(dispSymb);
+ }
+ if (prev.path3 === s) {
+ prevDisp.path3(dispSymb);
+ }
} else {
prevDisp.then(dispSymb);
}
@@ -84,6 +107,16 @@ function parse(input) {
if (s.no) {
constructChart(s.no, dispSymb, s);
}
+ } else if (dispSymb instanceof(Parallel)) {
+ if (s.path1) {
+ constructChart(s.path1, dispSymb, s);
+ }
+ if (s.path2) {
+ constructChart(s.path2, dispSymb, s);
+ }
+ if (s.path3) {
+ constructChart(s.path3, dispSymb, s);
+ }
} else if (s.next) {
constructChart(s.next, dispSymb, s);
}
@@ -95,6 +128,9 @@ function parse(input) {
},
clean: function() {
this.diagram.clean();
+ },
+ options: function() {
+ return this.diagram.options;
}
};
@@ -108,14 +144,14 @@ function parse(input) {
}
}
- if(prevBreak < input.length) {
+ if (prevBreak < input.length) {
lines.push(input.substr(prevBreak));
}
for (var l = 1, len = lines.length; l < len;) {
var currentLine = lines[l];
- if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0) {
+ if (currentLine.indexOf('->') < 0 && currentLine.indexOf('=>') < 0 && currentLine.indexOf('@>') < 0) {
lines[l - 1] += '\n' + currentLine;
lines.splice(l, 1);
len--;
@@ -124,6 +160,24 @@ function parse(input) {
}
}
+ function getStyle(s){
+ var startIndex = s.indexOf('(') + 1;
+ var endIndex = s.indexOf(')');
+ if (startIndex >= 0 && endIndex >= 0) {
+ return s.substring(startIndex,endIndex);
+ }
+ return '{}';
+ }
+
+ function getSymbValue(s){
+ var startIndex = s.indexOf('(') + 1;
+ var endIndex = s.indexOf(')');
+ if (startIndex >= 0 && endIndex >= 0) {
+ return s.substring(startIndex,endIndex);
+ }
+ return '';
+ }
+
function getSymbol(s) {
var startIndex = s.indexOf('(') + 1;
var endIndex = s.indexOf(')');
@@ -147,6 +201,15 @@ function parse(input) {
}
return next;
}
+
+ function getAnnotation(s) {
+ var startIndex = s.indexOf("(") + 1, endIndex = s.indexOf(")");
+ var tmp = s.substring(startIndex, endIndex);
+ if(tmp.indexOf(",") > 0) { tmp = tmp.substring(0, tmp.indexOf(",")); }
+ var tmp_split = tmp.split("@");
+ if(tmp_split.length > 1)
+ return startIndex >= 0 && endIndex >= 0 ? tmp_split[1] : "";
+ }
while (lines.length > 0) {
var line = lines.splice(0, 1)[0].trim();
@@ -155,14 +218,29 @@ function parse(input) {
// definition
var parts = line.split('=>');
var symbol = {
- key: parts[0],
+ key: parts[0].replace(/\(.*\)/, ''),
symbolType: parts[1],
text: null,
link: null,
target: null,
- flowstate: null
+ flowstate: null,
+ function: null,
+ lineStyle: {},
+ params: {}
};
+ //parse parameters
+ var params = parts[0].match(/\((.*)\)/);
+ if (params && params.length > 1){
+ var entries = params[1].split(',');
+ for(var i = 0; i < entries.length; i++) {
+ var entry = entries[i].split('=');
+ if (entry.length == 2) {
+ symbol.params[entry[0]] = entry[1];
+ }
+ }
+ }
+
var sub;
if (symbol.symbolType.indexOf(': ') >= 0) {
@@ -171,7 +249,15 @@ function parse(input) {
symbol.text = sub.join(': ');
}
- if (symbol.text && symbol.text.indexOf(':>') >= 0) {
+ if (symbol.text && symbol.text.indexOf(':$') >= 0) {
+ sub = symbol.text.split(':$');
+ symbol.text = sub.shift();
+ symbol.function = sub.join(':$');
+ } else if (symbol.symbolType.indexOf(':$') >= 0) {
+ sub = symbol.symbolType.split(':$');
+ symbol.symbolType = sub.shift();
+ symbol.function = sub.join(':$');
+ } else if (symbol.text && symbol.text.indexOf(':>') >= 0) {
sub = symbol.text.split(':>');
symbol.text = sub.shift();
symbol.link = sub.join(':>');
@@ -209,13 +295,24 @@ function parse(input) {
chart.symbols[symbol.key] = symbol;
} else if (line.indexOf('->') >= 0) {
+ var ann = getAnnotation(line);
+ if (ann) {
+ line = line.replace('@' + ann, '');
+ }
// flow
var flowSymbols = line.split('->');
- for (var i = 0, lenS = flowSymbols.length; i < lenS; i++) {
- var flowSymb = flowSymbols[i];
-
- var realSymb = getSymbol(flowSymb);
+ for (var iS = 0, lenS = flowSymbols.length; iS < lenS; iS++) {
+ var flowSymb = flowSymbols[iS];
+ var symbVal = getSymbValue(flowSymb);
+
+ if (symbVal === 'true' || symbVal === 'false') {
+ // map true or false to yes or no respectively
+ flowSymb = flowSymb.replace('true', 'yes');
+ flowSymb = flowSymb.replace('false', 'no');
+ }
+
var next = getNextPath(flowSymb);
+ var realSymb = getSymbol(flowSymb);
var direction = null;
if (next.indexOf(',') >= 0) {
@@ -224,17 +321,48 @@ function parse(input) {
direction = condOpt[1].trim();
}
+ if (ann) {
+ if (realSymb.symbolType === 'condition') {
+ if (next === "yes" || next === "true") {
+ realSymb.yes_annotation = ann;
+ } else {
+ realSymb.no_annotation = ann;
+ }
+ } else if (realSymb.symbolType === 'parallel') {
+ if (next === 'path1') {
+ realSymb.path1_annotation = ann;
+ } else if (next === 'path2') {
+ realSymb.path2_annotation = ann;
+ } else if (next === 'path3') {
+ realSymb.path3_annotation = ann;
+ }
+ }
+ ann = null;
+ }
+
if (!chart.start) {
chart.start = realSymb;
}
- if (i + 1 < lenS) {
- var nextSymb = flowSymbols[i + 1];
+ if (iS + 1 < lenS) {
+ var nextSymb = flowSymbols[iS + 1];
realSymb[next] = getSymbol(nextSymb);
realSymb['direction_' + next] = direction;
direction = null;
}
}
+ } else if (line.indexOf('@>') >= 0) {
+
+ // line style
+ var lineStyleSymbols = line.split('@>');
+ for (var iSS = 0, lenSS = lineStyleSymbols.length; iSS < lenSS; iSS++) {
+ if ((iSS + 1) !== lenSS) {
+ var curSymb = getSymbol(lineStyleSymbols[iSS]);
+ var nextSymbol = getSymbol(lineStyleSymbols[iSS+1]);
+
+ curSymb['lineStyle'][nextSymbol.key] = JSON.parse(getStyle(lineStyleSymbols[iSS + 1]));
+ }
+ }
}
}
diff --git a/src/flowchart.symbol.condition.js b/src/flowchart.symbol.condition.js
index 27cb5c7c..e9459492 100644
--- a/src/flowchart.symbol.condition.js
+++ b/src/flowchart.symbol.condition.js
@@ -6,30 +6,16 @@ var drawPath = drawAPI.drawPath;
function Condition(chart, options) {
options = options || {};
Symbol.call(this, chart, options);
+ this.yes_annotation = options.yes_annotation;
+ this.no_annotation = options.no_annotation;
this.textMargin = this.getAttr('text-margin');
- this.yes_direction = 'bottom';
- this.no_direction = 'right';
- if (options.yes && options.direction_yes && options.no && !options.direction_no) {
- if (options.direction_yes === 'right') {
- this.no_direction = 'bottom';
- this.yes_direction = 'right';
- } else {
- this.no_direction = 'right';
- this.yes_direction = 'bottom';
- }
- } else if (options.yes && !options.direction_yes && options.no && options.direction_no) {
- if (options.direction_no === 'right') {
- this.yes_direction = 'bottom';
- this.no_direction = 'right';
- } else {
- this.yes_direction = 'right';
- this.no_direction = 'bottom';
- }
- } else {
- this.yes_direction = 'bottom';
- this.no_direction = 'right';
+ this.yes_direction = options.direction_yes;
+ this.no_direction = options.direction_no;
+ if (!this.no_direction && this.yes_direction === 'right') {
+ this.no_direction = 'bottom';
+ } else if (!this.yes_direction && this.no_direction === 'bottom') {
+ this.yes_direction = 'right'
}
-
this.yes_direction = this.yes_direction || 'bottom';
this.no_direction = this.no_direction || 'right';
@@ -76,13 +62,14 @@ function Condition(chart, options) {
this.group.push(symbol);
symbol.insertBefore(this.text);
+ this.symbol = symbol
this.initialize();
}
inherits(Condition, Symbol);
Condition.prototype.render = function() {
-
+ var self = this;
if (this.yes_direction) {
this[this.yes_direction + '_symbol'] = this.yes_symbol;
}
@@ -113,21 +100,23 @@ Condition.prototype.render = function() {
this.right_symbol.setY(rightPoint.y - this.right_symbol.height/2);
this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);
- var self = this;
(function shift() {
var hasSymbolUnder = false;
var symb;
for (var i = 0, len = self.chart.symbols.length; i < len; i++) {
symb = self.chart.symbols[i];
- var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
- if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {
- hasSymbolUnder = true;
- break;
+ if (!self.params['align-next'] || self.params['align-next'] !== 'no') {
+ var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
+ if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width/2) {
+ hasSymbolUnder = true;
+ break;
+ }
}
}
if (hasSymbolUnder) {
+ if (self.right_symbol.symbolType === 'end') return;
self.right_symbol.setX(symb.getX() + symb.width + lineLength);
shift();
}
@@ -138,15 +127,50 @@ Condition.prototype.render = function() {
this.right_symbol.render();
}
}
+
+ if (this.left_symbol) {
+ var leftPoint = this.getLeft();
+
+ if (!this.left_symbol.isPositioned) {
+ this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);
+ this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));
+
+ (function shift() {
+ var hasSymbolUnder = false;
+ var symb;
+ for (var i = 0, len = self.chart.symbols.length; i < len; i++) {
+ symb = self.chart.symbols[i];
+
+ if (!self.params['align-next'] || self.params['align-next'] !== 'no') {
+ var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);
+ if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {
+ hasSymbolUnder = true;
+ break;
+ }
+ }
+ }
+
+ if (hasSymbolUnder) {
+ if (self.left_symbol.symbolType === 'end') return;
+ self.left_symbol.setX(symb.getX() + symb.width + lineLength);
+ shift();
+ }
+ })();
+
+ this.left_symbol.isPositioned = true;
+
+ this.left_symbol.render();
+ }
+ }
};
Condition.prototype.renderLines = function() {
if (this.yes_symbol) {
- this.drawLineTo(this.yes_symbol, this.getAttr('yes-text'), this.yes_direction);
+ this.drawLineTo(this.yes_symbol, this.yes_annotation ? this.yes_annotation : this.getAttr('yes-text'), this.yes_direction);
}
if (this.no_symbol) {
- this.drawLineTo(this.no_symbol, this.getAttr('no-text'), this.no_direction);
+ this.drawLineTo(this.no_symbol, this.no_annotation ? this.no_annotation : this.getAttr('no-text'), this.no_direction);
}
};
diff --git a/src/flowchart.symbol.input.js b/src/flowchart.symbol.input.js
new file mode 100644
index 00000000..6f5823dc
--- /dev/null
+++ b/src/flowchart.symbol.input.js
@@ -0,0 +1,67 @@
+var Symbol = require('./flowchart.symbol');
+var inherits = require('./flowchart.helpers').inherits;
+var drawAPI = require('./flowchart.functions');
+var drawPath = drawAPI.drawPath;
+
+function Input(chart, options) {
+ options = options || {};
+ Symbol.call(this, chart, options);
+ this.textMargin = this.getAttr('text-margin');
+
+ this.text.attr({
+ x: this.textMargin * 3
+ });
+
+ var width = this.text.getBBox().width + 4 * this.textMargin;
+ var height = this.text.getBBox().height + 2 * this.textMargin;
+ var startX = this.textMargin;
+ var startY = height/2;
+
+ var start = {x: startX, y: startY};
+ var points = [
+ {x: startX - this.textMargin + 2 * this.textMargin, y: height},
+ {x: startX - this.textMargin + width, y: height},
+ {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},
+ {x: startX - this.textMargin, y: 0},
+ {x: startX, y: startY}
+ ];
+
+ var symbol = drawPath(chart, start, points);
+
+ symbol.attr({
+ stroke: this.getAttr('element-color'),
+ 'stroke-width': this.getAttr('line-width'),
+ fill: this.getAttr('fill')
+ });
+ if (options.link) { symbol.attr('href', options.link); }
+ if (options.target) { symbol.attr('target', options.target); }
+ if (options.key) { symbol.node.id = options.key; }
+ symbol.node.setAttribute('class', this.getAttr('class'));
+
+ this.text.attr({
+ y: symbol.getBBox().height/2
+ });
+
+ this.group.push(symbol);
+ symbol.insertBefore(this.text);
+ this.symbol = symbol
+
+ this.initialize();
+}
+inherits(Input, Symbol);
+
+Input.prototype.getLeft = function() {
+ var y = this.getY() + this.group.getBBox().height/2;
+ var x = this.getX() + this.textMargin;
+ return {x: x, y: y};
+};
+
+Input.prototype.getRight = function() {
+ var y = this.getY() + this.group.getBBox().height/2;
+ var x = this.getX() + this.group.getBBox().width - this.textMargin;
+ return {x: x, y: y};
+};
+
+module.exports = Input;
+
+
diff --git a/src/flowchart.symbol.inputoutput.js b/src/flowchart.symbol.inputoutput.js
index 411c691d..cd8573d3 100644
--- a/src/flowchart.symbol.inputoutput.js
+++ b/src/flowchart.symbol.inputoutput.js
@@ -44,6 +44,7 @@ function InputOutput(chart, options) {
this.group.push(symbol);
symbol.insertBefore(this.text);
+ this.symbol = symbol
this.initialize();
}
diff --git a/src/flowchart.symbol.js b/src/flowchart.symbol.js
index fd70d368..7a01be98 100644
--- a/src/flowchart.symbol.js
+++ b/src/flowchart.symbol.js
@@ -9,6 +9,13 @@ function Symbol(chart, options, symbol) {
this.connectedTo = [];
this.symbolType = options.symbolType;
this.flowstate = (options.flowstate || 'future');
+ this.lineStyle = (options.lineStyle || {});
+ this.key = (options.key || '');
+ this.leftLines = [];
+ this.rightLines = [];
+ this.topLines = [];
+ this.bottomLines = [];
+ this.params = options.params;
this.next_direction = options.next && options['direction_next'] ? options['direction_next'] : undefined;
@@ -33,6 +40,16 @@ function Symbol(chart, options, symbol) {
if (fontW) this.text.attr({ 'font-weight': fontW });
if (options.link) { this.text.attr('href', options.link); }
+
+ //ndrqu Add click function with event and options params
+ if (options.function) {
+ this.text.attr({ 'cursor' : 'pointer' });
+
+ this.text.node.addEventListener("click", function(evt) {
+ window[options.function](evt,options);
+ }, false);
+ }
+
if (options.target) { this.text.attr('target', options.target); }
var maxWidth = this.getAttr('maxWidth');
@@ -66,9 +83,22 @@ function Symbol(chart, options, symbol) {
});
symbol.node.setAttribute('class', this.getAttr('class'));
+ var roundness = this.getAttr('roundness');
+ if (!isNaN(roundness)) {
+ symbol.node.setAttribute('ry', roundness);
+ symbol.node.setAttribute('rx', roundness);
+ }
if (options.link) { symbol.attr('href', options.link); }
if (options.target) { symbol.attr('target', options.target); }
+
+ //ndrqu Add click function with event and options params
+ if (options.function) {
+ symbol.node.addEventListener("click", function(evt) {
+ window[options.function](evt,options);
+ }, false);
+ symbol.attr({ 'cursor' : 'pointer' });
+ }
if (options.key) { symbol.node.id = options.key; }
this.group.push(symbol);
@@ -160,6 +190,7 @@ Symbol.prototype.getRight = function() {
Symbol.prototype.render = function() {
if (this.next) {
+ var self = this;
var lineLength = this.getAttr('line-length');
if (this.next_direction === 'right') {
@@ -167,11 +198,9 @@ Symbol.prototype.render = function() {
var rightPoint = this.getRight();
if (!this.next.isPositioned) {
-
this.next.setY(rightPoint.y - this.next.height/2);
this.next.shiftX(this.group.getBBox().x + this.width + lineLength);
- var self = this;
(function shift() {
var hasSymbolUnder = false;
var symb;
@@ -186,6 +215,39 @@ Symbol.prototype.render = function() {
}
if (hasSymbolUnder) {
+ if (self.next.symbolType === 'end') return;
+ self.next.setX(symb.getX() + symb.width + lineLength);
+ shift();
+ }
+ })();
+
+ this.next.isPositioned = true;
+
+ this.next.render();
+ }
+ } else if (this.next_direction === 'left') {
+
+ var leftPoint = this.getLeft();
+
+ if (!this.next.isPositioned) {
+ this.next.setY(leftPoint.y - this.next.height/2);
+ this.next.shiftX(-(this.group.getBBox().x + this.width + lineLength));
+
+ (function shift() {
+ var hasSymbolUnder = false;
+ var symb;
+ for (var i = 0, len = self.chart.symbols.length; i < len; i++) {
+ symb = self.chart.symbols[i];
+
+ var diff = Math.abs(symb.getCenter().x - self.next.getCenter().x);
+ if (symb.getCenter().y > self.next.getCenter().y && diff <= self.next.width/2) {
+ hasSymbolUnder = true;
+ break;
+ }
+ }
+
+ if (hasSymbolUnder) {
+ if (self.next.symbolType === 'end') return;
self.next.setX(symb.getX() + symb.width + lineLength);
shift();
}
@@ -212,9 +274,9 @@ Symbol.prototype.render = function() {
Symbol.prototype.renderLines = function() {
if (this.next) {
if (this.next_direction) {
- this.drawLineTo(this.next, '', this.next_direction);
+ this.drawLineTo(this.next, this.getAttr('arrow-text') || '', this.next_direction);
} else {
- this.drawLineTo(this.next);
+ this.drawLineTo(this.next, this.getAttr('arrow-text') || '');
}
}
};
@@ -228,6 +290,7 @@ Symbol.prototype.drawLineTo = function(symbol, text, origin) {
y = this.getCenter().y,
right = this.getRight(),
bottom = this.getBottom(),
+ top = this.getTop(),
left = this.getLeft();
var symbolX = symbol.getCenter().x,
@@ -245,100 +308,169 @@ Symbol.prototype.drawLineTo = function(symbol, text, origin) {
var maxX = 0,
line,
+ yOffset,
lineLength = this.getAttr('line-length'),
lineWith = this.getAttr('line-width');
if ((!origin || origin === 'bottom') && isOnSameColumn && isUnder) {
- line = drawLine(this.chart, bottom, symbolTop, text);
+ if (symbol.topLines.length === 0 && this.bottomLines.length === 0) {
+ line = drawLine(this.chart, bottom, symbolTop, text);
+ } else {
+ yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;
+ line = drawLine(this.chart, bottom, [
+ {x: symbolTop.x, y: symbolTop.y - yOffset},
+ {x: symbolTop.x, y: symbolTop.y}
+ ], text);
+ }
+ this.bottomLines.push(line);
+ symbol.topLines.push(line);
this.bottomStart = true;
symbol.topEnd = true;
maxX = bottom.x;
} else if ((!origin || origin === 'right') && isOnSameLine && isRight) {
- line = drawLine(this.chart, right, symbolLeft, text);
+ if (symbol.leftLines.length === 0 && this.rightLines.length === 0) {
+ line = drawLine(this.chart, right, symbolLeft, text);
+ } else {
+ yOffset = Math.max(symbol.leftLines.length, this.rightLines.length) * 10;
+ line = drawLine(this.chart, right, [
+ {x: right.x, y: right.y - yOffset},
+ {x: right.x, y: symbolLeft.y - yOffset},
+ {x: symbolLeft.x, y: symbolLeft.y - yOffset},
+ {x: symbolLeft.x, y: symbolLeft.y}
+ ], text);
+ }
+ this.rightLines.push(line);
+ symbol.leftLines.push(line);
this.rightStart = true;
symbol.leftEnd = true;
maxX = symbolLeft.x;
} else if ((!origin || origin === 'left') && isOnSameLine && isLeft) {
- line = drawLine(this.chart, left, symbolRight, text);
+ if (symbol.rightLines.length === 0 && this.leftLines.length === 0) {
+ line = drawLine(this.chart, left, symbolRight, text);
+ } else {
+ yOffset = Math.max(symbol.rightLines.length, this.leftLines.length) * 10;
+ line = drawLine(this.chart, right, [
+ {x: right.x, y: right.y - yOffset},
+ {x: right.x, y: symbolRight.y - yOffset},
+ {x: symbolRight.x, y: symbolRight.y - yOffset},
+ {x: symbolRight.x, y: symbolRight.y}
+ ], text);
+ }
+ this.leftLines.push(line);
+ symbol.rightLines.push(line);
this.leftStart = true;
symbol.rightEnd = true;
maxX = symbolRight.x;
} else if ((!origin || origin === 'right') && isOnSameColumn && isUpper) {
+ yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;
line = drawLine(this.chart, right, [
- {x: right.x + lineLength/2, y: right.y},
- {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: right.x + lineLength/2, y: right.y - yOffset},
+ {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.rightLines.push(line);
+ symbol.topLines.push(line);
this.rightStart = true;
symbol.topEnd = true;
maxX = right.x + lineLength/2;
} else if ((!origin || origin === 'right') && isOnSameColumn && isUnder) {
+ yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;
line = drawLine(this.chart, right, [
- {x: right.x + lineLength/2, y: right.y},
- {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: right.x + lineLength/2, y: right.y - yOffset},
+ {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.rightLines.push(line);
+ symbol.topLines.push(line);
this.rightStart = true;
symbol.topEnd = true;
maxX = right.x + lineLength/2;
} else if ((!origin || origin === 'bottom') && isLeft) {
+ yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;
if (this.leftEnd && isUpper) {
line = drawLine(this.chart, bottom, [
- {x: bottom.x, y: bottom.y + lineLength/2},
- {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},
- {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},
+ {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},
+ {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
} else {
line = drawLine(this.chart, bottom, [
- {x: bottom.x, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
}
+ this.bottomLines.push(line);
+ symbol.topLines.push(line);
this.bottomStart = true;
symbol.topEnd = true;
maxX = bottom.x + (bottom.x - symbolTop.x)/2;
+ } else if ((!origin || origin === 'bottom') && isRight && isUnder) {
+ yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;
+ line = drawLine(this.chart, bottom, [
+ {x: bottom.x, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y}
+ ], text);
+ this.bottomLines.push(line);
+ symbol.topLines.push(line);
+ this.bottomStart = true;
+ symbol.topEnd = true;
+ maxX = bottom.x;
+ if (symbolTop.x > maxX) maxX = symbolTop.x;
} else if ((!origin || origin === 'bottom') && isRight) {
+ yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;
line = drawLine(this.chart, bottom, [
- {x: bottom.x, y: bottom.y + lineLength/2},
- {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2},
- {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},
+ {x: bottom.x + (bottom.x - symbolTop.x)/2, y: bottom.y + lineLength/2 - yOffset},
+ {x: bottom.x + (bottom.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.bottomLines.push(line);
+ symbol.topLines.push(line);
this.bottomStart = true;
symbol.topEnd = true;
maxX = bottom.x + (bottom.x - symbolTop.x)/2;
} else if ((origin && origin === 'right') && isLeft) {
+ yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;
line = drawLine(this.chart, right, [
{x: right.x + lineLength/2, y: right.y},
- {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.rightLines.push(line);
+ symbol.topLines.push(line);
this.rightStart = true;
symbol.topEnd = true;
maxX = right.x + lineLength/2;
} else if ((origin && origin === 'right') && isRight) {
+ yOffset = Math.max(symbol.topLines.length, this.rightLines.length) * 10;
line = drawLine(this.chart, right, [
- {x: symbolTop.x, y: right.y},
- {x: symbolTop.x, y: symbolTop.y}
+ {x: symbolTop.x, y: right.y - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - yOffset}
], text);
+ this.rightLines.push(line);
+ symbol.topLines.push(line);
this.rightStart = true;
symbol.topEnd = true;
maxX = right.x + lineLength/2;
} else if ((origin && origin === 'bottom') && isOnSameColumn && isUpper) {
+ yOffset = Math.max(symbol.topLines.length, this.bottomLines.length) * 10;
line = drawLine(this.chart, bottom, [
- {x: bottom.x, y: bottom.y + lineLength/2},
- {x: right.x + lineLength/2, y: bottom.y + lineLength/2},
- {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: bottom.x, y: bottom.y + lineLength/2 - yOffset},
+ {x: right.x + lineLength/2, y: bottom.y + lineLength/2 - yOffset},
+ {x: right.x + lineLength/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.bottomLines.push(line);
+ symbol.topLines.push(line);
this.bottomStart = true;
symbol.topEnd = true;
maxX = bottom.x + lineLength/2;
@@ -347,31 +479,53 @@ Symbol.prototype.drawLineTo = function(symbol, text, origin) {
if (symbolLeft.x < left.x) {
diffX = symbolLeft.x - lineLength/2;
}
+ yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;
line = drawLine(this.chart, left, [
- {x: diffX, y: left.y},
- {x: diffX, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: diffX, y: left.y - yOffset},
+ {x: diffX, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.leftLines.push(line);
+ symbol.topLines.push(line);
this.leftStart = true;
symbol.topEnd = true;
maxX = left.x;
} else if ((origin === 'left')) {
+ yOffset = Math.max(symbol.topLines.length, this.leftLines.length) * 10;
line = drawLine(this.chart, left, [
- {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: left.y},
- {x: symbolTop.x + (left.x - symbolTop.x)/ 2, y: symbolTop.y - lineLength/2},
- {x: symbolTop.x, y: symbolTop.y - lineLength/2},
+ {x: symbolTop.x + (left.x - symbolTop.x)/2, y: left.y},
+ {x: symbolTop.x + (left.x - symbolTop.x)/2, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
{x: symbolTop.x, y: symbolTop.y}
], text);
+ this.leftLines.push(line);
+ symbol.topLines.push(line);
this.leftStart = true;
symbol.topEnd = true;
maxX = left.x;
+ } else if ((origin === 'top')) {
+ yOffset = Math.max(symbol.topLines.length, this.topLines.length) * 10;
+ line = drawLine(this.chart, top, [
+ {x: top.x, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y - lineLength/2 - yOffset},
+ {x: symbolTop.x, y: symbolTop.y}
+ ], text);
+ this.topLines.push(line);
+ symbol.topLines.push(line);
+ this.topStart = true;
+ symbol.topEnd = true;
+ maxX = top.x;
+ }
+
+ //update line style
+ if (this.lineStyle[symbol.key] && line){
+ line.attr(this.lineStyle[symbol.key]);
}
if (line) {
for (var l = 0, llen = this.chart.lines.length; l < llen; l++) {
var otherLine = this.chart.lines[l];
- var len;
var ePath = otherLine.attr('path'),
lPath = line.attr('path');
@@ -431,13 +585,15 @@ Symbol.prototype.drawLineTo = function(symbol, text, origin) {
}
lP += 2;
- len += 2;
}
}
}
}
this.chart.lines.push(line);
+ if (this.chart.minXFromSymbols === undefined || this.chart.minXFromSymbols > left.x) {
+ this.chart.minXFromSymbols = left.x;
+ }
}
if (!this.chart.maxXFromLine || (this.chart.maxXFromLine && maxX > this.chart.maxXFromLine)) {
diff --git a/src/flowchart.symbol.output.js b/src/flowchart.symbol.output.js
new file mode 100644
index 00000000..363dac0b
--- /dev/null
+++ b/src/flowchart.symbol.output.js
@@ -0,0 +1,124 @@
+var Symbol = require('./flowchart.symbol');
+var inherits = require('./flowchart.helpers').inherits;
+var drawAPI = require('./flowchart.functions');
+var drawPath = drawAPI.drawPath;
+
+function Output(chart, options) {
+ options = options || {};
+ Symbol.call(this, chart, options);
+ this.textMargin = this.getAttr('text-margin');
+
+ this.text.attr({
+ x: this.textMargin * 3
+ });
+
+ var width = this.text.getBBox().width + 4 * this.textMargin;
+ var height = this.text.getBBox().height + 2 * this.textMargin;
+ var startX = this.textMargin;
+ var startY = height/2;
+
+ var start = {x: startX, y: startY};
+ var points = [
+ {x: startX - this.textMargin, y: height},
+ {x: startX - this.textMargin + width + 2 * this.textMargin, y: height},
+ {x: startX - this.textMargin + width, y: 0},
+ {x: startX - this.textMargin + 2 * this.textMargin, y: 0},
+ {x: startX, y: startY}
+ ];
+
+ var symbol = drawPath(chart, start, points);
+
+ symbol.attr({
+ stroke: this.getAttr('element-color'),
+ 'stroke-width': this.getAttr('line-width'),
+ fill: this.getAttr('fill')
+ });
+ if (options.link) { symbol.attr('href', options.link); }
+ if (options.target) { symbol.attr('target', options.target); }
+ if (options.key) { symbol.node.id = options.key; }
+ symbol.node.setAttribute('class', this.getAttr('class'));
+
+ this.text.attr({
+ y: symbol.getBBox().height/2
+ });
+
+ this.group.push(symbol);
+ symbol.insertBefore(this.text);
+ this.symbol = symbol
+
+ this.initialize();
+}
+inherits(Output, Symbol);
+
+Output.prototype.getLeft = function() {
+ var y = this.getY() + this.group.getBBox().height/2;
+ var x = this.getX() + this.textMargin;
+ return {x: x, y: y};
+};
+
+Output.prototype.getRight = function() {
+ var y = this.getY() + this.group.getBBox().height/2;
+ var x = this.getX() + this.group.getBBox().width - this.textMargin;
+ return {x: x, y: y};
+};
+
+module.exports = Output;
+
+
+
+/*
+//var Symbol = require('./flowchart.symbol');
+var inherits = require('./flowchart.helpers').inherits;
+var drawAPI = require('./flowchart.functions');
+var InputOutput = require('./flowchart.symbol.inputoutput');
+var drawPath = drawAPI.drawPath;
+
+function Output(chart, options) {
+ options = options || {};
+ InputOutput.call(this, chart, options);
+
+ var width = this.text.getBBox().width + 4 * this.textMargin;
+ var height = this.text.getBBox().height + 2 * this.textMargin;
+ var startX = this.textMargin;
+ var startY = height/2;
+
+ var start = {x: startX, y: startY};
+ var points = [
+ {x: startX - this.textMargin + 2 * this.textMargin, y: height},
+ {x: startX - this.textMargin + width, y: height},
+ {x: startX - this.textMargin + width + 2 * this.textMargin, y: 0},
+ {x: startX - this.textMargin, y: 0},
+ {x: startX, y: startY}
+ ];
+
+ var symbol = drawPath(chart, start, points);
+
+ symbol.attr({
+ stroke: this.getAttr('element-color'),
+ 'stroke-width': this.getAttr('line-width'),
+ fill: this.getAttr('fill')
+ });
+ if (options.link) { symbol.attr('href', options.link); }
+ if (options.target) { symbol.attr('target', options.target); }
+ if (options.key) { symbol.node.id = options.key; }
+ symbol.node.setAttribute('class', this.getAttr('class'));
+
+ this.text.attr({
+ y: symbol.getBBox().height/2
+ });
+
+ this.group.push(symbol);
+ symbol.insertBefore(this.text);
+
+ if (this.symbol){
+ this.group.remove(this.symbol); //tds
+ this.symbol.parentNode.removeChild(this.symbol); //tds
+ }
+ this.symbol = symbol
+
+ this.initialize();
+}
+inherits(Output, InputOutput);
+
+module.exports = Output;
+*/
diff --git a/src/flowchart.symbol.parallel.js b/src/flowchart.symbol.parallel.js
new file mode 100644
index 00000000..bf7ae0c2
--- /dev/null
+++ b/src/flowchart.symbol.parallel.js
@@ -0,0 +1,210 @@
+var Symbol = require('./flowchart.symbol');
+var inherits = require('./flowchart.helpers').inherits;
+
+function Parallel(chart, options) {
+ var symbol = chart.paper.rect(0, 0, 0, 0);
+ options = options || {};
+ Symbol.call(this, chart, options, symbol);
+ this.path1_annotation = options.path1_annotation || '';
+ this.path2_annotation = options.path2_annotation || '';
+ this.path3_annotation = options.path3_annotation || '';
+ this.textMargin = this.getAttr('text-margin');
+ this.path1_direction = 'bottom';
+ this.path2_direction = 'right';
+ this.path3_direction = 'top';
+ this.params = options.params;
+ if (options.direction_next === 'path1' && !options[options.direction_next] && options.next) {
+ options[options.direction_next] = options.next;
+ }
+ if (options.direction_next === 'path2' && !options[options.direction_next] && options.next) {
+ options[options.direction_next] = options.next;
+ }
+ if (options.direction_next === 'path3' && !options[options.direction_next] && options.next) {
+ options[options.direction_next] = options.next;
+ }
+
+ if (options.path1 && options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && !options.direction_path3) {
+ if (options.direction_path1 === 'right') {
+ this.path2_direction = 'bottom';
+ this.path1_direction = 'right';
+ this.path3_direction = 'top';
+ } else if (options.direction_path1 === 'top') {
+ this.path2_direction = 'right';
+ this.path1_direction = 'top';
+ this.path3_direction = 'bottom';
+ } else if (options.direction_path1 === 'left') {
+ this.path2_direction = 'right';
+ this.path1_direction = 'left';
+ this.path3_direction = 'bottom';
+ } else {
+ this.path2_direction = 'right';
+ this.path1_direction = 'bottom';
+ this.path3_direction = 'top';
+ }
+ } else if (options.path1 && !options.direction_path1 && options.path2 && options.direction_path2 && options.path3 && !options.direction_path3) {
+ if (options.direction_path2 === 'right') {
+ this.path1_direction = 'bottom';
+ this.path2_direction = 'right';
+ this.path3_direction = 'top';
+ } else if (options.direction_path2 === 'left') {
+ this.path1_direction = 'bottom';
+ this.path2_direction = 'left';
+ this.path3_direction = 'right';
+ } else {
+ this.path1_direction = 'right';
+ this.path2_direction = 'bottom';
+ this.path3_direction = 'top';
+ }
+ } else if (options.path1 && !options.direction_path1 && options.path2 && !options.direction_path2 && options.path3 && options.direction_path3) {
+ if (options.direction_path2 === 'right') {
+ this.path1_direction = 'bottom';
+ this.path2_direction = 'top';
+ this.path3_direction = 'right';
+ } else if (options.direction_path2 === 'left') {
+ this.path1_direction = 'bottom';
+ this.path2_direction = 'right';
+ this.path3_direction = 'left';
+ } else {
+ this.path1_direction = 'right';
+ this.path2_direction = 'bottom';
+ this.path3_direction = 'top';
+ }
+ } else {
+ this.path1_direction = options.direction_path1;
+ this.path2_direction = options.direction_path2;
+ this.path3_direction = options.direction_path3;
+ }
+
+ this.path1_direction = this.path1_direction || 'bottom';
+ this.path2_direction = this.path2_direction || 'right';
+ this.path3_direction = this.path3_direction || 'top';
+
+ this.initialize();
+}
+inherits(Parallel, Symbol);
+
+Parallel.prototype.render = function() {
+ if (this.path1_direction) {
+ this[this.path1_direction + '_symbol'] = this.path1_symbol;
+ }
+
+ if (this.path2_direction) {
+ this[this.path2_direction + '_symbol'] = this.path2_symbol;
+ }
+
+ if (this.path3_direction) {
+ this[this.path3_direction + '_symbol'] = this.path3_symbol;
+ }
+
+ var lineLength = this.getAttr('line-length');
+
+ if (this.bottom_symbol) {
+ var bottomPoint = this.getBottom();
+
+ if (!this.bottom_symbol.isPositioned) {
+ this.bottom_symbol.shiftY(this.getY() + this.height + lineLength);
+ this.bottom_symbol.setX(bottomPoint.x - this.bottom_symbol.width / 2);
+ this.bottom_symbol.isPositioned = true;
+
+ this.bottom_symbol.render();
+ }
+ }
+
+ if (this.top_symbol) {
+ var topPoint = this.getTop();
+
+ if (!this.top_symbol.isPositioned) {
+ this.top_symbol.shiftY(this.getY() - this.top_symbol.height - lineLength);
+ this.top_symbol.setX(topPoint.x + this.top_symbol.width);
+ this.top_symbol.isPositioned = true;
+
+ this.top_symbol.render();
+ }
+ }
+
+ var self = this;
+
+ if (this.left_symbol) {
+ var leftPoint = this.getLeft();
+
+ if (!this.left_symbol.isPositioned) {
+ this.left_symbol.setY(leftPoint.y - this.left_symbol.height / 2);
+ this.left_symbol.shiftX(-(this.group.getBBox().x + this.width + lineLength));
+ (function shift() {
+ var hasSymbolUnder = false;
+ var symb;
+ for (var i = 0, len = self.chart.symbols.length; i < len; i++) {
+ symb = self.chart.symbols[i];
+
+ if (!self.params['align-next'] || self.params['align-next'] !== 'no') {
+ var diff = Math.abs(symb.getCenter().x - self.left_symbol.getCenter().x);
+ if (symb.getCenter().y > self.left_symbol.getCenter().y && diff <= self.left_symbol.width / 2) {
+ hasSymbolUnder = true;
+ break;
+ }
+ }
+ }
+
+ if (hasSymbolUnder) {
+ if (self.left_symbol.symbolType === 'end') return;
+ self.left_symbol.setX(symb.getX() + symb.width + lineLength);
+ shift();
+ }
+ })();
+
+ this.left_symbol.isPositioned = true;
+
+ this.left_symbol.render();
+ }
+ }
+
+ if (this.right_symbol) {
+ var rightPoint = this.getRight();
+
+ if (!this.right_symbol.isPositioned) {
+ this.right_symbol.setY(rightPoint.y - this.right_symbol.height / 2);
+ this.right_symbol.shiftX(this.group.getBBox().x + this.width + lineLength);
+ (function shift() {
+ var hasSymbolUnder = false;
+ var symb;
+ for (var i = 0, len = self.chart.symbols.length; i < len; i++) {
+ symb = self.chart.symbols[i];
+
+ if (!self.params['align-next'] || self.params['align-next'] !== 'no') {
+ var diff = Math.abs(symb.getCenter().x - self.right_symbol.getCenter().x);
+ if (symb.getCenter().y > self.right_symbol.getCenter().y && diff <= self.right_symbol.width / 2) {
+ hasSymbolUnder = true;
+ break;
+ }
+ }
+ }
+
+ if (hasSymbolUnder) {
+ if (self.right_symbol.symbolType === 'end') return;
+ self.right_symbol.setX(symb.getX() + symb.width + lineLength);
+ shift();
+ }
+ })();
+
+ this.right_symbol.isPositioned = true;
+
+ this.right_symbol.render();
+ }
+ }
+};
+
+Parallel.prototype.renderLines = function() {
+ if (this.path1_symbol) {
+ this.drawLineTo(this.path1_symbol, this.path1_annotation, this.path1_direction);
+ }
+
+ if (this.path2_symbol) {
+ this.drawLineTo(this.path2_symbol, this.path2_annotation, this.path2_direction);
+ }
+
+ if (this.path3_symbol) {
+ this.drawLineTo(this.path3_symbol, this.path3_annotation, this.path3_direction);
+ }
+};
+
+module.exports = Parallel;
\ No newline at end of file
diff --git a/src/jquery-plugin.js b/src/jquery-plugin.js
index 4aa67d81..71d8066f 100644
--- a/src/jquery-plugin.js
+++ b/src/jquery-plugin.js
@@ -1,13 +1,80 @@
if (typeof jQuery != 'undefined') {
var parse = require('./flowchart.parse');
+
(function( $ ) {
- $.fn.flowChart = function( options ) {
- return this.each(function() {
- var $this = $(this);
- var chart = parse($this.text());
- $this.html('');
- chart.drawSVG(this, options);
- });
+ function paramFit(needle, haystack) {
+ return needle == haystack ||
+ ( Array.isArray(haystack) && (haystack.includes(needle) || haystack.includes(Number(needle)) ))
+ }
+ var methods = {
+ init : function(options) {
+ return this.each(function() {
+ var $this = $(this);
+ this.chart = parse($this.text());
+ $this.html('');
+ this.chart.drawSVG(this, options);
+ });
+ },
+ setFlowStateByParam : function(param, paramValue, newFlowState) {
+ return this.each(function() {
+ var chart = this.chart;
+
+ // @todo this should be part of Symbol API
+ var nextSymbolKeys = ['next', 'yes', 'no', 'path1', 'path2', 'path3'];
+
+ for (var property in chart.symbols) {
+ if (chart.symbols.hasOwnProperty(property)) {
+ var symbol = chart.symbols[property];
+ var val = symbol.params[param];
+ if (paramFit(val, paramValue)) {
+ symbol.flowstate = newFlowState;
+ for (var nski = 0; nski < nextSymbolKeys.length; nski++) {
+ var nextSymbolKey = nextSymbolKeys[nski];
+ if (
+ symbol[nextSymbolKey] &&
+ symbol[nextSymbolKey]['params'] &&
+ symbol[nextSymbolKey]['params'][param] &&
+ paramFit(symbol[nextSymbolKey]['params'][param], paramValue)
+ ) {
+ symbol.lineStyle[symbol[nextSymbolKey]['key']] = {stroke: chart.options()['flowstate'][newFlowState]['fill']};
+ }
+ }
+ }
+ }
+ }
+
+ chart.clean();
+ chart.drawSVG(this);
+ });
+
+ },
+ clearFlowState: function () {
+ return this.each(function() {
+ var chart = this.chart;
+
+ for (var property in chart.symbols) {
+ if (chart.symbols.hasOwnProperty(property)) {
+ var node = chart.symbols[property];
+ node.flowstate = '';
+ }
+ }
+
+ chart.clean();
+ chart.drawSVG(this);
+ });
+ }
};
+
+ $.fn.flowChart = function(methodOrOptions) {
+ if ( methods[methodOrOptions] ) {
+ return methods[ methodOrOptions ].apply( this, Array.prototype.slice.call( arguments, 1 ));
+ } else if ( typeof methodOrOptions === 'object' || ! methodOrOptions ) {
+ // Default to "init"
+ return methods.init.apply( this, arguments );
+ } else {
+ $.error( 'Method ' + methodOrOptions + ' does not exist on jQuery.flowChart' );
+ }
+ };
+
})(jQuery); // eslint-disable-line
}
diff --git a/types/index.d.ts b/types/index.d.ts
new file mode 100644
index 00000000..76af8008
--- /dev/null
+++ b/types/index.d.ts
@@ -0,0 +1,43 @@
+declare module "flowchart.js" {
+ namespace FlowChart {
+ interface SVGOptions {
+ x: number;
+ y: number;
+ "line-width": number;
+ "line-length": number;
+ "text-margin": number;
+ "font-size": number;
+ "font-color": string;
+ "line-color": string;
+ "element-color": string;
+ fill: string;
+ roundness?: number;
+ "yes-text": string;
+ "no-text": string;
+ "arrow-end": string;
+ scale: number;
+ class: string;
+ [props: string]: any;
+ }
+
+ interface DrawOptions extends Partial {
+ /** Stymbol Styles */
+ symbols?: Record>;
+ /** FlowState config */
+ flowstate?: Record>;
+ }
+
+ interface Instance {
+ clean: () => void;
+ drawSVG: (container: HTMLElement | string, options?: DrawOptions) => void;
+ }
+ }
+
+ interface FlowChart {
+ parse: (code: string) => FlowChart.Instance;
+ }
+
+ const FlowChart: FlowChart;
+
+ export = FlowChart;
+}