Skip to content
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

expand(nodes, option) does not respect the passed options #138

Open
OskarHowe opened this issue Aug 11, 2022 · 0 comments
Open

expand(nodes, option) does not respect the passed options #138

OskarHowe opened this issue Aug 11, 2022 · 0 comments
Assignees

Comments

@OskarHowe
Copy link

OskarHowe commented Aug 11, 2022

Hi,
I have observed, that the expand(nodes, options) function does not apply correctly the passed options, when called.

Reproduce the issue:

  1. Display the graph with a layout and specify this layout in the options object layoutBy : {name: dagre} field
  2. Collapse all nodes and edges with
    2.1. collapseAll(options)
    2.2. collapseAllEdges()
  3. Change the layoutBy field in the options object, layoutBy : {name: breadthfirst}
  4. Expand any collapsed nodeA using
    4.1. expandEdgesBetweenNodes([nodeA, ...neighbors]))
    4.2. expand(nodeA, options)
  5. Notice that the graph you see is still in the dagre layout.

When you use instead:

  1. ...
  2. Expand all collapsed nodes using
    4.1. expandAllEdges()
    4.2. expandAll(options)
  3. Notice that the new layout has been applied.

Possible reason
By having a quick look into your source code, I assume the problem results from these lines in the file: expandCollapseUtilities.js, function: expandNodeBaseFunction, lines 46 – 48:

if (single) { this.endOperation(layoutBy, node); }

In any other expand function, see expandAll(options), the nodes will always be rearranged by the endOperation after expanding. Here, the rearrangement is conditional, which may cause this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants