added swichs: group by and calc based on. Also optimized function fade() for sankey graph.