Javascript visualization working