-
-
Notifications
You must be signed in to change notification settings - Fork 143
Conversation
6ffdb52
to
0e5454b
Compare
1ee69d1
to
dd30118
Compare
dash_core_components/_checklist.py
Outdated
def __init__( | ||
self, | ||
id=UNDEFINED, | ||
options="[]", |
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.
@T4rk1n is it intentional that these empty objects are quoted ("[]"
, "{}"
) here and in ComponentProp
?
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.
No, default props generation needs more testing.
a18e182
to
9cd1826
Compare
for more info.(default={ staticPlot: false, | ||
editable: false, edits: { | ||
annotationPosition: false, annotationTail: | ||
false, annotationText: 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.
Hey re: #514 I'm thinking of removing these defaults, just using config: {}
, as well as writing some sort of test that the PropTypes.shape
we give matches the available options in the current version of plotly.js. But in this PR the default seems to be the only info about what's allowed inside config
that makes it into the Python docs. How do you think we should handle this?
- bring the shape into this docstring programmatically?
- require that this shape be described explicitly in the docstring for
graphPropTypes.config
(and then I'd write a test to verify that this is kept up-to-date)? - something else?
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.
The default in the docstring come from Graph.defaultProps
, if you change it to {}
they will be removed.
bring the shape into this docstring programmatically?
You cannot do that on at runtime with react-docgen as nothing is evaluated just parsed. It has to be in the source. Maybe a script that fetch and format and you insert the output in the docstring, I'd imagine you'd only have to do that when you update plotly.js.
require that this shape be described explicitly in the docstring for graphPropTypes.config (and then I'd write a test to verify that this is kept up-to-date)?
I like that.
something else?
Front-end validations and keep as is with the default {}
?
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.
Come to think of it, the mypy validation for shape
is shallow and not key based, it might be worthwhile to format the PropType definition in the docstring.
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.
OK cool - one way or another we can handle this in documentation. For now I'm going to take the defaults out for #514
No description provided.