- Most Frequent Key-Phrases
-
+ Most Frequent Key-Phrases
+
+
Math.log2(word.value) * 5 }
+ fontSize={(word) => Math.log2(word.value) * 5}
//fontSize={33}
spiral="rectangular"
rotate={0}
- fill = "gray"
+ fill="gray"
padding={2}
onWordClick={(event, d) => {
console.log(`onWordClick: ${d.text}`);
+ handleClick(d.text);
}}
/>
-
+
+
);
};
diff --git a/src/Components/Layout/WordCloud_/WordCloud_.module.css b/src/Components/Layout/WordCloud_/WordCloud_.module.css
new file mode 100644
index 0000000..6e64127
--- /dev/null
+++ b/src/Components/Layout/WordCloud_/WordCloud_.module.css
@@ -0,0 +1,5 @@
+.pointer {
+ cursor: pointer;
+ text-decoration: none !important;
+ color: inherit;
+}
\ No newline at end of file
diff --git a/src/Components/PDFGenerator/PDFDownloadButton.js b/src/Components/PDFGenerator/PDFDownloadButton.js
new file mode 100644
index 0000000..e69de29
diff --git a/src/Components/PDFGenerator/PDFGenerator.js b/src/Components/PDFGenerator/PDFGenerator.js
index c0bb80f..0942091 100644
--- a/src/Components/PDFGenerator/PDFGenerator.js
+++ b/src/Components/PDFGenerator/PDFGenerator.js
@@ -1,14 +1,19 @@
-import React, { Fragment } from "react";
+import React, { Fragment, useState } from "react";
+import Button from "react-bootstrap/esm/Button";
import {
Document,
Page,
Text,
View,
StyleSheet,
- Font
+ Font,
+ pdf,createWorker
} from "@react-pdf/renderer";
+import { saveAs } from "file-saver";
+import { css } from "@emotion/react";
+import ClipLoader from "react-spinners/ClipLoader";
+//import { createWorker } from "@react-pdf-viewer/core"; // Import the createWorker function
-// Register font
Font.register({ family: "Times-Roman" });
const styles = StyleSheet.create({
@@ -17,53 +22,91 @@ const styles = StyleSheet.create({
backgroundColor: "#E4E4E4",
padding: 10,
},
-
text: {
fontFamily: "Times-Roman",
fontSize: 12,
},
title: {
fontSize: 14,
- }
+ },
});
const PDFGenerator = (props) => {
+ const [isLoading, setIsLoading] = useState(false);
+
+ const handleDownload = async () => {
+ setIsLoading(true);
+
+ try {
+ const worker = createWorker(); // Create a new web worker
+
+ await worker.load(); // Load the worker
+ await worker.setFont("path/to/font/Times-Roman.ttf"); // Set the font path
+
+ worker.onRenderError(() => {
+ console.error("Error generating PDF");
+ setIsLoading(false);
+ });
+
+ worker.onRenderProgress((percent) => {
+ console.log(`PDF rendering progress: ${percent}%`);
+ });
+
+ const pdfContent = (
+