Switch to ELK layout engine for proper compound node support
This commit is contained in:
BIN
.config.yaml.swp
BIN
.config.yaml.swp
Binary file not shown.
90
config.yaml
90
config.yaml
@@ -1,11 +1,97 @@
|
||||
locations:
|
||||
booth:
|
||||
children:
|
||||
shared:
|
||||
nodes:
|
||||
- satellite-1
|
||||
|
||||
qlab:
|
||||
nodes:
|
||||
- qlab
|
||||
- TX-QLAB-1
|
||||
- TX-QLAB-2
|
||||
- "SK_PTZEXTREMEV2 [457081]"
|
||||
- "SK_RACKPRO2 [452514]"
|
||||
- "d0:11:e5:17:03:0b" # pigeon
|
||||
|
||||
audio:
|
||||
nodes:
|
||||
- SQ-7
|
||||
|
||||
camera-control:
|
||||
nodes:
|
||||
- RX-CC-PREVIEW
|
||||
- RX-CC-M16
|
||||
|
||||
video-control:
|
||||
nodes:
|
||||
- RX-VC-M4
|
||||
- RX-VC-M16
|
||||
|
||||
control:
|
||||
nodes:
|
||||
- "sunset.local"
|
||||
- RX-CONTROL-1
|
||||
|
||||
house-left:
|
||||
nodes:
|
||||
- satellite-2
|
||||
|
||||
house-right:
|
||||
nodes:
|
||||
- satellite-3
|
||||
|
||||
stage:
|
||||
children:
|
||||
|
||||
upstage:
|
||||
nodes:
|
||||
- lighting-2
|
||||
children:
|
||||
|
||||
rack-lighting-2:
|
||||
nodes:
|
||||
- lighting-2
|
||||
- "48:59:00:41:00:29" # Pixie Driver 8k Port 1
|
||||
- "48:59:00:28:00:27" # Pixie Driver 8k Port 2
|
||||
- "48:59:00:3c:00:3e" # Pixie Driver 8k Port 5
|
||||
|
||||
downstage:
|
||||
children:
|
||||
rack-audio:
|
||||
nodes:
|
||||
- audio
|
||||
- "MICS-A"
|
||||
- "00:0e:dd:a7:29:93" # MICS-A bridge interface
|
||||
- "MICS-B"
|
||||
- "00:0e:dd:a8:3e:b3" # MICS-B bridge interface
|
||||
- "MICS-C"
|
||||
- "00:0e:dd:a7:6f:55" # MICS-C bridge interface
|
||||
- "MICS-D"
|
||||
- "00:0e:dd:64:3d:51" # MICS-D bridge interface
|
||||
- "MICS-E"
|
||||
- "00:0e:dd:ac:fc:7d" # MICS-E bridge interface
|
||||
|
||||
rack-lighting-1:
|
||||
nodes:
|
||||
- lighting-1
|
||||
- "48:59:00:27:00:27" # Pixie Driver 8k Port 1
|
||||
- "48:59:00:37:00:27" # Pixie Driver 8k Port 2
|
||||
- "48:59:00:3e:00:27" # Pixie Driver 8k Port 3
|
||||
- "48:59:00:3f:00:27" # Pixie Driver 8k Port 4
|
||||
- "48:59:00:47:00:1a" # Pixie Driver 8k Port 5
|
||||
- "48:59:00:44:00:1a" # Pixie Driver 8k Port 6
|
||||
- "48:59:00:42:00:19" # Pixie Driver 8k Port 7
|
||||
- "48:59:00:44:00:19" # Pixie Driver 8k Port 8
|
||||
|
||||
rack-video:
|
||||
nodes:
|
||||
- video
|
||||
- "ATEM 2 M/E Constellation 4K"
|
||||
- "HyperDeck Studio 4K Pro"
|
||||
- RX-QLAB-1
|
||||
- RX-QLAB-2
|
||||
- TX-PROJ-1
|
||||
- TX-PROJ-2
|
||||
- TX-M4
|
||||
- TX-M16
|
||||
- TX-MISC
|
||||
- TX-PREVIEW
|
||||
|
||||
8
static/cytoscape-elk.min.js
vendored
Normal file
8
static/cytoscape-elk.min.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Minified by jsDelivr using Terser v5.39.0.
|
||||
* Original file: /npm/cytoscape-elk@2.2.0/dist/cytoscape-elk.js
|
||||
*
|
||||
* Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
|
||||
*/
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("elkjs")):"function"==typeof define&&define.amd?define(["elkjs"],e):"object"==typeof exports?exports.cytoscapeElk=e(require("elkjs")):t.cytoscapeElk=e(t.ELK)}(this,(function(t){return function(){"use strict";var e={245:function(e){e.exports=t}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t](i,i.exports,r),i.exports}r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var o={};return function(){r.d(o,{default:function(){return p}});var t=r(245),e=r.n(t);var n=null!=Object.assign?Object.assign.bind(Object):function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.forEach((function(e){Object.keys(e).forEach((function(n){return t[n]=e[n]}))})),t},i={nodeDimensionsIncludeLabels:!1,fit:!0,padding:20,animate:!1,animateFilter:function(){return!0},animationDuration:500,animationEasing:void 0,transform:function(t,e){return e},ready:void 0,stop:void 0,nodeLayoutOptions:void 0,elk:{algorithm:void 0},priority:function(){return null}};function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var u={},c=function(t,e){var n={_cyEle:t,id:t.id()};if(e.nodeLayoutOptions&&(n.layoutOptions=e.nodeLayoutOptions(t)),!t.isParent()){var r=t.layoutDimensions(e),o=t.position();n.x=o.x-r.w/2,n.y=o.y-r.h/2,n.width=r.w,n.height=r.h}return t.scratch("elk",n),n},s=function(t){var e={_cyEle:t,id:t.id(),source:t.data("source"),target:t.data("target")};return t.scratch("elk",e),e},f=function(){function t(e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var r=e.elk,o=e.cy;this.options=n({},i,e),this.options.elk=n({aspectRatio:o.width()/o.height()},i.elk,r,u)}var r,o,f;return r=t,o=[{key:"run",value:function(){var t=this,n=this.options,r=n.eles,o=r.nodes(),i=r.edges(),a=new(e()),u=function(t,e,n){for(var r=[],o=[],i={},a={id:"root",children:[],edges:[]},u=0;u<t.length;u++){var f=t[u],l=c(f,n);r.push(l),i[f.id()]=l}for(var d=0;d<e.length;d++){var p=e[d],y=s(p);o.push(y),i[p.id()]=y}for(var h=0;h<r.length;h++){var v=r[h],g=v._cyEle;if(g.isChild()){var k=i[g.parent().id()];(k.children=k.children||[]).push(v)}else a.children.push(v)}for(var b=0;b<o.length;b++){var m=o[b];a.edges.push(m)}return a}(o,i,n);return u.layoutOptions=n.elk,a.layout(u).then((function(){o.filter((function(t){return!t.isParent()})).layoutPositions(t,n,(function(t){return function(t,e){for(var n=t.layoutDimensions(e),r=t.parent(),o=t.scratch("elk"),i={x:o.x,y:o.y};r.nonempty();){var a=r.scratch("elk");i.x+=a.x,i.y+=a.y,r=r.parent()}return i.x+=n.w/2,i.y+=n.h/2,i}(t,n)}))})),this}},{key:"stop",value:function(){return this}},{key:"destroy",value:function(){return this}}],o&&a(r.prototype,o),f&&a(r,f),Object.defineProperty(r,"prototype",{writable:!1}),t}(),l=f,d=function(t){t&&t("layout","elk",l)};"undefined"!=typeof cytoscape&&d(cytoscape);var p=d}(),o=o.default}()}));
|
||||
//# sourceMappingURL=/sm/34a9798ae1315f03be558b9d20c4eec77955798bd7e8ff309e6c6add909ebe73.map
|
||||
6696
static/elk.bundled.js
Normal file
6696
static/elk.bundled.js
Normal file
File diff suppressed because one or more lines are too long
@@ -47,10 +47,10 @@
|
||||
<div id="cy"></div>
|
||||
|
||||
<script src="cytoscape.min.js"></script>
|
||||
<script src="cola.min.js"></script>
|
||||
<script src="cytoscape-cola.min.js"></script>
|
||||
<script src="elk.bundled.js"></script>
|
||||
<script src="cytoscape-elk.min.js"></script>
|
||||
<script>
|
||||
cytoscape.use(cytoscapeCola);
|
||||
cytoscape.use(cytoscapeElk);
|
||||
let cy;
|
||||
|
||||
function getLabel(node) {
|
||||
@@ -106,15 +106,20 @@
|
||||
|
||||
function doLayout() {
|
||||
cy.layout({
|
||||
name: 'cola',
|
||||
animate: false,
|
||||
name: 'elk',
|
||||
fit: true,
|
||||
padding: 50,
|
||||
nodeDimensionsIncludeLabels: true,
|
||||
avoidOverlap: true,
|
||||
nodeSpacing: 40,
|
||||
edgeLength: 200,
|
||||
fit: true,
|
||||
randomize: true
|
||||
elk: {
|
||||
algorithm: 'layered',
|
||||
'elk.direction': 'DOWN',
|
||||
'elk.spacing.nodeNode': 80,
|
||||
'elk.spacing.edgeNode': 40,
|
||||
'elk.spacing.edgeEdge': 30,
|
||||
'elk.layered.spacing.nodeNodeBetweenLayers': 100,
|
||||
'elk.layered.crossingMinimization.strategy': 'LAYER_SWEEP',
|
||||
'elk.hierarchyHandling': 'INCLUDE_CHILDREN'
|
||||
}
|
||||
}).run();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user