add the very basics of a plot

Also troubleshoot to fix vite config for deduplicating react and
react-dom
This commit is contained in:
2026-02-18 19:52:08 -08:00
parent e7d8d09fbc
commit 35b0c2396f
8 changed files with 189 additions and 20 deletions
@@ -0,0 +1,25 @@
import { ScatterChart, Scatter, XAxis, YAxis, Tooltip, ResponsiveContainer } from "recharts";
import WeatherHistory from '@/hooks/weather-history'
function TemperaturePlot() {
const {data, isLoading, error} = WeatherHistory()
if (isLoading) return <p>Loading...</p>
if (error) return <p>Error: {error.message}</p>
return (
<div>
<ResponsiveContainer width="100%" height={400}>
<ScatterChart data={data}>
<XAxis dataKey="id" />
<YAxis />
<Tooltip />
<Scatter dataKey="temp" fill="#6366f1" />
</ScatterChart>
</ResponsiveContainer>
</div>
)
}
export default TemperaturePlot