-
Notifications
You must be signed in to change notification settings - Fork 522
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
Add types: VictoryErrorBar #1528
Conversation
3b36efb
to
76ba339
Compare
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.
Overall looks good. Went through the docs and found missing props that need to be added to VictoryErrorBarProps
interface
errorY?: number | number[]; | ||
}; | ||
|
||
export interface VictoryErrorBarProps extends VictoryCommonProps { |
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 think VictoryErrorBarProps
might need to extend the following:
- extends
VictoryLabelableProps
to account forlabelComponent
https://formidable.com/open-source/victory/docs/victory-error-bar#labelcomponent - extends
VictoryMultiLabelableProps
to account forlabels
https://formidable.com/open-source/victory/docs/victory-error-bar#labels - extends
VictoryDatableProps
to account forcategories
,dataComponent
,domain
,domainPadding
,samples
,sortKey
,sortOrder
Also adds the following missing props
eventKey?: StringOrNumberOrCallback | string[]
https://formidable.com/open-source/victory/docs/victory-error-bar#eventkeyorigin?: OriginType
https://formidable.com/open-source/victory/docs/victory-error-bar#origin can use thisOriginType
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.
Thank you for catching those!
data?: dataType | dataType[]; | ||
errorX?: number | number[]; | ||
errorY?: number | number[]; | ||
events?: EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback>[]; |
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 second argument for EventPropTypeInterface
might need to add StringOrNumberOrCallback | string[]
so
EventPropTypeInterface<"data" | "labels" | "parent", StringOrNumberOrCallback | string[]>[];
since eventKey
type is the following string || integer || array[string] || function
https://formidable.com/open-source/victory/docs/victory-error-bar#eventkey
…bleProps to VictoryError types
VictoryLabelableProps, | ||
VictoryMultiLabelableProps { | ||
borderWidth?: number; | ||
errorX?: number | number[]; |
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.
errorX
and errorY
are data accessor props like x
and y
on other components. They should use the same type as those, which includes functions, integers, strings, and arrays of strings.
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.
Ah! Sorry, question: is an array of ints allowed?
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.
Looking good. Just needs a fix for errorX
and errorY
. Otherwise approved.
Still need to resolve various issues with the styles in the demo