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
User-defined links do not provide access to link source & target until user interacts with the graph #471
Comments
@alico-cra I'm unable to reproduce your issue. Could you make a simple example on https://codesandbox.io/ that clearly shows the problem you're describing? And if you try this example you'll notice that the custom links are visible immediately, not when the user interacts with the graph. Do you observe a different behaviour? |
@vasturiano Here is the link to an example codesandbox displaying the issue.
This only occurs when defining |
As @alico-cra noted, I'm able to recreate this issue if I define a custom node AND link. With link only example (the text-label @vasturiano pointed to) I don't see the issue. I do notice that @vasturiano uses I started a new sandbox but was not able to fully replicate, although I do have other issues with the links not positioning correctly which are maybe related? https://codesandbox.io/p/sandbox/purple-morning-ntr2zf?file=%2Fsrc%2FForceGraph.jsx%3A57%2C9 |
@cramatt Yes that is a good point worth clarifying. The text-label example does work for me as well. However the difference in that example vs what I noted in this bug is that the issue seems to be present when newer content is present after initial render, and after a refresh occurs, the new links are present in the canvas but not visible. They almost seem to be defaulting to the |
Thanks for creating those examples. Like @cramatt already mentioned, the issue is that you're not implementing the You can see an example of that implementation here: react-force-graph/example/text-links/index-3d.html Lines 33 to 40 in ac46439
|
Describe the bug
In 3D-Force-Graph, when using
linkThreeObject
andlinkThreeObjectExtend
, the user does not have access to the converted link object (and properties such as target & source) from string until interaction with the component occurs. This is limiting as it prevents the user from displaying custom-defined links until the cursor interacts with the graph.This appears to be due to the behavior defined here: https://github.com/vasturiano/d3-force-3d#link_links
It requires that the graph be initialized before custom links are made visible.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
When loading the page for the first time, I would expect both custom nodes and custom links to be defined & visible on first load.
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: