Table widgets#

In order to control interactive plots, sometimes we need to vary certain parameters which depend on the data stored in the table. Therefore, table object has several widgets, which can be used for that purpose.

The table we are going to use as an example is:

import os

import ubermagtable as ut

# Sample OOMMF .odt file
dirname = os.path.join("..", "ubermagtable", "tests", "test_sample")
odtfile = os.path.join(dirname, "oommf-new-file2.odt")

table = ut.Table.fromfile(odtfile, x="t")


Slider widget allows us to restrict the time values shown in an interactive plot. Slider widget is:


The minimum value of the slider is the minimum time value, whereas the maximum value is the maximum time value. The steps on the slider correspond to the time step in data.

Widget description is generated by default, and can be changed by passing description argument.

table.slider(description="my slider")

Similar to plots, we can change the multiplier:


We now get the values in picoseconds and the units are shown in the widget description.

Slider is based on ipywidgets.SelectionSlider, so any keyword arguments accepted by it can be passed.


We can get a slider for any variable by passing it via x:


Value selector#

A simple widget, which allows us to select the columns from data table can be obtained using selector.


This returns a selection widget with all data columns present in the table. This method is based on ipywidgets.SelectMultiple, so any keyword argument accepted by it can be passed.