From 0f76cb4ff0e3bb8309b743840fe8d13abb35bf11 Mon Sep 17 00:00:00 2001 From: Eric Ciarla Date: Mon, 27 May 2024 18:17:40 -0400 Subject: [PATCH] Update client errors --- src/components/data-input.tsx | 328 +++++++++++++++++---------------- src/components/graph.tsx | 157 ++++++++-------- src/components/main.tsx | 43 ++--- src/components/menu.tsx | 338 +++++++++++++++++----------------- 4 files changed, 440 insertions(+), 426 deletions(-) diff --git a/src/components/data-input.tsx b/src/components/data-input.tsx index a060a5c..9c36560 100644 --- a/src/components/data-input.tsx +++ b/src/components/data-input.tsx @@ -47,172 +47,184 @@ export default function DataInput({ setIsClient(true); }, []); return ( -
-

- Choose data you want to visualize -

-
- - - - - - - Enter GitHub URL - - Please enter the GitHub repository URL to fetch stars data. - - - setRepoUrl(e.target.value)} - /> -
- - + + + + Enter GitHub URL + + Please enter the GitHub repository URL to fetch stars data. + + + setRepoUrl(e.target.value)} + /> +
+ + -
-
-
- - - - - - - Paste CSV Data - - Please paste your CSV data or upload a CSV file.
- Make sure you have only 2 columns (X, Y) -
-
- - { - const file = e.target.files![0]; - const reader = new FileReader(); - reader.onload = (e: any) => { - setPastedCsvData(e.target.result); - }; - reader.readAsText(file); - }} - // close the dialog after file is uploaded - /> -
- - -
-
-
-
+ /> +
+ + +
+ + +
+ + )} ); } diff --git a/src/components/graph.tsx b/src/components/graph.tsx index d202445..cb876db 100644 --- a/src/components/graph.tsx +++ b/src/components/graph.tsx @@ -56,87 +56,96 @@ export default function Graph({ }, [chartData, yName]); return ( -
-
-
+
+ {typeof window !== "undefined" && ( +
-
-
-
-
-
-
-
-
- {graphTitle} +
+
+
+
+
+
+
+
+
+
+ {graphTitle} +
+
+
+
+
+ {yName} +
+
+ { + if (value > 999) { + return (value / 1000).toFixed(1) + "k"; + } + return value.toString(); + }} + maxValue={maxValue} + connectNulls={true} + curveType="monotone" + /> +

+ {xName} +

+
-
-
-
-
- {yName} -
-
- { - if (value > 999) { - return (value / 1000).toFixed(1) + "k"; - } - return value.toString(); - }} - maxValue={maxValue} - connectNulls={true} - curveType="monotone" - /> -

- {xName} -

-
+ )}
); } diff --git a/src/components/main.tsx b/src/components/main.tsx index b0265e2..a137574 100644 --- a/src/components/main.tsx +++ b/src/components/main.tsx @@ -205,35 +205,22 @@ export default function MainComponent() { openCsv={openCsv} setOpenCsv={setOpenCsv} /> - + + Made by Firecrawl 🔥 + +
+ )}
); diff --git a/src/components/menu.tsx b/src/components/menu.tsx index 50e1b46..c80685d 100644 --- a/src/components/menu.tsx +++ b/src/components/menu.tsx @@ -115,187 +115,191 @@ export default function Menu({ }); }; return ( -
-
- {/*
+
+ {typeof window !== "undefined" && ( +
+
+ {/*
*/} -
-
- - Theme - - + setTheme( + allThemes[value as keyof typeof allThemes] as Theme + ) + } + > + + + + + {Object.entries(allThemes).map(([themeKey, themeValue]) => ( + - {themeValue.name.charAt(0).toUpperCase() + - themeValue.name.slice(1)} -
-
- - ))} - - -
-
- - Background - - setBackground(checked)} - /> -
-
- - Dark Mode - - setDarkMode(checked)} - /> -
-
-
-
- - Padding - - -
-
- - Width - - -
-
- - - - +
+
+ {themeValue.name.charAt(0).toUpperCase() + + themeValue.name.slice(1)} +
+
+ + ))} + + +
+
+ + Background + + setBackground(checked)} /> - - - generateEmbedCode()}> -
- - Embed -
-
- {/* +
+
+ + Dark Mode + + setDarkMode(checked)} + /> +
+
+
+
+ + Padding + + +
+
+ + Width + + +
+
+ + + + + + + generateEmbedCode()}> +
+ + Embed +
+
+ {/*
Copy PNG
*/} -
-
+ + +
+
-
-
- {/*
+ {/*
*/} +
+ )}
); }