emitting ipython events javascript more efficiently