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

Waffle next #2320

Merged
merged 44 commits into from May 7, 2023
Merged

Waffle next #2320

merged 44 commits into from May 7, 2023

Conversation

plouc
Copy link
Owner

@plouc plouc commented May 2, 2023

Adjust @nivo/waffle to be more in line with other packages.


🧰 Internal

  • Migrate the package to TypeScript, so typings should now be correct.
  • Not specific to @nivo/waffle, upgraded jest and enabled --workerThreads for the pgks-test make target.
  • Introduce a new @nivo/grid core package.
  • Introduce a new @nivo/canvas core package.

πŸŽ‰ Improvements

  • Components now support aria attributes.
  • SVG and HTML implementations now support layers.
  • Rather than having event handlers attached to each individual cells, we now have areas which capture the events, it makes the tooltip smoother when using padding as before the tooltip disappeared due to the gaps.
  • When using a custom tooltip, it'll behave like other packages, meaning that we won't wrap it with the default styled container (Custom tooltip render issueΒ #2218).
  • Introduce a testIdPrefix property, if specified, we're going to add a data-test-id attribute to the Waffle and WaffleHtml components, to ease testing. Please note that it doesn't work for WaffleCanvas as it has no concrete elements.
  • The package won't rely on recompose anymore, finally πŸ˜… (related to Tracking issue for removing recompose dependencyΒ #884).
  • Introduce a new forwardLegendData property, allowing users to implement custom legends.
  • Legend items order reacts to fillDirection.
  • The package doesn't need lodash anymore.
  • Add support for borderRadius on cells.

πŸ’₯ Breaking Changes 😒 (but still improvements for most of them πŸ˜„):

  • Remove react-motion and use @react-spring instead, meaning that the config you can use is slightly different.
    This will help to resolve Tracking issue for removing react-motion dependencyΒ #667, but @nivo/core should now only consider a react-spring config, to be addressed in a different PR.
  • I couldn't reproduce the previous transitions, so it behaves a bit differently.
  • Due to the introductions of areas, custom event handlers will now receive the data the cell is attached to rather than the cell itself, but if we want to somehow emulate the previous behavior, we can remove the areas layer and use a custom cell component using cellComponent.
  • As suggested in Use readonly types for arrays where appropriateΒ #2248, data is now readonly.
  • fillDirection was defining the origin rather than the direction, which was a bit confusing, so things are now inverted, e.g, bottom has the same behavior as top in the previous version:
β”‚   top             β”‚   right           β”‚   bottom          β”‚   left            β”‚
β”‚                   β”‚                   β”‚   ↓               β”‚                   β”‚
β”‚   8 ─── 7 ─── 6   β”‚ β†’ 0  ╭─ 3  ╭─ 6   β”‚   0 ─── 1 ─── 2   β”‚   8  ╭─ 5  ╭─ 2   β”‚
β”‚   ╭───────────╯   β”‚   β”‚  β”‚  β”‚  β”‚  β”‚   β”‚   ╭───────────╯   β”‚   β”‚  β”‚  β”‚  β”‚  β”‚   β”‚
β”‚   5 ─── 4 ─── 3   β”‚   1  β”‚  4  β”‚  7   β”‚   3 ─── 4 ─── 5   β”‚   5  β”‚  4  β”‚  1   β”‚
β”‚   ╭───────────╯   β”‚   β”‚  β”‚  β”‚  β”‚  β”‚   β”‚   ╭───────────╯   β”‚   β”‚  β”‚  β”‚  β”‚  β”‚   β”‚
β”‚   2 ─── 1 ─── 0   β”‚   2 ─╯  5 ─╯  8   β”‚   6 ─── 7 ─── 8   β”‚   6 ─╯  3 ─╯  0 ← β”‚
β”‚               ↑   β”‚                   β”‚                   β”‚                   β”‚

@vercel
Copy link

vercel bot commented May 2, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
nivo βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback May 7, 2023 4:27am

@plouc plouc self-assigned this May 2, 2023
@codesandbox-ci
Copy link

codesandbox-ci bot commented May 2, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5d95efc:

Sandbox Source
nivo Configuration
React 16.9.0 Issue #667

@plouc plouc added this to In progress in TypeScript migration May 2, 2023
@plouc plouc marked this pull request as ready for review May 7, 2023 04:17
@plouc plouc merged commit c9298f8 into master May 7, 2023
5 checks passed
@plouc plouc deleted the waffle-next branch May 7, 2023 04:29
@plouc plouc moved this from In progress to Done in TypeScript migration May 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 participant