Update layout

For #51
This commit is contained in:
usov_i 2023-02-15 14:11:58 +01:00
parent bb8c158591
commit 06f89842d6
5 changed files with 56 additions and 65 deletions

View File

@ -526,8 +526,8 @@ def create():
plot = figure( plot = figure(
x_range=Range1d(), x_range=Range1d(),
y_range=Range1d(), y_range=Range1d(),
plot_height=450, plot_height=550,
plot_width=450 + 32, plot_width=550 + 32,
tools="pan,wheel_zoom,reset", tools="pan,wheel_zoom,reset",
) )
plot.toolbar.logo = None plot.toolbar.logo = None
@ -611,17 +611,20 @@ def create():
row(app_dlfiles.button, plot_list), row(app_dlfiles.button, plot_list),
) )
hkl_layout = column(
hkl_div,
row(hkl_normal, hkl_cut, hkl_delta, Spacer(width=10), hkl_in_plane_x, hkl_in_plane_y),
)
disting_layout = column(disting_opt_div, disting_opt_cb)
column2_layout = column( column2_layout = column(
row(upload_data_div, upload_data, plot_file), row(upload_data_div, upload_data, plot_file),
row(
plot, plot,
row(hkl_layout, k_vectors), column(
row(disting_layout, tol_k_ni), hkl_div,
row(hkl_normal, hkl_cut, hkl_delta),
row(hkl_in_plane_x, hkl_in_plane_y),
k_vectors,
tol_k_ni,
disting_opt_div,
disting_opt_cb,
),
),
) )
tab_layout = row(column1_layout, column2_layout) tab_layout = row(column1_layout, column2_layout)

View File

@ -30,8 +30,8 @@ import pyzebra
IMAGE_W = 256 IMAGE_W = 256
IMAGE_H = 128 IMAGE_H = 128
IMAGE_PLOT_W = int(IMAGE_W * 2) + 52 IMAGE_PLOT_W = int(IMAGE_W * 2.4) + 52
IMAGE_PLOT_H = int(IMAGE_H * 2) + 27 IMAGE_PLOT_H = int(IMAGE_H * 2.4) + 27
def create(): def create():
@ -301,7 +301,7 @@ def create():
x_range=det_x_range, x_range=det_x_range,
y_range=frame_range, y_range=frame_range,
extra_y_ranges={"scanning_motor": scanning_motor_range}, extra_y_ranges={"scanning_motor": scanning_motor_range},
plot_height=400, plot_height=540,
plot_width=IMAGE_PLOT_W - 3, plot_width=IMAGE_PLOT_W - 3,
tools="pan,box_zoom,wheel_zoom,reset", tools="pan,box_zoom,wheel_zoom,reset",
active_scroll="wheel_zoom", active_scroll="wheel_zoom",
@ -325,7 +325,7 @@ def create():
x_range=det_y_range, x_range=det_y_range,
y_range=frame_range, y_range=frame_range,
extra_y_ranges={"scanning_motor": scanning_motor_range}, extra_y_ranges={"scanning_motor": scanning_motor_range},
plot_height=400, plot_height=540,
plot_width=IMAGE_PLOT_H + 22, plot_width=IMAGE_PLOT_H + 22,
tools="pan,box_zoom,wheel_zoom,reset", tools="pan,box_zoom,wheel_zoom,reset",
active_scroll="wheel_zoom", active_scroll="wheel_zoom",

View File

@ -35,8 +35,8 @@ import pyzebra
IMAGE_W = 256 IMAGE_W = 256
IMAGE_H = 128 IMAGE_H = 128
IMAGE_PLOT_W = int(IMAGE_W * 2) + 52 IMAGE_PLOT_W = int(IMAGE_W * 2.4) + 52
IMAGE_PLOT_H = int(IMAGE_H * 2) + 27 IMAGE_PLOT_H = int(IMAGE_H * 2.4) + 27
def create(): def create():
@ -585,7 +585,7 @@ def create():
y_range=frame_range, y_range=frame_range,
extra_x_ranges={"gamma": gamma_range}, extra_x_ranges={"gamma": gamma_range},
extra_y_ranges={"scanning_motor": scanning_motor_range}, extra_y_ranges={"scanning_motor": scanning_motor_range},
plot_height=450, plot_height=540,
plot_width=IMAGE_PLOT_W - 3, plot_width=IMAGE_PLOT_W - 3,
tools="pan,box_zoom,wheel_zoom,reset", tools="pan,box_zoom,wheel_zoom,reset",
active_scroll="wheel_zoom", active_scroll="wheel_zoom",
@ -613,7 +613,7 @@ def create():
y_range=frame_range, y_range=frame_range,
extra_x_ranges={"nu": nu_range}, extra_x_ranges={"nu": nu_range},
extra_y_ranges={"scanning_motor": scanning_motor_range}, extra_y_ranges={"scanning_motor": scanning_motor_range},
plot_height=450, plot_height=540,
plot_width=IMAGE_PLOT_H + 22, plot_width=IMAGE_PLOT_H + 22,
tools="pan,box_zoom,wheel_zoom,reset", tools="pan,box_zoom,wheel_zoom,reset",
active_scroll="wheel_zoom", active_scroll="wheel_zoom",

View File

