-
Notifications
You must be signed in to change notification settings - Fork 778
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
[WIP] Improve documentation for cards #2054
base: master
Are you sure you want to change the base?
Conversation
Also removes dangerous default values
4899b12
to
9e409e0
Compare
@@ -179,18 +206,23 @@ def __init__( | |||
@classmethod | |||
def from_dataframe( | |||
cls, | |||
dataframe=None, | |||
dataframe: Optional["pandas.DataFrame"] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dataframe: Optional["pandas.DataFrame"] = None, | |
dataframe:"pandas.DataFrame", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I applied it but this does change the current UX. I agree the None made no sense but just mentioning.
def __init__(self, src=None, label=None, disable_updates: bool = True): | ||
def __init__( | ||
self, | ||
src: Optional[bytes] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src: Optional[bytes] = None, | |
src: bytes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
self._text = text | ||
|
||
def __init__(self, text=None): | ||
def __init__(self, text: Optional[str] = None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def __init__(self, text: Optional[str] = None): | |
def __init__(self, text: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
@@ -770,19 +882,32 @@ class VegaChart(UserComponent): | |||
|
|||
REALTIME_UPDATABLE = True | |||
|
|||
def __init__(self, spec: dict, show_controls: bool = False): | |||
def __init__( | |||
self, spec: Union[Dict[Any, Any], "altair.Chart"], show_controls: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self, spec: Union[Dict[Any, Any], "altair.Chart"], show_controls: bool = False | |
self, spec: Dict[Any, Any], show_controls: bool = False |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am a bit confused here. Can't it take an altair.Chart like the update method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a class method for that.
|
||
Parameters | ||
---------- | ||
spec : Union[Dict[Any, Any], altair.Chart] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spec : Union[Dict[Any, Any], altair.Chart] | |
spec : Dict[Any, Any] |
6338d8d
to
fd72aa7
Compare
Also removes dangerous default values