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

new(vx-axis): use numTicks when falling back on scale.domain #752

Merged
merged 2 commits into from
Jun 18, 2020

Conversation

williaster
Copy link
Collaborator

🚀 Enhancements

This makes a small update to @vx/axis for non-continuous scales. Continuous scales support .ticks([count]), but things like band scales do not.

Currently Axis will use .ticks() if it exists, and falls back to .domain() for scales that don't have it. This is fine except for charts with a very large domain, in which case it'd be an improvement to account for numTicks if it's passed, to allow filtering to a reasonable number without requiring full specification of tickValues. I added that logic here.

Before

<Axis numTicks={5} scale={bandScale} />

image

After
image

@hshoff @kristw

@williaster williaster added this to the 0.0.198 milestone Jun 17, 2020
@williaster williaster requested a review from hshoff June 17, 2020 20:29
@williaster williaster changed the title new(vx-axis): us numTicks when falling back on scale.domain new(vx-axis): use numTicks when falling back on scale.domain Jun 18, 2020
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.

2 participants