0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 11:41:49 +02:00

feat: added axis_width and axis_color as optional plot settings

This commit is contained in:
2023-12-01 18:45:13 +01:00
parent b53f72f0ad
commit 504944f696

View File

@ -1,10 +1,6 @@
from typing import List, Dict, Union, Optional
from typing import Dict, List, Optional, Union
from pydantic import (
BaseModel,
Field,
field_validator,
)
from pydantic import BaseModel, Field, field_validator
from pydantic_core import PydanticCustomError
@ -27,9 +23,7 @@ class Signal(BaseModel):
# Check if device name provided
if v is None:
raise PydanticCustomError(
"no_device_name",
"Device name must be provided",
dict(wrong_value=v),
"no_device_name", "Device name must be provided", dict(wrong_value=v)
)
# Check if device exists in BEC
@ -125,12 +119,16 @@ class PlotSettings(BaseModel):
Attributes:
background_color (str): Color of the plot background.
axis_width (Optional[int]): Width of the plot axes.
axis_color (Optional[str]): Color of the plot axes.
num_columns (int): Number of columns in the plot layout.
colormap (str): Colormap to be used.
scan_types (bool): Indicates if the configuration is for different scan types.
"""
background_color: str
axis_width: Optional[int] = None
axis_color: Optional[str] = None
num_columns: int
colormap: str
scan_types: bool