optimized grouping in the graph

also small js and css optimisations