Skip to content

Commit b01c755

Browse files
committed
updated readme
1 parent 38ebfbb commit b01c755

File tree

2 files changed

+49
-12
lines changed

2 files changed

+49
-12
lines changed

README.md

Lines changed: 49 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
## Show a heatmap based on the time of day for a week
66

7+
😎 Demo: https://react-time-heatmap.netlify.app/
8+
79
The component takes in time entries and displays the count as a heatmap.
810

911
✔ You can add entries for an unlimited number of days
@@ -12,26 +14,61 @@ The component takes in time entries and displays the count as a heatmap.
1214

1315
✔ Can be made to flow, to use all space it has responsively
1416

15-
## Basic setup
16-
17-
| Description | Example |
18-
| ------------------------------------------------- | ------------------------------------------------------------------------ |
19-
| Shows entries from 7 days separated into 4 groups | ![Basic setup image](https://react-time-heatmap-img.netlify.app/7_4.gif) |
17+
## Examples
2018

21-
Code Example:
19+
Shows entries from 7 days separated into 4 groups
2220

2321
```typescript
2422
<TimeHeatMap timeEntries={entries} />
2523
```
2624

27-
## Custom days and group size
25+
Shows entries into a custom number of groups
2826

29-
| Description | Example |
30-
| -------------------------------------------------- | ------------------------------------------------------------------------- |
31-
| Shows entries from 10 days separated into 7 groups | ![Basic setup image](https://react-time-heatmap-img.netlify.app/10_7.gif) |
27+
```typescript
28+
<TimeHeatMap timeEntries={entries} numberOfGroups={7} />
29+
```
3230

33-
Code Example:
31+
Shows count for every hour
3432

3533
```typescript
36-
<TimeHeatMap timeEntries={entries} numberOfGroups={7} />
34+
<TimeHeatMap timeEntries={entries} showCounts={true} />
3735
```
36+
37+
## Available options
38+
39+
| Option | Required | Description | Default value |
40+
| -------------------- | -------- | ----------------------------------------------------------- | ------------------- |
41+
| timeEntries | yes | array of entries, needs to have 24 entries per day | `[]` |
42+
| numberOfGroups | no | the number of groups to split the colours into | `4` |
43+
| flow | no | allow the component to take the full width of its container | `false` |
44+
| textForNoTimeEntries | no | custom text to show when there are no entries loaded | `"No time entries"` |
45+
| showCounts | no | shows the counts for every hour, for testing | `false` |
46+
47+
## Entries example (shortened)
48+
49+
![Entries example](https://react-time-heatmap-img.netlify.app/entries.png)
50+
51+
✔ time. minute or time zone are not relevant
52+
53+
✔ the time needs to be a valid date
54+
55+
✔ the entries will be sorted by the component
56+
57+
👏 typescript will make sure you type everything right
58+
59+
## Examples
60+
61+
| Base example | Custom nr. groups | Show counts |
62+
| ------------------------------------------------------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
63+
| ![Base example](https://react-time-heatmap-img.netlify.app/7_4.gif) | ![Custom nr. groups](https://react-time-heatmap-img.netlify.app/10_7.gif) | ![Show counts](https://react-time-heatmap-img.netlify.app/numbers.gif) |
64+
65+
Flow enabled, responsive
66+
67+
![Show counts](https://react-time-heatmap-img.netlify.app/flow.gif)
68+
69+
## About
70+
71+
- made with React Hooks
72+
- uses CSS Grid to create the arrangement
73+
- styles applied with sass modules
74+
- support by any browser that supports grids (not IE)

demo/public/entries.PNG

39.6 KB
Loading

0 commit comments

Comments
 (0)