Creating a slider based on values from a list

Introduction

Making a slider take anything but linear values involves some sort of two-step process. In this case looking up the value from a list. This list value is shown in a text box instead of the actual slider value. (This side originally created by Jonas Hall)

Sample construction

When to use

This is useful when you want to changa a variable across a discrete range of values:
  • Showing values from a data table
  • Showing particular samples that are not linear, such as whn archimedes calculated the value of pi by inscribing and circumscribing a 3-, 6-, 12-, 24-, 48- and a 96-gon.

How do you do this?

The construction above uses the following KEY ELEMENTS:
  • A list: Create a list, L, of the values you want the list to take.
  • A slider: Create an integer slider n in the range from 1 to Length(L) with a step size of 1. Hide the label completely.
  • A number: Let a = L(n).
  • A text box: Define a text box with the text "n = a", where a is the dynamic object a slected from the drop-down objects menu in the text box dialogue.

Screencast of construction

More examples