polychron.presenters.DatingResultsPresenter
Module
DatingResultsPresenter
Bases: FramePresenter[DatingResultsView, ProjectSelection]
Presenter for the Dating Results page/tab.
Todo
- "no node" is a valid label provided by the user, this should probably be left None until it is included in the view.
results_list
instance-attribute
results_list: dict[str, None] = {}
Contexts and phase boundaries which have been selected via the right click option.
A dictionary of None values is used so that the "list" (keys) contains unique values, in insertion order. (set's do not maintain insertion order)
node
instance-attribute
node = 'no node'
The currenly selected node for right click operations
phase_len_nodes
instance-attribute
phase_len_nodes = []
Used during testmenu2 (right click menu) operations, seimilar to self.node
fig
instance-attribute
fig = None
A handle to a matplotlib figure being presented.
on_file_save
on_file_save() -> None
Callback for the File > Save project progress menu command
Formerly a call to startpage::save_state_1
on_button_posterior_densities
on_button_posterior_densities() -> None
Callback for when the "Posterior densities" button is pressed
Formerly startpage::mcmc_output
on_button_hpd_button
on_button_hpd_button() -> None
Callback for when the "HPD intervals" button is pressed
Formerly startpage::get_hpd_interval
on_button_clear_list_button
on_button_clear_list_button() -> None
Callback for when the "Clear list" button is pressed
Formerly clear_results_list
pre_click
pre_click(*args) -> None
makes test menu appear and removes any previous test menu
formerly PageOne.preClick
on_left
on_left(*args) -> None
hides menu when left clicking
Formerly PageOne.onLeft
on_right
on_right(*args) -> None
Makes the test menu appear after right click
Formerly PageOne.onRight
on_canvas_wheel2
on_canvas_wheel2(event: Any) -> None
Zoom with mouse wheel for the chronological image canvas
Formerly PageOne.wheel2
on_canvas_move_from2
on_canvas_move_from2(event: Any) -> None
Remembers previous coordinates for scrolling with the mouse
Formerly PageOne.move_from2
on_canvas_move_to2
on_canvas_move_to2(event: Any) -> None
Drag (move) canvas to the new position
Formerly PageOne.move_to2
chronograph_render_post
chronograph_render_post() -> None
Formerly PageOne.chronograph_render_post
nodecheck
nodecheck(x_current: int, y_current: int) -> str | None
Returns the node that corresponds to the mouse cooridinates
Formerly PageOne.nodecheck
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x_current
|
int
|
the x coord in image space accounting for translation |
required |
y_current
|
int
|
the y coord in image space accounting for translation |
required |
Returns:
Type | Description |
---|---|
str | None
|
The name of the node clicked on, or None |
Todo
Should this also reset the outline attribtues for non-selected nodes?. It also would need to triggere a re-render for this to be visibly shown to users.
# outline = nx.get_node_attributes(model_model.chronological_dag, "color")
# outline[node_inside] = "red"
# nx.set_node_attributes(model_model.chronological_dag, outline, "color")
clear_results_list
clear_results_list() -> None
clears nodes from results lists
Formerly PageOne.clear_results_list
get_hpd_interval
get_hpd_interval() -> None
loads hpd intervals into the results page
Formerly PageOne.get_hpd_interval
on_testmenu2
on_testmenu2(currentevent: Any) -> None
finds nodes in the chronodag on results page
Formerly PageOn.node_finder
testmenu_get_time_elapsed
testmenu_get_time_elapsed() -> None
When the "get time elasped" option has been selected in the right click menu: - Remove any existing elased_between options - Add a new get time elapsed option.
mcmc_output
mcmc_output() -> None
loads posterior density plots into the graph
Formerly PageOne.mcmc_output