pawamoy / dependenpy

Show the inter-dependencies between modules of Python packages.
https://pawamoy.github.io/dependenpy/
ISC License
28 stars 4 forks source link

Add colors #45

Open pawamoy opened 5 years ago

pawamoy commented 5 years ago

Related to #44. As an alternative to changing the "zero deps" character, we could add colors to the output to highlight the cells where deps are above 0, maybe with a gradient (cold, warm) on a scale from min_deps to max_deps.

Boost priority

Fund with Polar

vladdu commented 2 years ago

I looked a little at this feature, considering to use the "rich" library for the rendering. It has a Table object that simplifies things a lot, but unfortunately it doesn't have some styling methods that I would need (for example, banding the rows and columns' background according to the level of the element), so it's probably easiest to keep the current renderer. Maybe use "rich" but not for the table itself.

Anyway, the question is how to specify the styling. I'm thinking about a function that takes a matrix and the coordinates of the current cell (should even include tha headers, I think) and return some style. It's probably best to give it a try and see how it feels.

pawamoy commented 2 years ago

I don't really have an opinion on this. If you have ideas and want to prototype something, with rich for example, go for it! I'm sure the output can be made beautiful thanks to it. However I'd favor putting coloring libraries as extras (under a cli or tui extra for example), to avoid adding too many dependencies to the project. It should stay light when used as a library only.