diff --git a/src/App.jsx b/src/App.jsx index 1ae99eea..17df2eb2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,30 +1,27 @@ // * Imports * import { useState, useCallback, useEffect, useRef, version } from 'react'; import { - ReactFlow, ReactFlowProvider, useReactFlow, - MiniMap, - Controls, - Background, useNodesState, useEdgesState, } from '@xyflow/react'; import '@xyflow/react/dist/style.css'; import './styles/App.css'; -import Plot from 'react-plotly.js'; import { getApiEndpoint } from './config.js'; import Sidebar from './components/Sidebar'; import NodeSidebar from './components/NodeSidebar'; import { DnDProvider, useDnD } from './components/DnDContext.jsx'; -import ContextMenu from './components/ContextMenu.jsx'; import EventsTab from './components/EventsTab.jsx'; import GlobalVariablesTab from './components/GlobalVariablesTab.jsx'; import { makeEdge } from './components/CustomEdge'; import { nodeTypes, nodeDynamicHandles } from './nodeConfig.js'; import LogDock from './components/LogDock.jsx'; - -import { createFunctionNode } from './components/nodes/FunctionNode.jsx'; +import TopBar from './components/TopBar.jsx'; +import GraphView from './components/GraphView.jsx'; +import EdgeDetails from './components/EdgeDetails.jsx'; +import SolverPanel from './components/SolverPanel.jsx'; +import ResultsPanel from './components/ResultsPanel.jsx'; // * Declaring variables * @@ -69,6 +66,7 @@ const DnDFlow = () => { // for the log dock const [dockOpen, setDockOpen] = useState(false); + const onToggleLogs = useCallback(() => setDockOpen(o => !o), []); const [logLines, setLogLines] = useState([]); const sseRef = useRef(null); const append = (line) => setLogLines((prev) => [...prev, line]); @@ -952,420 +950,52 @@ const DnDFlow = () => { return (
- {/* Tab Navigation */} -
-
-

- PathView -

- - - - - -
- -
- {/* GitHub Link */} - { - e.target.style.backgroundColor = '#1b1f23'; - e.target.style.transform = 'translateY(-1px)'; - e.target.style.boxShadow = '0 4px 12px rgba(36, 41, 46, 0.4)'; - }} - onMouseLeave={(e) => { - e.target.style.backgroundColor = '#000000ff'; - e.target.style.transform = 'translateY(0)'; - e.target.style.boxShadow = '0 2px 6px rgba(36, 41, 46, 0.3)'; - }} - title="View on GitHub" - > - - - - - - {/* Help Button */} - -
-
+ {/* Tab Navigation */} + {/* Graph Editor Tab */} {activeTab === 'graph' && ( -
- {/* Sidebar */} -
+
+
- {/* Main Graph Area */} -
-
- - - - - - {menu && } - {copyFeedback && ( -
- {copyFeedback} -
- )} - - - - - - - - - - {showKeyboardShortcuts && ( -
-
- Keyboard Shortcuts: - -
- Ctrl+C: Copy selected node
- Ctrl+V: Paste copied node
- Ctrl+D: Duplicate selected node
- Del/Backspace: Delete selection
- Right-click: Context menu -
- )} -
-
-
+ + {/* Log Dock */} + setDockOpen(false)} + lines={logLines} + progress={null} + /> + {/* Node Sidebar */} { isDocumentationExpanded={isDocumentationExpanded} setIsDocumentationExpanded={setIsDocumentationExpanded} /> - {selectedEdge && ( -
-
-

Selected Edge

-
- ID: {selectedEdge.id} -
-
- Source: {selectedEdge.source} -
-
- Target: {selectedEdge.target} -
-
- Type: {selectedEdge.type} -
- -
- - -
-
- )} + {/* Edge Details */} + setSelectedEdge(null)} + onDelete={deleteSelectedEdge} + />
)} @@ -1453,369 +1023,11 @@ const DnDFlow = () => { {/* Solver Parameters Tab */} {activeTab === 'solver' && ( -
-
-

- Solver Parameters -

-
-
-
- - setSolverParams({ ...solverParams, dt: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- - setSolverParams({ ...solverParams, dt_min: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- - setSolverParams({ ...solverParams, dt_max: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- - -
- -
- - setSolverParams({ ...solverParams, tolerance_fpi: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- - setSolverParams({ ...solverParams, iterations_max: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- - setSolverParams({ ...solverParams, simulation_duration: e.target.value })} - style={{ - width: '95%', - padding: '10px', - borderRadius: '5px', - border: '1px solid #555', - backgroundColor: '#1e1e2f', - color: '#ffffff', - fontSize: '14px' - }} - /> -
- -
- -
- -
- -