-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcytoscape-dagre.min.js
More file actions
8 lines (8 loc) · 4.44 KB
/
cytoscape-dagre.min.js
File metadata and controls
8 lines (8 loc) · 4.44 KB
1
2
3
4
5
6
7
8
/**
* Minified by jsDelivr using Terser v5.37.0.
* Original file: /npm/cytoscape-dagre@2.5.0/cytoscape-dagre.js
*
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
*/
!function(e,n){"object"==typeof exports&&"object"==typeof module?module.exports=n(require("dagre")):"function"==typeof define&&define.amd?define(["dagre"],n):"object"==typeof exports?exports.cytoscapeDagre=n(require("dagre")):e.cytoscapeDagre=n(e.dagre)}(this,(function(e){return function(e){var n={};function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(n){return e[n]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},t.p="",t(t.s=0)}([function(e,n,t){var r=t(1),o=function(e){e&&e("layout","dagre",r)};"undefined"!=typeof cytoscape&&o(cytoscape),e.exports=o},function(e,n,t){function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}var o=function(e){return"function"==typeof e},i=t(2),a=t(3),u=t(4);function c(e){this.options=a({},i,e)}c.prototype.run=function(){var e=this.options,n=e.cy,t=e.eles,i=function(e,n){return o(n)?n.apply(e,[e]):n},a=e.boundingBox||{x1:0,y1:0,w:n.width(),h:n.height()};void 0===a.x2&&(a.x2=a.x1+a.w),void 0===a.w&&(a.w=a.x2-a.x1),void 0===a.y2&&(a.y2=a.y1+a.h),void 0===a.h&&(a.h=a.y2-a.y1);var c=new u.graphlib.Graph({multigraph:!0,compound:!0}),d={},f=function(e,n){null!=n&&(d[e]=n)};f("nodesep",e.nodeSep),f("edgesep",e.edgeSep),f("ranksep",e.rankSep),f("rankdir",e.rankDir),f("align",e.align),f("ranker",e.ranker),f("acyclicer",e.acyclicer),c.setGraph(d),c.setDefaultEdgeLabel((function(){return{}})),c.setDefaultNodeLabel((function(){return{}}));var s=t.nodes();o(e.sort)&&(s=s.sort(e.sort));for(var y=0;y<s.length;y++){var l=s[y],p=l.layoutDimensions(e);c.setNode(l.id(),{width:p.w,height:p.h,name:l.id()})}for(var g=0;g<s.length;g++){var h=s[g];h.isChild()&&c.setParent(h.id(),h.parent().id())}var v=t.edges().stdFilter((function(e){return!e.source().isParent()&&!e.target().isParent()}));o(e.sort)&&(v=v.sort(e.sort));for(var x=0;x<v.length;x++){var b=v[x];c.setEdge(b.source().id(),b.target().id(),{minlen:i(b,e.minLen),weight:i(b,e.edgeWeight),name:b.id()},b.id())}u.layout(c);for(var m,S=c.nodes(),j=0;j<S.length;j++){var w=S[j],O=c.node(w);n.getElementById(w).scratch().dagre=O}e.boundingBox?(m={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0},s.forEach((function(e){var n=e.scratch().dagre;m.x1=Math.min(m.x1,n.x),m.x2=Math.max(m.x2,n.x),m.y1=Math.min(m.y1,n.y),m.y2=Math.max(m.y2,n.y)})),m.w=m.x2-m.x1,m.h=m.y2-m.y1):m=a;return s.layoutPositions(this,e,(function(n){var t=(n="object"===r(n)?n:this).scratch().dagre;return function(n){if(e.boundingBox){var t=0===m.w?0:(n.x-m.x1)/m.w,r=0===m.h?0:(n.y-m.y1)/m.h;return{x:a.x1+t*a.w,y:a.y1+r*a.h}}return n}({x:t.x,y:t.y})})),this},e.exports=c},function(e,n){var t={nodeSep:void 0,edgeSep:void 0,rankSep:void 0,rankDir:void 0,align:void 0,acyclicer:void 0,ranker:void 0,minLen:function(e){return 1},edgeWeight:function(e){return 1},fit:!0,padding:30,spacingFactor:void 0,nodeDimensionsIncludeLabels:!1,animate:!1,animateFilter:function(e,n){return!0},animationDuration:500,animationEasing:void 0,boundingBox:void 0,transform:function(e,n){return n},ready:function(){},sort:void 0,stop:function(){}};e.exports=t},function(e,n){e.exports=null!=Object.assign?Object.assign.bind(Object):function(e){for(var n=arguments.length,t=new Array(n>1?n-1:0),r=1;r<n;r++)t[r-1]=arguments[r];return t.forEach((function(n){Object.keys(n).forEach((function(t){return e[t]=n[t]}))})),e}},function(n,t){n.exports=e}])}));
//# sourceMappingURL=/sm/ab0d5f70f38f0c419b568ba8a2aacc228dcda8b4c69c3ad59680a3ee9e63a6d0.map