rewriting the vis control code as typescript class