def project_point(cb, msg, attributes=('<STR_LIT:x>', '<STR_LIT:y>')):
if skip(cb, msg, attributes): return msg<EOL>plot = get_cb_plot(cb)<EOL>x, y = msg.get('<STR_LIT:x>', <NUM_LIT:0>), msg.get('<STR_LIT:y>', <NUM_LIT:0>)<EOL>crs = plot.current_frame.crs<EOL>coordinates = crs.transform_points(plot.projection, np.array([x]), np.array([y]))<EOL>msg['<STR_LIT:x>'], msg['<STR_LIT:y>'] = coordinates[<NUM_LIT:0>, :<NUM_LIT:2>]<EOL>return {k: v for k, v in msg.items() if k in attributes}<EOL>
Projects a single point supplied by a callback