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

Graphin style InnerLayout of ComboCombined layout breaks #372

Open
dukesun99 opened this issue Apr 4, 2022 · 2 comments
Open

Graphin style InnerLayout of ComboCombined layout breaks #372

dukesun99 opened this issue Apr 4, 2022 · 2 comments

Comments

@dukesun99
Copy link
Contributor

Describe the bug

When defining the innerLayout config of ComboCombined layout in graphin way, e.g.

const layoutWrong = {
  type: "comboCombined",
  innerLayout: {
    type: "dagre"
  }
};

It will result in a TypeError innerGraphLayout.layout is not a function.
Changing it to using G6 way of defining layout solve the issue:

const layoutCorrect = {
  type: "comboCombined",
  innerLayout: new G6.Layout["dagre"]()
};

Your Example Website or App

https://codesandbox.io/s/hardcore-bell-fbebob?file=/App.tsx:1993-2084

Steps to Reproduce the Bug or Issue

  1. Run the demo, and see the error
  2. Modify the layout={layoutWrong} to layout={layoutCorrect}, you will see it works

Expected behavior

I would expect the innerLayout also can be defined in the Graphin way.

Screenshots or Videos

No response

Platform

  • OS: Windows
  • Browser: Chrome
  • Version: 2.5.2

Additional context

No response

@dukesun99
Copy link
Contributor Author

I could figure out which part of the code to modify to make it work, however, I cannot modify it neatly, since some processing is required for force layouts, and seems some refactoring is needed. So maybe someone pls have a look.

Before supplying this.options to this line, innerLayout need to go through the same process to build an object.

@pomelo-nwu
Copy link
Member

@dukesun99 Thanks for finding this, we'll deal with it later

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