Dialogs for manipulating formatoptions.
Classes:
|
A dialog to modify the basemap settings. |
|
A dialog to modify color bounds and colormaps. |
|
A preview widget of a colorbar. |
|
A dummy plotter for the colorbar preview. |
|
A widget to update a formatoption. |
|
A dialog to change labels. |
|
A widget to change a formatoption. |
- class psy_view.dialogs.BasemapDialog(plotter: Plotter, *args, **kwargs)[source]
Bases:
QDialog
A dialog to modify the basemap settings.
Attributes:
A box for selecting the background image
Button box to cancel the operator or update the plotter
colors that affect the map background
Get default colors for the color labels in
widgets
.group box drawing grid lines and labels
group box for modifying the resolution of the land-sea-mask, see
opt_110m
,opt_50m
,opt_10m
Group box for options specific to meridionals (see
opt_meri_auto
,opt_meri_at
andopt_meri_every
,opt_meri_num
)Radiobutton for 10m resolution of lsm
Radiobutton for 110m resolution of lsm
Radiobutton for 50m resolution of lsm
Radio button for using the
google_map_detail
formatoptionRadiobutton for giving the exact position of meridionals (see
txt_meri_at
)Radiobutton for automatic drawing of meridionals
Radiobutton for equal-width spaced meridionals (see
txt_meri_every
)Radiobutton to draw a specific number of meridionals with equal-distance (see also
txt_meri_num
)Radiobutton for giving the exact position of parallels (see
txt_para_at
)Radiobutton for automatic drawing of parallels
Radiobutton for equal-width spaced parallels (see
txt_para_every
)Radiobutton to draw a specific number of parallels with equal-distance (see also
txt_para_num
)Radio button for using the
stock_image
formatoptionGroup box for options specific to parallels (see
opt_para_auto
,opt_para_at
andopt_para_every
,opt_para_num
)Test box for specifying the detail
text box for the central latitude (clat formatoption)
text box for the central longitude (clon formatoption)
text box for the fontsize of grid labels
Text field to enter the location of the meridionals on the map (see
opt_meri_at
)Text box to specify the distance between two meridionals (see
opt_meri_every
)Text box to set the number of meridionals to be shown (see
opt_meri_num
)Text field to enter the location of the parallels on the map (see
opt_para_at
)Text box to specify the distance between two parallels (see
opt_para_every
)Text box to set the number of parallels to be shown (see
opt_para_num
)Get the formatoptions of this dialog to update a plotter.
Methods:
fill_from_plotter
(plotter)Fill the dialog from a given plotter.
get_colors
(plotter)Get the colors for
widgets
from the plotter formatoptions.Update text widgets for the options to draw merdionals and parallels.
update_plotter
(plotter)Open a
BasemapDialog
to update a plotter.- background_img_box
A box for selecting the background image
- button_box
Button box to cancel the operator or update the plotter
- colors
colors that affect the map background
- fill_from_plotter(plotter: Plotter) None [source]
Fill the dialog from a given plotter.
- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter to get the formatoptions from.
- get_colors(plotter: Plotter) Dict[str, Any] [source]
Get the colors for
widgets
from the plotter formatoptions.- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter with the formatoptions
- Returns:
A mapping from formatoptions in
colors
to the corresponding color in the plotter.- Return type:
- grid_labels_box
group box drawing grid lines and labels
- lsm_box
group box for modifying the resolution of the land-sea-mask, see
opt_110m
,opt_50m
,opt_10m
- meridionals_box
Group box for options specific to meridionals (see
opt_meri_auto
,opt_meri_at
andopt_meri_every
,opt_meri_num
)
- opt_10m
Radiobutton for 10m resolution of lsm
- opt_110m
Radiobutton for 110m resolution of lsm
- opt_50m
Radiobutton for 50m resolution of lsm
- opt_google_image
Radio button for using the
google_map_detail
formatoption
- opt_meri_at
Radiobutton for giving the exact position of meridionals (see
txt_meri_at
)
- opt_meri_auto
Radiobutton for automatic drawing of meridionals
- opt_meri_every
Radiobutton for equal-width spaced meridionals (see
txt_meri_every
)
- opt_meri_num
Radiobutton to draw a specific number of meridionals with equal-distance (see also
txt_meri_num
)
- opt_para_at
Radiobutton for giving the exact position of parallels (see
txt_para_at
)
- opt_para_auto
Radiobutton for automatic drawing of parallels
- opt_para_every
Radiobutton for equal-width spaced parallels (see
txt_para_every
)
- opt_para_num
Radiobutton to draw a specific number of parallels with equal-distance (see also
txt_para_num
)
- opt_stock_img
Radio button for using the
stock_image
formatoption
- parallels_box
Group box for options specific to parallels (see
opt_para_auto
,opt_para_at
andopt_para_every
,opt_para_num
)
- sb_google_image
Test box for specifying the detail
- txt_clat
text box for the central latitude (clat formatoption)
- txt_clon
text box for the central longitude (clon formatoption)
- txt_grid_fontsize
text box for the fontsize of grid labels
- txt_meri_at
Text field to enter the location of the meridionals on the map (see
opt_meri_at
)
- txt_meri_every
Text box to specify the distance between two meridionals (see
opt_meri_every
)
- txt_meri_num
Text box to set the number of meridionals to be shown (see
opt_meri_num
)
- txt_para_at
Text field to enter the location of the parallels on the map (see
opt_para_at
)
- txt_para_every
Text box to specify the distance between two parallels (see
opt_para_every
)
- txt_para_num
Text box to set the number of parallels to be shown (see
opt_para_num
)
- classmethod update_plotter(plotter: Plotter) None [source]
Open a
BasemapDialog
to update a plotter.- Parameters:
plotter (psy_maps.plotters.MapPlotter) – The plotter to update.
- class psy_view.dialogs.CmapDialog(project: Project, *args, **kwargs)[source]
Bases:
QDialog
A dialog to modify color bounds and colormaps.
Attributes:
Button box to accept or cancel this dialog
ColorbarPreview
to show a preview of the colorbar with the selected formatoption infmt_widgets
Mapping from formatoption key to
LabelWidgetLine
widgets to controlling the formatoptionMap from formatoption in
fmt_widgets
to values.Get the plotter with the formatoptions we use to fill this dialog.
tabs for switching between bounds (
bounds_widget
) and colorbar ticks (cticks_widget
)Methods:
Update the
cbar_preview
from the variousfmt_widgets
.update_project
(project)Create a
CmapDialog
to update a project- button_box
Button box to accept or cancel this dialog
- cbar_preview
ColorbarPreview
to show a preview of the colorbar with the selected formatoption infmt_widgets
- fmt_widgets
Mapping from formatoption key to
LabelWidgetLine
widgets to controlling the formatoption
- property fmts: Dict[str, Any]
Map from formatoption in
fmt_widgets
to values.
- tabs
tabs for switching between bounds (
bounds_widget
) and colorbar ticks (cticks_widget
)
- update_preview() None [source]
Update the
cbar_preview
from the variousfmt_widgets
.
- classmethod update_project(project: Project) None [source]
Create a
CmapDialog
to update a projectThis classmethod creates a new
CmapDialog
instance, fills it with the formatoptions of the first plotter in project, enters the main event loop, and updates the project upon acceptance.- Parameters:
project (psyplot.project.Project) – The psyplot project to update
- psy_view.dialogs.Color(*args, **kwds) = typing.Any
Find a more appropriate description here
- Type:
TODO
- class psy_view.dialogs.ColorbarPreview(plotter: Plotter, parent: QWidget | None = None, *args, **kwargs)[source]
Bases:
FigureCanvasQTAgg
A preview widget of a colorbar.
This matplotlib figure contains one single axes to display the colorbar filled by the formatoptions of a given plotter.
Attributes:
Create a plotter with the formatoptions of the real
plotter
.The plotter to use for displaying the colorbar
Methods:
init_colorbar
(plotter)Initialize the colorbar.
resizeEvent
(event)Reimplemented to make sure we cannot get smaller than 0.
update_colorbar
(**kwargs)Update the colorbar with new formatoptions.
- property fake_plotter: FakePlotter
Create a plotter with the formatoptions of the real
plotter
.We can update this plotter without impacting the origin
plotter
- init_colorbar(plotter: Plotter) None [source]
Initialize the colorbar.
This method extracts the formatoptions of the given plotter and draws the colorbar.
- plotter
The plotter to use for displaying the colorbar
- update_colorbar(**kwargs) None [source]
Update the colorbar with new formatoptions.
This method takes the
fake_plotter
, updates it from the given kwargs, updates the colorbar preview.- Parameters:
**kwargs – bounds, cmap, cticks or cbar formatoption keyword-value pairs
- class psy_view.dialogs.FakePlotter(data=None, ax=None, auto_update=None, project=None, draw=False, make_plot=True, clear=False, enable_post=False, **kwargs)[source]
Bases:
Plotter
A dummy plotter for the colorbar preview.
Attributes:
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
Dummy formatoption for static type checking.
- bounds: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotter
formatoptions are, used inColorbarPreview.fake_plotter
- cbar: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotter
formatoptions are, used inColorbarPreview.fake_plotter
- cmap: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotter
formatoptions are, used inColorbarPreview.fake_plotter
- cticks: Formatoption
Dummy formatoption for static type checking.
This is just a workaround for the static type checker to be able to tell what the
FakePlotter
formatoptions are, used inColorbarPreview.fake_plotter
- class psy_view.dialogs.FormatoptionsEditor(fmto: Formatoption, *args, **kwargs)[source]
Bases:
QWidget
A widget to update a formatoption.
This widget is a light-weight version of the
psyplot_gui.fmt_widget.FormatoptionsWidget
class. It contains a line editor and a text editor to set the value of a specific formatoption.Attributes:
A tool button to switch from the single line editor
line_edit
to the multi-line editortext_edit
Check if the value in this editor differs from the original fmto.
The
Formatoption
that fills this widgetValue of the
fmto
at the initialization of this widgetA single line editor holding the formatoption value (see also
text_edit
andbtn_multiline
)True if the
text_edit
should be visible.A multi-line editor holiding the value of
fmto
(see alsoline_edit
andbtn_multiline
)Load the value of
text
with yaml.Methods:
Clear the editor.
get_obj
()Alias for
value
.insert_obj
(obj)Add a string to the formatoption widget.
set_obj
(obj)Clear the editor and set another object.
- btn_multiline
A tool button to switch from the single line editor
line_edit
to the multi-line editortext_edit
- fmto
The
Formatoption
that fills this widget
- line_edit
A single line editor holding the formatoption value (see also
text_edit
andbtn_multiline
)
- text_edit
A multi-line editor holiding the value of
fmto
(see alsoline_edit
andbtn_multiline
)
- psy_view.dialogs.LSM_T(*args, **kwargs)
Find a more appropriate description here
- Type:
TODO
- class psy_view.dialogs.LabelDialog(project: Project, *fmts: str)[source]
Bases:
QDialog
A dialog to change labels.
This class contains one
LabelWidgetLine
per text formatoption.Attributes:
Mapping from formatoption key to value in this dialog.
Methods:
update_project
(project, *fmts)Create a
LabelDialog
to update the labels in a project.- classmethod update_project(project: Project, *fmts: str) None [source]
Create a
LabelDialog
to update the labels in a project.This classmethod creates a new
LabelDialog
instance, fills it with the formatoptions of the first plotter in project, enters the main event loop, and updates the project upon acceptance.- Parameters:
project (psyplot.project.Project) – The psyplot project to update. Note that we will only use the very first plotter in this project
*fmts – The formatoption keys to display. Each formatoption should be a subclass of
psy_simple.base.TextBase
- class psy_view.dialogs.LabelWidgetLine(fmto: Formatoption, project: Project, fmto_widget: Type[QtWidgets.QWidget], widget_kws: Dict[str, Any] = {}, *args, **kwargs)[source]
Bases:
QGroupBox
A widget to change a formatoption.
This class holds a
FormatoptionsEditor
to control the appearance of a specific formatoption. Additionally it displays the formatoption specific line widget (seepsyplot.plotter.Formatoption.get_fmt_widget()
) to contol it.