top | item 42469560

Show HN: Interactive graphs in Rerun with a Rust port of D3-force

65 points| nikonp | 1 year ago |rerun.io

Rerun 0.21 comes with a new graph viewer that's written in Rust and runs in the browser via wasm. It's powered by a new force based layout engine that is a port of much of d3-force to Rust. (The release also contains some other cool stuff like undo/redo implemented on top of a timeseries DB.)

We built this with applications in robotics and spatial computing in mind but would love to hear feedback from folks that would see this as useful in other domains as well.

13 comments

order

jgoertler|1 year ago

Hi, Jochen from Rerun here (@grtlr on GitHub)! I implemented most of the graph view, including Fjädra [0], our Rust port of the excellent d3-force [1].

Happy to answer any questions!

[0](https://github.com/grtlr/fjadra)

[1](https://d3js.org/d3-force)

troelsSteegin|1 year ago

Is there a public way to add custom Blueprints (https://rerun.io/docs/concepts/blueprint) and Visualizers (https://rerun.io/docs/concepts/visualizers-and-overrides)? It looks like yes for Blueprints, reading through https://rerun.io/examples. I am guessing "not yet" for Visualizers? For example, I'd like to be able to render a Sankey diagram from a "dataflows" Blueprint through the Viewer (https://rerun.io/viewer). I realize that non-spatial is not Rerun's focus.

rendaw|1 year ago

What makes d3-force so excellent that you'd want to port it? Do force layouts have a lot of subtlety?

simgt|1 year ago

I've been using rerun for a while to visualize the content of inference pipelines, it's nothing short of amazing!

I really wanted live views of my gstreamer pipelines, so I've started to write a tool with egui [0]. Looks like rerun's GraphView doesn't support subgraphs and horizontal layouts yet, but I'm sure I'll soon be able to just have a gstreamer tracer that pushes reruns logs. That's better than having to find the motivation to go through my todo list! Yeah!

[0] https://github.com/simgt/glitch

jgoertler|1 year ago

Thank you for linking your project—that looks really cool! I saw you also implemented a pan-and-zoom area. We are currently working on moving Rerun's implementation to egui [0], so maybe keep an eye on that.

It would be super cool to have layered graph drawing in (Sugiyama-style) in Rerun too. The tricky–but super interesting–challenge that we face is that our layout implementations need to be consistent across timestamps if the underlying structure of the graph changes, which is why we initially chose a force-based layout approach. There, the time-varying aspect is handled naturally by the simulation.

The very interactive nature of Rerun also poses more restrictions on the implementation of our algorithms: re-layouts ideally need to be fast, to produce visualizations quickly, especially when scrubbing the timeline.

I still hope we can rid you of some of the todos ;).

[0](https://github.com/emilk/egui/pull/5505)

burningion|1 year ago

Have been playing with rerun since the early days, and the team has built a ton of amazing features for visualizing your robotics datasets. I used it on a bicyclist safety system to ingest raw data for playback and analysis later.

I especially like that they're also building an (amazing) Rust version of imgui called egui, and open sourcing all the work for the ecosystem: https://github.com/emilk/egui

rcarmo|1 year ago

This is pretty awesome. I especially liked replaying the graph layout. I do wonder what kind of native GUI toolkits whis would work with (since I don’t really care much for web UIs and browser overhead).