[IMG282] UI for load data
- Original Gitlab story: IMG282
This PR introduces the following changes:
- updated
MetaData
andDataLoading
class that serialize itself into json for output - utility function to handle json input
- corresponding ui unit test based off
PlayWright
- please following this documentation to perform ui tests locally.
To test the two stages, copy the following code in a cell
import panel as pn
from imars3d.ui.stages.metadata import MetaData
from imars3d.ui.stages.dataloading import DataLoader
pn.extension("jsoneditor")
# build the pipeline
wizard = pn.pipeline.Pipeline(
stages=[
("Metadata", MetaData),
("Load Data", DataLoader),
],
debug=True,
)
# NOTE: we have to disable the axes linking as it will try to link with
# the "ct" viewers in the pipeline.
wizard.network.linked_axes = False
wizard.servable()
and you should be able to see the app in the cell
Alternatively, you can use this script at the root of the repo with panel serve test.py
to view the two stages as a web app.
#!/usr/bin/env python3
import panel as pn
from imars3d.ui.stages.metadata import MetaData
from imars3d.ui.stages.dataloading import DataLoader
pn.extension("jsoneditor")
# build the pipeline
wizard = pn.pipeline.Pipeline(
stages=[
("Metadata", MetaData),
("Load Data", DataLoader),
],
debug=True,
)
# NOTE: we have to disable the axes linking as it will try to link with
# the "ct" viewers in the pipeline.
wizard.network.linked_axes = False
# setup via template
pn.template.FastListTemplate(
site="iMars3D demo",
title="Neutron Image Reconstruction",
logo="HFIR_SNS_logo.png",
header_background="#00A170",
main=wizard,
# theme="dark",
theme_toggle=False,
).servable()
Known issue:
The JSONEditor widget from
Update: the issue is resolved by adding a manual trigger after dict update to force a redraw of the JSONEditor.panel
does not auto refresh when its underlying dictionary is updated.