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

Streamline graph output (graphviz, mermaid, etc.) #349

Open
abejenaru opened this issue Apr 9, 2024 · 3 comments
Open

Streamline graph output (graphviz, mermaid, etc.) #349

abejenaru opened this issue Apr 9, 2024 · 3 comments
Assignees

Comments

@abejenaru
Copy link

Describe the feature

Hi, first of all big thanks for creating pipdeptree :)

I was looking into adding support for D2 graph generation, and I think it would be better to avoid adding another output option at this time.
Maybe streamlining the current graphviz and mermaid options under a common option (for example --output mermaid, --output graphviz_dot, etc.) and then supporting new formats is a workable enhancement ?

@abejenaru abejenaru added enhancement tobeconfirmed To be confirmed after more investigation labels Apr 9, 2024
@kemzeb
Copy link
Collaborator

kemzeb commented Apr 11, 2024

Though the D2 project does look fairly new (compared to mermaid and graphviz), I personally wouldn't mind this being added!

Maybe streamlining the current graphviz and mermaid options under a common option (for example --output mermaid, --output graphviz_dot, etc.) and then supporting new formats is a workable enhancement ?

I think this is a great idea too (though we would need to keep the older options for compatibility). We can have something like the following:

$ pipdeptree -h
usage: pipdeptree . . .
. . .
--render       choose how you want to render; this includes mermaid, graphviz-dot, graphviz-png, graphviz-svg, ... (default: text)
--mermaid  (DEPRECATED, use --option instead) . . .
. . .

@kemzeb kemzeb removed the tobeconfirmed To be confirmed after more investigation label Apr 11, 2024
@abejenaru
Copy link
Author

PS. Would adding --json and --json-tree rendering options in there make sense ? For me they are at the same level as graph outputs, but what is your take ?
Also, personal preference would be for a 1-letter parameter, like -o --output, as -r is already in use.

@kemzeb
Copy link
Collaborator

kemzeb commented Apr 24, 2024

PS. Would adding --json and --json-tree rendering options in there make sense ? For me they are at the same level as graph outputs, but what is your take ?

Yes, since both --json and --json-tree are rendering options we should include them. To me it would be confusing to see them as their own options but throw the rest within --output.

Also, personal preference would be for a 1-letter parameter, like -o --output, as -r is already in use.

Sure, we can do this instead.

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

No branches or pull requests

2 participants