arunghosh / react-heatmap-grid

A react component for heatmap visualisation in grid layout
https://codesandbox.io/s/r4rvwkl3yn
MIT License
76 stars 42 forks source link

xLabelWidth has no effect #190

Closed ollymarsay closed 4 years ago

ollymarsay commented 4 years ago

I have the following props set: From reading the source xLabelWidth of my xLabels (if using squares prop) should be equal to that of the cell height, however, it is consistently 41px. Additonally, the cellStyle margin messes with the xLabels and they are no longer centered. It would be really nice if there was xLabelStyle & yLabelStyle props (or just an easier way to target the labels through an el className or something).

To get around this I have tried adding the xLabelWidth prop, but this has no effect on the label regardless of what I set it to.

xLabels={xLabels}
yLabels={yLabels}
displayYLabels={false}
yLabelWidth={0}
data={calendarData}
squares
height={40}
onClick={(x, y) => alert(`Clicked ${x}, ${y}`)}
cellStyle={(background, value, min, max, data, x, y) => ({
    background: `${value === null ? '#F6F6F6' : value === 0 ? '#E2E2E2' : `rgb(255, 28, 28, ${1 - (max - value) / (max - min)})`}`,
    fontSize: '11.5px',
    color: '#444',
    borderRadius: '8px',
    margin: '2px'
})}
cellRender={(value, x, y) => <div></div>}
ollymarsay commented 4 years ago

Just realised this is legacy, closing!