1
Fork 0
mirror of https://github.com/pds-nest/nest.git synced 2024-11-23 05:24:18 +00:00
pds-2021-g2-nest/nest_frontend/components/base/BoxWordcloud.js

34 lines
1 KiB
JavaScript

import React from "react"
import BoxFull from "../base/BoxFull"
import ReactWordcloud from "@steffo/nest-react-wordcloud"
import Style from "./BoxWordcloud.module.css"
/**
* 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 {...props}>
<div className={Style.WordcloudContainer}>
<ReactWordcloud
options={{
colors: [
"var(--fg-primary)",
],
fontFamily: "Bree Serif",
fontSizes: [8, 64],
size: undefined,
deterministic: true,
}}
words={words}
/>
</div>
</BoxFull>
)
}