From 25c479e2ac8510ace75eb80619cebe748c9f1821 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sat, 15 May 2021 18:05:13 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20Add=20basic=20wordcloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/PageSwitcher.js | 4 + .../components/interactive/BoxWordcloud.js | 42 ++++++ nest_frontend/routes/PageRepositories.js | 2 +- nest_frontend/routes/PageRepository.js | 13 ++ .../routes/PageRepository.module.css | 14 ++ package-lock.json | 123 ++++++++++++------ 6 files changed, 154 insertions(+), 44 deletions(-) create mode 100644 nest_frontend/components/interactive/BoxWordcloud.js create mode 100644 nest_frontend/routes/PageRepository.js create mode 100644 nest_frontend/routes/PageRepository.module.css diff --git a/nest_frontend/PageSwitcher.js b/nest_frontend/PageSwitcher.js index 4e53fc6..9cfe1ec 100644 --- a/nest_frontend/PageSwitcher.js +++ b/nest_frontend/PageSwitcher.js @@ -8,6 +8,7 @@ import PageDashboard from "./routes/PageDashboard" import PageRoot from "./routes/PageRoot" import PageEdit from "./routes/PageEdit" import PageUsers from "./routes/PageUsers" +import PageRepository from "./routes/PageRepository" export default function PageSwitcher({ ...props }) { @@ -16,6 +17,9 @@ export default function PageSwitcher({ ...props }) { + + + diff --git a/nest_frontend/components/interactive/BoxWordcloud.js b/nest_frontend/components/interactive/BoxWordcloud.js new file mode 100644 index 0000000..1185e72 --- /dev/null +++ b/nest_frontend/components/interactive/BoxWordcloud.js @@ -0,0 +1,42 @@ +import React from "react" +import BoxFull from "../base/BoxFull" +import ReactWordcloud from "react-wordcloud" + + +export default function BoxWordcloud({ ...props }) { + return ( + +
+ +
+
+ ) +} diff --git a/nest_frontend/routes/PageRepositories.js b/nest_frontend/routes/PageRepositories.js index 78347c1..e5635e3 100644 --- a/nest_frontend/routes/PageRepositories.js +++ b/nest_frontend/routes/PageRepositories.js @@ -22,7 +22,7 @@ export default function PageRepositories({ children, className, ...props }) { } return {} }, - [bv.apiRequest, bv.refreshResource], + [bv], ) return ( diff --git a/nest_frontend/routes/PageRepository.js b/nest_frontend/routes/PageRepository.js new file mode 100644 index 0000000..a73158b --- /dev/null +++ b/nest_frontend/routes/PageRepository.js @@ -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 ( +
+ +
+ ) +} diff --git a/nest_frontend/routes/PageRepository.module.css b/nest_frontend/routes/PageRepository.module.css new file mode 100644 index 0000000..7203ab8 --- /dev/null +++ b/nest_frontend/routes/PageRepository.module.css @@ -0,0 +1,14 @@ +.PageRepository { + display: grid; + + grid-template-areas: "a"; + + grid-gap: 10px; + + width: 100%; + height: 100%; +} + +.Wordcloud { + grid-area: a; +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 272e54a..a3d1726 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6428,9 +6428,9 @@ "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" }, "node_modules/d3-ease": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", - "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", + "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" }, "node_modules/d3-format": { "version": "2.0.0", @@ -6467,9 +6467,9 @@ } }, "node_modules/d3-selection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", - "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" }, "node_modules/d3-time": { "version": "2.1.1", @@ -6488,23 +6488,39 @@ } }, "node_modules/d3-timer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", - "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" }, "node_modules/d3-transition": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", - "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", + "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", "dependencies": { - "d3-color": "1 - 2", - "d3-dispatch": "1 - 2", - "d3-ease": "1 - 2", - "d3-interpolate": "1 - 2", - "d3-timer": "1 - 2" - }, - "peerDependencies": { - "d3-selection": "2" + "d3-color": "1", + "d3-dispatch": "1", + "d3-ease": "1", + "d3-interpolate": "1", + "d3-selection": "^1.1.0", + "d3-timer": "1" + } + }, + "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": { @@ -16621,7 +16637,7 @@ }, "node_modules/react-wordcloud": { "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", "dependencies": { "d3-array": "^2.12.1", @@ -16629,8 +16645,8 @@ "d3-dispatch": "^2.0.0", "d3-scale": "^3.3.0", "d3-scale-chromatic": "^2.0.0", - "d3-selection": "^2.0.0", - "d3-transition": "^2.0.0", + "d3-selection": "^1.4.1", + "d3-transition": "^1.3.2", "lodash.clonedeep": "^4.5.0", "lodash.debounce": "^4.0.8", "resize-observer-polyfill": "^1.5.1", @@ -27681,9 +27697,9 @@ "integrity": "sha512-S/m2VsXI7gAti2pBoLClFFTMOO1HTtT0j99AuXLoGFKO6deHDdnv6ZGTxSTTUTgO1zVcv82fCOtDjYK4EECmWA==" }, "d3-ease": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-2.0.0.tgz", - "integrity": "sha512-68/n9JWarxXkOWMshcT5IcjbB+agblQUaIsbnXmrzejn2O82n3p2A9R2zEB9HIEFWKFwPAEDDN8gR0VdSAyyAQ==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/d3-ease/-/d3-ease-1.0.7.tgz", + "integrity": "sha512-lx14ZPYkhNx0s/2HX5sLFUI3mbasHjSSpwO/KaaNACweVwxUruKyWVcb293wMv1RqTPZyZ8kSZ2NogUZNcLOFQ==" }, "d3-format": { "version": "2.0.0", @@ -27720,9 +27736,9 @@ } }, "d3-selection": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-2.0.0.tgz", - "integrity": "sha512-XoGGqhLUN/W14NmaqcO/bb1nqjDAw5WtSYb2X8wiuQWvSZUsUVYsOSkOybUrNvcBjaywBdYPy03eXHMXjk9nZA==" + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-1.4.2.tgz", + "integrity": "sha512-SJ0BqYihzOjDnnlfyeHT0e30k0K1+5sR3d5fNueCNeuhZTnGw4M4o8mqJchSwgKMXCNFo+e2VTChiSJ0vYtXkg==" }, "d3-time": { "version": "2.1.1", @@ -27741,20 +27757,41 @@ } }, "d3-timer": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-2.0.0.tgz", - "integrity": "sha512-TO4VLh0/420Y/9dO3+f9abDEFYeCUr2WZRlxJvbp4HPTQcSylXNiL6yZa9FIUvV1yRiFufl1bszTCLDqv9PWNA==" + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/d3-timer/-/d3-timer-1.0.10.tgz", + "integrity": "sha512-B1JDm0XDaQC+uvo4DT79H0XmBskgS3l6Ve+1SBCfxgmtIb1AVrPIoqd+nPSv+loMX8szQ0sVUhGngL7D5QPiXw==" }, "d3-transition": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-2.0.0.tgz", - "integrity": "sha512-42ltAGgJesfQE3u9LuuBHNbGrI/AJjNL2OAUdclE70UE6Vy239GCBEYD38uBPoLeNsOhFStGpPI0BAOV+HMxog==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/d3-transition/-/d3-transition-1.3.2.tgz", + "integrity": "sha512-sc0gRU4PFqZ47lPVHloMn9tlPcv8jxgOQg+0zjhfZXMQuvppjG6YuwdMBE0TuqCZjeJkLecku/l9R0JPcRhaDA==", "requires": { - "d3-color": "1 - 2", - "d3-dispatch": "1 - 2", - "d3-ease": "1 - 2", - "d3-interpolate": "1 - 2", - "d3-timer": "1 - 2" + "d3-color": "1", + "d3-dispatch": "1", + "d3-ease": "1", + "d3-interpolate": "1", + "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": { @@ -35661,7 +35698,7 @@ } }, "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", "requires": { "d3-array": "^2.12.1", @@ -35669,8 +35706,8 @@ "d3-dispatch": "^2.0.0", "d3-scale": "^3.3.0", "d3-scale-chromatic": "^2.0.0", - "d3-selection": "^2.0.0", - "d3-transition": "^2.0.0", + "d3-selection": "^1.4.1", + "d3-transition": "^1.3.2", "lodash.clonedeep": "^4.5.0", "lodash.debounce": "^4.0.8", "resize-observer-polyfill": "^1.5.1",