cs-2022-class-profile/pages/playground.tsx

75 lines
1.7 KiB
TypeScript
Raw Normal View History

import { BarGraphHorizontal, BarGraphVertical } from "components/BarGraph";
2022-08-17 22:45:06 -04:00
import {
mockCategoricalData,
moreMockCategoricalData,
mockTimelineData,
} from "data/mocks";
2022-06-03 01:31:07 -04:00
import React from "react";
2022-08-17 22:45:06 -04:00
import Timeline from "@/components/Timeline";
import { ColorPalette } from "../components/ColorPalette";
2022-08-04 02:17:19 -04:00
import { WordCloud } from "../components/WordCloud";
import styles from "./playground.module.css";
2022-06-03 01:31:07 -04:00
export default function Home() {
return (
<div className={styles.page}>
2022-06-03 01:31:07 -04:00
<h1>Playground</h1>
<p>Show off your components here!</p>
<ColorPalette />
<h2>
<code>{"<BarGraphHorizontal />"}</code>
</h2>
<BarGraphHorizontal
className={styles.barGraphDemo}
data={mockCategoricalData}
width={800}
height={500}
margin={{
top: 20,
bottom: 40,
left: 150,
right: 20,
}}
/>
<h2>
<code>{"<BarGraphVertical />"}</code>
</h2>
<p>
<code>{"<BarGraphVertical />"}</code> takes the same props as{" "}
<code>{"<BarGraphHorizontal />"}</code>.
</p>
<BarGraphVertical
className={styles.barGraphDemo}
data={mockCategoricalData}
width={800}
height={500}
margin={{
top: 20,
bottom: 80,
left: 60,
right: 20,
}}
/>
2022-08-04 02:17:19 -04:00
<h2>
<code>{"<WordCloud />"}</code>
</h2>
<WordCloud
data={moreMockCategoricalData.map((word) => ({
text: word.key,
value: word.value,
}))}
/>
2022-08-17 22:45:06 -04:00
<h2>
<code>{"<Timeline />"}</code>
</h2>
2022-08-31 22:34:46 -04:00
<Timeline data={mockTimelineData} width={800} />
</div>
2022-06-03 01:31:07 -04:00
);
}