Comments (14)
New additions (and mere ideas) are very much appreciated!
I think it certainly makes sense to add this feature. Perhaps it should be generalized as to accept a --depth={N}
option? So in your case, you'd probably want to supply a --depth=1
.
from graph-composer.
jeah, i thought for depth as well. But I have dependencies in my graph that are sub dependencies, which i want to display.
Basicall i really want to filter with /webforge-(.*)/
from graph-composer.
Duh, totally missed your reply, sorry.
Now I see where you're coming from. Filtering on an arbitrary parameter is significantly more complex as you have to consider what happens with intermediary dependencies like this:
A -> B -> C
So if you only keep A and C (i.e. filter out B), you might either want show
A -> C
or just
A C
which dependending on your use case might both be incorrect.. I'm interested to see what you come up with, though.
Would you merge this?
Certainly yes! :)
from graph-composer.
๐
from graph-composer.
Some other thing that could make the graph more readable would be removing the require-dev dependencies. In our case every package depends on PHPUnit and PHP. This could easily be dropped. Maybe we can add a parameter to ignore dependencies also by require-dev?
from graph-composer.
@markuspoerschke ๐
from graph-composer.
Maybe we can add a parameter to ignore dependencies also by require-dev?
Thanks for your interest guys! Hiding dev dependencies is discussed in #2 (and a pending PR #19).
Afaict this tickets aims to find other, alternative ways to "filter" the dependency graph - though I'm not sure how this could/should work (see above for some background).
Any input is much appreciated!
from graph-composer.
I would want to see a --prune <package>
option, which removes that package and all of its dependencies from the graph. Simultaneously, any packages affected by the pruning would have a visual marker indicating they're not 100% complete. Example:
Initial state --prune D --prune C --prune B --prune A --prune A --prune D
============== ========== ========== ========== ========= ===================
A B A B* A* B A B B*
|- C | |- C* | |- C |
| | D | D
D--| D
The asterisks represent the visual indicator. On the graph, it could be a dotted border, a lighter hue, etc.
Show/hide dev dependencies is just a special case of this general instrument. If my require dev is phpunit
, behat
, and athletic
, then that's equivalent to --prune phpunit --prune behat --prune athletic
.
Admittedly, I haven't considered all the ramifications or possibilities. We might not allow --prune
to fragments the graph into multiple "islands", as explained in this research paper, ยง 3.2. However, we might offer a --prune-force
override to really do this.
I personally do not mind if the graph generation takes more time, if by spending that time I can get a graph that's more relevant to what I need to visualize.
from graph-composer.
+1 I would love something like this!
from graph-composer.
@clue I can put some cycles on this (though with no guaranteed delivery dates!).
What do you think of the --prune
API mentioned earlier?
How about an approach like PHP Dependency Analysis, which uses "levels" to decide how deep to descend?
from graph-composer.
Thought about implementing this with the --prune (or --exclude) command like @bishopb mentioned above, just don't know how to handle the PR from #19 which would potentionally conflict with this issue.
from graph-composer.
@P0rnflake, Isn't --dev
equivalent to current behavior and --no-dev
a convenient shortcut to the equivalent prunes (--prune dev/dep1 --prune dev/dep2 ... --prune dev/depN
)?
If so, then the CLI API and feature from #19 could be merged in, then when this issue is implemented, just rewrite that API to use prune. That wouldn't have any BC to the user, but it might abandon all the work from #19 in favor of the general prune approach.
from graph-composer.
Thanks for the discussion so far everybody ๐
I'd love to make this actionable and get this into a future release
As such, see also #33 which aims to implement a (much simpler) --depth
option.
Does anybody feel like giving an implementation that prunes/removes certain dependencies a go? Perhaps this may help sort out the remaining uncertainties.
from graph-composer.
Any progress planned on this? I would like this feature as well. Whenever I have time I could have a look at the code and propose a PR but that won't be soon.
from graph-composer.
Related Issues (20)
- Invalid handling of not lowercase package names. HOT 1
- Support running on MS Windows
- Add option to write exported image to STDOUT instead of file HOT 2
- Improve GraphViz support for MS Windows HOT 2
- Unable to run "graph-composer" (installed as a global composer package) HOT 3
- Does not work after 'composer global require clue/graph-composer' HOT 1
- Export graph with links HOT 1
- composer install doesn't work HOT 5
- Release 1.0.0 is missing version HOT 1
- Update symfony/console HOT 4
- Add option to limit depth of the graph HOT 4
- What about left to right direction? (horizontal layout) HOT 1
- What about only draw the dependencies of a sub package in a project? HOT 2
- Add support for imagemap output HOT 1
- add dockerfile/example to ease usage HOT 3
- Compatibility with composer v2 HOT 1
- Highlight outdated packages (`--outdated`)
- Unable to invoke "dot" to create image file HOT 1
- PHP 8+ support HOT 1
- Unable to invoke "dot" to create image file (code 127) HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from graph-composer.