🧪 We're running a cheminformatics notebook competition!

Enter by October 4
76 / 103
Slider2D

Slider2D

by marimo team

A 2D slider control for selecting x/y coordinates interactively.

About this notebook

This notebook shows the Slider2D control from the wigglystuff library. It uses marimo and wigglystuff. The notebook loads no dataset. It builds one Slider2D widget with a width and height of 320 pixels. The widget sets the x range from -2.0 to 2.0 and the y range from -1.0 to 1.5.

The reader drags a point inside a square area. The point moves in two directions at the same time. A callout below the widget reads the current values. It shows x and y to three decimal places. It also shows the x bounds and the y bounds.

The marimo cell wraps the Slider2D widget with mo.ui.anywidget. This connection lets the notebook read the widget.x and widget.y values in Python. The callout cell reruns each time the point moves.

Related notebooks