Colors from data not being displayed in Nivo ResponsiveHeatMap
See original GitHub issueSuppose I am inputting the following data into my ResponsiveHeatMap
const data = [
{
resultID: 'shopping',
accepted: 2,
acceptedColor: 'hsl(130,72%,65%)',
exception: 0,
exceptionColor: 'hsl(72,72%,44%)'
}
.
.
.
]
I am currently passing the following into the colors prop and it’s not working.
colors={({mapData}) => {
return mapData.data[`${mapData.id}Color`]
}}
I have checked out the following issues but they appear ResponsiveBar specific and aren’t useful for Responsive Heatmaps #581 #1417
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top Results From Across the Web
Colors from data not being displayed in Nivo ResponsiveBar
I have a ResponsiveBar component in my React app, but the colors are not being displayed as intended. I have followed the guidelines...
Read more >Heat Map chart - Nivo
An heat map matrix, you can chose between various colors scales, you also have the ability to change the cell shape for rectangle...
Read more >Colors Guide | nivo
Using colors in nivo, color schemes, color scales… ... The colors property. Beside highlighting data insights, your dataviz should be pretty, right?
Read more >Legends Guide - Nivo
Let's see how to add legends to your charts. Legend components are available via the @nivo/legends package, however it's added as a dependency...
Read more >Choropleth chart - Nivo
The Choropleth component displays divided geographical areas shaded in relation to some data variable. It's build on top of primitives from the GeoMap ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Can you show a full example of the code you are trying and we should be able to get it to work?
You need to process your colors to an array first and then pass it to colors property. See https://codesandbox.io/s/long-cherry-prbfw?file=/src/charts/HeatMap.tsx