Open OmarShafie opened 4 years ago
Update: I have tried to use different scales however was not impressed by the generated vizualisations
Logarithmic is not very suitable as it shrinks too much of it
The square root scale is better as it is closer to linear
a better mix is a Sqrt(n * lon(n))
but even that was not very interesting change
I found a way, which should work, that is by changing initial layer only
The implementation has been made,
However there is a slight issue as the fraction of the distributed flow is stll linear.
I have another approach, The requirement is that we want to preserve the perception of the weights of the links, but make the changes seems less drastic. For that, we can use a known principle in visualization, which is scaling. Naive scaling of all edges will not preserve some key aspects of sankey, such as if IN == OUT, then it should stay so even after scaling.
Formally, for any 2 edges with weights w1 and w2: if w1 < w2, then w1' < w2'. if w1 = w2, then w1' = w2'. for any node, if sum(IN) = sum(OUT), then sum(IN') = sum(OUT') which equivalent to a probability preserve.
Here is a suggested algorithm, We initially scale all edges, then in a greedy approach we adjust to meet the 3rd rule. sort nodes by importance, for node in nodes: which link is not locked, if IN = OUT, then pass else, change one (meet min/max or LEFT or RIGHT? not sure yet) lock both
A better approach is to start from the most important set of nodes that for a strongly connected components. https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
then scale these and propagate the changes linearly in each direction.
one caveat of this approach, is that links that are on the side
As number of hadiths increases within a search, the link widths (weight) grows linearly, this makes presenting a comparison really difficult as heavy links significantly outlarge lighter ones..
I suggest that as the knowing the exact accumulation of number of hadith in one link is not of sifnificant value to make visual wight in the link grows very slowly..
It is worth trying: (logarithmic scale) Harmonic scale?