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

🚧 Add basic wordcloud

This commit is contained in:
Steffo 2021-05-15 18:05:13 +02:00
parent 0187517943
commit 25c479e2ac
Signed by: steffo
GPG key ID: 6965406171929D01
6 changed files with 154 additions and 44 deletions

View file

@ -8,6 +8,7 @@ import PageDashboard from "./routes/PageDashboard"
import PageRoot from "./routes/PageRoot" import PageRoot from "./routes/PageRoot"
import PageEdit from "./routes/PageEdit" import PageEdit from "./routes/PageEdit"
import PageUsers from "./routes/PageUsers" import PageUsers from "./routes/PageUsers"
import PageRepository from "./routes/PageRepository"
export default function PageSwitcher({ ...props }) { export default function PageSwitcher({ ...props }) {
@ -16,6 +17,9 @@ export default function PageSwitcher({ ...props }) {
<Route path={"/repositories/:id/edit"} exact={true}> <Route path={"/repositories/:id/edit"} exact={true}>
<PageEdit/> <PageEdit/>
</Route> </Route>
<Route path={"/repositories/:id"} exact={true}>
<PageRepository/>
</Route>
<Route path={"/login"} exact={true}> <Route path={"/login"} exact={true}>
<PageLogin/> <PageLogin/>
</Route> </Route>

View file

@ -0,0 +1,42 @@
import React from "react"
import BoxFull from "../base/BoxFull"
import ReactWordcloud from "react-wordcloud"
export default function BoxWordcloud({ ...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={[
{
text: "noi",
value: 1
},
{
text: "estraiamo",
value: 1
},
{
text: "statistiche",
value: 1
},
{
text: "tweet",
value: 1
},
]}
/>
</div>
</BoxFull>
)
}

View file

@ -22,7 +22,7 @@ export default function PageRepositories({ children, className, ...props }) {
} }
return {} return {}
}, },
[bv.apiRequest, bv.refreshResource], [bv],
) )
return ( return (

View file

@ -0,0 +1,13 @@
import React from "react"
import Style from "./PageRepository.module.css"
import classNames from "classnames"
import BoxWordcloud from "../components/interactive/BoxWordcloud"
export default function PageRepository({ className, ...props }) {
return (
<div className={classNames(Style.PageRepository, className)} {...props}>
<BoxWordcloud className={Style.Wordcloud}/>
</div>
)
}

View file

@ -0,0 +1,14 @@
.PageRepository {
display: grid;
grid-template-areas: "a";
grid-gap: 10px;
width: 100%;
height: 100%;
}
.Wordcloud {
grid-area: a;
}

123
package-lock.json generated
View file

@ -6428,9 +6428,9 @@
"integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA=="
}, },
"node_modules/d3-ease": { "node_modules/d3-ease": {
"version": "2.0.0", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz",
"integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ=="
}, },
"node_modules/d3-format": { "node_modules/d3-format": {
"version": "2.0.0", "version": "2.0.0",
@ -6467,9 +6467,9 @@
} }
}, },
"node_modules/d3-selection": { "node_modules/d3-selection": {
"version": "2.0.0", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz",
"integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg=="
}, },
"node_modules/d3-time": { "node_modules/d3-time": {
"version": "2.1.1", "version": "2.1.1",
@ -6488,23 +6488,39 @@
} }
}, },
"node_modules/d3-timer": { "node_modules/d3-timer": {
"version": "2.0.0", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz",
"integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw=="
}, },
"node_modules/d3-transition": { "node_modules/d3-transition": {
"version": "2.0.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz",
"integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==",
"dependencies": { "dependencies": {
"d3-color": "1 - 2", "d3-color": "1",
"d3-dispatch": "1 - 2", "d3-dispatch": "1",
"d3-ease": "1 - 2", "d3-ease": "1",
"d3-interpolate": "1 - 2", "d3-interpolate": "1",
"d3-timer": "1 - 2" "d3-selection": "^1.1.0",
}, "d3-timer": "1"
"peerDependencies": { }
"d3-selection": "2" },
"node_modules/d3-transition/node_modules/d3-color": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz",
"integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q=="
},
"node_modules/d3-transition/node_modules/d3-dispatch": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz",
"integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA=="
},
"node_modules/d3-transition/node_modules/d3-interpolate": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz",
"integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==",
"dependencies": {
"d3-color": "1"
} }
}, },
"node_modules/damerau-levenshtein": { "node_modules/damerau-levenshtein": {
@ -16621,7 +16637,7 @@
}, },
"node_modules/react-wordcloud": { "node_modules/react-wordcloud": {
"version": "1.2.7", "version": "1.2.7",
"resolved": "git+ssh://git@github.com/Steffo99/react-wordcloud.git#aa959f7a261d99d1afb952d2e775699246068ca7", "resolved": "git+ssh://git@github.com/Steffo99/react-wordcloud.git#ac2474b1454b69e940979c8743deb027d6b248ee",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"d3-array": "^2.12.1", "d3-array": "^2.12.1",
@ -16629,8 +16645,8 @@
"d3-dispatch": "^2.0.0", "d3-dispatch": "^2.0.0",
"d3-scale": "^3.3.0", "d3-scale": "^3.3.0",
"d3-scale-chromatic": "^2.0.0", "d3-scale-chromatic": "^2.0.0",
"d3-selection": "^2.0.0", "d3-selection": "^1.4.1",
"d3-transition": "^2.0.0", "d3-transition": "^1.3.2",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",
@ -27681,9 +27697,9 @@
"integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA=="
}, },
"d3-ease": { "d3-ease": {
"version": "2.0.0", "version": "1.0.7",
"resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz",
"integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ=="
}, },
"d3-format": { "d3-format": {
"version": "2.0.0", "version": "2.0.0",
@ -27720,9 +27736,9 @@
} }
}, },
"d3-selection": { "d3-selection": {
"version": "2.0.0", "version": "1.4.2",
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz",
"integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg=="
}, },
"d3-time": { "d3-time": {
"version": "2.1.1", "version": "2.1.1",
@ -27741,20 +27757,41 @@
} }
}, },
"d3-timer": { "d3-timer": {
"version": "2.0.0", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz",
"integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw=="
}, },
"d3-transition": { "d3-transition": {
"version": "2.0.0", "version": "1.3.2",
"resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz",
"integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==",
"requires": { "requires": {
"d3-color": "1 - 2", "d3-color": "1",
"d3-dispatch": "1 - 2", "d3-dispatch": "1",
"d3-ease": "1 - 2", "d3-ease": "1",
"d3-interpolate": "1 - 2", "d3-interpolate": "1",
"d3-timer": "1 - 2" "d3-selection": "^1.1.0",
"d3-timer": "1"
},
"dependencies": {
"d3-color": {
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/d3-color/-/d3-color-1.4.1.tgz",
"integrity": "sha512-p2sTHSLCJI2QKunbGb7ocOh7DgTAn8IrLx21QRc/BSnodXM4sv6aLQlnfpvehFMLZEfBc6g9pH9SWQccFYfJ9Q=="
},
"d3-dispatch": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/d3-dispatch/-/d3-dispatch-1.0.6.tgz",
"integrity": "sha512-fVjoElzjhCEy+Hbn8KygnmMS7Or0a9sI2UzGwoB7cCtvI1XpVN9GpoYlnb3xt2YV66oXYb1fLJ8GMvP4hdU1RA=="
},
"d3-interpolate": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/d3-interpolate/-/d3-interpolate-1.4.0.tgz",
"integrity": "sha512-V9znK0zc3jOPV4VD2zZn0sDhZU3WAE2bmlxdIwwQPPzPjvyLkd8B3JUVdS1IDUFDkWZ72c9qnv1GK2ZagTZ8EA==",
"requires": {
"d3-color": "1"
}
}
} }
}, },
"damerau-levenshtein": { "damerau-levenshtein": {
@ -35661,7 +35698,7 @@
} }
}, },
"react-wordcloud": { "react-wordcloud": {
"version": "git+ssh://git@github.com/Steffo99/react-wordcloud.git#aa959f7a261d99d1afb952d2e775699246068ca7", "version": "git+ssh://git@github.com/Steffo99/react-wordcloud.git#ac2474b1454b69e940979c8743deb027d6b248ee",
"from": "react-wordcloud@github:Steffo99/react-wordcloud", "from": "react-wordcloud@github:Steffo99/react-wordcloud",
"requires": { "requires": {
"d3-array": "^2.12.1", "d3-array": "^2.12.1",
@ -35669,8 +35706,8 @@
"d3-dispatch": "^2.0.0", "d3-dispatch": "^2.0.0",
"d3-scale": "^3.3.0", "d3-scale": "^3.3.0",
"d3-scale-chromatic": "^2.0.0", "d3-scale-chromatic": "^2.0.0",
"d3-selection": "^2.0.0", "d3-selection": "^1.4.1",
"d3-transition": "^2.0.0", "d3-transition": "^1.3.2",
"lodash.clonedeep": "^4.5.0", "lodash.clonedeep": "^4.5.0",
"lodash.debounce": "^4.0.8", "lodash.debounce": "^4.0.8",
"resize-observer-polyfill": "^1.5.1", "resize-observer-polyfill": "^1.5.1",