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

Add options to exclude packages and dependencies from graph. #45

Closed

Conversation

markuspoerschke
Copy link

@markuspoerschke markuspoerschke commented Feb 1, 2019

Dev dependencies of dependencies are not shown anymore, because they are not relevant for the current package.

  • --no-dev will hide dev dependencies
  • --no-php will hide the constraints regarding the PHP version
  • --no-ext will hide PHP extensions
  • --depth will limit the depth of the generated graph
  • --exclude-regex allows to apply regular expressions to hide packages
  • --only-regex show only packages with their name matching the expression
  • --exclude-type exclude pacakges with given type
  • --only-type only show packages of given type

The filters are never applied to the root packge.

To apply these filters the packages must be rendered in the correct order. Before the packages were drawn "randomly" and were connected later on. Now packages are drawn from root package and only if they are a dependency of a package. This allow filtering for dependencies and packages. If a package (node) is missing, then the dependency (edge) is not shown. Vice versa the dependency (edge) is not shown when the package (node) is not available.

New
output_exfsyf

Old
output_n3qgvf

Open TODOs:

  • Update documentation (add examples etc.)
  • Fix PHPUnit tests (they are surprisingly still working ;-))
  • Cleanup code / code style etc.
  • Update CHANGELOG
  • Visualize rendering process so that new algo to render graph is understood (compare old vs. new)

Dev dependencies of dependencies are not shown anymore, because they are not relevant for the current package.

* `--no-dev` will hide dev dependencies
* `--no-php` will hide the constraints regarding the PHP version
* `--no-ext` will hide PHP extensions
* `--depth` will limit the depth of the generated graph
* `--exclude-regex` allows to apply regular expressions to hide packages

To apply these filters the packages must be rendered in the correct order. Before the packages were drawn "randomly" and were connected later on. Now packages are drawn from root package and only if they are a dependency of a package. This allow filtering for dependencies and packages. If a package (node) is missing, then the dependency (edge) is not shown. Vice versa the dependency (edge) is not shown when the package (node) is not available.
@markuspoerschke markuspoerschke changed the title Add options to exclude packages and dependencies from graph. WIP: Add options to exclude packages and dependencies from graph. Feb 1, 2019
@markuspoerschke
Copy link
Author

@markuspoerschke markuspoerschke changed the title WIP: Add options to exclude packages and dependencies from graph. Add options to exclude packages and dependencies from graph. Feb 1, 2019
@markuspoerschke
Copy link
Author

@clue Can you have a look on this one? The changes are huge, because the complete graph generation needed to be changed to support filtering by depth and filtering by packages.

I guess there are more filters needed like: --exclude-dependencies-from to exclude dependencies from sub packages or so. But this could be added even later :)

@machour
Copy link

machour commented Apr 15, 2019

PR tested on a heavy set of packages, and working like a charm, thank you @markuspoerschke

@wol-soft
Copy link

wol-soft commented Oct 8, 2019

I've implemented an up-to-date check based on this PR in wol-soft#1 which colorizes the graph. Would gladly create a PR after this one got merged. Is the repository still maintained? @clue

MicrosoftTeams-image

Colorized graphs work like:

  • green: latest version
  • lemon-green: patch available
  • yellow: minor patch available
  • orange: new major version available
  • red: package is abandoned

@samdark
Copy link

samdark commented Oct 21, 2019

We'd love to use what @wol-soft created. @clue?

@floriankraemer
Copy link

Can anyone merge this, please? :)

@patricknelson
Copy link

Bump. This would be amazing to see! My first time using graph-composer resulted in such a massive dependency tree that it practically rendered itself useless (since it was almost too complex to visually parse intuitively). The graph was so wide that you end up getting lost in the weaving lines.

@clue
Copy link
Owner

clue commented Dec 30, 2021

@markuspoerschke Thank you very much for looking into this and filing this PR! 👍

This PR contains a lot of nice features that I would love to see as part of graph-composer in the future! Unfortunately, it adds a fair amount of complexity and does not currently contain any tests, so it's a bit hard to review.

I'm currently in the process of updating this project and will work on the test suite next. The plan is to create a better base to build on top of, perhaps we can then rebase (part of) this PR to take advantage of this.

As a first step, I'm currently looking into --dev and --no-dev flags as per #2. Let's continue the discussion in #2 first and then afterwards look into how we can get this PR here ready! :shipit:


@wol-soft Really nice, would indeed love to see an --outdated flag in the future! Let's continue this discussion in #65! :shipit:

@SimonFrings SimonFrings removed this from the v1.3.0 milestone Jun 26, 2023
llaville added a commit to llaville/graph-composer that referenced this pull request Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants