feat: Add line chart type

This commit is contained in:
Matthias
2025-10-07 19:29:28 +02:00
parent 0715f46a4a
commit f9696d557c

View File

@@ -5,7 +5,7 @@ from pydantic import TypeAdapter
from typing_extensions import TypedDict
class AnnotationType(TypedDict, total=False):
class _BaseAnnotationType(TypedDict, total=False):
type: Required[Literal["area", "line"]]
start: str | datetime
end: str | datetime
@@ -16,4 +16,16 @@ class AnnotationType(TypedDict, total=False):
z_level: int
class AreaAnnotationType(_BaseAnnotationType, total=False):
type: Literal["area"]
class LinenAnnotationType(_BaseAnnotationType, total=False):
type: Literal["line"]
width: int
line_style: Literal["solid", "dashed", "dotted"]
AnnotationType = AreaAnnotationType | LinenAnnotationType
AnnotationTypeTA = TypeAdapter(AnnotationType)