Comments (6)
It doesn't matter that much to me now because I am using layoutBy
, but it seems strange to fire this event before updating the positions, because to me the meaning of afterexpand
means the event is fired after the whole expand operation is finished. i.e the node is restored and it's children are restored and properly positioned.
I'd say maybe you could document your meaning of afterexpand
and the context in which it is called. e.g this event is fired after the node children are restored, but before their positions are updated. Or if you don't want people to use afterexpand
, maybe just remove it from the documentation.
from cytoscape.js-expand-collapse.
@d2fong Can you give more details on what you are trying to do and how will swapping those lines help you achieve it?
from cytoscape.js-expand-collapse.
@kinimesi what do you think?
from cytoscape.js-expand-collapse.
@ugurdogrusoz Because someone run into a problem with the order of fired events, it does not mean that the order is wrong. afterexpand
event is fired just after the node is expanded. The positioning of nodes is a post process, which is done after node is expanded. So firing afterexpand
event, after doing the positioning is wrong and meaningless.
from cytoscape.js-expand-collapse.
First of all. I said in my response that you don't have to change it. All I am saying is that your documentation is misleading.
Take a look at your documentation for the layoutby
option and the afterexpand
event:
Here is the documentation for layoutby
:
layoutBy: null, // to rearrange after expand/collapse. It's just layout options or whole layout function. Choose your side!
Key phrase here is rearrange after expand/collapse.
Here is the documentation for afterexpand
:
cy.nodes().on("expandcollapse.afterexpand", function(event) { var node = this; ... }) Triggered after a node is expanded
Key phrase here is Triggered after node is expanded.
This could imply to people that these two things do something similar when in reality they will not. Because one happens before the nodes are repositioned and the other happens after.
Now you will say that after expand is not the same as after a node is expanded. But that then implies that the user has to know that there exists a post processing step.
But again, if I search for any terms such as post process
, reposition
, or position
. Nothing comes up in the documentation.
What I am trying to get at this is that you probably know the codebase for this extension really well. I bet most users do not. So I hope you can understand now why someone might get confused when you assume that users have to know specific implementation details that have not been documented at all to use this extension properly.
from cytoscape.js-expand-collapse.
@d2fong we moved the location of the trigger. we also made a note as follows in the documentation (unstable branch):
Notice that following events are performed for each node that is collapsed/expanded. Also, notice that any post-processing layout is performed after the event.
Please let us know if this is more reasonable now.
from cytoscape.js-expand-collapse.
Related Issues (20)
- Expanding compound node dis-aligns the rest of the graph HOT 1
- Option to Display number of collapsed nodes on collapsed groups HOT 4
- Option to not remove collapsed nodes HOT 4
- Demo on load clustering improvement HOT 2
- Expanding all the collapsed nodes causes a bad layout HOT 2
- Losing edges bug HOT 1
- flex layout not respected HOT 3
- Collapsed children are not in graph HOT 4
- Recursive Expand Parents HOT 2
- Exception - Expanding Collapsed Edges of a Collapsed Child HOT 9
- Undefined variable in 'expandCollapseUtilities.js' HOT 1
- Please Provide a @types/cytoscape-expand-collapse file to enable use in typescript projects HOT 1
- Ordering of children is not preserved HOT 1
- Adding new data to collapsed workspace HOT 7
- Getting collapsed edge containing certain edge HOT 6
- expand(nodes, option) does not respect the passed options
- Example for a layout function HOT 1
- Update saveJSON to return serialized data HOT 8
- Collapsing a compound with label-sized nodes and parallel bezier edges crashes cytoscape
- CollapsedChildren method on event's target object returns null even though elements are present inside
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cytoscape.js-expand-collapse.