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

Feature: Interactive graph [as html page] #333

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dzianis-dashkevich
Copy link

Dear contributors,

Thank you for madge, this is a nice and easy-to-use library.
Recently, I forked madge and added an interactive feature for my personal needs.
I decided that this might be helpful for others as well. So here I am.

This feature is highly inspired by: https://github.com/sverweij/dependency-cruiser/blob/develop/src/cli/tools/wrap-stream-in-html.js

Please, check this deployed example based on the video.js open-source project (https://github.com/videojs/video.js):
https://dzianis-dashkevich.github.io/madge-interactive-examples/video-js-graph.html

Controls features (I added it to the README):

Left click selects node(with edges) or edge. Other edges will be dimmed.
Left click out of context(node or edge) resets everything to the initial state.
Right click selects an additional node(with edges) or edge. Has no effect if there are no previously selected items.
Previously selected nodes or edges will be slightly dimmed(but will stay colored).
Escape resets everything to the initial state.

This example was generated by running the following command at the root of the project:
npx madge --interactive interactive-graph.html src/js/video.js

Currently, it is pretty opinionated (eg: colors, controls, etc..), we can discuss potential changes, if you are interested.
Please, just close this PR, If you are not interested in this feature.

Regards,
Dzianis

@PabloLION PabloLION mentioned this pull request Jan 30, 2023
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

Successfully merging this pull request may close these issues.

1 participant