Live data from Hacker News

Show HN: A Graphviz Implementation in Rust

github.com

21–30 of 56 posts

Re: Show HN: A Graphviz Implementation in Rust

#22
post #7
post #4

Does the standard implementation include any similar debug rendering? Seems like the coolest part of the project! I tend to stay away from Graphviz a lot more than I otherwise would these days due to the lack of manual formatting controls (have spent waaaayyy too many hours writing code to add invisible edges between certain nodes to force row-ordered layouts).

Hah, that's hilarious. I also like graphs but hate manually laying them out, so I always use Graphviz and live with the results. Sometimes I think I could do better, but typing "foo -> bar" a few times is so much easier than spending any time thinking about what would look nicest. One time I added colors though, that was kind of nice.

yep exactly. paraphrasing something I read somewhere ...

"Best to think of Graphviz as a competent but unruly teenager"

and then just be glad you did not have to do the work yourself.

Re: Show HN: A Graphviz Implementation in Rust

#24
Author of a web-based GraphViz editor [1] here. We're currently using viz.js [2], which is the original GraphViz compiled to WASM. Since viz.js is unmaintained, we're looking for a replacement.

This library looks really promising! As it's written in rust, it should be possible to port it to WASM. Are there plans in that direction?

Is it planned to be a drop-in replacement for GraphViz (or the dot engine)?

[1]: https://edotor.net [2]: https://github.com/mdaines/viz.js

Re: Show HN: A Graphviz Implementation in Rust

#29
post #15

This does not seem to compile: --> src/core/color.rs:180:21 | 180 | for pair in KNOWN_COLORS { | ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | = help: the trait `Iterator` is not implemented for `[(&str, u32); 148]` ... error[E0277]: `[geometry::Point; 20]` is not an iterator --> src/topo/placer/edge_fixer.rs:272:39 | 272 | for offset in offsets { | ^^^^^^^ borrow the array with…

It sounds like your rust is too old. IIRC the array FromIterator is only a month or two old.

Rust 1.53 is from June 2021 and that's where this first works (until Rust Edition 2021 you can't actually just method call into_iter() on arrays because that would mask syntax that could work in some cases on older Rust code, but this code uses the for loop which does not actually do a method call to get the iterator)

Re: Show HN: A Graphviz Implementation in Rust

#30
post #15

This does not seem to compile: --> src/core/color.rs:180:21 | 180 | for pair in KNOWN_COLORS { | ^^^^^^^^^^^^ borrow the array with `&` or call `.iter()` on it to iterate over it | = help: the trait `Iterator` is not implemented for `[(&str, u32); 148]` ... error[E0277]: `[geometry::Point; 20]` is not an iterator --> src/topo/placer/edge_fixer.rs:272:39 | 272 | for offset in offsets { | ^^^^^^^ borrow the array with…

It sounds like your rust is too old. IIRC the array FromIterator is only a month or two old.

Thanks, Kevin, that was it. I didn't expect Rust to (still) move that fast. ;)
Post reply on HN