fix: incorrect attr name for word cloud

This commit is contained in:
2026-01-28 19:54:38 +00:00
parent 506ef3bd46
commit dc2fb39fb7

View File

@@ -4,7 +4,7 @@ import axios from "axios";
type BackendWord = { type BackendWord = {
word: string; word: string;
frequency: number; count: number;
} }
const WordCloud = () => { const WordCloud = () => {
@@ -17,7 +17,7 @@ const WordCloud = () => {
.get("http://localhost:5000/stats/word_frequencies") .get("http://localhost:5000/stats/word_frequencies")
.then(res => { .then(res => {
const mapped = res.data.map((d: BackendWord) => ( const mapped = res.data.map((d: BackendWord) => (
{text: d.word, value: d.frequency} {text: d.word, value: d.count}
)); ));
setWords(mapped); setWords(mapped);
}) })