Skip to content

Commit

Permalink
trace selection in global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhsmit committed Oct 30, 2024
1 parent 4ce8765 commit f6a762d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
6 changes: 3 additions & 3 deletions dont_fret/web/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
fret_nodes = FRETStore(TEST_NODES)

burst_figure_selection = [
ListStore[str]([]),
ListStore[str]([]),
ListStore[str](),
ListStore[str](),
]

burst_figure_file_selection = [{}, {}]

trace_selection = PhotonNodeSelection(fret_nodes)
trace_selection = ListStore[str]()

# cfg set to dask manager
data_manager = ThreadedDataManager()
10 changes: 4 additions & 6 deletions dont_fret/web/trace/page.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,6 @@ def photon_values(self) -> list[dict]:
return [{"text": node.name, "value": node.id.hex} for node in self.fret_node.photons]


# move to global state
choice = ListStore[str]([])


@solara.component
def TracePage():
solara.Title(f"{state.APP_TITLE} / Trace")
Expand All @@ -157,12 +153,14 @@ def TracePage():
labels = ["Measurement", "Photons"] # TODO move elsewhere
TRACE_SETTINGS: solara.Reactive[TraceSettings] = solara.use_reactive(TraceSettings())

selectors = NestedSelectors(nodes=selector_nodes, selection=choice, labels=labels)
selectors = NestedSelectors(
nodes=selector_nodes, selection=state.trace_selection, labels=labels
)
with solara.Sidebar():
for level in selectors:
solara.Select(**level)

photon_node = get_photons(state.fret_nodes.items, choice.items)
photon_node = get_photons(state.fret_nodes.items, state.trace_selection.items)
TraceFigure(photon_node, TRACE_SETTINGS.value)
TCSPCFigure(photon_node)

Expand Down

0 comments on commit f6a762d

Please sign in to comment.