Add @since 3.8 annotation to niceTicks, use it in website examples#7034
Add @since 3.8 annotation to niceTicks, use it in website examples#7034PavelVanecek merged 7 commits intomainfrom
Conversation
…each for XAxis and YAxis Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7034 +/- ##
=======================================
Coverage 90.12% 90.13%
=======================================
Files 526 526
Lines 39242 39253 +11
Branches 5438 5437 -1
=======================================
+ Hits 35368 35379 +11
Misses 3865 3865
Partials 9 9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
@copilot please also add
|
…, ScatterAndLineOfBestFit, VerticalComposedChart Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
Done in 89c0d33. Added
|
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
@copilot I see that the visual regression log in CI says 21 failures But the uploaded artifact says 6 failures. Looks like the first artifact gets uploaded, and your next commit was correct but the VR result is stale. Why is that? Please look at the workflow files. This is not related to your changes, looks like an pre-existing problem. |
…act deployments Co-authored-by: PavelVanecek <1100170+PavelVanecek@users.noreply.github.com>
... The race condition is caused by two simultaneous CI runs for the same PR branch with no concurrency cancellation. What happened:
At the moment you looked: the CI log showed 21 failures (from Run 2 just completing Fix applied in 28307c3: Added |
|
Staging Deployment Details
These deployments will remain available for 30 days. To update snapshots: Comment |
|
/update-snapshots |
1 similar comment
|
/update-snapshots |
Bundle ReportBundle size has no change ✅ |
4a9e6fc to
d5390ff
Compare
|
/update-snapshots |
|
/update-snapshots |
|
✅ Visual regression snapshots have been updated and committed to this PR. |
There was a problem hiding this comment.
Looking at the diff makes me think that the new niceTicks algorithm is ... not strictly better, it's different. I don't see it as a replacement, more like an alternative. Perhaps we should continue supporting both, and have a prop that switches between them. What do you think @ckifer ?
There was a problem hiding this comment.
It mostly just adds more Y value so it can get to nicer numbers lol. There is a prop and it's default off right?
But yeah "nice" is actually kind of confusing because nice is subjective. We could have recharts nice and d3 nice
There was a problem hiding this comment.
Maybe like when domain is auto we can have an auto tick type "nice" and "d3-nice" idk that isn't super clear but the idea works
Description
Adds the
@since 3.8JSDoc annotation to theniceTicksprop onXAxisandYAxis, demonstrates the prop across multiple website example components, and fixes a pre-existing CI race condition that caused stale VR artifacts to be deployed.JSDoc update (
src/cartesian/XAxis.tsx,src/cartesian/YAxis.tsx):@since 3.8to theniceTicksprop documentationWebsite examples — added
niceTicksto the numerical axis/axes in:AreaChart/SimpleAreaChart.tsx— bothXAxisandYAxisAreaChart/StackedAreaChart.tsx— bothXAxisandYAxisBarChart/StackedBarChart.tsx— bothXAxisandYAxisBarChart/MixBarChart.tsx—YAxis(numerical axis)BarChart/BrushBarChart.tsx—YAxis(numerical axis)Legend/LegendEffectOpacity.tsx— bothXAxisandYAxisTooltip/CustomContentOfTooltip.tsx— bothXAxisandYAxisComposedChart/LineBarAreaComposedChart.tsx—YAxis(numerical axis)ComposedChart/ScatterAndLineOfBestFit.tsx— bothXAxisandYAxis(both aretype="number")ComposedChart/VerticalComposedChart.tsx—XAxisonly (the numerical axis in this chart)CI workflow fix (
.github/workflows/ci.yml):concurrency: cancel-in-progress: trueto cancel in-progress workflow runs when a new commit is pushed to the same branch. This fixes a pre-existing race condition where two simultaneous CI runs for the same PR could result in an older run's VR artifact being deployed after a newer run's, causing the deployed report to show stale results.Related Issue
https://github.com/recharts/recharts/issues —
niceTicksintroduced in PR #7009Motivation and Context
niceTickswas added in 3.8 but lacked a@sinceannotation and had no visible usage in the website examples, reducing its discoverability.The CI race condition occurred because the workflow had no
concurrencysetting, allowing multiple pipeline runs for the same PR branch to proceed simultaneously. When commit 1 (affecting 2 charts) deployed its 6-failure VR report to gh-pages, and commit 2 (affecting 7 charts) then ran its VR tests, the CI log would show 21 failures while the deployed artifact still showed the stale 6-failure report from the earlier run.How Has This Been Tested?
ESLint (
react/jsx-boolean-value: "never") passes on all changed files. Existing example component tests cover the modified files.Screenshots (if appropriate):
Types of changes
Checklist:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.