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

Could dep-tree entropy take a graph (as JSON?) as input? #84

Open
ramirez7 opened this issue Feb 28, 2024 · 3 comments
Open

Could dep-tree entropy take a graph (as JSON?) as input? #84

ramirez7 opened this issue Feb 28, 2024 · 3 comments

Comments

@ramirez7
Copy link

Hello,

My coworker and I have been working on a project with similar goals & philosophy as dep-tree: https://github.com/dustin/graphex

It analyzes Haskell codebases and produces the graph as JSON. And it provides a CLI to analyze deps (for instance, you can ask why one file depends on another file to debug a tangled graph).

It already supports Looking Glass for visualization, but dep-tree entropy looks like it would be an improvement in many ways.

I'd love to hook it up to dep-tree entropy. But it looks like dep-tree entropy doesn't support just giving it a graph in some standard format? And it instead couples the graph generation with the graph visualization?

If there was some JSON format I could target, I could easily write a graphex graph dep-tree that converts graphex's JSON format to dep-tree's.

(I'd happily do the legwork to make this happen myself btw! If you have any pointers for getting started.)

@ramirez7
Copy link
Author

Oh wait I found this #76

Is the format documented somewhere? Also, I don't think entropy supports it afaict.

@gabotechs
Copy link
Owner

But I don't think you can use that, that's an output format for dumping the created graph in a json file. If I understand correctly what you want is a way to provide the already formed graph to dep-tree entropy so that it can render it.

Right now providing an input in a standard format is not supported, the best way to achieve this would be to create a language implementation that instead of referring to an actual programming language, it would accept a json file.

I wrote a guide about how to contribute new language implementations https://github.com/gabotechs/dep-tree/blob/main/docs/IMPLEMENTING_NEW_LANGUAGES.md. Your use-case is not strictly a programming language, but the idea is pretty much the same: receive a file as an input and parse its contents in order to form the graph.

Feel free to take a look and see if that could work for you!

@ramirez7
Copy link
Author

Sweet! Thanks for the pointers. I'll cut a PR when I get the chance 😁

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

2 participants