Add blocks to miniview

-Refactor the code to use common block drawing in mini and main graphs
-refactor also the overlay logic. Now it calculates based on the size of
grouping svg element, so also text element is taken into account.
-Add support for dragging the window in miniview