G6
G6 copied to clipboard
Large Graph Example - Find Neighbors Functionality Not Working
Describe the bug
Thank you for this great library and excellent example: https://g6.antv.vision/en/examples/case/graphDemos#largeGraph
In that Large Graph Example though, if you right click on a real (non-aggregated node) and select "Find N-degree Neighbors" from the context menu - it will add a bunch of new nodes to the graph with "undefined" labels. Does not seem to be working correctly.
P.S. is there another example, or a recommended way to update this current example, to handle the case of multiple levels of clustered groups? For example, a top-level cluster could contain a few sub-clusters, and each of those may contain either the "real nodes" or even more child clusters of their own). Please let me know, would be much appreciated.
Your Example Website or App
https://g6.antv.vision/en/examples/case/graphDemos#largeGraph
Steps to Reproduce the Bug or Issue
if you view that Example and right click on a real (non-aggregated node) and select "Find N-degree Neighbors" - it will add a bunch of new nodes to the graph with "undefined" labels.
Expected behavior
It would highlight in some way the first/second/third degree neighbors to the current node that the context menu option was used on.
Screenshots or Videos
No response
Platform
Windows 11 MS Edge latest
Additional context
No response
The label with undefined-xxx
is generate by G6.Util.uniqueId()
which is defined as
export const uniqueId = (type: string): string => {
return `${type}-${Math.random()}${Date.now()}`;
};
So the undefined
comes from the undefined param type
. In the large graph example, the type
is missed when calling uniqueId, I will update the code ASAP.
P.S. is there another example, or a recommended way to update this current example, to handle the case of multiple levels of clustered groups? For example, a top-level cluster could contain a few sub-clusters, and each of those may contain either the "real nodes" or even more child clusters of their own).
I think it just some different implementation for the function generateNeighbors
in the large graph demo
This issue has been solved?
This issue has been solved?
Yes
This issue has been solved?
Yes
I have the same problem. What shoud I do to show the label nodes of the N-degree neighbors?