Draft
Conversation
Owner
I am not sure to which degree it matters how is the colour assigned. Visually, it will always look better to map it according to y-axis as it will show a nice gradient. Mapping it by size at |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a
stratify_by_kargument that allows the user to color links and nodes by a fixed "K" value. In a hierarchical example, this is interesting, since it lets you see what components of a cluster atk"flow into"/"out of" nodes at that strata.This is useful because it lets you investigate cluster co-occurrence while also visualizing similarity for other clusterings. Each edge represents the count of observations moving from
ki->kjthat are in stratumqatstratify_by_k.For linewidths, the
linewidthparameter refers to the (square root) of the width of the root node. I've moved to square root (likesinax.scatter()) because the width here is going to be interpreted in areal units (points^2) rather than directly (points). Each line, then, is actually a parallelogram whose area is proportional to the number ofki->kjobservations in stratumqatstratify_by_k.For colors, the
cmapargument specifies the colormap to use for nodes and edges. The coloring for nodes/edges is calculated for all clusters atk. For clustersk_i<k, we nodes use the count-weighted average color for strata in that node. This works better visually than re-calculating the cluster color fromyusing the colormap because it's easier imho to think in terms of the color combination than it is to estimate the hue between two other hues on a color map, but I have examples that just calculated color based on the colormap at eachkif you're curious. Line colors correspond to the color for stratumqalways.To enable this, I've had to also add a
cmapargument. I think ifstratify_by_k=None,cmapshould color nodes/edges according to the fraction of observations they contain: bigger nodes/more populous links are "higher" values in the colormap. I didn't implement this yet, because I wanted to check:I still need to:
cmapbehaviors without stratification after a decision is made above.