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

[xy-chart][grid] add x/yGridValues, bump @vx/grid to fix band-scale bug #146

Merged
merged 5 commits into from
Nov 14, 2018

Conversation

williaster
Copy link
Owner

🏆 Enhancements
🐛 Bug Fix

This PR makes the following improvements/bug fixes for @data-ui/xy-chart

  • bumps @vx/grid to ^0.0.180 so that we can leverage some new functionality and fixes
  • fixes an issue with x and y gridlines where they don't work for band type scales
  • adds additional customization hooks for controlling the number, position, and values of grid lines. The following are now available:
    • x/yGridOffset controls the offset of the gridline from the grid / tick value. This is useful for band scales which are offset by bandwidth() / 2. This defaults to bandwidth() / 2 if the scale is a band type, and 0 otherwise
    • x/yGridValuesallows a user to specify the exact values for grid lines. If not defined, these fall back toX/YAxis.props.tickValuesif available (so grid and ticks are in sync by default but can be independent), or undefined in which case the@vx/gridcomponents will fallback tonumTicks`.
    • (not new, but related) numTicks can be set on X/YAxis components and are used by default for the grid

Demo of custom xGridValues
image

cc @conglei @kristw @rmusa

@codecov
Copy link

codecov bot commented Nov 14, 2018

Codecov Report

Merging #146 into master will increase coverage by 0.7%.
The diff coverage is 60%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master    #146     +/-   ##
========================================
+ Coverage   79.79%   80.5%   +0.7%     
========================================
  Files         109     109             
  Lines        2386    2395      +9     
  Branches      547     556      +9     
========================================
+ Hits         1904    1928     +24     
+ Misses        310     290     -20     
- Partials      172     177      +5
Impacted Files Coverage Δ
packages/xy-chart/src/utils/propShapes.js 100% <100%> (ø) ⬆️
packages/xy-chart/src/chart/XYChart.jsx 77.27% <57.14%> (+8.98%) ⬆️
packages/xy-chart/src/utils/chartUtils.js 89.58% <0%> (+2.08%) ⬆️
packages/xy-chart/src/utils/drag/util/raise.js 100% <0%> (+100%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 596c094...28be991. Read the comment docs.

@williaster
Copy link
Owner Author

Merging this, want to remove the diff hit threshold in the future.

@williaster williaster merged commit c08f6b9 into master Nov 14, 2018
@williaster williaster deleted the chris--xychart-grid-enhancement branch November 14, 2018 08:14
@williaster williaster added this to the v0.0.70 milestone Nov 15, 2018
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.

1 participant