-
Notifications
You must be signed in to change notification settings - Fork 716
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(geo, vendor): add d3-geo@3
to visx-vendor
, support geoPath.digits(n)
#1767
Conversation
@@ -115,6 +115,7 @@ | |||
"ts-node": "9.1.1", | |||
"typescript": "^3.8.3" | |||
}, | |||
"packageManager": "[email protected]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am using corepack on my computer, which comes with the latest Yarn by default (v4). Specifying packageManager
helps corepack
pick the right version and run yarn install
without errors.
// @see https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67363 | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
if (digits !== undefined) path.digits(digits); | ||
if (pointRadius !== undefined) path.pointRadius(pointRadius); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side suggestion / question: https://github.com/airbnb/visx/pull/213/files#r1388679342
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is fine (even though 0
shouldn't be a valid input)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @kachkaev this looks great to me overall! No issues from my end except with the one visx/demo
typescript change I mention (it does look like CI is failing on that so I would try reverting the change and seeing if that fixes it)
packages/visx-demo/tsconfig.json
Outdated
@@ -14,11 +14,12 @@ | |||
"moduleResolution": "node", | |||
"composite": true, | |||
"outDir": "lib", | |||
"resolveJsonModule": false, | |||
"resolveJsonModule": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, I think there's an issue where next forces this when running the demo app locally, but I think it fails the TS generation in CI. let's see if it passes with this change, else I'd have you revert it for merging (and separately need to fix the issue)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted this accidental change in f7dddef. Yeah the file was updated by Next when I ran these commands:
cd packages/visx-demo
NODE_OPTIONS=--openssl-legacy-provider yarn dev
(I had to use NODE_OPTIONS
to avoid Error: error:0308010C:digital envelope routines::unsupported
in Node 18.18.2)
It would be nice to update packages/visx-demo/tsconfig.json
but I guess we can do this in a separate DX-focused PR.
// @see https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/67363 | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-call | ||
if (digits !== undefined) path.digits(digits); | ||
if (pointRadius !== undefined) path.pointRadius(pointRadius); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this change is fine (even though 0
shouldn't be a valid input)
@@ -44,6 +44,6 @@ module.exports = { | |||
verbose: false, | |||
testPathIgnorePatterns: ['<rootDir>/packages/visx-demo'], | |||
transformIgnorePatterns: [ | |||
'node_modules/(?!(d3-(array|color|format|interpolate|scale|time|time-format)|delaunator|internmap|robust-predicates)/)', | |||
'node_modules/(?!(d3-(array|color|format|geo|interpolate|scale|time|time-format)|delaunator|internmap|robust-predicates)/)', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for finding this – sorry I missed it in my instructions! this isn't ideal to have to do for each ESM-only package, will think on ways to streamline it.
Co-authored-by: Chris Williams <[email protected]>
Thanks for your feedback @williaster! I updated the diff, hope the CI will pass this time 🤞 I guess what’s left is PR description, unless you have other suggestions on the diff. If you can help me with triaging the changes by type (breaking change, feature, etc.), that’d be great. I can look at other PRs for examples, but there is quite a lot going on in this small PR at once (major bump of |
d3-geo
, add it to visx-vendor
, support geoPath.digits(n)
d3-geo@3
to visx-vendor
, support geoPath.digits(n)
Thanks @kachkaev 🙌 I took a pass at updating the PR title + description. Feel free to tweak if you like, only the title is added to the change log (the PR labels determine what it is labeled as there. I think this is just a |
I think unless you have any other things you want to add, this is probably good to go. Will wait to hear from you before merging/releasing, tho! |
Oh great! Thanks for helping! If the diff and the description look acceptable, let’s get this PR in! Visx is a great lib! I’m glad I’ve been able to pay back with this small contribution! 🙌 |
UPD: Done in a3f86cb |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, thanks for landing the type change as well!! 🎉
really appreciate the contribution and hard work. glad to hear you are enjoying visx
overall :)
🎉 This PR is included in version |
…igits(n)` (airbnb#1767) * Update `d3-geo`, add it to `visx-vendor`, support `Projection#digits` * Link to issue * Reduce diff * tsconfigs * Update packages/visx-geo/src/projections/Projection.tsx Co-authored-by: Chris Williams <[email protected]> * Reduce diff * Update `@types/d3-geo` to `3.1.0` * Dedupe `d3-array` --------- Co-authored-by: Chris Williams <[email protected]>
🚀 Enhancements
Closes #1761
d3-geo
to3.0.8
to supportgeoPath.digits(n)
d3-geo
dep to@visx/vendor
because the new version is ESM-onlyDemo
digits={5}
digits={0}
no
digits
prop (defaults to 3)