[ANN] PlutoTables: edit any Julia object in a tabular interface


Edit [and show, wip] arbitrary Julia objects in a tabular interface. Based on Pluto and PlutoUI for interactivity, Accessors and AccessorsExtra for object modification.

Pluto and PlutoUI interactivity is very convenient, but those widgets only support basic types like numbers and strings. Often, one needs to edit an arbitrary object, with potentially nested and repeated properties. PlutoTables provides several tabular input widgets for Julia objects, see the notebook for a list of examples.

Specific parameters to edit are specified using the Accessors/AccessorsExtra optic syntax, and can include a wide range of transformations or selection functions.
A simple example of a tabular UI for editing a tuple-of-namedtuples:

See also

  • Accessors and AccessorsExtra packages for generically referring to parts and transformations of arbitrary objects (so-called “optics”)
  • AccessibleOptimization using a very similar approach to define optimization problems, including model fitting
  • PlutoUIExtra package that includes a sidebar pluto widget. Sidebar is useful with both tabular inputs from PlutoTables and other UI elements.

PlutoTables has just been registered in General.


Thank you for putting this table together. I think it might be useful for one of my projects. I have a group of sliders such as:

x1 = @bind x1 Slider(0:10, default=5)
x2 = @bind x2 Slider(0:10, default=5)
xn = @bind xn Slider(0:10, default=5)

each in a different cell. Unfortunately, this makes it difficult to see the plot they are manipulating. Organizing the sliders into a R x C table would make things easier to see. Is there a way I can accomplish that with your package so I can see the the slider variable labels (e.g., x1)? The row and column labels would not be necessary in this case.

Currently, PlutoTables only does columns and rows in a “systematic” way: eg, a column for each element of a collection, a row for each property of that object.

For convenience, you can combine your variables into a struct, or a couple of structs that make sense in your case. Then, PlutoTables can create a widget per struct, potentially saving space already.

Also, it’s often convenient to place PlutoTables widgets that control plots or other major outputs into a sidebar that stays aside and doesn’t scroll with the main notebook content.
This looks like this (add @binds to actually obtain object values):

Here, PlutoUIExtra is under registration in General, install it from Alexander Plavin / PlutoUIExtra.jl · GitLab url for now.