11import {
22 Autocomplete ,
3+ Box ,
34 Card ,
45 CardContent ,
56 Checkbox ,
@@ -34,14 +35,28 @@ export default function LegendBar(): React.JSX.Element {
3435 } ;
3536
3637 return (
37- < Card variant = "outlined" sx = { { flexGrow : 1 , overflow : "scroll" } } >
38- < CardContent >
38+ < Card variant = "outlined" sx = { { flexGrow : 1 , overflow : "hidden" , display : "flex" , flexDirection : "column" } } >
39+ < Box
40+ sx = { {
41+ px : 2 ,
42+ py : 0.75 ,
43+ bgcolor : "grey.100" ,
44+ borderBottom : 1 ,
45+ borderColor : "divider" ,
46+ } }
47+ >
48+ < Typography variant = "subtitle1" fontWeight = { 600 } >
49+ Plot Controls
50+ </ Typography >
51+ </ Box >
52+ < CardContent sx = { { overflow : "auto" } } >
3953 < Stack spacing = { 1 } >
4054 < FormGroup >
4155 { /* Detector */ }
4256 < FormControlLabel
4357 control = {
4458 < Checkbox
59+ size = "small"
4560 checked = { plotConfig . detector }
4661 onChange = { ( _ , checked ) =>
4762 plotConfig . update ( { detector : checked } )
@@ -56,7 +71,7 @@ export default function LegendBar(): React.JSX.Element {
5671 plotConfig . update ( { detectorColor : color . rgb } )
5772 }
5873 />
59- < Typography display = { "flex" } alignItems = { "center" } >
74+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
6075 Detector
6176 </ Typography >
6277 </ Stack >
@@ -67,6 +82,7 @@ export default function LegendBar(): React.JSX.Element {
6782 < FormControlLabel
6883 control = {
6984 < Checkbox
85+ size = "small"
7086 checked = { plotConfig . beamstop }
7187 onChange = { ( _ , checked ) => {
7288 plotConfig . update ( { beamstop : checked } ) ;
@@ -81,7 +97,7 @@ export default function LegendBar(): React.JSX.Element {
8197 plotConfig . update ( { beamstopColor : color . rgb } )
8298 }
8399 />
84- < Typography display = { "flex" } alignItems = { "center" } >
100+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
85101 Beamstop
86102 </ Typography >
87103 </ Stack >
@@ -91,6 +107,7 @@ export default function LegendBar(): React.JSX.Element {
91107 < FormControlLabel
92108 control = {
93109 < Checkbox
110+ size = "small"
94111 checked = { plotConfig . clearance }
95112 onChange = { ( _ , checked ) => {
96113 plotConfig . update ( { clearance : checked } ) ;
@@ -105,7 +122,7 @@ export default function LegendBar(): React.JSX.Element {
105122 plotConfig . update ( { clearanceColor : color . rgb } )
106123 }
107124 />
108- < Typography display = { "flex" } alignItems = { "center" } >
125+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
109126 Clearance
110127 </ Typography >
111128 </ Stack >
@@ -115,6 +132,7 @@ export default function LegendBar(): React.JSX.Element {
115132 < FormControlLabel
116133 control = {
117134 < Checkbox
135+ size = "small"
118136 checked = { plotConfig . visibleRange }
119137 onChange = { ( _ , checked ) =>
120138 plotConfig . update ( { visibleRange : checked } )
@@ -129,7 +147,7 @@ export default function LegendBar(): React.JSX.Element {
129147 plotConfig . update ( { visibleColor : color . rgb } )
130148 }
131149 />
132- < Typography display = { "flex" } alignItems = { "center" } >
150+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
133151 Visible Range
134152 </ Typography >
135153 </ Stack >
@@ -139,6 +157,7 @@ export default function LegendBar(): React.JSX.Element {
139157 < FormControlLabel
140158 control = {
141159 < Checkbox
160+ size = "small"
142161 checked = { plotConfig . requestedRange }
143162 onChange = { ( _ , checked ) =>
144163 plotConfig . update ( { requestedRange : checked } )
@@ -153,7 +172,7 @@ export default function LegendBar(): React.JSX.Element {
153172 plotConfig . update ( { requestedRangeColor : color . rgb } )
154173 }
155174 />
156- < Typography display = { "flex" } alignItems = { "center" } >
175+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
157176 Requested Range
158177 </ Typography >
159178 </ Stack >
@@ -163,6 +182,7 @@ export default function LegendBar(): React.JSX.Element {
163182 < FormControlLabel
164183 control = {
165184 < Checkbox
185+ size = "small"
166186 checked = { plotConfig . inaccessibleRange }
167187 onChange = { ( _ , checked ) =>
168188 plotConfig . update ( { inaccessibleRange : checked } )
@@ -177,7 +197,7 @@ export default function LegendBar(): React.JSX.Element {
177197 plotConfig . update ( { inaccessibleRangeColor : color . rgb } )
178198 }
179199 />
180- < Typography display = { "flex" } alignItems = { "center" } >
200+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
181201 Inaccessible Range
182202 </ Typography >
183203 </ Stack >
@@ -188,6 +208,7 @@ export default function LegendBar(): React.JSX.Element {
188208 < FormControlLabel
189209 control = {
190210 < Checkbox
211+ size = "small"
191212 checked = { plotConfig . cameraTube }
192213 onChange = { ( _ , checked ) =>
193214 plotConfig . update ( { cameraTube : checked } )
@@ -202,7 +223,7 @@ export default function LegendBar(): React.JSX.Element {
202223 plotConfig . update ( { cameraTubeColor : color . rgb } )
203224 }
204225 />
205- < Typography display = { "flex" } alignItems = { "center" } >
226+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
206227 Camera Tube
207228 </ Typography >
208229 </ Stack >
@@ -214,6 +235,7 @@ export default function LegendBar(): React.JSX.Element {
214235 < FormControlLabel
215236 control = {
216237 < Checkbox
238+ size = "small"
217239 checked = { plotConfig . mask }
218240 onChange = { ( _ , checked ) =>
219241 plotConfig . update ( { mask : checked } )
@@ -228,7 +250,7 @@ export default function LegendBar(): React.JSX.Element {
228250 plotConfig . update ( { maskColor : color . rgb } )
229251 }
230252 />
231- < Typography display = { "flex" } alignItems = { "center" } >
253+ < Typography variant = "body2" display = { "flex" } alignItems = { "center" } >
232254 Mask
233255 </ Typography >
234256 </ Stack >
@@ -240,6 +262,7 @@ export default function LegendBar(): React.JSX.Element {
240262 < FormControlLabel
241263 control = {
242264 < Checkbox
265+ size = "small"
243266 checked = { plotConfig . calibrant }
244267 onChange = { ( _ , checked ) =>
245268 plotConfig . update ( { calibrant : checked } )
@@ -274,8 +297,9 @@ export default function LegendBar(): React.JSX.Element {
274297 </ FormGroup >
275298 { /* Axis control */ }
276299 < FormControl >
277- < FormLabel id = "plot-axes-label" > Axes: </ FormLabel >
300+ < FormLabel id = "plot-axes-label" sx = { { typography : "body2" , mb : 0.5 } } > Axes</ FormLabel >
278301 < RadioGroup
302+ row
279303 aria-labelledby = "plot-axes-label"
280304 value = { plotConfig . plotAxes }
281305 name = "radio-buttons-group"
@@ -285,18 +309,18 @@ export default function LegendBar(): React.JSX.Element {
285309 >
286310 < FormControlLabel
287311 value = { PlotAxes . millimetre }
288- control = { < Radio /> }
289- label = "Axes in mm"
312+ control = { < Radio size = "small" /> }
313+ label = "mm"
290314 />
291315 < FormControlLabel
292316 value = { PlotAxes . pixel }
293- control = { < Radio /> }
294- label = "Axes in pixels"
317+ control = { < Radio size = "small" /> }
318+ label = "pixels"
295319 />
296320 < FormControlLabel
297321 value = { PlotAxes . reciprocal }
298- control = { < Radio /> }
299- label = "Axes in q (nm^-1 )"
322+ control = { < Radio size = "small" /> }
323+ label = "q (nm⁻¹ )"
300324 />
301325 </ RadioGroup >
302326 </ FormControl >
0 commit comments