-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Edge between two edges (or node and edge), edges inside nodes/edges (recursive encapsulation) #1217
Comments
This is a duplicate of #959 |
You would have to create intermediary nodes to simulate hyperedges, as hyperedges are not supported natively yet. It's not such a simple feature to implement, because it would affect large parts of the API -- like algorithms, traversing, etc. |
This is not a duplicate, because described above does not match definition of hyperedge direclty. Hyperedge is N to N connection, edge is 1 to 1. Link is also 1 to 1 connection, but difference is that each one (of these 1s) are also links (or edges), and there is no separate verticies type. For example link that starts from itself and ends with itself is a point, or actually a verticle. The actual needed feature is to allow source and target of edges to reference other edges (not only nodes). https://en.wikipedia.org/wiki/Associative_model_of_data (here vertices/nodes/items coexist with links/edges). |
My mistake. If you want not hyperedges but edge-edge edges, I'm not sure whether that would make sense. One of the premises of graph theory is that edges connect nodes. Whereas algorithms and traversal etc. can be made to make sense with hyperedges, my intuition is that edge-edge edges could not. |
This is still true here. However if also an edge can connect edges then new possibilities for algorithms are open. One way to use this is to get an ability to describe ordered set (or sequence). edges: [
{ data: { id: 'ad', source: 'a', target: 'd' } },
{ data: { id: 'eb', source: 'e', target: 'b' } },
{ data: { id: 'adeb', source: 'ad', target: 'eb' } } // Added this edge
] If we take this example, we can interpret 'adeb' edge as tree of edges ((a -> d) (e -> b)), and at the same time as sequence of nodes (a -> d -> e -> b) or just "adeb" (string), if 'a', 'd', 'e' & 'b' nodes represent corresponding letters/symbols itself. It can be an N-gram of words (not only letters). For example a sentence (builded with nodes). All previous logic with nodes still ok. And new can be added. I`m not sure it should be so difficult as hyperedges implementation. Because cytoscape already has an ability to click on edges, name edges. So the addition is, to render edges, that starts from center(middle) of one edge to center(middle) of other edge. May be it can be done as a plugin or switch/option that can be turned on or off. Other visualizations (from book by SIMON WILLIAMS, "THE ASSOCIATIVE Here is an example of semantic type system, that uses links/edges as node/pairs to continue an English sentence (fact) about some real world event. |
I've spoken to others in the Cytoscape team about this. This would be far more difficult than the hyperedges implementation. As I said before, a basic premise of graph theory is that edges connect only nodes. Allowing edges to connect to edges breaks that premise, and completely breaks the model. Cytoscape.js is not just a visualisation tool, it has a sophisticated graph theoretic model and accompanying algorithms. We can't break 90%+ of the functionality of the library to accommodate a single non-graph-theory usecase. Your examples are database entity-relationship models. N-ary relationships are represented by entities, in databases and in your diagramme. Similarly, you should be using separate nodes to represent n-ary relationships if you want to use Cytoscape.js. You can do this in your app-level code or you can create an extension. If you can point us toward reputable journal published papers that define edge-edge edges in graph theory, then perhaps we can revisit this. For now, I'm closing this and you can use intermediary nodes. Thanks for your feedback |
Those are ER/database models, not graph theoretic models. |
Ok there are other possible solutions:
Can you please point out are these options possible with cytoscape?
Or.. What exactly do you mean by |
You should be able to do (1) with an intermediary node between the edges so that the edge-edge edge points towards the intermediary node. (2) is just compound nodes. |
Implemented examples:
|
http://gojs.net/latest/samples/linksToLinks.html (implementation at go.js) |
Go.js is a generic charting lib, Cytoscape.js is for graph theory As far as I'm aware, there is no concept of edge-edge edges in graph theory. |
I too would like this option. |
@maxkfranz talks about graph model. |
I've created a Cytoscape extension that allows edges to be connected to other edges, according to the Associative Model of Data: |
I`m working on project (https://github.com/Konard/LinksPlatform) that uses associative model of data.
For example this platform (as database) allows to store egdes between edges. And there is no difference between edges and nodes, all are links (pairs of references to other two links - source & target). Also because link consists of two links this creates a fractal which can be used to store sequences or entire graphs (networks) insite one link.
So my question is it possible to visualize something like this using cytoscape.js ? And if not, is it easy to extend/modify cytoscape.js for that task?
Node to node, node to edge:
Node to node, node to edge, edge to edge:
Sequence, fractal, recursive encapsulation:
I actually tried to change example (http://jsbin.com/gist/5b192c88616af2f75344) like this:
But added edge didn`t show up.
The text was updated successfully, but these errors were encountered: