mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-25 14:34:19 +00:00
🔧 Modularize the wordcloud
This commit is contained in:
parent
7e445915ae
commit
5b2ffaee3a
1 changed files with 10 additions and 19 deletions
|
@ -3,7 +3,15 @@ import BoxFull from "../base/BoxFull"
|
||||||
import ReactWordcloud from "react-wordcloud"
|
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 (
|
return (
|
||||||
<BoxFull header={"Wordcloud"} {...props}>
|
<BoxFull header={"Wordcloud"} {...props}>
|
||||||
<div style={{"width": "100%", "height": "100%"}}>
|
<div style={{"width": "100%", "height": "100%"}}>
|
||||||
|
@ -17,24 +25,7 @@ export default function BoxWordcloud({ ...props }) {
|
||||||
size: undefined,
|
size: undefined,
|
||||||
deterministic: true,
|
deterministic: true,
|
||||||
}}
|
}}
|
||||||
words={[
|
words={words}
|
||||||
{
|
|
||||||
text: "noi",
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "estraiamo",
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "statistiche",
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
text: "tweet",
|
|
||||||
value: 1
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</BoxFull>
|
</BoxFull>
|
||||||
|
|
Loading…
Reference in a new issue