You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi Devs, awesome project! I'm working on code to show (parts of) graphs for our project Activity Browser.
What I want to make is a feature similar to #104, as this didn't yet exist, I thought I'd write it myself with a callback.
I had already written a Stackoverflow post, but after looking through the issues here, I'm getting a feeling there are bugs involved that are out of my control (e.g. #112), though I'm also experiencing the problem when using the Grid Layout.
Anyway, I will re-post most of the post from Stack Overflow as well:
I want to have an interactive graph, where I can click on a parent node, and the parent should 'collapse' (not show it's children anymore) or 'expand' (show it's children). This also means that the graph should replace the edges of it's children with edges to the parent.
As I'm still learning to use Dash-Cytoscape, I'm using a toy example. Each of the two graphs (with children and with children hidden) are separate variables. In my real project, I would dynamically re-generate the elements for the graph.
I can manage to write a callback function that happily feeds the graph a new set of elements when I click the right node (the special 'parent' nodes).
Note here, that I have both of the two example states showing what I want.
When I click the parent node, the elements should be replaced with the other state, making the graph show/hide the children of the parent.
See also the two states here:
What is going wrong:
What is instead happening is that the parent node is detached from the other nodes, it loses the edges connecting it to the rest of the graph.
See also the two broken states here:
What I tried:
So far, I loaded each of the states separately, this shows exactly what I want
I tried to make an MRE with fewer nodes and edges, but when I run that, there is no problem. I cannot see how my MRE differs from the 'real' code where it matters.
So to be clear: What I want is to be able to switch between the two top images, but this ends up breaking the network in some way I don't understand. If you want to see the other working graph in the main code, replace current_state = m_start_elements with current_state = start_elements.
Description
Hi Devs, awesome project! I'm working on code to show (parts of) graphs for our project Activity Browser.
What I want to make is a feature similar to #104, as this didn't yet exist, I thought I'd write it myself with a callback.
I had already written a Stackoverflow post, but after looking through the issues here, I'm getting a feeling there are bugs involved that are out of my control (e.g. #112), though I'm also experiencing the problem when using the Grid Layout.
Anyway, I will re-post most of the post from Stack Overflow as well:
I want to have an interactive graph, where I can click on a parent node, and the parent should 'collapse' (not show it's children anymore) or 'expand' (show it's children). This also means that the graph should replace the edges of it's children with edges to the parent.
As I'm still learning to use Dash-Cytoscape, I'm using a toy example. Each of the two graphs (with children and with children hidden) are separate variables. In my real project, I would dynamically re-generate the
elements
for the graph.I can manage to write a callback function that happily feeds the graph a new set of
elements
when I click the right node (the special 'parent' nodes).Note here, that I have both of the two example states showing what I want.
When I click the parent node, the
elements
should be replaced with the other state, making the graph show/hide the children of the parent.See also the two states here:
What is going wrong:
What is instead happening is that the parent node is detached from the other nodes, it loses the edges connecting it to the rest of the graph.
See also the two broken states here:
What I tried:
So far, I loaded each of the states separately, this shows exactly what I want
I tried to make an MRE with fewer nodes and edges, but when I run that, there is no problem. I cannot see how my MRE differs from the 'real' code where it matters.
So to be clear: What I want is to be able to switch between the two top images, but this ends up breaking the network in some way I don't understand. If you want to see the other working graph in the main code, replace
current_state = m_start_elements
withcurrent_state = start_elements
.Steps/Code to Reproduce
For reference, here's my MRE:
And here's my actual code:
Expected Results
See first two images above
Actual Results
See last two images
Versions
I'm using the Conda sources for the versions:
The text was updated successfully, but these errors were encountered: