Code Monkey home page Code Monkey logo

cytoscape-edge-connections's People

Contributors

jri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cytoscape-edge-connections's Issues

Structure / namespacing

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.

Remove edge

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?

Using multiple cytoscape instances leads to cy instance mismatch

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?

Persisting and restoring aux-nodes

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.