Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question / Feature Request] Adding support for reading in a graph from a dotfile #466

Open
saresend opened this issue Sep 14, 2021 · 4 comments

Comments

@saresend
Copy link

Summary

This might already be supported, but I can't seem to find it on docs.rs:
I'd like a way to read in a graph from a dotfile

Motivation

My usecase is the following: I have a tool that outputs graphs to a dotfile format, and I'd like to be able to perform operations with petgraph on the output of those tools.

As an example, one thing that gets output is a graph of all of the dependencies my project has, and given a set of dependencies I'd like to remove, I'd like to find the minimum cut such that my project no longer depends on those libraries. Currently, the approach I have is to visually inspect the output of graphviz for plausible ways to do this, but I'd like to be able to write a tool that finds where I can remove them a bit easier. There are a couple other usages I'd like to add, and for that I'd love to have a way to operate on the contents of a dotfile, with petgraph

Details

  • Are you willing to implement this yourself? Mentor someone else and help them
    implement it?

Happy to help add this myself, just want to verify this is behavior that petgraph is ok supporting

@saona-raimundo
Copy link

Related to #446
(I just noticed the similarity while looking at the issues)

@XVilka
Copy link
Member

XVilka commented Apr 17, 2023

It's a good idea, but I think it should be a separate crate/library to avoid unnecessary dependencies. On the other hand, such crate could be a part of petgraph organization as well.

@daniel-pfeiffer
Copy link

daniel-pfeiffer commented Jan 24, 2024

Not exactly what you're asking for, but related:
RustDOT: graph! { A -- A -- B; A -- C; }

@daniel-pfeiffer
Copy link

I have generalised those ideas and published them as crate rust_dot. Still a plain macro, not yet a proc-macro, but built around that technology. Turns out this now allows parsing strings or files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants