This applies to SolutionsControl, TestsControl and ViewsControl.
var menuOptions = [
{isRadio: true, value: 'MOLECULES', text: new Text( moleculesString, {font: FONT} ), icon: new Image( magnifyingGlassImage, {scale: 0.75} )},
{isRadio: false, text: showSolventString, icon: new H2OMolecule( model )},
{isRadio: true, value: 'EQUILIBRIUM', text: new Node( {children: [
new Text( equilibriumString, {font: FONT, centerX: -6} ),
new Text( concentrationString, {font: FONT, centerX: 0, centerY: 8} )
]} ), icon: new Node( {children: [
new Rectangle( 0, 0, 24.5, 18, {fill: 'white', stroke: 'black', lineWidth: 0.5} ),
new Rectangle( 2, 6, 3, 12, {fill: model.MOLECULES_COLORS.B} ),
new Rectangle( 7.5, 3, 3, 15, {fill: model.MOLECULES_COLORS.H2O} ),
new Rectangle( 13, 9, 3, 9, {fill: model.MOLECULES_COLORS.A} ),
new Rectangle( 18.5, 9, 3, 9, {fill: model.MOLECULES_COLORS.H3O} )
]} )},
{isRadio: true, value: 'LIQUID', text: new Text( liquidString, {font: FONT} ), icon: new Image( beakerImage, {scale: 0.75} )}
];
This array is then passed to a for loop that interprets the various (undocumented) flags and literals to create the UI components and control panel. This is a mess. It makes it difficult to modify existing controls, add new controls, or new control types (the for loop will only handle check boxes or radio buttons).
Please rewrite these control panels so that they are extensible and maintainable. An approach similar to js/view/control-panel/SolutionControl/SolutionControl would be fine.