bde0876rearrange tabsJeremy Magland 1import { BrowserRouter, Routes, Route, Link, Navigate } from "react-router-dom";
3import axios from "axios";
12function App() {
0968553routingJeremy Magland 13 const [benchmarkData, setBenchmarkData] = useState<BenchmarkData | null>(
14 null,
15 );
16 const [isLoading, setIsLoading] = useState(true);
17 const [error, setError] = useState<string | null>(null);
19 useEffect(() => {
20 const fetchData = async () => {
21 try {
22 setIsLoading(true);
23 setError(null);
24 const response = await axios.get(
17f0f3aget results from memobinJeremy Magland 25 "https://tempory.net/f/memobin/benchcompress/global/results.json",
27 setBenchmarkData(response.data);
28 } catch (error) {
29 const message =
30 error instanceof Error ? error.message : "Failed to fetch data";
31 setError(message);
32 console.error("Error fetching benchmark data:", error);
33 } finally {
34 setIsLoading(false);
35 }
36 };
38 fetchData();
39 }, []);
45 style={{
47 padding: "3rem 2rem 2rem 2rem",
49 >
50 <nav
51 style={{
52 position: "fixed",
53 top: 0,
54 left: 0,
55 right: 0,
62 >
64 style={{
65 display: "flex",
66 justifyContent: "space-between",
67 alignItems: "center",
68 minHeight: "32px",
69 }}
70 >
71 <Link
72 to="/datasets"
73 style={{
74 display: "flex",
75 alignItems: "center",
76 textDecoration: "none",
77 minWidth: 0,
78 maxWidth: "calc(100% - 80px)",
79 }}
80 >
81 <img
82 src="/benchcompress/logo.svg"
83 alt="Benchcompress Logo"
84 style={{
85 width: "28px",
86 height: "28px",
87 marginRight: "10px",
88 flexShrink: 0,
89 }}
90 />
91 <span
92 style={{
93 minWidth: 0,
94 whiteSpace: "nowrap",
95 overflow: "hidden",
96 textOverflow: "ellipsis",
97 }}
98 >
99 <span
100 style={{
101 fontSize: "1rem",
102 fontWeight: "500",
103 color: "#2c2c2c",
104 }}
105 >
106 Benchcompress
107 </span>
108 <span className="app-header-subtitle">
109 {" · "}
110 <span style={{ fontSize: "1rem", color: "#777" }}>
93dd44areorganize datasets and algs, add seismicJeremy Magland 111 Comparing compression algorithms for scientific data arrays
113 </span>
114 </span>
115 </Link>
117 <Link
118 to="/paper"
119 style={{
120 color: "#0066cc",
121 textDecoration: "none",
122 fontWeight: "500",
123 }}
124 >
125 Paper
126 </Link>
128 to="/monitor"
129 style={{
130 color: "#0066cc",
131 textDecoration: "none",
132 fontWeight: "500",
133 }}
134 >
135 Monitor
136 </Link>
138 to="/about"
139 style={{
140 color: "#0066cc",
141 textDecoration: "none",
142 fontWeight: "500",
143 }}
144 >
145 About
146 </Link>
147 </div>
150 <main>
152 <div>Loading benchmark data...</div>
153 ) : error ? (
154 <div>Error: {error}</div>
155 ) : (
156 <Routes>
bde0876rearrange tabsJeremy Magland 157 <Route path="/" element={<Navigate to="/datasets" replace />} />
159 path="/datasets"
162 <Route
163 path="/algorithms"
167 path="/dataset/:datasetName"
171 path="/algorithm/:algorithmName"
178 )}
180 </div>
181 </BrowserRouter>
183}
185export default App;