Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
A control for cyclical data, such as angles or direction
ResourceFunction["CircularSlider"][x] represents a control that returns the dynamic variable x, over the range {0,360}. | |
ResourceFunction["CircularSlider"][x,max] represents a control that returns the dynamic variable x, over the range {0,max}. | |
ResourceFunction["CircularSlider"][x,max,dx] represents a control that returns the dynamic variable x, over the range {0,max} with a step size dx. |
| "Start" | "Top" | sets the 0 point, and can take the values "Top", "Right", "Bottom", "Left" |
| "Direction" | "CW" | sets the direction for increasing values: "CW", "CCW" or "ACW" |
| "ControlColor" | Red | sets the color of the control knob |
| "Background" | ThemeColor["Background"] | sets the background color. Use None for a transparent background |
| "TrackColor" | LightYellow | sets the color inside the track |
| "ShowValueQ" | True | when True, shows the value of the slider in the center. |
| "Size" | 150 | sets the size of the control. It must be ≥ 0. Tiny,Small,Medium, or Large is also accepted. |
The default circular slider starts at the top and goes from 0 to 360 in the clockwise direction:
| In[1]:= |
| Out[1]= | ![]() |
Use only integer values, for example, using the dx parameter:
| In[2]:= |
| Out[2]= | ![]() |
Use an angle in radians. 0 is to the right, the direction is counter-clockwise, and the range is 0 to 2π:
| In[3]:= | ![]() |
| Out[3]= | ![]() |
Control the position of the start using "Start":
| In[4]:= | ![]() |
| Out[4]= | ![]() |
Control the direction using "Direction":
| In[5]:= | ![]() |
| Out[5]= | ![]() |
By default, the widget works in light and dark mode automatically. If you select your own background color, the color of the text and 0-indicator are adjusted automatically:
| In[6]:= | ![]() |
| Out[6]= | ![]() |
If you set the background to None, the existing background is used:
| In[7]:= | ![]() |
| Out[7]= | ![]() |
Showing the value is optional:
| In[8]:= | ![]() |
| Out[8]= | ![]() |
This work is licensed under a Creative Commons Attribution 4.0 International License