-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjoint.shapes.devs.min.js
More file actions
15 lines (8 loc) · 2.86 KB
/
joint.shapes.devs.min.js
File metadata and controls
15 lines (8 loc) · 2.86 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*! Rappid v3.1.1 - HTML5 Diagramming Framework - TRIAL VERSION
Copyright (c) 2015 client IO
2020-06-11
This Source Code Form is subject to the terms of the Rappid Trial License
, v. 2.0. If a copy of the Rappid License was not distributed with this
file, You can obtain one at http://jointjs.com/license/rappid_v2.txt
or from the Rappid archive as was distributed by client IO. See the LICENSE file.*/
this.joint=this.joint||{},this.joint.shapes=this.joint.shapes||{},function(t,e,r,a){"use strict";var o=e.Generic.define("devs.Model",{inPorts:[],outPorts:[],size:{width:80,height:80},attrs:{".":{magnet:!1},".label":{text:"Model","ref-x":.5,"ref-y":10,"font-size":18,"text-anchor":"middle",fill:"#000"},".body":{"ref-width":"100%","ref-height":"100%",stroke:"#000"}},ports:{groups:{in:{position:{name:"left"},attrs:{".port-label":{fill:"#000"},".port-body":{fill:"#fff",stroke:"#000",r:10,magnet:!0}},label:{position:{name:"left",args:{y:10}}}},out:{position:{name:"right"},attrs:{".port-label":{fill:"#000"},".port-body":{fill:"#fff",stroke:"#000",r:10,magnet:!0}},label:{position:{name:"right",args:{y:10}}}}}}},{markup:'<g class="rotatable"><rect class="body"/><text class="label"/></g>',portMarkup:'<circle class="port-body"/>',portLabelMarkup:'<text class="port-label"/>',initialize:function(){e.Generic.prototype.initialize.apply(this,arguments),this.on("change:inPorts change:outPorts",this.updatePortItems,this),this.updatePortItems()},updatePortItems:function(t,e,r){var o=a.uniq(this.get("inPorts")),i=a.difference(a.uniq(this.get("outPorts")),o),s=this.createPortItems("in",o),n=this.createPortItems("out",i);this.prop("ports/items",s.concat(n),a.assign({rewrite:!0},r))},createPortItem:function(t,e){return{id:e,group:t,attrs:{".port-label":{text:e}}}},createPortItems:function(t,e){return a.toArray(e).map(this.createPortItem.bind(this,t))},_addGroupPort:function(t,e,r){var o=this.get(e);return this.set(e,Array.isArray(o)?o.concat(t):[t],r)},addOutPort:function(t,e){return this._addGroupPort(t,"outPorts",e)},addInPort:function(t,e){return this._addGroupPort(t,"inPorts",e)},_removeGroupPort:function(t,e,r){return this.set(e,a.without(this.get(e),t),r)},removeOutPort:function(t,e){return this._removeGroupPort(t,"outPorts",e)},removeInPort:function(t,e){return this._removeGroupPort(t,"inPorts",e)},_changeGroup:function(t,e,r){return this.prop("ports/groups/"+t,a.isObject(e)?e:{},r)},changeInGroup:function(t,e){return this._changeGroup("in",t,e)},changeOutGroup:function(t,e){return this._changeGroup("out",t,e)}}),i=o.define("devs.Atomic",{size:{width:80,height:80},attrs:{".label":{text:"Atomic"}}}),s=o.define("devs.Coupled",{size:{width:200,height:300},attrs:{".label":{text:"Coupled"}}}),n=r.Link.define("devs.Link",{attrs:{".connection":{"stroke-width":2}}});t.Atomic=i,t.Coupled=s,t.Link=n,t.Model=o}(this.joint.shapes.devs=this.joint.shapes.devs||{},joint.shapes.basic,joint.dia,joint.util);