Layout improvements
This commit is contained in:
parent
1b90d53466
commit
f43488af34
@ -78,7 +78,7 @@ def create():
|
||||
ccl_file_list.append((os.path.join(ccl_path, file), file))
|
||||
file_select.options = ccl_file_list
|
||||
|
||||
proposal_textinput = TextInput(title="Proposal number:", default_size=145)
|
||||
proposal_textinput = TextInput(title="Proposal number:", width=210)
|
||||
proposal_textinput.on_change("value", proposal_textinput_callback)
|
||||
|
||||
def _init_datatable():
|
||||
@ -100,7 +100,7 @@ def create():
|
||||
def ccl_file_select_callback(_attr, _old, _new):
|
||||
pass
|
||||
|
||||
file_select = MultiSelect(title="Available .ccl/.dat files:", default_size=200, height=250)
|
||||
file_select = MultiSelect(title="Available .ccl/.dat files:", width=210, height=250)
|
||||
file_select.on_change("value", ccl_file_select_callback)
|
||||
|
||||
def file_open_button_callback():
|
||||
@ -122,7 +122,7 @@ def create():
|
||||
_init_datatable()
|
||||
_update_preview()
|
||||
|
||||
file_open_button = Button(label="Open New", default_size=100)
|
||||
file_open_button = Button(label="Open New", width=100)
|
||||
file_open_button.on_click(file_open_button_callback)
|
||||
|
||||
def file_append_button_callback():
|
||||
@ -136,7 +136,7 @@ def create():
|
||||
|
||||
_init_datatable()
|
||||
|
||||
file_append_button = Button(label="Append", default_size=100)
|
||||
file_append_button = Button(label="Append", width=100)
|
||||
file_append_button.on_click(file_append_button_callback)
|
||||
|
||||
def upload_button_callback(_attr, _old, new):
|
||||
@ -159,7 +159,7 @@ def create():
|
||||
_update_preview()
|
||||
|
||||
upload_div = Div(text="or upload new .ccl/.dat files:", margin=(5, 5, 0, 5))
|
||||
upload_button = FileInput(accept=".ccl,.dat", multiple=True, default_size=200)
|
||||
upload_button = FileInput(accept=".ccl,.dat", multiple=True, width=200)
|
||||
upload_button.on_change("value", upload_button_callback)
|
||||
|
||||
def append_upload_button_callback(_attr, _old, new):
|
||||
@ -174,7 +174,7 @@ def create():
|
||||
_init_datatable()
|
||||
|
||||
append_upload_div = Div(text="append extra files:", margin=(5, 5, 0, 5))
|
||||
append_upload_button = FileInput(accept=".ccl,.dat", multiple=True, default_size=200)
|
||||
append_upload_button = FileInput(accept=".ccl,.dat", multiple=True, width=200)
|
||||
append_upload_button.on_change("value", append_upload_button_callback)
|
||||
|
||||
def monitor_spinner_callback(_attr, old, new):
|
||||
@ -341,13 +341,13 @@ def create():
|
||||
def fit_from_spinner_callback(_attr, _old, new):
|
||||
fit_from_span.location = new
|
||||
|
||||
fit_from_spinner = Spinner(title="Fit from:", default_size=145)
|
||||
fit_from_spinner = Spinner(title="Fit from:", width=145)
|
||||
fit_from_spinner.on_change("value", fit_from_spinner_callback)
|
||||
|
||||
def fit_to_spinner_callback(_attr, _old, new):
|
||||
fit_to_span.location = new
|
||||
|
||||
fit_to_spinner = Spinner(title="to:", default_size=145)
|
||||
fit_to_spinner = Spinner(title="to:", width=145)
|
||||
fit_to_spinner.on_change("value", fit_to_spinner_callback)
|
||||
|
||||
def fitparams_add_dropdown_callback(click):
|
||||
@ -366,7 +366,7 @@ def create():
|
||||
("Pseudo Voigt", "pvoigt"),
|
||||
# ("Pseudo Voigt1", "pseudovoigt1"),
|
||||
],
|
||||
default_size=145,
|
||||
width=145,
|
||||
disabled=True,
|
||||
)
|
||||
fitparams_add_dropdown.on_click(fitparams_add_dropdown_callback)
|
||||
@ -387,7 +387,7 @@ def create():
|
||||
else:
|
||||
fitparams_table_source.data.update(dict(param=[], value=[], vary=[], min=[], max=[]))
|
||||
|
||||
fitparams_select = MultiSelect(options=[], height=120, default_size=145)
|
||||
fitparams_select = MultiSelect(options=[], height=120, width=145)
|
||||
fitparams_select.tags = [0]
|
||||
fitparams_select.on_change("value", fitparams_select_callback)
|
||||
|
||||
@ -402,7 +402,7 @@ def create():
|
||||
|
||||
fitparams_select.value = []
|
||||
|
||||
fitparams_remove_button = Button(label="Remove fit function", default_size=145, disabled=True)
|
||||
fitparams_remove_button = Button(label="Remove fit function", width=145, disabled=True)
|
||||
fitparams_remove_button.on_click(fitparams_remove_button_callback)
|
||||
|
||||
def fitparams_factory(function):
|
||||
@ -465,7 +465,7 @@ def create():
|
||||
_update_table()
|
||||
_update_preview()
|
||||
|
||||
fit_all_button = Button(label="Fit All", button_type="primary", default_size=145)
|
||||
fit_all_button = Button(label="Fit All", button_type="primary", width=145)
|
||||
fit_all_button.on_click(fit_all_button_callback)
|
||||
|
||||
def fit_button_callback():
|
||||
@ -478,23 +478,21 @@ def create():
|
||||
_update_table()
|
||||
_update_preview()
|
||||
|
||||
fit_button = Button(label="Fit Current", default_size=145)
|
||||
fit_button = Button(label="Fit Current", width=145)
|
||||
fit_button.on_click(fit_button_callback)
|
||||
|
||||
def area_method_radiobutton_callback(_handler):
|
||||
_update_preview()
|
||||
|
||||
area_method_radiobutton = RadioButtonGroup(
|
||||
labels=["Fit area", "Int area"], active=0, default_size=145, disabled=True
|
||||
labels=["Fit area", "Int area"], active=0, width=145, disabled=True
|
||||
)
|
||||
area_method_radiobutton.on_click(area_method_radiobutton_callback)
|
||||
|
||||
def lorentz_checkbox_callback(_handler):
|
||||
_update_preview()
|
||||
|
||||
lorentz_checkbox = CheckboxGroup(
|
||||
labels=["Lorentz Correction"], default_size=145, margin=[13, 5, 5, 5]
|
||||
)
|
||||
lorentz_checkbox = CheckboxGroup(labels=["Lorentz Correction"], width=145, margin=[13, 5, 5, 5])
|
||||
lorentz_checkbox.on_click(lorentz_checkbox_callback)
|
||||
|
||||
export_preview_textinput = TextAreaInput(title="Export file preview:", width=500, height=400)
|
||||
@ -534,11 +532,11 @@ def create():
|
||||
_update_preview()
|
||||
|
||||
hkl_precision_select = Select(
|
||||
title="hkl precision:", options=["2", "3", "4"], value="2", default_size=80
|
||||
title="hkl precision:", options=["2", "3", "4"], value="2", width=80
|
||||
)
|
||||
hkl_precision_select.on_change("value", hkl_precision_select_callback)
|
||||
|
||||
save_button = Button(label="Download File", button_type="success", default_size=200)
|
||||
save_button = Button(label="Download File", button_type="success", width=200)
|
||||
save_button.js_on_click(CustomJS(args={"js_data": js_data}, code=javaScript))
|
||||
|
||||
fitpeak_controls = row(
|
||||
|
@ -53,7 +53,7 @@ def create():
|
||||
reflectionPrinter_format_select.value = config.reflectionPrinter_format
|
||||
|
||||
if config.algorithm == "adaptivemaxcog":
|
||||
algorithm_tabs.active = 0
|
||||
algorithm_params.active = 0
|
||||
threshold_textinput.value = config.threshold
|
||||
shell_textinput.value = config.shell
|
||||
steepness_textinput.value = config.steepness
|
||||
@ -62,7 +62,7 @@ def create():
|
||||
aps_window_textinput.value = str(tuple(map(int, config.aps_window.values())))
|
||||
|
||||
elif config.algorithm == "adaptivedynamic":
|
||||
algorithm_tabs.active = 1
|
||||
algorithm_params.active = 1
|
||||
adm_window_textinput.value = str(tuple(map(int, config.adm_window.values())))
|
||||
border_textinput.value = str(tuple(map(int, config.border.values())))
|
||||
minWindow_textinput.value = str(tuple(map(int, config.minWindow.values())))
|
||||
@ -80,8 +80,8 @@ def create():
|
||||
with io.BytesIO(base64.b64decode(new)) as file:
|
||||
_load_config_file(file)
|
||||
|
||||
upload_div = Div(text="Open XML configuration file:")
|
||||
upload_button = FileInput(accept=".xml")
|
||||
upload_div = Div(text="Open .xml config:")
|
||||
upload_button = FileInput(accept=".xml", width=200)
|
||||
upload_button.on_change("value", upload_button_callback)
|
||||
|
||||
# General parameters
|
||||
@ -89,7 +89,7 @@ def create():
|
||||
def logfile_textinput_callback(_attr, _old, new):
|
||||
config.logfile = new
|
||||
|
||||
logfile_textinput = TextInput(title="Logfile:", value="logfile.log", width=320)
|
||||
logfile_textinput = TextInput(title="Logfile:", value="logfile.log")
|
||||
logfile_textinput.on_change("value", logfile_textinput_callback)
|
||||
|
||||
def logfile_verbosity_select_callback(_attr, _old, new):
|
||||
@ -125,20 +125,20 @@ def create():
|
||||
ranges.append(re.findall(r"\b\d+\b", line))
|
||||
config.filelist_ranges = ranges
|
||||
|
||||
filelist_ranges_textareainput = TextAreaInput(title="ranges:", height=100)
|
||||
filelist_ranges_textareainput = TextAreaInput(title="ranges:", rows=1)
|
||||
filelist_ranges_textareainput.on_change("value", filelist_ranges_textareainput_callback)
|
||||
|
||||
# ---- crystal
|
||||
def crystal_sample_textinput_callback(_attr, _old, new):
|
||||
config.crystal_sample = new
|
||||
|
||||
crystal_sample_textinput = TextInput(title="Sample Name:")
|
||||
crystal_sample_textinput = TextInput(title="Sample Name:", width=290)
|
||||
crystal_sample_textinput.on_change("value", crystal_sample_textinput_callback)
|
||||
|
||||
def lambda_textinput_callback(_attr, _old, new):
|
||||
config.crystal_lambda = new
|
||||
|
||||
lambda_textinput = TextInput(title="lambda:", width=145)
|
||||
lambda_textinput = TextInput(title="lambda:", width=100)
|
||||
lambda_textinput.on_change("value", lambda_textinput_callback)
|
||||
|
||||
def ub_textareainput_callback(_attr, _old, new):
|
||||
@ -150,19 +150,19 @@ def create():
|
||||
def zeroOM_textinput_callback(_attr, _old, new):
|
||||
config.crystal_zeroOM = new
|
||||
|
||||
zeroOM_textinput = TextInput(title="zeroOM:", width=145)
|
||||
zeroOM_textinput = TextInput(title="zeroOM:", width=100)
|
||||
zeroOM_textinput.on_change("value", zeroOM_textinput_callback)
|
||||
|
||||
def zeroSTT_textinput_callback(_attr, _old, new):
|
||||
config.crystal_zeroSTT = new
|
||||
|
||||
zeroSTT_textinput = TextInput(title="zeroSTT:", width=145)
|
||||
zeroSTT_textinput = TextInput(title="zeroSTT:", width=100)
|
||||
zeroSTT_textinput.on_change("value", zeroSTT_textinput_callback)
|
||||
|
||||
def zeroCHI_textinput_callback(_attr, _old, new):
|
||||
config.crystal_zeroCHI = new
|
||||
|
||||
zeroCHI_textinput = TextInput(title="zeroCHI:", width=145)
|
||||
zeroCHI_textinput = TextInput(title="zeroCHI:", width=100)
|
||||
zeroCHI_textinput.on_change("value", zeroCHI_textinput_callback)
|
||||
|
||||
# ---- DataFactory
|
||||
@ -210,42 +210,42 @@ def create():
|
||||
def threshold_textinput_callback(_attr, _old, new):
|
||||
config.threshold = new
|
||||
|
||||
threshold_textinput = TextInput(title="Threshold:")
|
||||
threshold_textinput = TextInput(title="Threshold:", width=145)
|
||||
threshold_textinput.on_change("value", threshold_textinput_callback)
|
||||
|
||||
# ---- shell
|
||||
def shell_textinput_callback(_attr, _old, new):
|
||||
config.shell = new
|
||||
|
||||
shell_textinput = TextInput(title="Shell:")
|
||||
shell_textinput = TextInput(title="Shell:", width=145)
|
||||
shell_textinput.on_change("value", shell_textinput_callback)
|
||||
|
||||
# ---- steepness
|
||||
def steepness_textinput_callback(_attr, _old, new):
|
||||
config.steepness = new
|
||||
|
||||
steepness_textinput = TextInput(title="Steepness:")
|
||||
steepness_textinput = TextInput(title="Steepness:", width=145)
|
||||
steepness_textinput.on_change("value", steepness_textinput_callback)
|
||||
|
||||
# ---- duplicateDistance
|
||||
def duplicateDistance_textinput_callback(_attr, _old, new):
|
||||
config.duplicateDistance = new
|
||||
|
||||
duplicateDistance_textinput = TextInput(title="Duplicate Distance:")
|
||||
duplicateDistance_textinput = TextInput(title="Duplicate Distance:", width=145)
|
||||
duplicateDistance_textinput.on_change("value", duplicateDistance_textinput_callback)
|
||||
|
||||
# ---- maxequal
|
||||
def maxequal_textinput_callback(_attr, _old, new):
|
||||
config.maxequal = new
|
||||
|
||||
maxequal_textinput = TextInput(title="Max Equal:")
|
||||
maxequal_textinput = TextInput(title="Max Equal:", width=145)
|
||||
maxequal_textinput.on_change("value", maxequal_textinput_callback)
|
||||
|
||||
# ---- window
|
||||
def aps_window_textinput_callback(_attr, _old, new):
|
||||
config.aps_window = dict(zip(("x", "y", "z"), re.findall(r"\b\d+\b", new)))
|
||||
|
||||
aps_window_textinput = TextInput(title="Window (x, y, z):")
|
||||
aps_window_textinput = TextInput(title="Window (x, y, z):", width=145)
|
||||
aps_window_textinput.on_change("value", aps_window_textinput_callback)
|
||||
|
||||
# Adaptive Dynamic Mask Integration (adaptivedynamic)
|
||||
@ -253,56 +253,56 @@ def create():
|
||||
def adm_window_textinput_callback(_attr, _old, new):
|
||||
config.adm_window = dict(zip(("x", "y", "z"), re.findall(r"\b\d+\b", new)))
|
||||
|
||||
adm_window_textinput = TextInput(title="Window (x, y, z):")
|
||||
adm_window_textinput = TextInput(title="Window (x, y, z):", width=145)
|
||||
adm_window_textinput.on_change("value", adm_window_textinput_callback)
|
||||
|
||||
# ---- border
|
||||
def border_textinput_callback(_attr, _old, new):
|
||||
config.border = dict(zip(("x", "y", "z"), re.findall(r"\b\d+\b", new)))
|
||||
|
||||
border_textinput = TextInput(title="Border (x, y, z):")
|
||||
border_textinput = TextInput(title="Border (x, y, z):", width=145)
|
||||
border_textinput.on_change("value", border_textinput_callback)
|
||||
|
||||
# ---- minWindow
|
||||
def minWindow_textinput_callback(_attr, _old, new):
|
||||
config.minWindow = dict(zip(("x", "y", "z"), re.findall(r"\b\d+\b", new)))
|
||||
|
||||
minWindow_textinput = TextInput(title="Min Window (x, y, z):")
|
||||
minWindow_textinput = TextInput(title="Min Window (x, y, z):", width=145)
|
||||
minWindow_textinput.on_change("value", minWindow_textinput_callback)
|
||||
|
||||
# ---- reflectionFile
|
||||
def reflectionFile_textinput_callback(_attr, _old, new):
|
||||
config.reflectionFile = new
|
||||
|
||||
reflectionFile_textinput = TextInput(title="Reflection File:")
|
||||
reflectionFile_textinput = TextInput(title="Reflection File:", width=145)
|
||||
reflectionFile_textinput.on_change("value", reflectionFile_textinput_callback)
|
||||
|
||||
# ---- targetMonitor
|
||||
def targetMonitor_textinput_callback(_attr, _old, new):
|
||||
config.targetMonitor = new
|
||||
|
||||
targetMonitor_textinput = TextInput(title="Target Monitor:")
|
||||
targetMonitor_textinput = TextInput(title="Target Monitor:", width=145)
|
||||
targetMonitor_textinput.on_change("value", targetMonitor_textinput_callback)
|
||||
|
||||
# ---- smoothSize
|
||||
def smoothSize_textinput_callback(_attr, _old, new):
|
||||
config.smoothSize = new
|
||||
|
||||
smoothSize_textinput = TextInput(title="Smooth Size:")
|
||||
smoothSize_textinput = TextInput(title="Smooth Size:", width=145)
|
||||
smoothSize_textinput.on_change("value", smoothSize_textinput_callback)
|
||||
|
||||
# ---- loop
|
||||
def loop_textinput_callback(_attr, _old, new):
|
||||
config.loop = new
|
||||
|
||||
loop_textinput = TextInput(title="Loop:")
|
||||
loop_textinput = TextInput(title="Loop:", width=145)
|
||||
loop_textinput.on_change("value", loop_textinput_callback)
|
||||
|
||||
# ---- minPeakCount
|
||||
def minPeakCount_textinput_callback(_attr, _old, new):
|
||||
config.minPeakCount = new
|
||||
|
||||
minPeakCount_textinput = TextInput(title="Min Peak Count:")
|
||||
minPeakCount_textinput = TextInput(title="Min Peak Count:", width=145)
|
||||
minPeakCount_textinput.on_change("value", minPeakCount_textinput_callback)
|
||||
|
||||
# ---- displacementCurve
|
||||
@ -313,7 +313,7 @@ def create():
|
||||
config.displacementCurve = maps
|
||||
|
||||
displacementCurve_textinput = TextAreaInput(
|
||||
title="Displacement Curve (twotheta, x, y):", height=100
|
||||
title="Displ. Curve (2θ, x, y):", width=145, height=100
|
||||
)
|
||||
displacementCurve_textinput.on_change("value", displacementCurve_textinput_callback)
|
||||
|
||||
@ -323,36 +323,26 @@ def create():
|
||||
else:
|
||||
config.algorithm = "adaptivedynamic"
|
||||
|
||||
algorithm_tabs = Tabs(
|
||||
algorithm_params = Tabs(
|
||||
tabs=[
|
||||
Panel(
|
||||
child=column(
|
||||
threshold_textinput,
|
||||
shell_textinput,
|
||||
steepness_textinput,
|
||||
duplicateDistance_textinput,
|
||||
maxequal_textinput,
|
||||
aps_window_textinput,
|
||||
row(threshold_textinput, shell_textinput, steepness_textinput),
|
||||
row(duplicateDistance_textinput, maxequal_textinput, aps_window_textinput),
|
||||
),
|
||||
title="Adaptive Peak Search",
|
||||
title="Peak Search",
|
||||
),
|
||||
Panel(
|
||||
child=column(
|
||||
adm_window_textinput,
|
||||
border_textinput,
|
||||
minWindow_textinput,
|
||||
reflectionFile_textinput,
|
||||
targetMonitor_textinput,
|
||||
smoothSize_textinput,
|
||||
loop_textinput,
|
||||
minPeakCount_textinput,
|
||||
displacementCurve_textinput,
|
||||
row(adm_window_textinput, border_textinput, minWindow_textinput),
|
||||
row(reflectionFile_textinput, targetMonitor_textinput, smoothSize_textinput),
|
||||
row(loop_textinput, minPeakCount_textinput, displacementCurve_textinput),
|
||||
),
|
||||
title="Adaptive Dynamic Integration",
|
||||
title="Dynamic Integration",
|
||||
),
|
||||
]
|
||||
)
|
||||
algorithm_tabs.on_change("active", algorithm_tabs_callback)
|
||||
algorithm_params.on_change("active", algorithm_tabs_callback)
|
||||
|
||||
def process_button_callback():
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
@ -369,34 +359,31 @@ def create():
|
||||
process_button = Button(label="Process", button_type="primary")
|
||||
process_button.on_click(process_button_callback)
|
||||
|
||||
output_log = TextAreaInput(title="Logfile output:", height=600, disabled=True)
|
||||
output_config = TextAreaInput(title="Current config:", height=600, width=400, disabled=True)
|
||||
output_log = TextAreaInput(title="Logfile output:", height=320, width=465, disabled=True)
|
||||
output_config = TextAreaInput(title="Current config:", height=320, width=465, disabled=True)
|
||||
|
||||
general_params_layout = column(
|
||||
row(column(Spacer(height=2), upload_div), upload_button),
|
||||
row(logfile_textinput, logfile_verbosity_select),
|
||||
row(filelist_type, filelist_format_textinput),
|
||||
filelist_datapath_textinput,
|
||||
filelist_ranges_textareainput,
|
||||
crystal_sample_textinput,
|
||||
row(lambda_textinput, zeroOM_textinput),
|
||||
row(zeroSTT_textinput, zeroCHI_textinput),
|
||||
row(crystal_sample_textinput, lambda_textinput),
|
||||
ub_textareainput,
|
||||
row(zeroOM_textinput, zeroSTT_textinput, zeroCHI_textinput),
|
||||
row(
|
||||
dataFactory_implementation_select,
|
||||
dataFactory_dist1_textinput,
|
||||
dataFactory_dist2_textinput,
|
||||
dataFactory_dist3_textinput,
|
||||
),
|
||||
reflectionPrinter_format_select,
|
||||
row(reflectionPrinter_format_select),
|
||||
)
|
||||
|
||||
tab_layout = column(
|
||||
row(column(Spacer(height=2), upload_div), upload_button),
|
||||
row(
|
||||
general_params_layout,
|
||||
algorithm_tabs,
|
||||
column(row(output_config, output_log), row(process_button)),
|
||||
),
|
||||
tab_layout = row(
|
||||
general_params_layout,
|
||||
column(output_config, algorithm_params, row(process_button)),
|
||||
output_log,
|
||||
)
|
||||
|
||||
async def update_config():
|
||||
|
@ -59,7 +59,7 @@ def create():
|
||||
filelist.options = file_list
|
||||
filelist.value = file_list[0][0]
|
||||
|
||||
proposal_textinput = TextInput(title="Enter proposal number:", default_size=145)
|
||||
proposal_textinput = TextInput(title="Enter proposal number:", width=145)
|
||||
proposal_textinput.on_change("value", proposal_textinput_callback)
|
||||
|
||||
def upload_button_callback(_attr, _old, new):
|
||||
@ -176,7 +176,7 @@ def create():
|
||||
def index_spinner_callback(_attr, _old, new):
|
||||
update_image(new)
|
||||
|
||||
index_spinner = Spinner(title="Image index:", value=0, low=0)
|
||||
index_spinner = Spinner(title="Image index:", value=0, low=0, width=80)
|
||||
index_spinner.on_change("value", index_spinner_callback)
|
||||
|
||||
plot = Plot(
|
||||
@ -429,7 +429,7 @@ def create():
|
||||
overview_plot_x_image_glyph.color_mapper = LinearColorMapper(palette=cmap_dict[new])
|
||||
overview_plot_y_image_glyph.color_mapper = LinearColorMapper(palette=cmap_dict[new])
|
||||
|
||||
colormap = Select(title="Colormap:", options=list(cmap_dict.keys()), default_size=145)
|
||||
colormap = Select(title="Colormap:", options=list(cmap_dict.keys()), width=210)
|
||||
colormap.on_change("value", colormap_callback)
|
||||
colormap.value = "plasma"
|
||||
|
||||
@ -446,7 +446,7 @@ def create():
|
||||
update_image()
|
||||
|
||||
main_auto_checkbox = CheckboxGroup(
|
||||
labels=["Main Auto Range"], active=[0], default_size=145, margin=[10, 5, 0, 5]
|
||||
labels=["Main Auto Range"], active=[0], width=145, margin=[10, 5, 0, 5]
|
||||
)
|
||||
main_auto_checkbox.on_click(main_auto_checkbox_callback)
|
||||
|
||||
@ -459,7 +459,7 @@ def create():
|
||||
value=1,
|
||||
step=STEP,
|
||||
disabled=bool(main_auto_checkbox.active),
|
||||
default_size=95,
|
||||
width=100,
|
||||
height=31,
|
||||
)
|
||||
display_max_spinner.on_change("value", display_max_spinner_callback)
|
||||
@ -474,7 +474,7 @@ def create():
|
||||
value=0,
|
||||
step=STEP,
|
||||
disabled=bool(main_auto_checkbox.active),
|
||||
default_size=95,
|
||||
width=100,
|
||||
height=31,
|
||||
)
|
||||
display_min_spinner.on_change("value", display_min_spinner_callback)
|
||||
@ -492,7 +492,7 @@ def create():
|
||||
update_overview_plot()
|
||||
|
||||
proj_auto_checkbox = CheckboxGroup(
|
||||
labels=["Projections Auto Range"], active=[0], default_size=145, margin=[10, 5, 0, 5]
|
||||
labels=["Projections Auto Range"], active=[0], width=145, margin=[10, 5, 0, 5]
|
||||
)
|
||||
proj_auto_checkbox.on_click(proj_auto_checkbox_callback)
|
||||
|
||||
@ -506,7 +506,7 @@ def create():
|
||||
value=1,
|
||||
step=PROJ_STEP,
|
||||
disabled=bool(proj_auto_checkbox.active),
|
||||
default_size=95,
|
||||
width=100,
|
||||
height=31,
|
||||
)
|
||||
proj_display_max_spinner.on_change("value", proj_display_max_spinner_callback)
|
||||
@ -522,7 +522,7 @@ def create():
|
||||
value=0,
|
||||
step=PROJ_STEP,
|
||||
disabled=bool(proj_auto_checkbox.active),
|
||||
default_size=95,
|
||||
width=100,
|
||||
height=31,
|
||||
)
|
||||
proj_display_min_spinner.on_change("value", proj_display_min_spinner_callback)
|
||||
@ -532,7 +532,7 @@ def create():
|
||||
h, k, l = calculate_hkl(det_data, index)
|
||||
image_source.data.update(h=[h], k=[k], l=[l])
|
||||
|
||||
hkl_button = Button(label="Calculate hkl (slow)")
|
||||
hkl_button = Button(label="Calculate hkl (slow)", width=210)
|
||||
hkl_button.on_click(hkl_button_callback)
|
||||
|
||||
selection_list = TextAreaInput(rows=7)
|
||||
@ -559,9 +559,9 @@ def create():
|
||||
selection_button = Button(label="Add selection")
|
||||
selection_button.on_click(selection_button_callback)
|
||||
|
||||
mf_spinner = Spinner(title="Magnetic field:", format="0.00", width=145, disabled=True)
|
||||
temp_spinner = Spinner(title="Temperature:", format="0.00", width=145, disabled=True)
|
||||
geometry_textinput = TextInput(title="Geometry:", disabled=True)
|
||||
mf_spinner = Spinner(title="Magnetic field:", format="0.00", width=100, disabled=True)
|
||||
temp_spinner = Spinner(title="Temperature:", format="0.00", width=100, disabled=True)
|
||||
geometry_textinput = TextInput(title="Geometry:", width=120, disabled=True)
|
||||
|
||||
# Final layout
|
||||
layout_image = column(gridplot([[proj_v, None], [plot, proj_h]], merge_tools=False))
|
||||
@ -572,15 +572,13 @@ def create():
|
||||
proj_auto_checkbox,
|
||||
row(proj_display_min_spinner, proj_display_max_spinner),
|
||||
)
|
||||
hkl_layout = column(geometry_textinput, hkl_button)
|
||||
params_layout = row(mf_spinner, temp_spinner)
|
||||
|
||||
layout_controls = row(
|
||||
column(selection_button, selection_list),
|
||||
Spacer(width=20),
|
||||
column(colormap_layout),
|
||||
Spacer(width=20),
|
||||
column(index_spinner, params_layout, hkl_layout),
|
||||
column(row(mf_spinner, temp_spinner), row(geometry_textinput, index_spinner), hkl_button),
|
||||
)
|
||||
|
||||
layout_overview = column(
|
||||
|
@ -87,7 +87,7 @@ def create():
|
||||
dat_file_list.append((os.path.join(full_proposal_path, file), file))
|
||||
file_select.options = dat_file_list
|
||||
|
||||
proposal_textinput = TextInput(title="Proposal number:", default_size=200)
|
||||
proposal_textinput = TextInput(title="Proposal number:", width=210)
|
||||
proposal_textinput.on_change("value", proposal_textinput_callback)
|
||||
|
||||
def _init_datatable():
|
||||
@ -111,7 +111,7 @@ def create():
|
||||
def file_select_callback(_attr, _old, _new):
|
||||
pass
|
||||
|
||||
file_select = MultiSelect(title="Available .dat files:", default_size=200, height=250)
|
||||
file_select = MultiSelect(title="Available .dat files:", width=210, height=250)
|
||||
file_select.on_change("value", file_select_callback)
|
||||
|
||||
def file_open_button_callback():
|
||||
@ -132,7 +132,7 @@ def create():
|
||||
_init_datatable()
|
||||
_update_preview()
|
||||
|
||||
file_open_button = Button(label="Open New", default_size=100)
|
||||
file_open_button = Button(label="Open New", width=100)
|
||||
file_open_button.on_click(file_open_button_callback)
|
||||
|
||||
def file_append_button_callback():
|
||||
@ -146,7 +146,7 @@ def create():
|
||||
|
||||
_init_datatable()
|
||||
|
||||
file_append_button = Button(label="Append", default_size=100)
|
||||
file_append_button = Button(label="Append", width=100)
|
||||
file_append_button.on_click(file_append_button_callback)
|
||||
|
||||
def upload_button_callback(_attr, _old, new):
|
||||
@ -168,7 +168,7 @@ def create():
|
||||
_update_preview()
|
||||
|
||||
upload_div = Div(text="or upload new .dat files:", margin=(5, 5, 0, 5))
|
||||
upload_button = FileInput(accept=".dat", multiple=True, default_size=200)
|
||||
upload_button = FileInput(accept=".dat", multiple=True, width=200)
|
||||
upload_button.on_change("value", upload_button_callback)
|
||||
|
||||
def append_upload_button_callback(_attr, _old, new):
|
||||
@ -183,7 +183,7 @@ def create():
|
||||
_init_datatable()
|
||||
|
||||
append_upload_div = Div(text="append extra files:", margin=(5, 5, 0, 5))
|
||||
append_upload_button = FileInput(accept=".dat", multiple=True, default_size=200)
|
||||
append_upload_button = FileInput(accept=".dat", multiple=True, width=200)
|
||||
append_upload_button.on_change("value", append_upload_button_callback)
|
||||
|
||||
def monitor_spinner_callback(_attr, _old, new):
|
||||
@ -429,20 +429,20 @@ def create():
|
||||
title="Parameter:",
|
||||
options=["user defined", "temp", "mf", "h", "k", "l"],
|
||||
value="user defined",
|
||||
default_size=145,
|
||||
width=145,
|
||||
)
|
||||
param_select.on_change("value", param_select_callback)
|
||||
|
||||
def fit_from_spinner_callback(_attr, _old, new):
|
||||
fit_from_span.location = new
|
||||
|
||||
fit_from_spinner = Spinner(title="Fit from:", default_size=145)
|
||||
fit_from_spinner = Spinner(title="Fit from:", width=145)
|
||||
fit_from_spinner.on_change("value", fit_from_spinner_callback)
|
||||
|
||||
def fit_to_spinner_callback(_attr, _old, new):
|
||||
fit_to_span.location = new
|
||||
|
||||
fit_to_spinner = Spinner(title="to:", default_size=145)
|
||||
fit_to_spinner = Spinner(title="to:", width=145)
|
||||
fit_to_spinner.on_change("value", fit_to_spinner_callback)
|
||||
|
||||
def fitparams_add_dropdown_callback(click):
|
||||
@ -461,7 +461,7 @@ def create():
|
||||
("Pseudo Voigt", "pvoigt"),
|
||||
# ("Pseudo Voigt1", "pseudovoigt1"),
|
||||
],
|
||||
default_size=145,
|
||||
width=145,
|
||||
)
|
||||
fitparams_add_dropdown.on_click(fitparams_add_dropdown_callback)
|
||||
|
||||
@ -481,7 +481,7 @@ def create():
|
||||
else:
|
||||
fitparams_table_source.data.update(dict(param=[], value=[], vary=[], min=[], max=[]))
|
||||
|
||||
fitparams_select = MultiSelect(options=[], height=120, default_size=145)
|
||||
fitparams_select = MultiSelect(options=[], height=120, width=145)
|
||||
fitparams_select.tags = [0]
|
||||
fitparams_select.on_change("value", fitparams_select_callback)
|
||||
|
||||
@ -496,7 +496,7 @@ def create():
|
||||
|
||||
fitparams_select.value = []
|
||||
|
||||
fitparams_remove_button = Button(label="Remove fit function", default_size=145)
|
||||
fitparams_remove_button = Button(label="Remove fit function", width=145)
|
||||
fitparams_remove_button.on_click(fitparams_remove_button_callback)
|
||||
|
||||
def fitparams_factory(function):
|
||||
@ -559,7 +559,7 @@ def create():
|
||||
_update_table()
|
||||
_update_preview()
|
||||
|
||||
fit_all_button = Button(label="Fit All", button_type="primary", default_size=145)
|
||||
fit_all_button = Button(label="Fit All", button_type="primary", width=145)
|
||||
fit_all_button.on_click(fit_all_button_callback)
|
||||
|
||||
def fit_button_callback():
|
||||
@ -572,23 +572,21 @@ def create():
|
||||
_update_table()
|
||||
_update_preview()
|
||||
|
||||
fit_button = Button(label="Fit Current", default_size=145)
|
||||
fit_button = Button(label="Fit Current", width=145)
|
||||
fit_button.on_click(fit_button_callback)
|
||||
|
||||
def area_method_radiobutton_callback(_handler):
|
||||
_update_preview()
|
||||
|
||||
area_method_radiobutton = RadioButtonGroup(
|
||||
labels=["Fit area", "Int area"], active=0, default_size=145, disabled=True
|
||||
labels=["Fit area", "Int area"], active=0, width=145, disabled=True
|
||||
)
|
||||
area_method_radiobutton.on_click(area_method_radiobutton_callback)
|
||||
|
||||
def lorentz_checkbox_callback(_handler):
|
||||
_update_preview()
|
||||
|
||||
lorentz_checkbox = CheckboxGroup(
|
||||
labels=["Lorentz Correction"], default_size=145, margin=[13, 5, 5, 5]
|
||||
)
|
||||
lorentz_checkbox = CheckboxGroup(labels=["Lorentz Correction"], width=145, margin=[13, 5, 5, 5])
|
||||
lorentz_checkbox.on_click(lorentz_checkbox_callback)
|
||||
|
||||
export_preview_textinput = TextAreaInput(title="Export file preview:", width=450, height=400)
|
||||
@ -623,7 +621,7 @@ def create():
|
||||
js_data.data.update(content=file_content)
|
||||
export_preview_textinput.value = exported_content
|
||||
|
||||
save_button = Button(label="Download File", button_type="success", default_size=220)
|
||||
save_button = Button(label="Download File", button_type="success", width=220)
|
||||
save_button.js_on_click(CustomJS(args={"js_data": js_data}, code=javaScript))
|
||||
|
||||
fitpeak_controls = row(
|
||||
|
@ -28,11 +28,11 @@ def create():
|
||||
lattice_const_textinput = TextInput(
|
||||
title="Lattice constants:", value="8.3211,8.3211,8.3211,90.00,90.00,90.00"
|
||||
)
|
||||
max_res_spinner = Spinner(title="max-res", value=2, step=0.01)
|
||||
seed_pool_size_spinner = Spinner(title="seed-pool-size", value=5, step=0.01)
|
||||
seed_len_tol_spinner = Spinner(title="seed-len-tol", value=0.02, step=0.01)
|
||||
seed_angle_tol_spinner = Spinner(title="seed-angle-tol", value=1, step=0.01)
|
||||
eval_hkl_tol_spinner = Spinner(title="eval-hkl-tol", value=0.15, step=0.01)
|
||||
max_res_spinner = Spinner(title="max-res:", value=2, step=0.01, width=145)
|
||||
seed_pool_size_spinner = Spinner(title="seed-pool-size:", value=5, step=0.01, width=145)
|
||||
seed_len_tol_spinner = Spinner(title="seed-len-tol:", value=0.02, step=0.01, width=145)
|
||||
seed_angle_tol_spinner = Spinner(title="seed-angle-tol:", value=1, step=0.01, width=145)
|
||||
eval_hkl_tol_spinner = Spinner(title="eval-hkl-tol:", value=0.15, step=0.01, width=145)
|
||||
|
||||
diff_vec = []
|
||||
ub_matrices = []
|
||||
@ -172,11 +172,9 @@ def create():
|
||||
path_prefix_textinput,
|
||||
selection_list,
|
||||
lattice_const_textinput,
|
||||
max_res_spinner,
|
||||
seed_pool_size_spinner,
|
||||
seed_len_tol_spinner,
|
||||
seed_angle_tol_spinner,
|
||||
eval_hkl_tol_spinner,
|
||||
row(max_res_spinner, seed_pool_size_spinner),
|
||||
row(seed_len_tol_spinner, seed_angle_tol_spinner),
|
||||
row(eval_hkl_tol_spinner),
|
||||
process_button,
|
||||
),
|
||||
column(results_table, row(ub_matrix_textareainput, hkl_textareainput)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user