@ -29,7 +29,7 @@ from pyzebra.app.panel_hdf_viewer import calculate_hkl
def create(): def create():
_update_slice = None _update_slice = None
measured_data_div = Div(text="Measured data:") measured_data_div = Div(text="Measured <b>HDF</b> data:")
measured_data = FileInput(accept=".hdf", multiple=True, width=200) measured_data = FileInput(accept=".hdf", multiple=True, width=200)
upload_hkl_div = Div(text="Open hkl/mhkl data:") upload_hkl_div = Div(text="Open hkl/mhkl data:")
@ -247,8 +247,8 @@ def create():
plot = figure( plot = figure(
x_range=DataRange1d(), x_range=DataRange1d(),
y_range=DataRange1d(), y_range=DataRange1d(),
plot_height=450, plot_height=550,
plot_width=450 + 32, plot_width=550 + 32,
tools="pan,wheel_zoom,reset", tools="pan,wheel_zoom,reset",
) )
plot.toolbar.logo = None plot.toolbar.logo = None
@ -341,46 +341,30 @@ def create():
auto_range_cb.on_change("active", auto_range_cb_callback) auto_range_cb.on_change("active", auto_range_cb_callback)
auto_range_cb.active = [0] auto_range_cb.active = [0]
range_layout = row(
column(Spacer(height=19), auto_range_cb),
xrange_min_ni,
xrange_max_ni,
yrange_min_ni,
yrange_max_ni,
Spacer(width=27),
xrange_step_ni,
yrange_step_ni,
)
cm_layout = row(colormap_select, display_min_ni, display_max_ni)
column1_layout = column( column1_layout = column(
row( row(
column(row(measured_data_div, measured_data), row(upload_hkl_div, upload_hkl_fi)), column(row(measured_data_div, measured_data), row(upload_hkl_div, upload_hkl_fi)),
plot_file, plot_file,
), ),
row(
plot, plot,
column( column(
hkl_div, hkl_div,
row( row(hkl_normal, hkl_cut, hkl_delta),
hkl_normal, row(hkl_in_plane_x, hkl_in_plane_y),
hkl_cut, colormap_select,
hkl_delta, row(display_min_ni, display_max_ni),
Spacer(width=10), row(column(Spacer(height=19), auto_range_cb)),
hkl_in_plane_x, row(xrange_min_ni, xrange_max_ni),
hkl_in_plane_y, row(yrange_min_ni, yrange_max_ni),
Spacer(width=10), row(xrange_step_ni, yrange_step_ni),
cm_layout, ),
), ),
row(column(Spacer(height=7), redef_lattice_cb), redef_lattice_ti), row(column(Spacer(height=7), redef_lattice_cb), redef_lattice_ti),
row(column(Spacer(height=7), redef_ub_cb), redef_ub_ti), row(column(Spacer(height=7), redef_ub_cb), redef_ub_ti),
range_layout,
),
) )
column2_layout = app.PlotHKL().layout column2_layout = app.PlotHKL().layout
hdf_div = Div(text="<b>HDF DATA</b>") tab_layout = row(column1_layout, Spacer(width=50), column2_layout)
ccl_div = Div(text="<b>CCL DATA</b>")
tab_layout = row(
column(hdf_div, column1_layout), Spacer(width=70), column(ccl_div, column2_layout)
)
return Panel(child=tab_layout, title="plot data") return Panel(child=tab_layout, title="plot data")

View File

@ -32,7 +32,7 @@ import pyzebra
class PlotHKL: class PlotHKL:
def __init__(self): def __init__(self):
_update_slice = None _update_slice = None
measured_data_div = Div(text="Measured data:") measured_data_div = Div(text="Measured <b>CCL</b> data:")
measured_data = FileInput(accept=".ccl", multiple=True, width=200) measured_data = FileInput(accept=".ccl", multiple=True, width=200)
upload_hkl_div = Div(text="Open hkl/mhkl data:") upload_hkl_div = Div(text="Open hkl/mhkl data:")
@ -366,8 +366,8 @@ class PlotHKL:
plot = figure( plot = figure(
x_range=Range1d(), x_range=Range1d(),
y_range=Range1d(), y_range=Range1d(),
plot_height=450, plot_height=550,
plot_width=450 + 32, plot_width=550 + 32,
tools="pan,wheel_zoom,reset", tools="pan,wheel_zoom,reset",
) )
plot.toolbar.logo = None plot.toolbar.logo = None
@ -434,19 +434,23 @@ class PlotHKL:
res_mult_ni = NumericInput(title="Resolution mult:", value=10, mode="int", width=100) res_mult_ni = NumericInput(title="Resolution mult:", value=10, mode="int", width=100)
tol_k_ni = NumericInput(title="k tolerance:", value=0.01, mode="float", width=100) tol_k_ni = NumericInput(title="k tolerance:", value=0.01, mode="float", width=100)
hkl_layout = column(
hkl_div,
row(hkl_normal, hkl_cut, hkl_delta, Spacer(width=10), hkl_in_plane_x, hkl_in_plane_y),
)
disting_layout = column(disting_opt_div, row(disting_opt_cb, disting_opt_rb))
layout = column( layout = column(
row( row(
column(row(measured_data_div, measured_data), row(upload_hkl_div, upload_hkl_fi)), column(row(measured_data_div, measured_data), row(upload_hkl_div, upload_hkl_fi)),
plot_file, plot_file,
), ),
row(
plot, plot,
row(hkl_layout, k_vectors), column(
row(disting_layout, column(tol_k_ni, res_mult_ni)), hkl_div,
row(hkl_normal, hkl_cut, hkl_delta),
row(hkl_in_plane_x, hkl_in_plane_y),
k_vectors,
row(tol_k_ni, res_mult_ni),
disting_opt_div,
disting_opt_cb,
disting_opt_rb,
),
),
) )
self.layout = layout self.layout = layout