Skip to content

Components

Accordion

accordion

Accordion

Accordion()

A class representing an accordion component.

The Accordion class is used to create an accordion component with various sub-components such as file input, color pickers, switches, menus, and sliders.

Attributes:

Name Type Description
file_input FileInputComponent

The file input component.

color_picker_ch1 Colorpicker

The color picker for channel 1.

color_picker_ch2 Colorpicker

The color picker for channel 2.

color_picker_result Colorpicker

The color picker for the result.

method_selector MethodSelector

The selector for methods.

selector Selector

The selector component.

data_selector DataSelector

The data selector component.

int_slider IntSlider

The integer slider component.

gen_nav GeneratorNavigator

The generator navigator component.

blocksize_selector BlocksizeSelector

The blocksize selector component.

channel_selector_input ChannelSelector

The channel selector for input.

channel_selector_output ChannelSelector

The channel selector for output.

window_selector WindowSelector

The selector for the windows.

overlap_selector OverlapSelector

The selector for the overlaps.

exporter_selector ExporterSelector

The selector for the exporters.

file_exporter FileExporter

The file exporter component.

toggle_group ToggleGroup

The toggle group component.

toggle_y_axis ToggleYAxis

The toggle for the y-axis.

toggle_x_axis ToggleXAxis

The toggle for the x-axis.

accordion Accordion

The accordion component.

Source code in src/fft_analysator/gui/components/accordion.py
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
def __init__(self):
    self.file_input = FileInputComponent()
    self.color_picker_ch1 = Colorpicker()
    self.color_picker_ch2 = Colorpicker()
    self.color_picker_result = Colorpicker()
    self.method_selector = MethodSelector()
    self.selector = Selector()
    self.data_selector = DataSelector()
    self.int_slider= IntSlider()
    self.gen_nav = GeneratorNavigator(self.int_slider)
    self.gen_nav = GeneratorNavigator(self.int_slider)
    self.blocksize_selector = BlocksizeSelector()
    self.channel_selector_input = ChannelSelector()
    self.channel_selector_output = ChannelSelector()
    self.window_selector = WindowSelector()
    self.overlap_selector = OverlapSelector()
    self.file_exporter = FileExporter()
    self.exporter_selector = ExporterSelector()
    self.toggle_group = ToggleGroup()
    self.toggle_x_axis = ToggleXAxis()
    self.toggle_y_axis = ToggleYAxis()
    self.accordion = pn.Accordion

    # Set default colors
    self.color_picker_ch1.component.value = '#D23232' # Red for channel 1
    self.color_picker_ch2.component.value = '#1D1DB9'  # Blue for channel 2
    self.color_picker_result.component.value = '#CB8710'  # Green for result

    # Initially hide the color picker
    self.color_picker_ch1.component.visible = False
    self.color_picker_ch2.component.visible = False
    self.color_picker_result.component.visible = False

    self._component = self.accordion(('Upload', pn.Column(pn.Row(self.file_input.component, self.data_selector.component), self.selector.component, self.blocksize_selector.component)),
                                      ('Plot', pn.Column(pn.Row(self.channel_selector_input.component, self.channel_selector_output.component),
                                                        pn.Row(self.color_picker_ch1.component,self.color_picker_ch2.component,self.color_picker_result.component),
                                                        pn.layout.Divider(margin=(5, 0, 5, 0)),
                                                        #self.int_slider.component,
                                                        self.gen_nav.component,
                                                        self.toggle_group.component,
                                                        pn.Row(self.toggle_x_axis.component, self.toggle_y_axis.component)
                                                        )),
                                        ('Calculation', pn.Column(pn.Row(self.window_selector.component,
                                                                        self.overlap_selector.component),
                                                                        self.method_selector.component)
                                         ),
                                        ('Export', pn.Column(self.exporter_selector.component,self.file_exporter.component)),
                                        sizing_mode='stretch_width')

component property

component

Get the accordion component.

Returns:

Name Type Description
_component object

The stored widget.

Blocksize Selector

blocksize_selector

BlocksizeSelector

