Open buddhike opened 6 years ago
@ojizero Do you think ApplyFilters
should return a more detailed information to support operations like this or is there a better way to do this?
@buddyspike I'm not sure if ApplyFilters should return more detailed info, since it would expand it's scope from simply applying filters on a manifest, into generating addition info from a manifest. Thoughts ?
It does not necessarily have to be in ApplyFilters
. Could be a wrapper around it. But I guess we need a function that would return a set of filtered modules, their dependencies and dependents in expanded form. This would make it easier to implement operations like "grouped visualisation" right?
For example, what if the return type of ApplyFilters
is something like:
type FilteredModules struct {
Modules Modules
Dependencies Modules // Expanded dependencies
Dependants Modules // Expanded dependents
}
Just a thought, I'm sure something will flesh out once you get the fingers on the keyboard 😄 .
Hmmm, wouldn't it be a little bit redundant having a structure to hold both modules, and their dependencies and dependents? That is, you can extract all the info in such structure directly from the Modules struct (so long as you're in lib package) so why duplicate this info. 😬
@buddyspike I am wondering if the serializer should receive some form of options parameters (akin to the ApplyFilters for example) that could be used to define it's intended output, for example something of the likes of
type SerializeOpts struct {
showDependents bool
showDependencies bool
mainColor string
dependentsColor string
dependenciesColor string
}
and based on the passed options the serializer emits the needed graph, this way we can isolate graph generation and all its needed information inside the serializer function (potentially through other methods that aren't exported).
@buddyspike sorry for the delay on my end but I couldn't find much free time in the past weeks 😅, I opened #116 to discuss how I tried to go about changing the SerializeAsDot method.
@ojizero, Don't apologise man 😄. Thanks again for the awesome contributions. Take it easy!
When used with
--name
and--graph
options indescribe
command, this feature will emit a dot graph containing the dependents and dependencies of the filtered modules.They should be colour coded and grouped for easy identification of relationship.