fixed #5 added legend extension, behavior show/hide for layer legend, histogram and main canvas