You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
23 KiB
1 line
23 KiB
"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[14058],{29470:function(e,t,n){n.r(t),n.d(t,{default:function(){return c}});var o=n(59301),i=n(12378);function a(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(a,go.CommandHandler),a.prototype.canAlignSelection=function(){var e=this.diagram;return null!==e&&!e.isReadOnly&&!e.isModelReadOnly&&!(e.selection.count<2)},a.prototype.alignLeft=function(){var e=this.diagram;e.startTransaction("aligning left");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.x,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t,e.position.y))})),e.commitTransaction("aligning left")},a.prototype.alignRight=function(){var e=this.diagram;e.startTransaction("aligning right");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.x+e.actualBounds.width;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(t-e.actualBounds.width,e.position.y))})),e.commitTransaction("aligning right")},a.prototype.alignTop=function(){var e=this.diagram;e.startTransaction("alignTop");var t=1/0;e.selection.each((function(e){e instanceof go.Link||(t=Math.min(e.position.y,t))})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.position.x,t))})),e.commitTransaction("alignTop")},a.prototype.alignBottom=function(){var e=this.diagram;e.startTransaction("aligning bottom");var t=-1/0;e.selection.each((function(e){if(!(e instanceof go.Link)){var n=e.actualBounds.y+e.actualBounds.height;t=Math.max(n,t)}})),e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,t-e.actualBounds.height))})),e.commitTransaction("aligning bottom")},a.prototype.alignCenterX=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center X");var n=t.actualBounds.x+t.actualBounds.width/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(n-e.actualBounds.width/2,e.actualBounds.y))})),e.commitTransaction("aligning Center X")}},a.prototype.alignCenterY=function(){var e=this.diagram,t=e.selection.first();if(t){e.startTransaction("aligning Center Y");var n=t.actualBounds.y+t.actualBounds.height/2;e.selection.each((function(e){e instanceof go.Link||e.move(new go.Point(e.actualBounds.x,n-e.actualBounds.height/2))})),e.commitTransaction("aligning Center Y")}},a.prototype.alignColumn=function(e){var t=this.diagram;t.startTransaction("align Column"),void 0===e&&(e=0),e=parseFloat(e);var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var o=0;o<n.length-1;o++){var i=n[o],a=i.actualBounds.y+i.actualBounds.height+e;n[o+1].move(new go.Point(i.actualBounds.x,a))}t.commitTransaction("align Column")},a.prototype.alignRow=function(e){void 0===e&&(e=0),e=parseFloat(e);var t=this.diagram;t.startTransaction("align Row");var n=new Array;t.selection.each((function(e){e instanceof go.Link||n.push(e)}));for(var o=0;o<n.length-1;o++){var i=n[o],a=i.actualBounds.x+i.actualBounds.width+e;n[o+1].move(new go.Point(a,i.actualBounds.y))}t.commitTransaction("align Row")},a.prototype.canRotate=function(e){var t=this.diagram;return null!==t&&!t.isReadOnly&&!t.isModelReadOnly&&!(t.selection.count<1)},a.prototype.rotate=function(e){var t;void 0===e&&(e=90),(t=this.diagram).startTransaction("rotate "+e.toString()),(t=this.diagram).selection.each((function(t){t instanceof go.Link||t instanceof go.Group||(t.angle+=e)})),t.commitTransaction("rotate "+e.toString())},a.prototype.pullToFront=function(){var e=this.diagram;e.startTransaction("pullToFront");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.max(n,t)}})),t.set(e,n)})),e.selection.each((function(e){a._assignZOrder(e,t.get(e.layer)+1)})),e.commitTransaction("pullToFront")},a.prototype.pushToBack=function(){var e=this.diagram;e.startTransaction("pushToBack");var t=new go.Map;e.selection.each((function(e){t.set(e.layer,0)})),t.iteratorKeys.each((function(e){var n=0;e.parts.each((function(e){if(!e.isSelected){var t=e.zOrder;isNaN(t)?e.zOrder=0:n=Math.min(n,t)}})),t.set(e,n)})),e.selection.each((function(e){a._assignZOrder(e,t.get(e.layer)-1-a._findGroupDepth(e))})),e.commitTransaction("pushToBack")},a._assignZOrder=function(e,t,n){void 0===n&&(n=e),e.layer===n.layer&&(e.zOrder=t),e instanceof go.Group&&e.memberParts.each((function(e){a._assignZOrder(e,t+1,n)}))},a._findGroupDepth=function(e){if(e instanceof go.Group){var t=0;return e.memberParts.each((function(e){t=Math.max(t,a._findGroupDepth(e))})),t+1}return 0},a.prototype.doKeyDown=function(){var e=this.diagram;if(null!==e){var t=e.lastInput;if("Up"===t.key||"Down"===t.key||"Left"===t.key||"Right"===t.key){var n=this.arrowKeyBehavior;if("none"===n)return;if("select"===n)return void this._arrowKeySelect();if("move"===n)return void this._arrowKeyMove();if("tree"===n)return void this._arrowKeyTree()}go.CommandHandler.prototype.doKeyDown.call(this)}},a.prototype._getAllParts=function(){var e=new Array;return this.diagram.nodes.each((function(t){e.push(t)})),this.diagram.parts.each((function(t){e.push(t)})),e},a.prototype._arrowKeyMove=function(){var e=this.diagram,t=e.lastInput,n=0,o=0;if(t.control||t.meta)n=1,o=1;else if(null!==e.grid){var i=e.grid.gridCellSize;o=i.width,n=i.height}e.startTransaction("arrowKeyMove"),e.selection.each((function(e){"Up"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y-n)):"Down"===t.key?e.move(new go.Point(e.actualBounds.x,e.actualBounds.y+n)):"Left"===t.key?e.move(new go.Point(e.actualBounds.x-o,e.actualBounds.y)):"Right"===t.key&&e.move(new go.Point(e.actualBounds.x+o,e.actualBounds.y))})),e.commitTransaction("arrowKeyMove")},a.prototype._arrowKeySelect=function(){var e=this.diagram,t=e.lastInput,n=null;"Up"===t.key?n=this._findNearestPartTowards(270):"Down"===t.key?n=this._findNearestPartTowards(90):"Left"===t.key?n=this._findNearestPartTowards(180):"Right"===t.key&&(n=this._findNearestPartTowards(0)),null!==n&&(t.shift?n.isSelected=!0:t.control||t.meta?n.isSelected=!n.isSelected:e.select(n))},a.prototype._findNearestPartTowards=function(e){var t=this.diagram.selection.first();if(null===t)return null;for(var n=t.actualBounds.center,o=this._getAllParts(),i=1/0,a=t,r=0;r<o.length;r++){var l=o[r];if(l!==t&&l.canSelect()){var s=l.actualBounds.center,c=n.directionPoint(s),d=this._angleCloseness(c,e);if(d<=45){var u=n.distanceSquaredPoint(s);(u*=1+Math.sin(d*Math.PI/180))<i&&(i=u,a=l)}}}return a},a.prototype._angleCloseness=function(e,t){return Math.min(Math.abs(t-e),Math.min(Math.abs(t+360-e),Math.abs(t-360-e)))},a.prototype._arrowKeyTree=function(){var e=this.diagram,t=e.selection.first();if(t instanceof go.Node){var n=e.lastInput;if("Right"===n.key)if(t.isTreeLeaf);else if(t.isTreeExpanded){null!==(i=this._sortTreeChildrenByY(t).first())&&e.select(i)}else e.commandHandler.canExpandTree(t)&&e.commandHandler.expandTree(t);else if("Left"===n.key){if(!t.isTreeLeaf&&t.isTreeExpanded)e.commandHandler.canCollapseTree(t)&&e.commandHandler.collapseTree(t);else null!==(a=t.findTreeParentNode())&&e.select(a)}else if("Up"===n.key){if(null!==(a=t.findTreeParentNode()))if((l=(r=this._sortTreeChildrenByY(a)).indexOf(t))>0){for(var o=r.elt(l-1);null!==o&&o.isTreeExpanded&&!o.isTreeLeaf;){o=this._sortTreeChildrenByY(o).last()}null!==o&&e.select(o)}else e.select(a)}else if("Down"===n.key){var i;if(t.isTreeExpanded&&!t.isTreeLeaf)null!==(i=this._sortTreeChildrenByY(t).first())&&e.select(i);else for(;null!==t;){var a,r,l;if(null===(a=t.findTreeParentNode()))break;if((l=(r=this._sortTreeChildrenByY(a)).indexOf(t))<r.length-1){e.select(r.elt(l+1));break}t=a}}var s=e.selection.first();null!==s&&e.scrollToRect(s.actualBounds)}},a.prototype._sortTreeChildrenByY=function(e){var t=(new go.List).addAll(e.findTreeChildrenNodes());return t.sort((function(e,t){var n=e.location,o=t.location;return n.y<o.y?-1:n.y>o.y?1:n.x<o.x?-1:n.x>o.x?1:0})),t},a.prototype.copyToClipboard=function(e){go.CommandHandler.prototype.copyToClipboard.call(this,e),this._lastPasteOffset.set(this.pasteOffset)},a.prototype.pasteFromClipboard=function(){var e=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(e,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),e},Object.defineProperty(a.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(e){if("move"!==e&&"select"!==e&&"scroll"!==e&&"tree"!==e&&"none"!==e)throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+e);this._arrowKeyBehavior=e}}),Object.defineProperty(a.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(e){if(!(e instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+e);this._pasteOffset.set(e)}});var r=a,l=(n(88005),n(85160)),s=n(37712);window.go=i;var c=function(){var e=(0,o.useRef)().current;return(0,s.jsxs)("div",{style:{width:"100%",height:"100%"},onClick:function(){var t;console.log(JSON.stringify(e.model.toJson())),e.isModified=!1,t=e.makeImage(),document.body.appendChild(t)},children:[(0,s.jsx)(l.FI,{initDiagram:function(){var t=i.GraphObject.make,n="#ff3333",o="#3358ff",a="#25ad23",l="#d533ff",s="#7d33ff",c="#ff6233",d="#ffffff",u="#000000",f="#fffcd5",g="#d5ebff",p="#f2dfe0",m="#a5d2fa",h="#cccccc",k="#b3e6b3",y="#fcbbbd";function w(e,n){var o=function(t,n){t.handled=!0,t.diagram.model.commit((function(o){var a=n.part.adornedPart,r=(new i.Point).setRectSpot(a.actualBounds,e);r.subtract(a.location),r.scale(2,2),r.x+=30*Math.sign(r.x),r.y+=30*Math.sign(r.y),r.add(a.location),r.snapToGridPoint(t.diagram.grid.gridOrigin,t.diagram.grid.gridCellSize);var l=o.copyNodeData(a.data);o.setGroupKeyForNodeData(l,o.getGroupKeyForNodeData(a.data)),o.addNodeData(l);var s={from:a.key,to:o.getKeyForNodeData(l)};o.addLinkData(s);var c=t.diagram.findNodeForData(l);c.location=r,t.diagram.select(c),setTimeout((function(){t.diagram.commandHandler.editTextBlock()}),20)}))};return t(i.Shape,{figure:n,alignment:e,alignmentFocus:e.opposite(),width:e.equals(i.Spot.Top)||e.equals(i.Spot.Bottom)?25:18,height:e.equals(i.Spot.Top)||e.equals(i.Spot.Bottom)?18:25,fill:"orange",stroke:d,strokeWidth:4,mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},isActionable:!0,click:o,contextClick:o})}function S(e){return t(i.Shape,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="orange"},click:function(e,t){e.diagram.commandHandler.showContextMenu(t.part.adornedPart)}},e||{})}function v(e,t){return function(n,o){n.handled=!0,n.diagram.model.commit((function(n){n.set(o.part.adornedPart.data,e,t)}))}}function T(e,n){return n||(n="color"),t(i.Shape,{width:16,height:16,stroke:"lightgray",fill:e,margin:1,background:"transparent",mouseEnter:function(e,t){return t.stroke="dodgerblue"},mouseLeave:function(e,t){return t.stroke="lightgray"},click:v(n,e),contextClick:v(n,e)})}function B(){return[t("ContextMenuButton",t(i.Panel,"Horizontal",T(d,"fill"),T(f,"fill"),T(g,"fill"),T(p,"fill"))),t("ContextMenuButton",t(i.Panel,"Horizontal",T(h,"fill"),T(k,"fill"),T(m,"fill"),T(y,"fill")))]}function b(){return[t("ContextMenuButton",t(i.Panel,"Horizontal",T(u),T(a),T(o),T(n))),t("ContextMenuButton",t(i.Panel,"Horizontal",T(d),T(l),T(s),T(c)))]}function x(e,n){return n||(n="thickness"),t(i.Shape,"LineH",{width:16,height:16,strokeWidth:e,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:v(n,e),contextClick:v(n,e)})}function P(e,n){return n||(n="dash"),t(i.Shape,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:e,margin:1,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:v(n,e),contextClick:v(n,e)})}function L(){return[t("ContextMenuButton",t(i.Panel,"Horizontal",x(1),x(2),x(3),x(4))),t("ContextMenuButton",t(i.Panel,"Horizontal",P(null),P([2,4]),P([4,4])))]}function C(e,n){return n||(n="figure"),t(i.Shape,{width:32,height:32,scale:.5,fill:"lightgray",figure:e,margin:1,background:"transparent",mouseEnter:function(e,t){return t.fill="dodgerblue"},mouseLeave:function(e,t){return t.fill="lightgray"},click:v(n,e),contextClick:v(n,e)})}function M(e){return t(i.Shape,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(e+4).toString()+" H3"})}function D(e){var n="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return 0===e?n="M0 0 M16 16 M0 8 L16 8":2===e&&(n="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),t(i.Shape,{geometryString:n,margin:2,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:v("dir",e),contextClick:v("dir",e)})}function O(e){var n=function(t,n){t.handled=!0,t.diagram.model.commit((function(t){var o=n.part.adornedPart;t.set(o.data,e?"toSpot":"fromSpot",i.Spot.stringify(i.Spot.AllSides)),(e?o.toNode:o.fromNode).invalidateConnectedLinks()}))};return t(i.Shape,{width:12,height:12,fill:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:n,contextClick:n})}function N(e,n){var o=0,a=i.Spot.RightSide;e.equals(i.Spot.Top)?(o=270,a=i.Spot.TopSide):e.equals(i.Spot.Left)?(o=180,a=i.Spot.LeftSide):e.equals(i.Spot.Bottom)&&(o=90,a=i.Spot.BottomSide),n||(o-=180);var r=function(e,t){e.handled=!0,e.diagram.model.commit((function(e){var o=t.part.adornedPart;e.set(o.data,n?"toSpot":"fromSpot",i.Spot.stringify(a)),(n?o.toNode:o.fromNode).invalidateConnectedLinks()}))};return t(i.Shape,{alignment:e,alignmentFocus:e.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:o,background:"transparent",mouseEnter:function(e,t){return t.background="dodgerblue"},mouseLeave:function(e,t){return t.background="transparent"},click:r,contextClick:r})}return(e=new i.Diagram("myDiagramDiv",{padding:20,grid:t(i.Panel,"Grid",t(i.Shape,"LineH",{stroke:"lightgray",strokeWidth:.5}),t(i.Shape,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:function(e){e.diagram.commandHandler.addTopLevelParts(e.diagram.selection,!0)||e.diagram.currentTool.doCancel()},commandHandler:t(r),"clickCreatingTool.archetypeNodeData":{text:"NEW NODE"},PartCreated:function(e){var t=e.subject;t.location=t.location.copy().snapToGridPoint(e.diagram.grid.gridOrigin,e.diagram.grid.gridCellSize),setTimeout((function(){e.diagram.commandHandler.editTextBlock()}),20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:function(e){e.subject;setTimeout((function(){e.diagram.commandHandler.editTextBlock()}))},LinkRelinked:function(e){e.parameter.part.invalidateConnectedLinks();var t=e.subject;e.diagram.toolManager.linkingTool.isForwards?t.toNode.invalidateConnectedLinks():t.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0})).nodeTemplate=t(i.Node,"Auto",{locationSpot:i.Spot.Center,locationObjectName:"SHAPE",desiredSize:new i.Size(120,60),minSize:new i.Size(40,40),resizable:!0,resizeCellSize:new i.Size(20,20)},new i.Binding("location","loc",i.Point.parse).makeTwoWay(i.Point.stringify),new i.Binding("desiredSize","size",i.Size.parse).makeTwoWay(i.Size.stringify),t(i.Shape,{name:"SHAPE",fill:d,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:i.Spot.AllSides,toSpot:i.Spot.AllSides},new i.Binding("figure"),new i.Binding("fill"),new i.Binding("stroke","color"),new i.Binding("strokeWidth","thickness"),new i.Binding("strokeDashArray","dash")),t(i.Shape,{width:100,height:40,strokeWidth:0,fill:"transparent"}),t(i.TextBlock,{margin:1,textAlign:"center",overflow:i.TextBlock.OverflowEllipsis,editable:!0},new i.Binding("text").makeTwoWay(),new i.Binding("stroke","color"))),e.nodeTemplate.toolTip=t("ToolTip",t(i.Panel,"Vertical",{maxSize:new i.Size(200,NaN)},t(i.TextBlock,{font:"bold 10pt sans-serif",textAlign:"center"},new i.Binding("text")),t(i.TextBlock,{font:"10pt sans-serif",textAlign:"center"},new i.Binding("text","details")))),e.nodeTemplate.selectionAdornmentTemplate=t(i.Adornment,"Spot",t(i.Placeholder,{padding:10}),w(i.Spot.Top,"TriangleUp"),w(i.Spot.Left,"TriangleLeft"),w(i.Spot.Right,"TriangleRight"),w(i.Spot.Bottom,"TriangleDown"),S({alignment:new i.Spot(.75,0)})),e.nodeTemplate.contextMenu=t("ContextMenu",t("ContextMenuButton",t(i.Panel,"Horizontal",C("Rectangle"),C("RoundedRectangle"),C("Ellipse"),C("Diamond"))),t("ContextMenuButton",t(i.Panel,"Horizontal",C("Parallelogram2"),C("ManualOperation"),C("Procedure"),C("Cylinder1"))),t("ContextMenuButton",t(i.Panel,"Horizontal",C("Terminator"),C("CreateRequest"),C("Document"),C("TriangleDown"))),B(),b(),L()),e.groupTemplate=t(i.Group,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:i.Spot.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:function(e,t){t.addMembers(t.diagram.selection,!0)||t.diagram.currentTool.doCancel()},avoidable:!1},new i.Binding("location","loc",i.Point.parse).makeTwoWay(i.Point.stringify),t(i.Panel,"Auto",{name:"BODY"},t(i.Shape,{parameter1:10,fill:d,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:i.Spot.AllSides,toSpot:i.Spot.AllSides},new i.Binding("fill"),new i.Binding("stroke","color"),new i.Binding("strokeWidth","thickness"),new i.Binding("strokeDashArray","dash")),t(i.Placeholder,{background:"transparent",margin:20})),t(i.TextBlock,{alignment:i.Spot.Top,alignmentFocus:i.Spot.Bottom,font:"bold 12pt sans-serif",editable:!0},new i.Binding("text"),new i.Binding("stroke","color"))),e.groupTemplate.selectionAdornmentTemplate=t(i.Adornment,"Spot",t(i.Panel,"Auto",t(i.Shape,{fill:null,stroke:"dodgerblue",strokeWidth:3}),t(i.Placeholder,{margin:1.5})),S({alignment:i.Spot.TopRight,alignmentFocus:i.Spot.BottomRight})),e.groupTemplate.contextMenu=t("ContextMenu",B(),b(),L()),e.linkTemplate=t(i.Link,{layerName:"Foreground",routing:i.Link.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new i.Binding("fromSpot","fromSpot",i.Spot.parse),new i.Binding("toSpot","toSpot",i.Spot.parse),new i.Binding("fromShortLength","dir",(function(e){return e>=1?10:0})),new i.Binding("toShortLength","dir",(function(e){return e>=1?10:0})),new i.Binding("points").makeTwoWay(),t(i.Shape,{strokeWidth:2},new i.Binding("stroke","color"),new i.Binding("strokeWidth","thickness"),new i.Binding("strokeDashArray","dash")),t(i.Shape,{segmentIndex:0,segmentOffset:new i.Point(15,0),segmentOrientation:i.Link.OrientAlong,alignmentFocus:i.Spot.Right,figure:"circle",width:10,strokeWidth:0},new i.Binding("fill","color"),new i.Binding("visible","dir",(function(e){return 1===e}))),t(i.Shape,{segmentIndex:-1,segmentOffset:new i.Point(-10,6),segmentOrientation:i.Link.OrientPlus90,alignmentFocus:i.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new i.Binding("fill","color"),new i.Binding("visible","dir",(function(e){return e>=1})),new i.Binding("width","thickness",(function(e){return 7+3*e})),new i.Binding("height","thickness",(function(e){return 7+3*e})),new i.Binding("segmentOffset","thickness",(function(e){return new i.Point(-15,4+1.5*e)}))),t(i.Shape,{segmentIndex:0,segmentOffset:new i.Point(15,-6),segmentOrientation:i.Link.OrientMinus90,alignmentFocus:i.Spot.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new i.Binding("fill","color"),new i.Binding("visible","dir",(function(e){return 2===e})),new i.Binding("width","thickness",(function(e){return 7+3*e})),new i.Binding("height","thickness",(function(e){return 7+3*e})),new i.Binding("segmentOffset","thickness",(function(e){return new i.Point(-15,4+1.5*e)}))),t(i.TextBlock,{alignmentFocus:new i.Spot(0,1,-4,0),editable:!0},new i.Binding("text").makeTwoWay(),new i.Binding("stroke","color"))),e.linkTemplate.selectionAdornmentTemplate=t(i.Adornment,t(i.Shape,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:M(2)},new i.Binding("pathPattern","thickness",M)),S({alignmentFocus:new i.Spot(0,0,-6,-4)})),e.linkTemplate.contextMenu=t("ContextMenu",b(),L(),t("ContextMenuButton",t(i.Panel,"Horizontal",D(0),D(1),D(2))),t("ContextMenuButton",t(i.Panel,"Horizontal",t(i.Panel,"Spot",O(!1),N(i.Spot.Top,!1),N(i.Spot.Left,!1),N(i.Spot.Right,!1),N(i.Spot.Bottom,!1)),t(i.Panel,"Spot",{margin:new i.Margin(0,0,0,2)},O(!0),N(i.Spot.Top,!0),N(i.Spot.Left,!0),N(i.Spot.Right,!0),N(i.Spot.Bottom,!0))))),e.model=i.Model.fromJson('{ "class": "GraphLinksModel",\n "nodeDataArray": [\n{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},\n{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},\n{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},\n{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},\n{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},\n{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},\n{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},\n{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},\n{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}\n],\n "linkDataArray": [\n{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},\n{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},\n{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},\n{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},\n{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},\n{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},\n{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}\n]}'),e},divClassName:"diagram-component",style:{height:"800px"}}),(0,s.jsx)("div",{id:"myDiagramDiv"})]})}}}]); |