-
Notifications
You must be signed in to change notification settings - Fork 363
Chart docs: annotate types #2139
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
Chart docs: annotate types #2139
Comments
What's wrong with overriding the existing Victory props to make |
If Overriding props to be a simple |
It wouldn't generate an error if we |
We should be able to import Victory interfaces in order to take advantage of existing property types and documentation. Ideally, pass-thru props would remain unchanged -- we shouldn't have to redefine prop types for react-docs. Currently, we're overridding all Victory property types, and duplicating @type/victory documentation, simply to generate react-docs. It's a pain to keep in sync with Victory changes. And after all that, types like It may be helpful if we could use some sort of annotation in order to define the type just for our documentation? For example, If we could at least do that, then we could leave the Victory pass-thru props untouched. Although, I still don't want react-docgen to display I don't really have a good solution, but it's a problem we must solve. The react-docs are unreadable as is. Our users must go to Victory's site to view documentation, instead. |
Oh, I completely understand that issue. That requires extending react-docgen to follow imports to resolve types. I can open that issue upstream. |
Looks like a PR is already opened to add support for this. Awaiting its merge and a new package release. |
Still awaiting its update and merge. Can likely dedicate a day this week to fix it upstream. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The unreadable chart docs are still an ongoing issue. Inheriting types would be ideal, but if we could somehow provide our own prop types, that would help us clarify the docs. |
@redallen I agree with following Javadoc syntax . |
That would be fine by me. @deprecated, @hide, etc. would be a good start. If we could add them, just when we chose to override, that would be even better. |
I'm going to reopen this to ensure we apply annotations to the chart docs. These are the supported annotations: https://github.com/patternfly/patternfly-org/blob/feat/org-redesign/packages |
Tried using @propType, but does not appear to work. Created https://github.com/patternfly/patternfly-react/issues/5304 to track it. |
The react-charts docs contain some complex object types. For example, the
ChartArea
component showsAnimatePropTypeInterface
as theanimate
type below.The Victory docs show the
animate
type astype: boolean || object
.See https://formidable.com/open-source/victory/docs/victory-area/#animate
Note: There are far more complex examples, but using
animate
for simplicity.I don't want to override the existing Victory property types, just to add a description for react-docs. I would prefer to document properties using an annotation, if possible?
That may allow us to simplify the
animate
description / type as aboolean
instead ofAnimatePropTypeInterface
. It would also isolate us from Victory changing the underlying property type and breaking our component wrappers.The text was updated successfully, but these errors were encountered: