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