Open PixDay opened 1 year ago
@PixDay you could try cloning the data 4 times and passing each instance to its own 3d-force-graph
component, each associated with a different div
.
@vasturiano I think I will have some issues since I'm using different forces and a lot of data, the 4 graphs will probably not have the exact same position for all their elements
Wouldn't it be possible to edit the source code, make it take an array of HTML elements, and loop over them while rendering the graph?
I have an alternative suggestion for this that just may work. If you have 4 separate DOM elements, each with its own 3dForceGraph
instance, but with a shared data structure object (what you input via graphData
) they should all remain in sync, even though they're separate elements.
One thing that you have to be careful however is to only have one force system active at any time, otherwise the effect of the forces will essentially quadruple and you'll start seeing strange motion artifacts.
To do that you can simply deactivate all the default forces in all but one of the instances. Something like this:
myGraphInstance
.d3Force('link', null)
.d3Force('charge', null)
.d3Force('center', null);
It is possible to render the same graph in 4 differents HTML div?
The objectives is to render the graph 4 times to create an pyramidal hologram:![image](https://github.com/vasturiano/3d-force-graph/assets/33284435/e0d51d69-e919-4676-819b-bc5291981766)