-
Notifications
You must be signed in to change notification settings - Fork 197
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
353 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
.wrapper { | ||
position: relative; | ||
height: 100%; | ||
} | ||
|
||
.xLabels, | ||
.yLabels { | ||
font-size: 10px; | ||
color: var(--mantine-color-gray-5); | ||
line-height: 1; | ||
} | ||
|
||
.xLabels { | ||
position: absolute; | ||
bottom: 0; | ||
left: 20px; | ||
right: 0; | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
|
||
.yLabels { | ||
position: absolute; | ||
top: 0; | ||
bottom: 16px; | ||
left: 0; | ||
display: flex; | ||
flex-direction: column-reverse; | ||
justify-content: space-between; | ||
padding: 0 5px; | ||
|
||
> div { | ||
writing-mode: vertical-rl; | ||
} | ||
} | ||
|
||
.heatmap { | ||
position: absolute; | ||
inset: 0 0 16px 22px; | ||
display: grid; | ||
grid-template-columns: repeat(100, 1fr); | ||
grid-template-rows: repeat(10, 1fr); | ||
place-items: stretch stretch; | ||
gap: 1px; | ||
} | ||
|
||
.cell { | ||
transition: background-color 100ms; | ||
cursor: pointer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { Heatmap } from './Heatmap'; | ||
|
||
const meta = { | ||
component: Heatmap, | ||
} satisfies Meta<typeof Heatmap>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default = () => ( | ||
<Heatmap | ||
xLabels={['Jun 1 20:20:200', 'Jun 10 20:20:200']} | ||
yLabels={['0ms', '30m']} | ||
/> | ||
); |
Oops, something went wrong.