Closed bsansone closed 3 months ago
Since comboCombined's outerLayout is a force layout, it is an asynchronous layout. So you have to refresh the graph's nodes positions in the layout end callback function. e.g.
const comboCombinedLayout = new G6.Layout.comboCombined({ width: 800, height: 500, onLayoutEnd: () => { graph.refreshPositions() // here } });
This issue has been closed because it has been outdate for a long time. Please open a new issue if you still need help.
这个 issue 已经被关闭,因为 它已经过期很久了。 如果你仍然需要帮助,请创建一个新的 issue。
Describe the bug
I am using the
comboCombined
layout type to render my graph in the browser which works fine, but for some graphs that are large we want to calculate the layout (get the x, y coordinates) on the server. I assumed this can be done by doing:The results however are different than what I would normally get with:
Your Example Website or App
https://codesandbox.io/s/infallible-ptolemy-hz8jq6?file=/src/index.js
Steps to Reproduce the Bug or Issue
Notice the
layoutCfg
is set to use the defaultcomboCombined
layout type and the graph renders correctly.type: "comboCombined"
and uncomment// type: null
const comboCombinedLayout = new G6.Layout.comboCombined({
, leaving the layout type =null
will tell the graph we have predefined x, y coordinates to use.Expected behavior
I expected using the built-in
new G6.Layout.comboCombined
method to act the same as thelayout: { type: "comboCombined" }
config so that the coordinates can be computed on the server.Screenshots or Videos
Expected Results:
Actual Results:
Platform
Additional context
No response