mod2b add click on legend / improve text popover / cleanup code