I'm a newbie in jointjs. Today I have a small example as below:
I have a start Activity
var startEndActivity = function (x, y, name, fillColor, textColor, size) { fillColor = fillColor || '#007FBE'; textColor = textColor || "#000"; size = size || { width: 100, height: 40 }; var rect = new joint.shapes.basic.Rect({ position: { x: x, y: y }, size: size, attrs: { rect: { fill: fillColor, rx: 5, ry: 5, 'stroke-width': 1, stroke: '#002F5D' }, text: { text: name, fill: textColor, 'font-size': 14, 'font-family': 'sans-serif' } } }); graph.addCell(rect); return rect;}
I have a condition Activity
var activityDecision = function (x, y, name, fillColor, textColor, size{ fillColor = fillColor || '#BF664C'; textColor = textColor || "#080808"; size = size || { width: 200, height: 60 }; var node = new joint.shapes.basic.Rhombus({ position: { x: x, y: y }, size: size, }); node.attr({ rect: { fill: fillColor, 'stroke-width': 1, stroke: 'white' }, text: { text: name, fill: textColor, } }); graph.addCell(node); return node;}
I want to click on start activity and I can draw a arrow to connect between 2 elements. Thank you so much