feat: word cloud on stat page

This commit is contained in:
2026-01-27 18:37:42 +00:00
parent ecc1a62d24
commit dda1c1fee8
4 changed files with 166 additions and 2 deletions

View File

@@ -9,6 +9,7 @@ import {
CartesianGrid,
ResponsiveContainer
} from "recharts";
import WordCloud from "../stats/WordCloud";
function PostsPerDay() {
const [data, setData] = useState([]);
@@ -19,7 +20,7 @@ function PostsPerDay() {
axios
.get("http://localhost:5000/stats/posts_per_day")
.then(res => {
setData(res.data);
setData(res.data.filter((item: any) => new Date(item.date) >= new Date("2025-06-01")));
setLoading(false);
})
.catch(err => {
@@ -35,7 +36,7 @@ function PostsPerDay() {
<div>
<h2>Posts per Day</h2>
<ResponsiveContainer width="100%" height={350}>
<ResponsiveContainer width={800} height={350}>
<LineChart data={data}>
<CartesianGrid strokeDasharray="3 3" />
<XAxis dataKey="date" />
@@ -48,6 +49,8 @@ function PostsPerDay() {
/>
</LineChart>
</ResponsiveContainer>
<WordCloud />
</div>
);
}