ccu.fancyplots._gui.fed

GUI widgets for displaying free energy diagrams.

Specifically, this module provides the FreeEnergyDiagram and TightFreeEnergyDiagram classes.

class ccu.fancyplots._gui.fed.FreeEnergyDiagram(parent: FancyPlotsGUI, *args, **kwargs)[source]

Bases: Toplevel

View the free energy diagram.

Variables:
  • canvas – The FigureCanvasTkAgg in which the free energy diagram in plotted.

  • coordinate_label – The ttk.Label used to display the mouse coordinates.

  • cleanup_button – The ttk.Button used to preview the diagram with a tight layout.

  • introduction – The ttk.Label used to display the cursor coordinate hint.

  • parent – The FancyPlotsGUI.

  • tooltip – The Tooltip used to display the tight layout hint.

Create a window for displaying a free energy diagram.

Parameters:
_bind_keys() None[source]

Configure key bindings for the widget.

_organize() None[source]
generate_figure() tuple[Axes | None, Axes | None, Figure | None][source]

Generate the free energy diagram.

Returns:

The output of plotting.generate_figure() if a mechanism is defined. Otherwise, (None, None, None).

mouse_coordinates(event: Event) None[source]

Update the mouse coordinates label.

Parameters:

event – A “<Control-Motion>” tk.Event.

resize() None[source]

Resize the window using the formatting parameter.

tight_layout_on_press(_: Event) None[source]

Generate a free energy diagram with a tight layout.

tight_layout_on_release(_: Event) None[source]

Destroy the tight layout free energy diagram.

update_graph() bool[source]

Update the free energy diagram.

Returns:

True if the graph was successfully updated. False, otherwise.

class ccu.fancyplots._gui.fed.TightFreeEnergyDiagram(parent: FancyPlotsGUI, *args, **kwargs)[source]

Bases: Toplevel

View the free energy diagram with a tight layout.

Create a window for displaying a tight layout free energy diagram.

Parameters:
  • parent – The running root.FancyPlotsGUI instance.

  • *args – Positional arguments for tkinter.Toplevel.

  • **kwargs – Keyword arguments fo tkinter.Toplevel.