dmx-systems / cytoscape-edge-connections Goto Github PK
View Code? Open in Web Editor NEWA Cytoscape extension that allows edges to connect other edges, according to the Associative Model of Data
License: Other
A Cytoscape extension that allows edges to connect other edges, according to the Associative Model of Data
License: Other
It would be good if this extension handled namespacing a bit better. It's best if an extension only sets data under ele.scratch('myExtensionName')
and if it only exposes ele.myExtensionName()
and cy.myExtensionName()
.
For example:
const ec = cy.edgeConnections();
ec.addEdge(edge);
ec.addEdges(edges);
ec.getAuxNode(edge);
ec.isAuxNode(node);
ec.getEdgeId(auxNode);
// within the above, only data is set within `ele.scratch('edgeConnections')`
It's best to follow this practice, because eventually another extension, the core lib, or an app's code will clobber the function or data at non-namespaced keys.
Could you update the demo page to use the latest version of the extension?
If you remove an aux-node you get those console-errors:
cytoscape-edge-connections.min.js:1 Data inconsistency: aux node of edge Be {0: Be, length: 1, _private: {…}} not in graph, auxNodeId 8226739c-b017-4c62-829f-432b7d6e39d0 ...
cytoscape-edge-connections.min.js:1 Uncaught Error: data inconsistency: aux node of edge 500 not in graph ...
I want to clear the cytoscape graph. Therefore I just added cy.filter('*').remove();
to the end of the demo:
https://plnkr.co/edit/23jg04nebyRRZ0HiX334?p=preview
Is there an intended way of doing this?
Hi, is it possible to add multiple aux nodes to the same edge?
Hi,
I have different graphs built with cytoscape.js and on each of them I initialise the edge connection plugin.
Something like this:
const cy1 = cytoscape()
const cy2 = cytoscape()
const cy1Ec = cy1.edgeConnections()
cy1Ec.addEdges(...)
const cy2Ec = cy2.edgeConnections()
cy2Ec.addEdges(...)
// ...sometime later
cy1.style(...) // this fires the event handler set by cy1Ec but internally it uses cy2 causing the data inconsistency exception
When an event handler set by cy1Ec gets triggered, it uses the last cytoscape instance on which edgeConnections()
has been called (cy2) instead of the correct one (cy1).
I haven't tried yet, but I guess also adding a new edge on cy1 after cy2.edgeConnections()
would result in the addition of the edge on cy2 instance, in this case I could easily avoid the issue calling again cy1.edgeConnections()
but I can't control when the event handler will be triggered.
Am I missing something?
Thanks for this package!
If I connect a node to an aux-node, I presumably then need to save the aux-node in order to be able to restore the edge connections when reloading the page, as the newly created edge has the id of the aux-node as target.
Do you have an example of persisting and restoring a graph with edge connections? I am having problems loading nodes into cytoscape so that saved aux-nodes are recognised as such by edge-connections.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.