codesuki / react-d3-components

D3 Components for React
http://codesuki.github.io/react-d3-components/example.html
MIT License
1.63k stars 206 forks source link

Migration to 5 version D3 #156

Closed retyui closed 6 years ago

retyui commented 6 years ago

Remove .npmignore used package.json -> files (check result npm pack) Update D3 version to latest Did the formatting eslint --fix

retyui commented 6 years ago

https://github.com/codesuki/react-d3-components/issues/155

codesuki commented 6 years ago

That was quick! Thanks for the PR. Please let me check it on monday, I am away for the weekend. Thanks again!

retyui commented 6 years ago

replace schemeCategory20 => schemeCategory10

D3 no longer provides the d3.schemeCategory20* categorical color schemes

retyui commented 6 years ago

There are still many problems, I now understand what this method does

https://github.com/codesuki/react-d3-components/blob/master/src/StackDataMixin.jsx#L26-L52

codesuki commented 6 years ago

Is this PR still WIP? If you need me to explain any part of the code, let me know!

retyui commented 6 years ago

@codesuki Yes, this PR still work in progress. In the near future I will try to end the migration

retyui commented 6 years ago

@codesuki I almost finished left the most difficult for me : this is a change for d3.stack StackDataMixin.jsx#L27-L39 mentioned by @PierreGUI https://github.com/codesuki/react-d3-components/issues/133#issuecomment-308734293

Fast check result

git clone https://github.com/retyui/react-d3-components -b d3-version-5
yarn
yarn watch

And open: http://localhost:3000/example/d3-v5/

codesuki commented 6 years ago

Great! I'll have a look later today. Thanks!

retyui commented 6 years ago

@codesuki Well, what do you say?

codesuki commented 6 years ago

Sorry, in the middle of release preparations. I'll need a few more days until I have time to check it out.

codesuki commented 6 years ago

What happened?

retyui commented 6 years ago

Do not worry, I want to do everything in stages. Multiple steps for migration

retyui commented 6 years ago

@codesuki This is a list of changes that need to be made so that migration is as productive as possible: 1) Add lint-staged, prettier, update webpack to latest version 2) Add test for components 3) Replace mixins to hocs 4) Migrate to d3 version 5 Do you agree with these changes?

codesuki commented 6 years ago

Yes that is a reasonable list. Step 3 is mostly useful for React upgrades, but super useful.