Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/recharts/recharts
Browse files Browse the repository at this point in the history
* 'master' of https://github.com/recharts/recharts:
  Add inactiveShape prop to Pie component (#2900)
  Revert "chore: move type deps into devDependencies (#2843)" (#2942)
  Fix typing of default tooltip formatter (#2924)
  done (#2936)
  Take letter-spacing and font-size into consideration while rendering ticks (#2898)
  Add formatter function type to tooltip props (#2916)
  doc: Update CHANGELOG.md about d3 7.x (#2919)
  • Loading branch information
arcthur committed Sep 6, 2022
2 parents 8f57ad6 + deee55f commit b9c83a5
Show file tree
Hide file tree
Showing 13 changed files with 300 additions and 63 deletions.
65 changes: 65 additions & 0 deletions CHANGELOG.md
Expand Up @@ -15,6 +15,71 @@
# fix

- update react-smooth version
- update d3 from 6.x to 7.x it may break some tools like jest

fix config for jest is to add the following configuration

```javascript
const path = require('path');
// took from d3/package.json
const d3Pkgs = [
'd3',
'd3-array',
'd3-axis',
'd3-brush',
'd3-chord',
'd3-color',
'd3-contour',
'd3-delaunay',
'd3-dispatch',
'd3-drag',
'd3-dsv',
'd3-ease',
'd3-fetch',
'd3-force',
'd3-format',
'd3-geo',
'd3-hierarchy',
'd3-interpolate',
'd3-path',
'd3-polygon',
'd3-quadtree',
'd3-random',
'd3-scale',
'd3-scale-chromatic',
'd3-selection',
'd3-shape',
'd3-time',
'd3-time-format',
'd3-timer',
'd3-transition',
'd3-zoom',
];

// option 1 map module to an bundled version of the package which is es5
const moduleNameMapper = d3Pkgs.reduce((acc, pkg) => {
acc[`^${pkg}$`] = path.join(require.resolve(pkg), `../../dist/${pkg}.min.js`);
return acc;
}, {});

module.exports = {
moduleNameMapper: {
// option 1
// ...moduleNameMapper
},
transform: {
// match mjs js jsx ts tsx
'^.+\\.m?[jt]sx?$': 'babel-jest',
},
// stop ignore node_modules transform since d3 and others start to put es6 as main of packages
transformIgnorePatterns: [
// option 2, stop ignore transform on es6 packages
`/node_modules/(?!${d3Pkgs.join('|')}|internmap|d3-delaunay|delaunator|robust-predicates)`,
// option 3, stop ignore transform on all node_modules
// `/node_modules/(?!.*)`,
],
};
```

## 2.1.11 (Jun 24, 2022)

Expand Down
30 changes: 9 additions & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -55,6 +55,9 @@
"react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0"
},
"dependencies": {
"@types/d3-interpolate": "^3.0.1",
"@types/d3-scale": "^4.0.2",
"@types/d3-shape": "^3.1.0",
"classnames": "^2.2.5",
"d3-interpolate": "^3.0.1",
"d3-scale": "^4.0.2",
Expand All @@ -81,9 +84,6 @@
"@babel/preset-typescript": "^7.6.0",
"@babel/runtime": "^7.6.3",
"@types/classnames": "^2.2.9",
"@types/d3-interpolate": "^3.0.1",
"@types/d3-scale": "^4.0.2",
"@types/d3-shape": "^3.1.0",
"@types/lodash": "^4.14.144",
"@types/react": "^16.0.0",
"@types/react-dom": "^16.0.0",
Expand Down

0 comments on commit b9c83a5

Please sign in to comment.