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 marked this pull request as ready for review May 7, 2023 04:17
@plouc plouc merged commit c9298f8 into master May 7, 2023
@plouc plouc deleted the waffle-next branch May 7, 2023 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant