Skip to content

Conversation

@robonyong
Copy link
Contributor

Had a similar need to #1425, wanted to change the label that's shown in a heatmap cell.

I copied the way Bar handles a label prop for this one, please let me know if there's a different preferred way to do so now.

@codesandbox-ci
Copy link

codesandbox-ci bot commented Feb 20, 2021

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 0edfe89:

Sandbox Source
nivo Configuration
nivo-website Configuration

Copy link
Contributor

@wyze wyze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First off, sorry for the late review!

We are trying to get rid of recompose so we'd like to avoid adding any new code containing that. That said we can take the recompose code you did and create a variable with useMemo hook!

const getLabel = useMemo(() => getLabelGenerator(label, labelFormat), [label, labelFormat])

@robonyong
Copy link
Contributor Author

@wyze Makes sense! I removed the recompose stuff & switched to using useMemo inside the useHeatmap hook

Copy link
Contributor

@wyze wyze left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

Also, thanks for adding stories for the canvas implementation.

@wyze wyze changed the title feat(heatmap): allow label formatting on heatmaps feat(heatmap): allow label formatting May 10, 2021
@wyze wyze merged commit 92d11b1 into plouc:master May 10, 2021
@wyze wyze mentioned this pull request May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants