1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-22 04:54:18 +00:00

🔧 Modularize the wordcloud

This commit is contained in:
Steffo 2021-05-16 23:14:28 +02:00
parent 7e445915ae
commit 5b2ffaee3a
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -3,7 +3,15 @@ import BoxFull from "../base/BoxFull"
import ReactWordcloud from "react-wordcloud"
export default function BoxWordcloud({ ...props }) {
/**
* A Box which displays a wordcloud.
*
* @param words - A list of word objects, made of a string "text" and a number "value"
* @param props - Additional props to pass to the box.
* @returns {JSX.Element}
* @constructor
*/
export default function BoxWordcloud({ words, props }) {
return (
<BoxFull header={"Wordcloud"} {...props}>
<div style={{"width": "100%", "height": "100%"}}>
@ -17,24 +25,7 @@ export default function BoxWordcloud({ ...props }) {
size: undefined,
deterministic: true,
}}
words={[
{
text: "noi",
value: 1
},
{
text: "estraiamo",
value: 1
},
{
text: "statistiche",
value: 1
},
{
text: "tweet",
value: 1
},
]}
words={words}
/>
</div>
</BoxFull>