buche-cytoscape
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -0,1 +1,2 @@ | ||
#!/usr/bin/env buche --inspect node | ||
@@ -9,3 +10,3 @@ function buche(cfg) { | ||
path: '/', | ||
pluginPath: '../lib/index.js' | ||
pluginPath: `${__dirname}/../lib/index.js` | ||
}); | ||
@@ -18,3 +19,3 @@ | ||
options: { | ||
style: "./graph-style.css", | ||
style: `${__dirname}/graph-style.css`, | ||
layout: { | ||
@@ -32,12 +33,3 @@ name: 'cola' | ||
let connections = connList.map(pair => pair.split('')); | ||
let nodes = new Set(connList.join('')); | ||
for (let node of nodes) { | ||
buche({ | ||
command: 'element', | ||
path: '/graph', | ||
id: node | ||
}); | ||
} | ||
for (let [from, to] of connections) { | ||
@@ -44,0 +36,0 @@ buche({ |
@@ -0,1 +1,2 @@ | ||
#!/usr/bin/env buche --inspect node | ||
@@ -48,3 +49,3 @@ function buche(cfg) { | ||
path: '/', | ||
pluginPath: '../lib/index.js' | ||
pluginPath: `${__dirname}/../lib/index.js` | ||
}); | ||
@@ -51,0 +52,0 @@ |
@@ -39,2 +39,3 @@ | ||
this.cy = setup(this.element, this.config); | ||
this.nodes = {}; | ||
} | ||
@@ -63,2 +64,17 @@ | ||
} | ||
let src = elem.data.source; | ||
let targ = elem.data.target; | ||
if (src && targ) { | ||
if (!this.nodes[src]) { | ||
this.cy.add({data: {id: src}}); | ||
this.nodes[src] = true; | ||
} | ||
if (!this.nodes[targ]) { | ||
this.cy.add({data: {id: targ}}); | ||
this.nodes[targ] = true; | ||
} | ||
} | ||
else { | ||
this.nodes[elem.data.id] = true; | ||
} | ||
this.cy.add(elem); | ||
@@ -65,0 +81,0 @@ this.cy.resize(); |
{ | ||
"name": "buche-cytoscape", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"lockfileVersion": 1, | ||
@@ -5,0 +5,0 @@ "requires": true, |
{ | ||
"name": "buche-cytoscape", | ||
"description": "Cytoscape channel and element for Buche.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"format": "cjs", | ||
@@ -6,0 +6,0 @@ "repository": { |
16081
407