JFG-784 Display legend as tree and add possibility to collapse it

!NOTE! first of all should be merged https://github.com/griddynamics/jagger/pull/529
please, mention, why is ti required