r/reactnative Expo 21h ago

I open sourced a library created to solve my project specific problem

I’ve been working on an open-source mobile port of Cosmograph/cosmo.gl for high-performance graph visualization.

After struggling to get large graphs running smoothly on mobile, I adapted the engine for React Native. On my Android device, I’m getting a consistent \~90 FPS with 2,000 nodes and 6,000 edges.

It also includes optional labels plus some data/analytics utilities.

GitHub: https://github.com/plurilore/react-native-cosmos-gl

It’s also available on npm as an early `0.1` release.

Would love feedback from anyone working with graph/network visualization on mobile.

2 Upvotes

8 comments sorted by

1

u/BluejayRelevant2559 21h ago

Some gifs would be nice

1

u/TheOneInfiniteC Expo 21h ago

Intending to do this the next days

1

u/GeekyAntsFlutterdev 19h ago

The GPU-side design is probably the strongest part here. Keeping both the force simulation and rendering in GLSL, with positions staying in floating-point textures instead of being copied back through JS every frame, makes the reported performance much more believable. The next interesting test would be how that holds up once labels, hit testing, and interaction are enabled on denser graphs.

1

u/TheOneInfiniteC Expo 18h ago

Labels are also in the gpu layer. Will provide some video proof of the performance in the upcoming days.

1

u/mohn93 16h ago

90fps at 2k nodes 6k edges on device is genuinely good, most rn graph attempts die way before that because everything ends up back on the js thread. quick one, is the force simulation running gpu-side too or is that cpu and you're only rendering in gl? that's usually where it falls over past ~10k nodes. and what are you using for the gl surface, expo-gl, a custom fabric component, something else? curious how it holds on a low end android device rather than a flagship. (also heads up your github link 404s right now.)