vasturiano / 3d-force-graph

3D force-directed graph component using ThreeJS/WebGL
https://vasturiano.github.io/3d-force-graph/example/large-graph/
MIT License
4.67k stars 825 forks source link

Can this support 2D ? #502

Open neo6053 opened 2 years ago

neo6053 commented 2 years ago

I plan to upgrade our old d3v2 library since the performance is very bad as it's using SVG. I try to use VisJS which uses canvas but still the performance is not that good. I wonder is there a library that uses WebGL for rendering network graph (force directed graph). Then, I stumble across this library, But I do not need the 3D camera view, is it possible to fix the camera to 2D? or is there any better 2D graph library with good performance? I saw vasturiano has this library, but it also uses canvas : https://github.com/vasturiano/force-graph

vasturiano commented 2 years ago

@neo6053 you can set the number of dimensions to 2 in this module via .numDimensions(2). Additionally you can switch to fly controls (see this example) which will switch the navigation to something closer to what you'd expect from a 2D view.

I'm not certain you'll achieve a higher performance compared to canvas rendering, but you can try.

neo6053 commented 2 years ago

@vasturiano Thank you very much! I find the performance of WebGL is much better than canvas? https://ahoak.github.io/renderer-benchmark/

zzr1001 commented 9 months ago

@vasturiano非常感谢! 我发现WebGL的性能比canvas好很多?https://ahoak.github.io/renderer-benchmark/

Can I see your source code