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 request: Color lines to indicate which node they originate from #469

Open
akinnee opened this issue Jun 17, 2021 · 3 comments
Open
Labels
enhancement this will make dependency-cruiser sweeter

Comments

@akinnee
Copy link

akinnee commented Jun 17, 2021

Context

With a bunch of same-colored lines, it's hard to follow where they go.

Expected Behavior

Each node could have a unique outline color and the edges originating from it can match that same color.

Current Behavior

All nodes and edges are the same color.

Possible Solution

  • When a node is created, pick a random color or generate a stable color by hashing the node's text.
  • Set the outline color of that node to the color.
  • Arrows pointing outward from the node should have the same color.
@sverweij
Copy link
Owner

Hi @akinnee I’ve bumped into this as well and it’s why these two features in dependency-cruiser exist

The real world samples page has several examples that employ both techniques.

Do these features meet your need?

@akinnee
Copy link
Author

akinnee commented Jun 17, 2021

@sverweij, thanks! If I set the color of a module, will the edges coming from it match that color?

Also, I'd prefer not to have to create a separate regex for each module if I want to make them unique. Would it be possible to provide a callback function that takes the node as an argument and returns some theme options for the node?

@sverweij sverweij added the enhancement this will make dependency-cruiser sweeter label Jun 23, 2021
@sverweij
Copy link
Owner

@akinnee currently I've only used it the other way around (the line gets the color of the dependency it's pointing to) - but I understand the need to use the colors on the from side. And maybe even both (with a gradient? will have to see how usable that'd be, though)

I'm looking into your suggestion and see if I can make it simpler so you don't have to spec out modules individually (or even by group/ regex) i.e. by providing something that automatically colors from a pallet. I'm trying to prototype it first to see how usable that'd be - but got a little lost in color theory. I'll dump an update here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement this will make dependency-cruiser sweeter
Projects
None yet
Development

No branches or pull requests

2 participants