BlocksizeSelector()

A class representing a block size selector.

Attributes:

Name Type Description
blocksize_selector Select

The block size selector widget.

sizes list

A list of available block sizes.

_component Select

The internal block size selector component.

Source code in src/fft_analysator/gui/components/blocksize_selector.py
15
16
17
18
19
20
21
def __init__(self):
    """
    The block size selector is initialized as a panel Select widget with specific parameters.
    """
    self.blocksize_selector = pn.widgets.Select
    self.sizes = [128, 256, 512, 1024, 2048,4096, 8192, 16384, 32768, 65536]
    self._component = self.blocksize_selector(name='Select Blocksize', options=self.sizes, value=1024)

component property

component

Get the block size selector component.

Returns:

Name Type Description
_component object

The stored widget.

Channel Selector

channel_selector

ChannelSelector

ChannelSelector()

A class used to represent a Channel Selector widget.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options list

A list of options for the selector widget. Initially empty.

_component object

The panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/channel_selector.py
17
18
19
20
21
22
23
24
def __init__(self):
    """
    The selector attribute is initialized as a panel Select widget.
    """
    self.selector = pn.widgets.Select
    self.options = []
    self._component = self.selector(name='No data chosen!', options=self.options, width=135, margin=(10,15),
                                    disabled=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Color Picker

color_picker

Colorpicker

Colorpicker()

A class used to represent a Color Picker widget.

Attributes:

Name Type Description
color_picker object

An instance of the panel ColorPicker widget.

_component object

The panel ColorPicker widget with specific parameters.

Source code in src/fft_analysator/gui/components/color_picker.py
16
17
18
19
20
21
def __init__(self):
    """
    The color picker is initialized as a panel ColorPicker widget with specific parameters.
    """
    self.color_picker = pn.widgets.ColorPicker
    self._component = self.color_picker(name='', value='#FF0000', margin=(10, 30), visible=False)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Data Selector

data_selector

DataSelector

DataSelector()

A class used to represent a Data Selector widget.

This class encapsulates a panel Select widget and provides an interface for populating it with options and retrieving the selected option.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options list

A list of options for the selector widget. Initially empty.

_component object

The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The selector attribute is initialized as a panel Select widget. The options attribute is initialized as an empty list. The _component attribute is initialized as a panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/data_selector.py
23
24
25
26
27
28
29
30
31
32
33
34
def __init__(self):
    """
    Constructs all the necessary attributes for the DataSelector object.

    The selector attribute is initialized as a panel Select widget.
    The options attribute is initialized as an empty list.
    The _component attribute is initialized as a panel Select widget with specific parameters.
    """
    self.selector = pn.widgets.Select
    self.options = []
    self._component = self.selector(name='', options=self.options, size=len(self.options)+2,
                                    margin=(20, 0, 0, 20), height=30, width=200)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Exporter Selector

exporter_selector

ExporterSelector

ExporterSelector()

A class used to select the export format.

Attributes:

Name Type Description
export_selector Select

An instance of the Panel Select widget.

options list

A list of available export formats.

_component Select

The Panel Select widget with specific parameters.

Attributes:

Name Type Description
export_selector Select

An instance of the Panel Select widget.

options list

A list of available export formats.

_component Select

The Panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/exporter_selector.py
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
def __init__(self):
    """
    Constructs all the necessary attributes for the ExporterSelector object.

    Attributes:
        export_selector (pn.widgets.Select):
            An instance of the Panel Select widget.
        options (list):
            A list of available export formats.
        _component (pn.widgets.Select):
            The Panel Select widget with specific parameters.
    """
    self.export_selector = pn.widgets.Select
    self.options = ['Numpy Array', 'Binary']
    self._component = self.export_selector(name='Choose export extension:', options=self.options, width=300,
                                           value='Numpy Array', disabled=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Exporter

exporter

FileExporter

FileExporter()

A class used to export files.

Attributes:

Name Type Description
file_input_button Button

An instance of the Panel Button widget.

_component Button

The Panel Button widget with specific parameters.

dir_path str

The directory path where the file will be saved.

Attributes:

Name Type Description
file_input_button Button

An instance of the Panel Button widget.

_component Button

The Panel Button widget with specific parameters.

dir_path str

The directory path where the file will be saved.

Source code in src/fft_analysator/gui/components/exporter.py
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self):
    """
    Constructs all the necessary attributes for the FileExporter object.

    Attributes:
        file_input_button (pn.widgets.Button):
            An instance of the Panel Button widget.
        _component (pn.widgets.Button):
            The Panel Button widget with specific parameters.
        dir_path (str):
            The directory path where the file will be saved.
    """
    self.file_input_button = pn.widgets.Button
    self._component = self.file_input_button(name='\U0001F4BE ' 'Save and Export', margin=(10, 0, 10, 10), width=150,
                                             disabled=True)
    self.dir_path = None

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

select_directory

select_directory(event, data, chn1, chn2, method, ext, window, overlap)

Selects the directory and saves the data.

Parameters:

Name Type Description Default
event object

The event that triggers the directory selection.

required
data array

The data to be saved.

required
chn1 int

The first channel.

required
chn2 int

The second channel.

required
method str

The method used.

required
ext str

The file extension.

required
window str

The window type.

required
overlap float

The overlap value.

required

Returns:

Type Description

None

Source code in src/fft_analysator/gui/components/exporter.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
def select_directory(self, event, data, chn1, chn2, method, ext, window, overlap):
    """
    Selects the directory and saves the data.

    Args:
        event (object): The event that triggers the directory selection.
        data (np.array): The data to be saved.
        chn1 (int): The first channel.
        chn2 (int): The second channel.
        method (str): The method used.
        ext (str): The file extension.
        window (str): The window type.
        overlap (float): The overlap value.

    Returns:
        None
    """
    root = Tk()
    root.withdraw()
    root.call('wm', 'attributes', '.', '-topmost', True)
    dir = filedialog.askdirectory(initialdir=os.getcwd())
    method = method.replace(" ", "")
    #data = np.array(data)
    if dir:
        self.dir_path = dir
        file_name = str(dir) + "/" + str(method) + "_" + str(chn1) + "_" + str(chn2) + "_" + str(window) + "_" + str(overlap)
        if ext == "Numpy Array":
            np.save(file_name, data)
        if ext == "Binary":
            data = np.abs(data)
            data.tofile(file_name)
    else:
        self.dir_path = None
    root.destroy()

File Input Tkinter

file_input_tkinter

FileInputComponent

FileInputComponent()

A class used to represent a File Input Component.

Attributes:

Name Type Description
file_input_button object

An instance of the panel Button widget.

_component object

The panel Button widget with specific parameters.

file_paths str

The paths of the selected files. Initially None.

Methods:

Name Description
select_files

Opens a file dialog to select files.

component

Gets the stored widget.

The file_input_button attribute is initialized as a panel Button widget. The _component attribute is initialized as a panel Button widget with specific parameters. The file_paths attribute is initialized as None.

Source code in src/fft_analysator/gui/components/file_input_tkinter.py
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self):
    """
    Constructs all the necessary attributes for the FileInputComponent object.

    The file_input_button attribute is initialized as a panel Button widget.
    The _component attribute is initialized as a panel Button widget with specific parameters.
    The file_paths attribute is initialized as None.
    """
    self.file_input_button = pn.widgets.Button
    self._component = self.file_input_button(name="Load file", margin=(20, 0, 10, 10))
    self.file_paths = None
    pn.bind(self.select_files, self._component, watch=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

select_files

select_files(event)

Opens a file dialog to select files.

Parameters:

Name Type Description Default
event object

The event object passed by the panel Button widget.

required
Source code in src/fft_analysator/gui/components/file_input_tkinter.py
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
def select_files(self, event):
    """
    Opens a file dialog to select files.

    Args:
        event (object): The event object passed by the panel Button widget.
    """
    root = Tk()
    root.withdraw()
    root.call('wm', 'attributes', '.', '-topmost', True)
    files = filedialog.askopenfilename(
        multiple=False,
        filetypes=[("HDF5 files", "*.h5")],  # Nur .h5 Dateien erlauben
        initialdir=os.getcwd()  # Starten im aktuellen Verzeichnis
    )
    if files:
        self.file_paths = files
    else:
        self.file_paths = None
    root.destroy()

Generator Navigator

generator_navigator

GeneratorNavigator

GeneratorNavigator(int_slider_callback)

A class used to represent a Generator Navigator.

Attributes:

Name Type Description
button_back object

An instance of the panel Button widget for navigating backwards.

button_forward object

An instance of the panel Button widget for navigating forwards.

reset_button object

An instance of the panel Button widget for resetting.

index_box object

An instance of the panel IntInput widget for inputting index.

goto_button object

An instance of the panel Button widget for going to a specific index.

_component object

The panel Row widget with specific parameters.

int_slider_callback object

The callback function for the integer slider.

Methods:

Name Description
int_slider_next

Increments the value of the integer slider.

int_slider_previous

Decrements the value of the integer slider.

int_slider_reset

Resets the value of the integer slider.

int_slider_goto

Sets the value of the integer slider to the value of the index box.

component

Gets the stored widget.

The button_back, button_forward, reset_button, index_box, and goto_button attributes are initialized as panel Button widgets. The _component attribute is initialized as a panel Row widget with specific parameters. The int_slider_callback attribute is set to the provided callback function.

Source code in src/fft_analysator/gui/components/generator_navigator.py
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
def __init__(self, int_slider_callback):
    """
    Constructs all the necessary attributes for the GeneratorNavigator object.

    The button_back, button_forward, reset_button, index_box, and goto_button attributes are initialized as panel Button widgets.
    The _component attribute is initialized as a panel Row widget with specific parameters.
    The int_slider_callback attribute is set to the provided callback function.
    """
    self.button_back = pn.widgets.Button(name='\u25c0', button_type='default', margin=(10, 5, 5, 5), disabled=True)
    self.button_forward = pn.widgets.Button(name='\u25b6', button_type='default', margin=(10, 5, 5, 5), disabled=True)
    self.reset_button = pn.widgets.Button(name='\u21ba', button_type='default', margin=(10, 5, 5, 5), disabled=True)
    self.index_box = pn.widgets.IntInput(name='Index:', value=0, margin=(-10, 20, 0, 10), disabled=True, width=80)
    self.goto_button = pn.widgets.Button(name='Go', button_type='default', margin=(10, 5, 5, 5), disabled=True)
    self._component = pn.Row(self.goto_button, self.index_box, self.button_back, self.reset_button, self.button_forward,
                             margin=(5, 5, 10, 5))

    self.int_slider_callback = int_slider_callback

    pn.bind(self.int_slider_next, self.button_forward, watch=True)
    pn.bind(self.int_slider_previous, self.button_back, watch=True)
    pn.bind(self.int_slider_reset, self.reset_button, watch=True)
    pn.bind(self.int_slider_goto, self.goto_button, watch=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

int_slider_goto

int_slider_goto(event)

Sets the value of the integer slider to the value of the index box.

Parameters:

Name Type Description Default
event object

The event object passed by the panel Button widget.

required
Source code in src/fft_analysator/gui/components/generator_navigator.py
90
91
92
93
94
95
96
97
98
99
def int_slider_goto(self, event):
    """
    Sets the value of the integer slider to the value of the index box.

    Args:
        event (object): The event object passed by the panel Button widget.
    """
    if (self.index_box.value <= self.int_slider_callback.component.end
        and self.index_box.value >= self.int_slider_callback.component.start):
        self.int_slider_callback.component.value = self.index_box.value

int_slider_next

int_slider_next(event)

Increments the value of the integer slider.

Parameters:

Name Type Description Default
event object

The event object passed by the panel Button widget.

required
Source code in src/fft_analysator/gui/components/generator_navigator.py
60
61
62
63
64
65
66
67
68
def int_slider_next(self, event):
    """
    Increments the value of the integer slider.

    Args:
        event (object): The event object passed by the panel Button widget.
    """
    if (self.int_slider_callback.component.value < self.int_slider_callback.component.end):
        self.int_slider_callback.component.value += 1

int_slider_previous

int_slider_previous(event)

Decrements the value of the integer slider.

Parameters:

Name Type Description Default
event object

The event object passed by the panel Button widget.

required
Source code in src/fft_analysator/gui/components/generator_navigator.py
70
71
72
73
74
75
76
77
78
def int_slider_previous(self, event):
    """
    Decrements the value of the integer slider.

    Args:
        event (object): The event object passed by the panel Button widget.
    """
    if (self.int_slider_callback.component.value > self.int_slider_callback.component.start):
        self.int_slider_callback.component.value -= 1

int_slider_reset

int_slider_reset(event)

Resets the value of the integer slider.

Parameters:

Name Type Description Default
event object

The event object passed by the panel Button widget.

required
Source code in src/fft_analysator/gui/components/generator_navigator.py
80
81
82
83
84
85
86
87
88
def int_slider_reset(self, event):
    """
    Resets the value of the integer slider.

    Args:
        event (object): The event object passed by the panel Button widget.
    """
    if self.int_slider_callback:
        self.int_slider_callback.component.value = 0

Integer Slider

int_slider

IntSlider

IntSlider()

A helper class used to represent a helper Integer Slider widget to store the logic for the generator navigation buttons.

Attributes:

Name Type Description
int_slider object

An instance of the panel IntSlider widget.

_component object

The panel IntSlider widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The int_slider attribute is initialized as a panel IntSlider widget. The _component attribute is initialized as a panel IntSlider widget with specific parameters.

Source code in src/fft_analysator/gui/components/int_slider.py
20
21
22
23
24
25
26
27
28
29
def __init__(self):
    """
    Constructs all the necessary attributes for the IntSlider object.

    The int_slider attribute is initialized as a panel IntSlider widget.
    The _component attribute is initialized as a panel IntSlider widget with specific parameters.
    """
    self.int_slider = pn.widgets.IntSlider
    self._component = self.int_slider(name='Current Block', start=0, step=1, margin=(15, 20, 25, 20),
    sizing_mode='stretch_width', disabled=True, align='start')

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Methode Selector

method_selector

MethodSelector

MethodSelector()

A class used to represent a Method Selector widget.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options list

A list of options for the selector widget.

_component object

The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The selector attribute is initialized as a panel Select widget. The options attribute is initialized with a list of analysis methods. The _component attribute is initialized as a panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/method_selector.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
def __init__(self):
    """
    Constructs all the necessary attributes for the MethodSelector object.

    The selector attribute is initialized as a panel Select widget.
    The options attribute is initialized with a list of analysis methods.
    The _component attribute is initialized as a panel Select widget with specific parameters.
    """
    self.selector = pn.widgets.Select
    self.options = ["No Analysis Function", "Auto Spectral Density - Input", "Auto Spectral Density - Output",
                    "Cross Spectral Density", "Coherence","Auto Correlation - Input", "Auto Correlation - Output",
                    "Cross Correlation", "Impulse Response", "Amplitude Response", "Phase Response"]
    self._component = self.selector(name='Choose analysis and saving method:', options=self.options, width=300,
                                    value='No Analysis Function', disabled=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Overlap Selector

overlap_selector

OverlapSelector

OverlapSelector()

A class used to represent an Overlap Selector widget.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options list

A list of options for the selector widget.

_component object

The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The selector attribute is initialized as a panel Select widget. The options attribute is initialized with a list of overlap options. The _component attribute is initialized as a panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/overlap_selector.py
20
21
22
23
24
25
26
27
28
29
30
31
def __init__(self):
    """
    Constructs all the necessary attributes for the OverlapSelector object.

    The selector attribute is initialized as a panel Select widget.
    The options attribute is initialized with a list of overlap options.
    The _component attribute is initialized as a panel Select widget with specific parameters.
    """
    self.selector = pn.widgets.Select
    self.options = ['None', '50%', '75%', '87.5%']
    self._component = self.selector(name='Choose overlap:', options=self.options, width=140, value='50%',
                                    disabled=True)

component property

component

Gets the stored widget.

Returns:

Name Type Description
_component object

The stored widget.

Selector

selector

Selector

Selector()

A class used to represent a Selector widget.

This class encapsulates a panel Select widget and provides an interface for populating it with options and retrieving the selected option.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options list

A list of options for the selector widget. Initially empty.

_component object

The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The selector attribute is initialized as a panel Select widget. The options attribute is initialized as an empty list. The _component attribute is initialized as a panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/selector.py
23
24
25
26
27
28
29
30
31
32
33
def __init__(self):
    """
    Constructs all the necessary attributes for the Selector object.

    The selector attribute is initialized as a panel Select widget.
    The options attribute is initialized as an empty list.
    The _component attribute is initialized as a panel Select widget with specific parameters.
    """
    self.selector = pn.widgets.Select
    self.options = []
    self._component = self.selector(name='Choose table:', options=self.options, size=len(self.options)+2)

component property

component

Gets the stored widget.

This method returns the panel Select widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.

Toggle Group

toggle_group

ToggleGroup

ToggleGroup()

A class used to represent a ToggleGroup widget.

This class encapsulates a panel ToggleGroup widget and provides an interface for populating it with options and retrieving the selected option.

Attributes:

Name Type Description
selector object

An instance of the panel ToggleGroup widget.

options list

A list of options for the ToggleGroup widget. Initially empty.

_component object

The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The toggle_group attribute is initialized as a panel ToggleGroup widget. The options attribute is initialized as an empty list. The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.

Source code in src/fft_analysator/gui/components/toggle_group.py
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
def __init__(self):
    """
    Constructs all the necessary attributes for the ToggleGroup object.

    The toggle_group attribute is initialized as a panel ToggleGroup widget.
    The options attribute is initialized as an empty list.
    The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.
    """
    self.stretch = False
    self.grid = False
    self.log = False
    self.db = False
    self.toggle_group = pn.widgets.ToggleGroup
    self.options = ['Stretch','dB','Grid']
    self._component = self.toggle_group(name='Choose table:', options=self.options, width=300, disabled=True)

component property

component

Gets the stored widget.

This method returns the panel ToggleGroup widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.

Toggle Group x-axis

toggle_x_axis

ToggleXAxis

ToggleXAxis()

A class used to represent a ToggleGroup widget.

This class encapsulates a panel ToggleGroup widget and provides an interface for populating it with options and retrieving the selected option.

Attributes

selector : object An instance of the panel ToggleGroup widget. options : list A list of options for the ToggleGroup widget. Initially empty. _component : object The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The toggle_group attribute is initialized as a panel ToggleGroup widget. The options attribute is initialized as an empty list. The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.

Source code in src/fft_analysator/gui/components/toggle_x_axis.py
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self):
    """
    Constructs all the necessary attributes for the ToggleGroup object.

    The toggle_group attribute is initialized as a panel ToggleGroup widget.
    The options attribute is initialized as an empty list.
    The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.
    """
    self.x_log = False
    self.toggle_group = pn.widgets.ToggleGroup
    self.options = ['x-linear', 'x-log']
    self._component = self.toggle_group(name='Choose table:', options=self.options, width=140, disabled=True,
                                        behavior="radio", value='x-linear')

component property

component

Gets the stored widget.

This method returns the panel ToggleGroup widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.

Toggle Group y-axis

toggle_y_axis

ToggleYAxis

ToggleYAxis()

A class used to represent a ToggleGroup widget.

This class encapsulates a panel ToggleGroup widget and provides an interface for populating it with options and retrieving the selected option.

Attributes

selector : object An instance of the panel ToggleGroup widget. options : list A list of options for the ToggleGroup widget. Initially empty. _component : object The panel Select widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The toggle_group attribute is initialized as a panel ToggleGroup widget. The options attribute is initialized as an empty list. The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.

Source code in src/fft_analysator/gui/components/toggle_y_axis.py
24
25
26
27
28
29
30
31
32
33
34
35
36
def __init__(self):
    """
    Constructs all the necessary attributes for the ToggleGroup object.

    The toggle_group attribute is initialized as a panel ToggleGroup widget.
    The options attribute is initialized as an empty list.
    The _component attribute is initialized as a panel ToggleGroup widget with specific parameters.
    """
    self.y_log = False
    self.toggle_group = pn.widgets.ToggleGroup
    self.options = ['y-linear', 'y-log']
    self._component = self.toggle_group(name='Choose table:', options=self.options, width=140, disabled=True,
                                        behavior="radio", value='y-linear')

component property

component

Gets the stored widget.

This method returns the panel ToggleGroup widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.

Tabs

tabs

Tabs

Tabs()

A class used to represent a Tabs widget.

This class encapsulates a panel Tabs widget and provides an interface for interacting with it.

Attributes:

Name Type Description
tabs object

An instance of the panel Tabs widget.

str_signal_tab str

The title of the signal tab.

str_frequency_response_tab str

The title of the frequency response tab.

str_impulse_response_tab str

The title of the impulse response tab.

str_analysis_function_tab str

The title of the analysis function tab.

_component object

The panel Tabs widget with specific parameters.

Methods:

Name Description
component

Gets the stored widget.

The tabs attribute is initialized as a panel Tabs widget. The str_signal_tab, str_frequency_response_tab, str_impulse_response_tab, and str_analysis_function_tab attributes are initialized with specific string values. The _component attribute is initialized as a panel Tabs widget with specific parameters.

Source code in src/fft_analysator/gui/components/tabs.py
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
def __init__(self):
    """
    Constructs all the necessary attributes for the Tabs object.

    The tabs attribute is initialized as a panel Tabs widget.
    The str_signal_tab, str_frequency_response_tab, str_impulse_response_tab, and str_analysis_function_tab attributes are initialized with specific string values.
    The _component attribute is initialized as a panel Tabs widget with specific parameters.
    """
    self.tabs = pn.Tabs
    self.str_signal_tab = "Input/Output"
    self.str_frequency_response_tab = "Frequency Response"
    self.str_impulse_response_tab = "Impulse Response"
    self.str_analysis_function_tab = "Analysis Functions"
    self._component = self.tabs(
        (self.str_signal_tab, 'No data chosen!'),
        (self.str_frequency_response_tab, 'No data chosen!'),
        (self.str_impulse_response_tab, 'No data chosen!'),
        (self.str_analysis_function_tab, 'No data chosen!'),
        sizing_mode='stretch_width', dynamic=True)

component property

component

Gets the stored widget.

This method returns the panel Tabs widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.

Window Selector

window_selector

WindowSelector

WindowSelector()

A class used to represent a Window Selector widget.

This class encapsulates a panel Select widget and provides an interface for populating it with window options and retrieving the selected option.

Attributes:

Name Type Description
selector object

An instance of the panel Select widget.

options

(list): A list of options for the selector widget.

_component object

The panel Select widget with specific parameters.

Methods

component() Gets the stored widget.

The selector attribute is initialized as a panel Select widget. The options attribute is initialized with a list of window options. The _component attribute is initialized as a panel Select widget with specific parameters.

Source code in src/fft_analysator/gui/components/window_selector.py
24
25
26
27
28
29
30
31
32
33
34
35
def __init__(self):
    """
    Constructs all the necessary attributes for the WindowSelector object.

    The selector attribute is initialized as a panel Select widget.
    The options attribute is initialized with a list of window options.
    The _component attribute is initialized as a panel Select widget with specific parameters.
    """
    self.selector = pn.widgets.Select
    self.options = ['Hanning', 'Rectangular', 'Hamming', 'Bartlett', 'Blackman']
    self._component = self.selector(name='Choose window:', options=self.options, width=140, value='Hanning',
                                    disabled=True)

component property

component

Gets the stored widget.

This method returns the panel Select widget stored in the _component attribute.

Returns:

Name Type Description
_component object

The stored widget.