joel-woodfield commited on
Commit
89ce55d
·
1 Parent(s): 15d2f30

Use the old react version temporarily

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .gitignore +1 -0
  2. README.md +3 -6
  3. dist/assets/index-BoCAEVud.css +1 -0
  4. dist/assets/index-CARha6nB.js +0 -0
  5. dist/index.html +14 -0
  6. {frontends/react/public → dist}/vite.svg +0 -0
  7. eslint.config.js +29 -0
  8. index.html +13 -0
  9. {backend → new/backend}/src/manager.py +0 -0
  10. {frontends → new/frontends}/react/.gitignore +0 -0
  11. {frontends → new/frontends}/react/README.md +0 -0
  12. {frontends → new/frontends}/react/eslint.config.js +0 -0
  13. {frontends → new/frontends}/react/index.html +0 -0
  14. {frontends → new/frontends}/react/package-lock.json +0 -0
  15. {frontends → new/frontends}/react/package.json +0 -0
  16. new/frontends/react/public/vite.svg +1 -0
  17. {frontends → new/frontends}/react/src/App.tsx +0 -0
  18. {frontends → new/frontends}/react/src/DataViewer.tsx +0 -0
  19. {frontends → new/frontends}/react/src/NetworkViewer.tsx +0 -0
  20. {frontends → new/frontends}/react/src/PyodideBackend.ts +0 -0
  21. {frontends → new/frontends}/react/src/Sidebar.tsx +0 -0
  22. {frontends → new/frontends}/react/src/assets/react.svg +0 -0
  23. {frontends → new/frontends}/react/src/index.css +0 -0
  24. {frontends → new/frontends}/react/src/main.tsx +0 -0
  25. {frontends → new/frontends}/react/src/pyodide.worker.ts +0 -0
  26. {frontends → new/frontends}/react/src/ui/Button.tsx +0 -0
  27. {frontends → new/frontends}/react/src/ui/Dropdown.tsx +0 -0
  28. {frontends → new/frontends}/react/src/ui/FileUploader.tsx +0 -0
  29. {frontends → new/frontends}/react/src/ui/FilesUploader.tsx +0 -0
  30. {frontends → new/frontends}/react/src/ui/InputField.tsx +0 -0
  31. {frontends → new/frontends}/react/src/ui/LoadingScreen.tsx +0 -0
  32. {frontends → new/frontends}/react/src/ui/Radio.tsx +0 -0
  33. {frontends → new/frontends}/react/src/ui/Tabs.tsx +0 -0
  34. {frontends → new/frontends}/react/src/useAppLogic.ts +0 -0
  35. {frontends → new/frontends}/react/src/usePyodideBackend.ts +0 -0
  36. {frontends → new/frontends}/react/tsconfig.app.json +0 -0
  37. {frontends → new/frontends}/react/tsconfig.json +0 -0
  38. {frontends → new/frontends}/react/tsconfig.node.json +0 -0
  39. {frontends → new/frontends}/react/vite.config.ts +0 -0
  40. package-lock.json +0 -0
  41. package.json +29 -0
  42. public/vite.svg +1 -0
  43. src/App.css +12 -0
  44. src/App.jsx +30 -0
  45. src/assets/cnn.png +0 -0
  46. src/assets/decision_boundary.svg +0 -0
  47. src/assets/gaussian_processes.png +0 -0
  48. src/assets/mario.png +0 -0
  49. src/assets/mlp.png +0 -0
  50. src/assets/optimization.png +0 -0
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ node_modules/
README.md CHANGED
@@ -3,10 +3,7 @@ title: Cnn Visualizer
3
  emoji: 🌍
4
  colorFrom: indigo
5
  colorTo: red
6
- sdk: gradio
7
- sdk_version: 5.46.0
8
- app_file: app.py
9
  pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
3
  emoji: 🌍
4
  colorFrom: indigo
5
  colorTo: red
6
+ sdk: static
7
+ app_file: dist/index.html
 
8
  pinned: false
