Add files via upload

This commit is contained in:
Scott Sutherland 2024-09-12 17:04:29 -05:00 committed by GitHub
parent e5aae1794f
commit ca59cb533d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 6146 additions and 0 deletions

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,397 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("dagre"));
else if(typeof define === 'function' && define.amd)
define(["dagre"], factory);
else if(typeof exports === 'object')
exports["cytoscapeDagre"] = factory(require("dagre"));
else
root["cytoscapeDagre"] = factory(root["dagre"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE__4__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
var impl = __webpack_require__(1); // registers the extension on a cytoscape lib ref
var register = function register(cytoscape) {
if (!cytoscape) {
return;
} // can't register if cytoscape unspecified
cytoscape('layout', 'dagre', impl); // register with cytoscape.js
};
if (typeof cytoscape !== 'undefined') {
// expose to global cytoscape (i.e. window.cytoscape)
register(cytoscape);
}
module.exports = register;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
var isFunction = function isFunction(o) {
return typeof o === 'function';
};
var defaults = __webpack_require__(2);
var assign = __webpack_require__(3);
var dagre = __webpack_require__(4); // constructor
// options : object containing layout options
function DagreLayout(options) {
this.options = assign({}, defaults, options);
} // runs the layout
DagreLayout.prototype.run = function () {
var options = this.options;
var layout = this;
var cy = options.cy; // cy is automatically populated for us in the constructor
var eles = options.eles;
var getVal = function getVal(ele, val) {
return isFunction(val) ? val.apply(ele, [ele]) : val;
};
var bb = options.boundingBox || {
x1: 0,
y1: 0,
w: cy.width(),
h: cy.height()
};
if (bb.x2 === undefined) {
bb.x2 = bb.x1 + bb.w;
}
if (bb.w === undefined) {
bb.w = bb.x2 - bb.x1;
}
if (bb.y2 === undefined) {
bb.y2 = bb.y1 + bb.h;
}
if (bb.h === undefined) {
bb.h = bb.y2 - bb.y1;
}
var g = new dagre.graphlib.Graph({
multigraph: true,
compound: true
});
var gObj = {};
var setGObj = function setGObj(name, val) {
if (val != null) {
gObj[name] = val;
}
};
setGObj('nodesep', options.nodeSep);
setGObj('edgesep', options.edgeSep);
setGObj('ranksep', options.rankSep);
setGObj('rankdir', options.rankDir);
setGObj('align', options.align);
setGObj('ranker', options.ranker);
setGObj('acyclicer', options.acyclicer);
g.setGraph(gObj);
g.setDefaultEdgeLabel(function () {
return {};
});
g.setDefaultNodeLabel(function () {
return {};
}); // add nodes to dagre
var nodes = eles.nodes();
if (isFunction(options.sort)) {
nodes = nodes.sort(options.sort);
}
for (var i = 0; i < nodes.length; i++) {
var node = nodes[i];
var nbb = node.layoutDimensions(options);
g.setNode(node.id(), {
width: nbb.w,
height: nbb.h,
name: node.id()
}); // console.log( g.node(node.id()) );
} // set compound parents
for (var _i = 0; _i < nodes.length; _i++) {
var _node = nodes[_i];
if (_node.isChild()) {
g.setParent(_node.id(), _node.parent().id());
}
} // add edges to dagre
var edges = eles.edges().stdFilter(function (edge) {
return !edge.source().isParent() && !edge.target().isParent(); // dagre can't handle edges on compound nodes
});
if (isFunction(options.sort)) {
edges = edges.sort(options.sort);
}
for (var _i2 = 0; _i2 < edges.length; _i2++) {
var edge = edges[_i2];
g.setEdge(edge.source().id(), edge.target().id(), {
minlen: getVal(edge, options.minLen),
weight: getVal(edge, options.edgeWeight),
name: edge.id()
}, edge.id()); // console.log( g.edge(edge.source().id(), edge.target().id(), edge.id()) );
}
dagre.layout(g);
var gNodeIds = g.nodes();
for (var _i3 = 0; _i3 < gNodeIds.length; _i3++) {
var id = gNodeIds[_i3];
var n = g.node(id);
cy.getElementById(id).scratch().dagre = n;
}
var dagreBB;
if (options.boundingBox) {
dagreBB = {
x1: Infinity,
x2: -Infinity,
y1: Infinity,
y2: -Infinity
};
nodes.forEach(function (node) {
var dModel = node.scratch().dagre;
dagreBB.x1 = Math.min(dagreBB.x1, dModel.x);
dagreBB.x2 = Math.max(dagreBB.x2, dModel.x);
dagreBB.y1 = Math.min(dagreBB.y1, dModel.y);
dagreBB.y2 = Math.max(dagreBB.y2, dModel.y);
});
dagreBB.w = dagreBB.x2 - dagreBB.x1;
dagreBB.h = dagreBB.y2 - dagreBB.y1;
} else {
dagreBB = bb;
}
var constrainPos = function constrainPos(p) {
if (options.boundingBox) {
var xPct = dagreBB.w === 0 ? 0 : (p.x - dagreBB.x1) / dagreBB.w;
var yPct = dagreBB.h === 0 ? 0 : (p.y - dagreBB.y1) / dagreBB.h;
return {
x: bb.x1 + xPct * bb.w,
y: bb.y1 + yPct * bb.h
};
} else {
return p;
}
};
nodes.layoutPositions(layout, options, function (ele) {
ele = _typeof(ele) === "object" ? ele : this;
var dModel = ele.scratch().dagre;
return constrainPos({
x: dModel.x,
y: dModel.y
});
});
return this; // chaining
};
module.exports = DagreLayout;
/***/ }),
/* 2 */
/***/ (function(module, exports) {
var defaults = {
// dagre algo options, uses default value on undefined
nodeSep: undefined,
// the separation between adjacent nodes in the same rank
edgeSep: undefined,
// the separation between adjacent edges in the same rank
rankSep: undefined,
// the separation between adjacent nodes in the same rank
rankDir: undefined,
// 'TB' for top to bottom flow, 'LR' for left to right,
align: undefined,
// alignment for rank nodes. Can be 'UL', 'UR', 'DL', or 'DR', where U = up, D = down, L = left, and R = right
acyclicer: undefined,
// If set to 'greedy', uses a greedy heuristic for finding a feedback arc set for a graph.
// A feedback arc set is a set of edges that can be removed to make a graph acyclic.
ranker: undefined,
// Type of algorithm to assigns a rank to each node in the input graph.
// Possible values: network-simplex, tight-tree or longest-path
minLen: function minLen(edge) {
return 1;
},
// number of ranks to keep between the source and target of the edge
edgeWeight: function edgeWeight(edge) {
return 1;
},
// higher weight edges are generally made shorter and straighter than lower weight edges
// general layout options
fit: true,
// whether to fit to viewport
padding: 30,
// fit padding
spacingFactor: undefined,
// Applies a multiplicative factor (>0) to expand or compress the overall area that the nodes take up
nodeDimensionsIncludeLabels: false,
// whether labels should be included in determining the space used by a node
animate: false,
// whether to transition the node positions
animateFilter: function animateFilter(node, i) {
return true;
},
// whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions
animationDuration: 500,
// duration of animation in ms if enabled
animationEasing: undefined,
// easing of animation if enabled
boundingBox: undefined,
// constrain layout bounds; { x1, y1, x2, y2 } or { x1, y1, w, h }
transform: function transform(node, pos) {
return pos;
},
// a function that applies a transform to the final node position
ready: function ready() {},
// on layoutready
sort: undefined,
// a sorting function to order the nodes and edges; e.g. function(a, b){ return a.data('weight') - b.data('weight') }
// because cytoscape dagre creates a directed graph, and directed graphs use the node order as a tie breaker when
// defining the topology of a graph, this sort function can help ensure the correct order of the nodes/edges.
// this feature is most useful when adding and removing the same nodes and edges multiple times in a graph.
stop: function stop() {} // on layoutstop
};
module.exports = defaults;
/***/ }),
/* 3 */
/***/ (function(module, exports) {
// Simple, internal Object.assign() polyfill for options objects etc.
module.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {
for (var _len = arguments.length, srcs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
srcs[_key - 1] = arguments[_key];
}
srcs.forEach(function (src) {
Object.keys(src).forEach(function (k) {
return tgt[k] = src[k];
});
});
return tgt;
};
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE__4__;
/***/ })
/******/ ]);
});

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,470 @@
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("klayjs"));
else if(typeof define === 'function' && define.amd)
define(["klayjs"], factory);
else if(typeof exports === 'object')
exports["cytoscapeKlay"] = factory(require("klayjs"));
else
root["cytoscapeKlay"] = factory(root["$klay"]);
})(this, function(__WEBPACK_EXTERNAL_MODULE_4__) {
return /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // identity function for calling harmony imports with the correct context
/******/ __webpack_require__.i = function(value) { return value; };
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, {
/******/ configurable: false,
/******/ enumerable: true,
/******/ get: getter
/******/ });
/******/ }
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 3);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var klay = __webpack_require__(4);
var assign = __webpack_require__(1);
var defaults = __webpack_require__(2);
var klayNSLookup = {
'addUnnecessaryBendpoints': 'de.cau.cs.kieler.klay.layered.unnecessaryBendpoints',
'alignment': 'de.cau.cs.kieler.alignment',
'aspectRatio': 'de.cau.cs.kieler.aspectRatio',
'borderSpacing': 'borderSpacing',
'compactComponents': 'de.cau.cs.kieler.klay.layered.components.compact',
'compactionStrategy': 'de.cau.cs.kieler.klay.layered.nodeplace.compactionStrategy',
'contentAlignment': 'de.cau.cs.kieler.klay.layered.contentAlignment',
'crossingMinimization': 'de.cau.cs.kieler.klay.layered.crossMin',
'cycleBreaking': 'de.cau.cs.kieler.klay.layered.cycleBreaking',
'debugMode': 'de.cau.cs.kieler.debugMode',
'direction': 'de.cau.cs.kieler.direction',
'edgeLabelSideSelection': 'de.cau.cs.kieler.klay.layered.edgeLabelSideSelection',
// <broken> 'de.cau.cs.kieler.klay.layered.edgeNodeSpacingFactor': options.edgeNodeSpacingFactor,
'edgeRouting': 'de.cau.cs.kieler.edgeRouting',
'edgeSpacingFactor': 'de.cau.cs.kieler.klay.layered.edgeSpacingFactor',
'feedbackEdges': 'de.cau.cs.kieler.klay.layered.feedBackEdges',
'fixedAlignment': 'de.cau.cs.kieler.klay.layered.fixedAlignment',
'greedySwitchCrossingMinimization': 'de.cau.cs.kieler.klay.layered.greedySwitch',
'hierarchyHandling': 'de.cau.cs.kieler.hierarchyHandling',
'inLayerSpacingFactor': 'de.cau.cs.kieler.klay.layered.inLayerSpacingFactor',
'interactiveReferencePoint': 'de.cau.cs.kieler.klay.layered.interactiveReferencePoint',
'layerConstraint': 'de.cau.cs.kieler.klay.layered.layerConstraint',
'layoutHierarchy': 'de.cau.cs.kieler.layoutHierarchy',
'linearSegmentsDeflectionDampening': 'de.cau.cs.kieler.klay.layered.linearSegmentsDeflectionDampening',
'mergeEdges': 'de.cau.cs.kieler.klay.layered.mergeEdges',
'mergeHierarchyCrossingEdges': 'de.cau.cs.kieler.klay.layered.mergeHierarchyEdges',
'noLayout': 'de.cau.cs.kieler.noLayout',
'nodeLabelPlacement': 'de.cau.cs.kieler.nodeLabelPlacement',
'nodeLayering': 'de.cau.cs.kieler.klay.layered.nodeLayering',
'nodePlacement': 'de.cau.cs.kieler.klay.layered.nodePlace',
'portAlignment': 'de.cau.cs.kieler.portAlignment',
'portAlignmentEastern': 'de.cau.cs.kieler.portAlignment.east',
'portAlignmentNorth': 'de.cau.cs.kieler.portAlignment.north',
'portAlignmentSouth': 'de.cau.cs.kieler.portAlignment.south',
'portAlignmentWest': 'de.cau.cs.kieler.portAlignment.west',
'portConstraints': 'de.cau.cs.kieler.portConstraints',
'portLabelPlacement': 'de.cau.cs.kieler.portLabelPlacement',
'portOffset': 'de.cau.cs.kieler.offset',
'portSide': 'de.cau.cs.kieler.portSide',
'portSpacing': 'de.cau.cs.kieler.portSpacing',
'postCompaction': 'de.cau.cs.kieler.klay.layered.postCompaction',
'priority': 'de.cau.cs.kieler.priority',
'randomizationSeed': 'de.cau.cs.kieler.randomSeed',
'routeSelfLoopInside': 'de.cau.cs.kieler.selfLoopInside',
'separateConnectedComponents': 'de.cau.cs.kieler.separateConnComp',
'sizeConstraint': 'de.cau.cs.kieler.sizeConstraint',
'sizeOptions': 'de.cau.cs.kieler.sizeOptions',
'spacing': 'de.cau.cs.kieler.spacing',
'splineSelfLoopPlacement': 'de.cau.cs.kieler.klay.layered.splines.selfLoopPlacement',
'thoroughness': 'de.cau.cs.kieler.klay.layered.thoroughness',
'wideNodesOnMultipleLayers': 'de.cau.cs.kieler.klay.layered.wideNodesOnMultipleLayers'
};
var mapToKlayNS = function mapToKlayNS(klayOpts) {
var keys = Object.keys(klayOpts);
var ret = {};
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
var nsKey = klayNSLookup[key];
var val = klayOpts[key];
ret[nsKey] = val;
}
return ret;
};
var klayOverrides = {
interactiveReferencePoint: 'CENTER' // Determines which point of a node is considered by interactive layout phases.
};
var getPos = function getPos(ele) {
var parent = ele.parent();
var k = ele.scratch('klay');
var p = {
x: k.x,
y: k.y
};
while (parent.nonempty()) {
var kp = parent.scratch('klay');
p.x += kp.x;
p.y += kp.y;
parent = parent.parent();
}
return p;
};
var makeNode = function makeNode(node, options) {
var dims = node.layoutDimensions(options);
var padding = node.numericStyle('padding');
var k = {
_cyEle: node,
id: node.id(),
padding: {
top: padding,
left: padding,
bottom: padding,
right: padding
}
};
if (!node.isParent()) {
k.width = dims.w;
k.height = dims.h;
}
node.scratch('klay', k);
return k;
};
var makeEdge = function makeEdge(edge, options) {
var k = {
_cyEle: edge,
id: edge.id(),
source: edge.data('source'),
target: edge.data('target'),
properties: {}
};
var priority = options.priority(edge);
if (priority != null) {
k.properties.priority = priority;
}
edge.scratch('klay', k);
return k;
};
var makeGraph = function makeGraph(nodes, edges, options) {
var klayNodes = [];
var klayEdges = [];
var klayEleLookup = {};
var graph = {
id: 'root',
children: [],
edges: []
};
// map all nodes
for (var i = 0; i < nodes.length; i++) {
var n = nodes[i];
var k = makeNode(n, options);
klayNodes.push(k);
klayEleLookup[n.id()] = k;
}
// map all edges
for (var _i = 0; _i < edges.length; _i++) {
var e = edges[_i];
var _k = makeEdge(e, options);
klayEdges.push(_k);
klayEleLookup[e.id()] = _k;
}
// make hierarchy
for (var _i2 = 0; _i2 < klayNodes.length; _i2++) {
var _k2 = klayNodes[_i2];
var _n = _k2._cyEle;
if (!_n.isChild()) {
graph.children.push(_k2);
} else {
var parent = _n.parent();
var parentK = klayEleLookup[parent.id()];
var children = parentK.children = parentK.children || [];
children.push(_k2);
}
}
for (var _i3 = 0; _i3 < klayEdges.length; _i3++) {
var _k3 = klayEdges[_i3];
var _e = _k3._cyEle;
var parentSrc = _e.source().parent();
var parentTgt = _e.target().parent();
// put all edges in the top level for now
// TODO does this cause issues in certain edgecases?
if (false) {
var kp = klayEleLookup[parentSrc.id()];
kp.edges = kp.edges || [];
kp.edges.push(_k3);
} else {
graph.edges.push(_k3);
}
}
return graph;
};
function Layout(options) {
var klayOptions = options.klay;
this.options = assign({}, defaults, options);
this.options.klay = assign({}, defaults.klay, klayOptions, klayOverrides);
}
Layout.prototype.run = function () {
var layout = this;
var options = this.options;
var eles = options.eles;
var nodes = eles.nodes();
var edges = eles.edges();
var graph = makeGraph(nodes, edges, options);
klay.layout({
graph: graph,
options: mapToKlayNS(options.klay),
success: function success() {},
error: function error(_error) {
throw _error;
}
});
nodes.filter(function (n) {
return !n.isParent();
}).layoutPositions(layout, options, getPos);
return this;
};
Layout.prototype.stop = function () {
return this; // chaining
};
Layout.prototype.destroy = function () {
return this; // chaining
};
module.exports = Layout;
/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
// Simple, internal Object.assign() polyfill for options objects etc.
module.exports = Object.assign != null ? Object.assign.bind(Object) : function (tgt) {
for (var _len = arguments.length, srcs = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
srcs[_key - 1] = arguments[_key];
}
srcs.filter(function (src) {
return src != null;
}).forEach(function (src) {
Object.keys(src).forEach(function (k) {
return tgt[k] = src[k];
});
});
return tgt;
};
/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var defaults = {
nodeDimensionsIncludeLabels: false, // Boolean which changes whether label dimensions are included when calculating node dimensions
fit: true, // Whether to fit
padding: 20, // Padding on fit
animate: false, // Whether to transition the node positions
animateFilter: function animateFilter(node, i) {
return true;
}, // Whether to animate specific nodes when animation is on; non-animated nodes immediately go to their final positions
animationDuration: 500, // Duration of animation in ms if enabled
animationEasing: undefined, // Easing of animation if enabled
transform: function transform(node, pos) {
return pos;
}, // A function that applies a transform to the final node position
ready: undefined, // Callback on layoutready
stop: undefined, // Callback on layoutstop
klay: {
// Following descriptions taken from http://layout.rtsys.informatik.uni-kiel.de:9444/Providedlayout.html?algorithm=de.cau.cs.kieler.klay.layered
addUnnecessaryBendpoints: false, // Adds bend points even if an edge does not change direction.
aspectRatio: 1.6, // The aimed aspect ratio of the drawing, that is the quotient of width by height
borderSpacing: 20, // Minimal amount of space to be left to the border
compactComponents: false, // Tries to further compact components (disconnected sub-graphs).
crossingMinimization: 'LAYER_SWEEP', // Strategy for crossing minimization.
/* LAYER_SWEEP The layer sweep algorithm iterates multiple times over the layers, trying to find node orderings that minimize the number of crossings. The algorithm uses randomization to increase the odds of finding a good result. To improve its results, consider increasing the Thoroughness option, which influences the number of iterations done. The Randomization seed also influences results.
INTERACTIVE Orders the nodes of each layer by comparing their positions before the layout algorithm was started. The idea is that the relative order of nodes as it was before layout was applied is not changed. This of course requires valid positions for all nodes to have been set on the input graph before calling the layout algorithm. The interactive layer sweep algorithm uses the Interactive Reference Point option to determine which reference point of nodes are used to compare positions. */
cycleBreaking: 'GREEDY', // Strategy for cycle breaking. Cycle breaking looks for cycles in the graph and determines which edges to reverse to break the cycles. Reversed edges will end up pointing to the opposite direction of regular edges (that is, reversed edges will point left if edges usually point right).
/* GREEDY This algorithm reverses edges greedily. The algorithm tries to avoid edges that have the Priority property set.
INTERACTIVE The interactive algorithm tries to reverse edges that already pointed leftwards in the input graph. This requires node and port coordinates to have been set to sensible values.*/
direction: 'UNDEFINED', // Overall direction of edges: horizontal (right / left) or vertical (down / up)
/* UNDEFINED, RIGHT, LEFT, DOWN, UP */
edgeRouting: 'ORTHOGONAL', // Defines how edges are routed (POLYLINE, ORTHOGONAL, SPLINES)
edgeSpacingFactor: 0.5, // Factor by which the object spacing is multiplied to arrive at the minimal spacing between edges.
feedbackEdges: false, // Whether feedback edges should be highlighted by routing around the nodes.
fixedAlignment: 'NONE', // Tells the BK node placer to use a certain alignment instead of taking the optimal result. This option should usually be left alone.
/* NONE Chooses the smallest layout from the four possible candidates.
LEFTUP Chooses the left-up candidate from the four possible candidates.
RIGHTUP Chooses the right-up candidate from the four possible candidates.
LEFTDOWN Chooses the left-down candidate from the four possible candidates.
RIGHTDOWN Chooses the right-down candidate from the four possible candidates.
BALANCED Creates a balanced layout from the four possible candidates. */
inLayerSpacingFactor: 1.0, // Factor by which the usual spacing is multiplied to determine the in-layer spacing between objects.
layoutHierarchy: false, // Whether the selected layouter should consider the full hierarchy
linearSegmentsDeflectionDampening: 0.3, // Dampens the movement of nodes to keep the diagram from getting too large.
mergeEdges: false, // Edges that have no ports are merged so they touch the connected nodes at the same points.
mergeHierarchyCrossingEdges: true, // If hierarchical layout is active, hierarchy-crossing edges use as few hierarchical ports as possible.
nodeLayering: 'NETWORK_SIMPLEX', // Strategy for node layering.
/* NETWORK_SIMPLEX This algorithm tries to minimize the length of edges. This is the most computationally intensive algorithm. The number of iterations after which it aborts if it hasn't found a result yet can be set with the Maximal Iterations option.
LONGEST_PATH A very simple algorithm that distributes nodes along their longest path to a sink node.
INTERACTIVE Distributes the nodes into layers by comparing their positions before the layout algorithm was started. The idea is that the relative horizontal order of nodes as it was before layout was applied is not changed. This of course requires valid positions for all nodes to have been set on the input graph before calling the layout algorithm. The interactive node layering algorithm uses the Interactive Reference Point option to determine which reference point of nodes are used to compare positions. */
nodePlacement: 'BRANDES_KOEPF', // Strategy for Node Placement
/* BRANDES_KOEPF Minimizes the number of edge bends at the expense of diagram size: diagrams drawn with this algorithm are usually higher than diagrams drawn with other algorithms.
LINEAR_SEGMENTS Computes a balanced placement.
INTERACTIVE Tries to keep the preset y coordinates of nodes from the original layout. For dummy nodes, a guess is made to infer their coordinates. Requires the other interactive phase implementations to have run as well.
SIMPLE Minimizes the area at the expense of... well, pretty much everything else. */
randomizationSeed: 1, // Seed used for pseudo-random number generators to control the layout algorithm; 0 means a new seed is generated
routeSelfLoopInside: false, // Whether a self-loop is routed around or inside its node.
separateConnectedComponents: true, // Whether each connected component should be processed separately
spacing: 20, // Overall setting for the minimal amount of space to be left between objects
thoroughness: 7 // How much effort should be spent to produce a nice layout..
},
priority: function priority(edge) {
return null;
} // Edges with a non-nil value are skipped when geedy edge cycle breaking is enabled
};
module.exports = defaults;
/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
var impl = __webpack_require__(0);
// registers the extension on a cytoscape lib ref
var register = function register(cytoscape) {
if (!cytoscape) {
return;
} // can't register if cytoscape unspecified
cytoscape('layout', 'klay', impl); // register with cytoscape.js
};
if (typeof cytoscape !== 'undefined') {
// expose to global cytoscape (i.e. window.cytoscape)
register(cytoscape);
}
module.exports = register;
/***/ }),
/* 4 */
/***/ (function(module, exports) {
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
/***/ })
/******/ ]);
});

32
Scripts/JavaScript/cytoscape.min.js vendored Normal file

File diff suppressed because one or more lines are too long

3809
Scripts/JavaScript/dagre.min.js vendored Normal file

File diff suppressed because one or more lines are too long