I have the following code, stripped down from the original to the bare essentials:
numbers = Range@30;
Manipulate[Plot[a x^2 - b x^.3 + c x - d, {x, 0, 10}]
, Grid[{
{"a", "b", "c", "d"}
, {Control[{{a, numbers[[3]], ""}, numbers,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]
, Control[{{b, numbers[[5]], ""}, numbers,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]
, Control[{{c, numbers[[7]], ""}, numbers,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]
, Control[{{d, numbers[[9]], ""}, numbers,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]}
}, Dividers -> {{2 -> True, 3 -> True, 4 -> True}, None}]
]
This looks like this:
All is working fine, however, the selection is clumsy, as I have the same selection pane four times. This might even get clumsier in the original, with more selections, and maybe even many more than four times. What I would like to have is the following (a pure mockup that is not working as I wish and describe below):
This should work as follow: Select a variable, e.g. b. Then select the parameter, in this case a number, for b, e.g. 5, using the number pane underneath. Then select another variable, e.g. c and select a number for this variable using the same number pane underneath, etc. In the actual version, the silly number pane will be replaced by a periodic table of elements, and elements are selected for various data presentation.
Addition-------- I probably should have made a more concrete example. So here is a stripped down version much closer to what I try to achieve:
data = {
{"Mg", 3, 4, 2, 5}
, {"Si", 6, 4, 7, 2}
, {"Al", 2, 5, 2, 6}
, {"Sr", 1, 5, 7, 8}
};
a = Sort[ElementData[#, "AtomicNumber"] & /@ Range[40]];
elementsSorted = ElementData[#, "Symbol"] & /@ a;
Manipulate[
posEl1 = Position[data, el1][[1, 1]];
posEl2 = Position[data, el2][[1, 1]];
posEl3 = Position[data, el3][[1, 1]];
ListPlot[
Transpose[{Rest@data[[posEl1]],
Rest@data[[posEl2]]/Rest@data[[posEl3]]}],
PlotRange -> {{0, 10}, {0, 10}}]
, Grid[{
{"x-Axis", "y-Axis nom", "y-Axis denom"}
, {Control[{{el1, elementsSorted[[12]], ""}, elementsSorted,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]
, Control[{{el2, elementsSorted[[14]], ""}, elementsSorted,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]
, Control[{{el3, elementsSorted[[38]], ""}, elementsSorted,
ControlType -> RadioButtonBar,
Appearance -> "Horizontal" -> {Automatic, 6}}]}
}, Dividers -> {{2 -> True, 3 -> True}, None}]
]
The result looks as shown below. As the very reduced dataset only includes 4 elements, only those can be selected to make the plot work. Now, what would be great is, to have a periodic table instead of the pane (actually this is what I would get working). The important bit is to have only one periodic table, and a selector as shown above, for which axis/nominator/denominator I want to select the element.
Manipulator[]
controls does not fit the actual use-case? E.g.,{a, 1, 30, 1, Appearance -> "Labeled"}
etc. (Just checking, because the selector-type controls make the problem seem complicated, to the point of possible needing a custom control.) $\endgroup$