-
Notifications
You must be signed in to change notification settings - Fork 19
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
support legends #33
base: master
Are you sure you want to change the base?
support legends #33
Conversation
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.
Looks mostly good to me, i didn't test, as i don't use that code, but seems like a good feature to have, and i'd rather not block it just because there is not much dev focus on that widget, it sure could use some love!
kivy_garden/graph/__init__.py
Outdated
@@ -174,6 +296,8 @@ class Graph(Widget): | |||
''' | |||
|
|||
def __init__(self, **kwargs): | |||
self._legend: Union[BoxLayout, None] = 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.
There is an Optional
type for this (use Optional[BoxLayout]
instead).
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.
Thanks. Didn't know that.
kivy_garden/graph/__init__.py
Outdated
@@ -174,6 +296,8 @@ class Graph(Widget): | |||
''' | |||
|
|||
def __init__(self, **kwargs): | |||
self._legend: Union[BoxLayout, None] = None | |||
self._legend_plots: Tuple[Plot] = tuple() |
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.
Don't you mean Tuple[Plot, ...]
? (i think you are currently defining a tuple of one element of type Plot, not of any number of Plot elements).
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.
Correct
#3