9
+ ---
 
 
dist/assets/index-BoCAEVud.css ADDED
@@ -0,0 +1 @@
 
 
1
+ :root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}body{margin:0;min-width:320px;min-height:100vh}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:orange}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media(prefers-color-scheme:light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}h1{font-size:40px;font-weight:700;text-align:left}.main-container{flex:1;display:grid;grid-template-columns:2fr 1fr;gap:2rem}.convolution-viewer{display:flex;flex-direction:row;justify-content:center;gap:2rem;padding:2rem}.convolution-viewer-item{display:flex;flex-direction:column;align-items:center;width:300px;height:340px;border-radius:10px;background:#fafafa;padding:1rem;box-shadow:0 2px 6px #0000000d;transition:transform .2s ease,box-shadow .2s ease;border:1px solid black}.convolution-viewer-item h3{margin:.5rem 0 1rem;font-size:1.1rem;font-weight:600;color:#333;text-align:center;border-bottom:2px solid orange;padding-bottom:.3rem}.convolution-viewer-item img{flex-grow:1;width:100%;height:100%;max-height:none;object-fit:contain}` .app-button{padding:8px 16px;background-color:#f0f0f0;border:none;border-radius:8px;cursor:pointer;font-size:1rem}.app-button:focus{outline:none}.app-button:hover{outline:1px solid orange}.app-button.selected{background-color:orange;color:#fff}.preset-selector{display:flex;align-items:center;gap:12px;background:#f7f7f7;padding:12px 16px;border-radius:8px;border:1px solid #ddd;margin-bottom:12px;width:fit-content}.preset-label{font-weight:600;font-size:14px}.preset-dropdown{padding:6px 10px;font-size:14px;border-radius:6px;border:1px solid #ccc;background:#fff}.preset-dropdown:focus{outline:none}.preset-dropdown:focus-visible{outline:2px solid #4e9fff}.preset-apply{padding:6px 14px;font-size:14px;background:#4e9fff;color:#fff;border:none;border-radius:6px;cursor:pointer;transition:background .2s}.preset-apply:hover{background:#1e7be6}.kernel-editor{display:flex;flex-direction:column;gap:30px;padding:12px;max-width:fit-content;align-items:center}.kernel-matrix{display:flex;flex-direction:column;gap:8px}.kernel-row{display:flex;gap:8px}.kernel-size-options{border:1px solid #d0d0d0;border-radius:6px;padding:8px 12px;background:#f9f9f9;box-shadow:0 1px 2px #0000000a}.kernel-size-options form{display:flex;justify-content:space-between;align-items:center}.kernel-size-options input[type=number]{width:auto;max-width:4ch;margin:0 8px}.kernel-cell{width:4.5em;height:2.4em;text-align:center;font-size:15px;border:1px solid #d0d0d0;border-radius:6px;background:#fff;transition:border-color .2s,box-shadow .2s,transform .1s;box-shadow:0 1px 2px #0000000a}.kernel-cell:hover{border-color:#888}.kernel-cell:focus{outline:none;border-color:orange;box-shadow:0 0 0 3px #0078ff33;transform:scale(1.02)}.channel-buttons{display:flex;gap:12px}.channel-buttons .selected{background-color:orange;color:#fff}.channel-buttons button:focus{outline:none}.channel-buttons button:focus-visible{outline:2px solid orange}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=number]{-moz-appearance:textfield}.tabs{display:flex;flex-direction:column;height:100%}.tab-buttons{display:flex;border-bottom:1px solid #ccc;margin-bottom:20px}.tab-buttons button{padding:10px 20px;border:none;background:none;cursor:pointer;border-radius:0;will-change:border-bottom}.tab-buttons button.active{border-bottom:3px solid orange}.tab-content{flex:1;padding:20px;border:none}.tab-buttons button:focus{outline:none}.tab-buttons button:focus-visible{outline:2px solid orange}.switch-container{display:flex;align-items:center;justify-content:center;gap:12px;font-size:16px;-webkit-user-select:none;user-select:none}.switch{position:relative;width:70px;height:36px}.slider{position:absolute;cursor:pointer;inset:0;background:#777;border-radius:36px;transition:background .25s}.slider:before{position:absolute;content:"";height:28px;width:28px;left:4px;top:4px;background:#fff;border-radius:50%;transition:transform .25s}.switch input:checked+.slider{background:orange}.input-selector{display:flex;flex-direction:column;gap:30px}.switch{position:relative;display:inline-block;width:50px;height:24px}.switch input{opacity:0;width:0;height:0}.slider{position:absolute;cursor:pointer;inset:0;background-color:#ccc;transition:.4s;border-radius:24px}.slider:before{position:absolute;content:"";height:18px;width:18px;left:3px;bottom:3px;background-color:#fff;transition:.4s;border-radius:50%}input:checked+.slider{background-color:#4caf50}input:checked+.slider:before{transform:translate(26px)}.layer-viewer{padding:12px;border:1px solid #ccc;margin-bottom:20px;border-radius:6px;background:#fafafa}.layer-title{margin:0 0 6px;font-size:20px;font-weight:600}.layer-details{display:flex;justify-content:space-evenly;margin-bottom:12px;color:#444;font-size:14px}.layer-grid{display:flex;flex-wrap:wrap;gap:6px}.layer-grid img{width:100px;height:100px;image-rendering:pixelated}.card{background-color:#fff;border:1px solid #dcdfe6;border-radius:12px;padding:18px;display:flex;flex-direction:column;gap:24px;width:300px}.field{display:flex;flex-direction:column;gap:6px}.field label,.field legend{font-weight:600;color:#2c2f37;align-self:flex-start}.field input[type=text],.field input[type=number],.field textarea{border:1px solid #ccd0dd;border-radius:6px;padding:8px 10px;font-size:.95rem;font-family:inherit;background-color:#fafafe}.field textarea{resize:vertical}.field input[readonly],.field textarea[readonly]{background-color:#f4f6fc;color:#4a4f5c}.double-field{display:flex;gap:6px;width:100%;justify-content:space-between}.double-field .field{width:140px}.input-button{display:grid;grid-template-columns:1fr 1fr;gap:8px}.fieldset{border:1px solid #ccd0dd;border-radius:6px;padding:10px 12px 12px;display:flex;flex-direction:column;gap:6px}.fieldset label{font-weight:500;color:#343844}.slider-field{gap:10px}.slider-control{display:flex;align-items:center;gap:12px}.slider-control input[type=range]{width:80px;-webkit-appearance:none;background-color:#d3d3d3;border-radius:6px;accent-color:var(--accent-color);flex:1}.slider-control input[type=range]::-webkit-slider-runnable-track{height:6px;background:#d3d3d3;border-radius:6px}.slider-control input[type=range]::-webkit-slider-thumb{-webkit-appearance:none;width:14px;height:14px;border-radius:50%;background:var(--accent-color);cursor:pointer;margin-top:-4px}.slider-control span{min-width:28px;text-align:right;font-weight:600}.network-visualizer{display:grid;grid-template-columns:2fr 1fr;gap:20px}
dist/assets/index-CARha6nB.js ADDED
The diff for this file is too large to render. See raw diff
 
dist/index.html ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>moz-todo-react</title>
8
+ <script type="module" crossorigin src="/assets/index-CARha6nB.js"></script>
9
+ <link rel="stylesheet" crossorigin href="/assets/index-BoCAEVud.css">
10
+ </head>
11
+ <body>
12
+ <div id="root"></div>
13
+ </body>
14
+ </html>
{frontends/react/public → dist}/vite.svg RENAMED
File without changes
eslint.config.js ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import js from '@eslint/js'
2
+ import globals from 'globals'
3
+ import reactHooks from 'eslint-plugin-react-hooks'
4
+ import reactRefresh from 'eslint-plugin-react-refresh'
5
+ import { defineConfig, globalIgnores } from 'eslint/config'
6
+
7
+ export default defineConfig([
8
+ globalIgnores(['dist']),
9
+ {
10
+ files: ['**/*.{js,jsx}'],
11
+ extends: [
12
+ js.configs.recommended,
13
+ reactHooks.configs.flat.recommended,
14
+ reactRefresh.configs.vite,
15
+ ],
16
+ languageOptions: {
17
+ ecmaVersion: 2020,
18
+ globals: globals.browser,
19
+ parserOptions: {
20
+ ecmaVersion: 'latest',
21
+ ecmaFeatures: { jsx: true },
22
+ sourceType: 'module',
23
+ },
24
+ },
25
+ rules: {
26
+ 'no-unused-vars': ['error', { varsIgnorePattern: '^[A-Z_]' }],
27
+ },
28
+ },
29
+ ])
index.html ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
+ <title>moz-todo-react</title>
8
+ </head>
9
+ <body>
10
+ <div id="root"></div>
11
+ <script type="module" src="/src/main.jsx"></script>
12
+ </body>
13
+ </html>
{backend → new/backend}/src/manager.py RENAMED
File without changes
{frontends → new/frontends}/react/.gitignore RENAMED
File without changes
{frontends → new/frontends}/react/README.md RENAMED
File without changes
{frontends → new/frontends}/react/eslint.config.js RENAMED
File without changes
{frontends → new/frontends}/react/index.html RENAMED
File without changes
{frontends → new/frontends}/react/package-lock.json RENAMED
File without changes
{frontends → new/frontends}/react/package.json RENAMED
File without changes
new/frontends/react/public/vite.svg ADDED
{frontends → new/frontends}/react/src/App.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/DataViewer.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/NetworkViewer.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/PyodideBackend.ts RENAMED
File without changes
{frontends → new/frontends}/react/src/Sidebar.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/assets/react.svg RENAMED
File without changes
{frontends → new/frontends}/react/src/index.css RENAMED
File without changes
{frontends → new/frontends}/react/src/main.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/pyodide.worker.ts RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/Button.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/Dropdown.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/FileUploader.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/FilesUploader.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/InputField.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/LoadingScreen.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/Radio.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/ui/Tabs.tsx RENAMED
File without changes
{frontends → new/frontends}/react/src/useAppLogic.ts RENAMED
File without changes
{frontends → new/frontends}/react/src/usePyodideBackend.ts RENAMED
File without changes
{frontends → new/frontends}/react/tsconfig.app.json RENAMED
File without changes
{frontends → new/frontends}/react/tsconfig.json RENAMED
File without changes
{frontends → new/frontends}/react/tsconfig.node.json RENAMED
File without changes
{frontends → new/frontends}/react/vite.config.ts RENAMED
File without changes
package-lock.json ADDED
The diff for this file is too large to render. See raw diff
 
package.json ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "moz-todo-react",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "scripts": {
7
+ "dev": "vite",
8
+ "build": "vite build",
9
+ "lint": "eslint .",
10
+ "preview": "vite preview"
11
+ },
12
+ "dependencies": {
13
+ "@tensorflow/tfjs": "^4.22.0",
14
+ "react": "^19.2.0",
15
+ "react-dom": "^19.2.0",
16
+ "react-plotly.js": "^2.6.0"
17
+ },
18
+ "devDependencies": {
19
+ "@eslint/js": "^9.39.1",
20
+ "@types/react": "^19.2.7",
21
+ "@types/react-dom": "^19.2.3",
22
+ "@vitejs/plugin-react": "^5.1.1",
23
+ "eslint": "^9.39.1",
24
+ "eslint-plugin-react-hooks": "^7.0.1",
25
+ "eslint-plugin-react-refresh": "^0.4.24",
26
+ "globals": "^16.5.0",
27
+ "vite": "^7.3.1"
28
+ }
29
+ }
public/vite.svg ADDED
src/App.css ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ h1 {
2
+ font-size: 40px;
3
+ font-weight: bold;
4
+ text-align: left;
5
+ }
6
+
7
+ .main-container {
8
+ flex: 1;
9
+ display: grid;
10
+ grid-template-columns: 2fr 1fr;
11
+ gap: 2rem;
12
+ }
src/App.jsx ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import './App.css'
2
+ import ConvolutionVisualizer from "./components/convolution/ConvolutionVisualizer.jsx"
3
+ import NetworkVisualizer from "./components/network/NetworkVisualizer.jsx"
4
+ import Tabs from "./components/Tabs/Tabs.jsx"
5
+
6
+
7
+ function App() {
8
+ const tabData = [
9
+ {
10
+ label: "Convolution",
11
+ content: <ConvolutionVisualizer />,
12
+ },
13
+ {
14
+ label: "Network",
15
+ content: <NetworkVisualizer />,
16
+ },
17
+ ];
18
+
19
+ return (
20
+ <>
21
+ <h1>CNN Visualizer</h1>
22
+ <Tabs
23
+ defaultTab="Convolution"
24
+ tabs={tabData}
25
+ />
26
+ </>
27
+ )
28
+ }
29
+
30
+ export default App;
src/assets/cnn.png ADDED
src/assets/decision_boundary.svg ADDED
src/assets/gaussian_processes.png ADDED
src/assets/mario.png ADDED
src/assets/mlp.png ADDED
src/assets/optimization.png ADDED