Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use not required for colum config #21

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions swankit/callback/models/key.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
@Description:
与Key相关的回调函数触发时的模型
"""
from typing import Union, Optional, Dict, List, Literal, Tuple, TypedDict
from typing import Union, Optional, Dict, List, Literal, Tuple, TypedDict, NotRequired

from swankit.core import ChartType, ParseErrorInfo, MediaBuffer, ChartReference
from urllib.parse import quote
Expand All @@ -18,21 +18,14 @@
YRange = Optional[Tuple[Optional[float], Optional[float]]]


class ColumnConfig:
class ColumnConfig(TypedDict):
"""
列信息配置
"""

def __init__(self, y_range: YRange = None, chart_name: Optional[str] = None, metric_name: Optional[str] = None):
"""
生成的列信息配置对象
:param y_range: y轴范围
:param chart_name: 图表名称
:param metric_name: 指标名称
"""
self.y_range: YRange = y_range
self.chart_name: Optional[str] = chart_name
self.metric_name: Optional[str] = metric_name
y_range: YRange
metric_name: NotRequired[str]
chart_name: NotRequired[str]


class ColumnInfo:
Expand Down
Loading