Skip to content
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

feat(grid): update scale types in vx/grid #775

Merged
merged 2 commits into from
Aug 4, 2020
Merged

Conversation

kristw
Copy link
Collaborator

@kristw kristw commented Aug 3, 2020

💥 Breaking Changes

Similar to @vx/axis in #773 , @vx/grid components now accept D3 Scale as generic type instead of ScaleInput. Developers should not expect to specify this generic type as it can be inferred from the passed scale.

@@ -109,15 +109,15 @@ export default withTooltip<AreaProps, TooltipData>(
/>
<LinearGradient id="area-background-gradient" from={background} to={background2} />
<LinearGradient id="area-gradient" from={accentColor} to={accentColor} toOpacity={0.1} />
<GridRows<number>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generic type can be inferred from the input scale and this is no longer needed.

@williaster williaster added this to the 0.0.199 milestone Aug 4, 2020
Copy link
Collaborator

@williaster williaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

had a couple comments on the doc strings, but lgtm otherwise!

/** `@vx/scale` or `d3-scale` object used to map from ScaleInput to y-coordinates. */
scale: Scale<ScaleInput, number>;
scale: Scale;
/** Exact values used to generate grid coordinates (y- for Rows, x- for Columns) lines using `scale`. Overrides `numTicks` if specified. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we remove the (y- for Rows, x- for Columns) piece here? also I think a leftover typo from me, could likely also remove the word coordinates here

/** `@vx/scale` or `d3-scale` object used to map from ScaleInput to x-coordinates. */
scale: Scale<ScaleInput, number>;
scale: Scale;
/** Exact values used to generate grid coordinates (y- for Rows, x- for Columns) lines using `scale`. Overrides `numTicks` if specified. */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto re removing y- ... and x- from comment + removing coordinates

@hshoff hshoff merged commit f40b882 into airbnb:master Aug 4, 2020
@kristw kristw deleted the kristw--grid branch August 17, 2020 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants