import gradio as gr def update_position(data): # data will be the position of the rectangle, expected to be a JSON string return data # Here you can parse and use the position data as needed html_code = """
""" interface = gr.Interface( fn=update_position, inputs=gr.HTML(), outputs="json", allow_flagging="never", live=True ) interface.launch(server_name='0.0.0.0', server_port=7860)