mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-26 06:54:18 +00:00
33 lines
1,002 B
JavaScript
33 lines
1,002 B
JavaScript
import React from "react"
|
|
import BoxFull from "../base/BoxFull"
|
|
import ReactWordcloud from "react-wordcloud"
|
|
|
|
|
|
/**
|
|
* 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%"}}>
|
|
<ReactWordcloud
|
|
options={{
|
|
colors: [
|
|
"var(--fg-primary)",
|
|
],
|
|
fontFamily: "Bree Serif",
|
|
fontSizes: [12, 128],
|
|
size: undefined,
|
|
deterministic: true,
|
|
}}
|
|
words={words}
|
|
/>
|
|
</div>
|
|
</BoxFull>
|
|
)
|
|
}
|