From 9817eaf5c6e5b97a4e3b6058813d9cc70aa623bc Mon Sep 17 00:00:00 2001 From: Reese Hayman <108630606+KwibooReese@users.noreply.github.com> Date: Fri, 29 Nov 2024 17:58:29 +0000 Subject: [PATCH] doc: Update README.md (#135) I had a bit of trouble when first using the package, since this issue applies to everyone using nextjs I think it would be wise to include it in the README --- core/README.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/core/README.md b/core/README.md index cb034d4a..23f88d10 100644 --- a/core/README.md +++ b/core/README.md @@ -24,6 +24,7 @@ A lightweight calendar heatmap react component built on SVG, customizable versio # Not dependent on uiw. npm install @uiw/react-heat-map --save ``` +If using Next.js, you will need to use the [`next-remove-imports`](https://www.npmjs.com/package/next-remove-imports) package to avoid errors, see [issue #69](https://github.com/uiwjs/react-heat-map/issues/69). ## Basic Usage @@ -315,12 +316,12 @@ export default Demo | `legendCellSize` | Size of the legend cells, in pixel. Value equal to `0` hide legend. | number | `11` | | `startDate` | Start date | Date | `new Date()` | | `endDate` | End date | Date | - | -| `space` | Interval between grid sizes | number | `2` |  -| `monthPlacement` | position of month labels | `'top' | 'bottom'` | `top` |  +| `space` | Interval between grid sizes | number | `2` | +| `monthPlacement` | position of month labels | `'top' | 'bottom'` | `top` | | `rectProps` | Grid node attribute settings | `React.SVGProps` | `2` | -| `weekLabels` | Week display | string[] | `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']` |  -| `monthLabels` | Month display | string[] | `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']` |  -| `panelColors` | Backgroud color of active colors | `Record` \| `string[]` | `['var(--rhm-rect, #EBEDF0)','#C6E48B','#7BC96F', '#239A3B', '#196127']` |  +| `weekLabels` | Week display | string[] | `['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']` | +| `monthLabels` | Month display | string[] | `['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']` | +| `panelColors` | Backgroud color of active colors | `Record` \| `string[]` | `['var(--rhm-rect, #EBEDF0)','#C6E48B','#7BC96F', '#239A3B', '#196127']` | | `rectRender` | Single `day` block re-render | `(data: E & { key: number }, valueItem: HeatMapValue & { date: string, column: number, row: number, index: number }) => React.ReactElement` | - | | `legendRender` | Single `legend` block re-render | `(props: React.SVGProps) => React.ReactNode` | - | @@ -367,3 +368,4 @@ Made with [github-action-contributors](https://github.com/jaywcjlove/github-acti ## License Licensed under the MIT License. +