Skip to content

Conversation

@jasonwells
Copy link
Contributor

@jasonwells jasonwells commented Dec 18, 2018

This commit adds gridCount/integer support to gridXValues and gridYValues for line charts. This allows for grid lines and axes ticks to be calculated the same when using a number that is passed. For example:

<ResponsiveLine
  axisRight={{
    tickValues: 6,
  }}
  gridYValues={6}
  ...
/>

I tried to follow all of the contributing guidelines, happy to contribute to a great library!

gridYValues: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
gridXValues: PropTypes.oneOfType([
PropTypes.number,
PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.number, PropTypes.string])),
Copy link
Owner

Choose a reason for hiding this comment

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

The line chart also supports Date objects, so you should add PropTypes.instanceOf(Date) to both gridXValues and gridYValues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, I wasn't sure about that. I've added it now.

@plouc
Copy link
Owner

plouc commented Jan 24, 2019

@jasonwells sorry for the late review

@jasonwells
Copy link
Contributor Author

@plouc Thanks for the input and no worries!

@plouc plouc merged commit fd49e83 into plouc:master Jan 24, 2019
@plouc
Copy link
Owner

plouc commented Jan 24, 2019

Thank you @jasonwells!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants