fix: incorrect attr name for word cloud
This commit is contained in:
@@ -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);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user