@@ -341,6 +341,7 @@ const DnDFlow = () => {
341341
342342 // Create node data with label and initialize all expected fields as empty strings
343343 let nodeData = {
344+ id : newNodeId ,
344345 label : `${ type } ${ newNodeId } ` ,
345346 nodeColor : '#DDE6ED' // Default node color
346347 } ;
@@ -1094,45 +1095,62 @@ const DnDFlow = () => {
10941095 } , [ selectedEdge , selectedNode , copiedNode , duplicateNode , setCopyFeedback ] ) ;
10951096
10961097 return (
1097- < div style = { { width : '100vw' , height : '100vh' , display : 'flex' , flexDirection : 'column' } } >
1098-
1098+ < div
1099+ style = { {
1100+ width : "100vw" ,
1101+ height : "100vh" ,
1102+ display : "flex" ,
1103+ flexDirection : "column" ,
1104+ } }
1105+ >
10991106 { /* Tab Navigation */ }
1100- < TopBar activeTab = { activeTab } setActiveTab = { setActiveTab } versionInfo = { versionInfo } />
1107+ < TopBar
1108+ activeTab = { activeTab }
1109+ setActiveTab = { setActiveTab }
1110+ versionInfo = { versionInfo }
1111+ />
11011112
11021113 { /* Graph Editor Tab */ }
1103- { activeTab === 'graph' && (
1104- < div style = { { display : 'flex' , flex : 1 , height : 'calc(100vh - 50px)' , overflow : 'hidden' } } >
1114+ { activeTab === "graph" && (
1115+ < div
1116+ style = { {
1117+ display : "flex" ,
1118+ flex : 1 ,
1119+ height : "calc(100vh - 50px)" ,
1120+ overflow : "hidden" ,
1121+ } }
1122+ >
11051123 { /* Sidebar */ }
11061124 < div
1107- data-sidebar-state = { sidebarVisible ? ' expanded' : ' collapsed' }
1125+ data-sidebar-state = { sidebarVisible ? " expanded" : " collapsed" }
11081126 className = "sidebar-container"
11091127 style = { {
1110- position : ' relative' ,
1111- width : sidebarVisible ? ' 250px' : ' 0px' ,
1112- height : ' 100%' ,
1113- transition : ' width 0.5s ease' ,
1114- overflow : ' hidden'
1128+ position : " relative" ,
1129+ width : sidebarVisible ? " 250px" : " 0px" ,
1130+ height : " 100%" ,
1131+ transition : " width 0.5s ease" ,
1132+ overflow : " hidden" ,
11151133 } }
11161134 >
11171135 < div
11181136 style = { {
1119- position : ' fixed' ,
1120- left : sidebarVisible ? ' 0px' : ' -250px' ,
1121- top : ' 50px' , // Account for top bar height
1122- width : ' 250px' ,
1123- height : ' calc(100vh - 50px)' ,
1124- transition : ' left 0.5s ease' ,
1137+ position : " fixed" ,
1138+ left : sidebarVisible ? " 0px" : " -250px" ,
1139+ top : " 50px" , // Account for top bar height
1140+ width : " 250px" ,
1141+ height : " calc(100vh - 50px)" ,
1142+ transition : " left 0.5s ease" ,
11251143 zIndex : 10 ,
1126- borderRight : ' 1px solid #ccc' ,
1127- backgroundColor : ' #1e1e2f'
1144+ borderRight : " 1px solid #ccc" ,
1145+ backgroundColor : " #1e1e2f" ,
11281146 } }
11291147 >
11301148 < Sidebar />
11311149 </ div >
11321150 </ div >
11331151
11341152 { /* Main content area that moves with sidebar */ }
1135- < div style = { { position : ' relative' , flex : 1 , height : ' 100%' } } >
1153+ < div style = { { position : " relative" , flex : 1 , height : " 100%" } } >
11361154 < GraphView
11371155 refEl = { ref }
11381156 reactFlowWrapperRef = { reactFlowWrapper }
@@ -1153,13 +1171,23 @@ const DnDFlow = () => {
11531171 duplicateNode = { duplicateNode }
11541172 copyFeedback = { copyFeedback }
11551173 ui = { {
1156- selectedNode, selectedEdge,
1157- deleteSelectedNode, deleteSelectedEdge,
1158- saveGraph, loadGraph, resetGraph, saveToPython, runPathsim,
1174+ selectedNode,
1175+ selectedEdge,
1176+ deleteSelectedNode,
1177+ deleteSelectedEdge,
1178+ saveGraph,
1179+ loadGraph,
1180+ resetGraph,
1181+ saveToPython,
1182+ runPathsim,
11591183 shareGraphURL,
1160- dockOpen, setDockOpen, onToggleLogs,
1161- showKeyboardShortcuts, setShowKeyboardShortcuts,
1162- sidebarVisible, setSidebarVisible,
1184+ dockOpen,
1185+ setDockOpen,
1186+ onToggleLogs,
1187+ showKeyboardShortcuts,
1188+ setShowKeyboardShortcuts,
1189+ sidebarVisible,
1190+ setSidebarVisible,
11631191 } }
11641192 />
11651193
@@ -1197,42 +1225,38 @@ const DnDFlow = () => {
11971225 ) }
11981226
11991227 { /* Events tab */ }
1200- { activeTab === 'events' && < EventsTab events = { events } setEvents = { setEvents } /> }
1228+ { activeTab === "events" && (
1229+ < EventsTab events = { events } setEvents = { setEvents } />
1230+ ) }
12011231
12021232 { /* Solver Parameters Tab */ }
1203- {
1204- activeTab === 'solver' && (
1205- < SolverPanel
1206- solverParams = { solverParams }
1207- setSolverParams = { setSolverParams }
1208- setActiveTab = { setActiveTab }
1209- />
1210- )
1211- }
1233+ { activeTab === "solver" && (
1234+ < SolverPanel
1235+ solverParams = { solverParams }
1236+ setSolverParams = { setSolverParams }
1237+ setActiveTab = { setActiveTab }
1238+ />
1239+ ) }
12121240
12131241 { /* Global Variables Tab */ }
1214- {
1215- activeTab === 'globals' && (
1216- < GlobalVariablesTab
1217- globalVariables = { globalVariables }
1218- setGlobalVariables = { setGlobalVariables }
1219- setActiveTab = { setActiveTab }
1220- pythonCode = { pythonCode }
1221- setPythonCode = { setPythonCode }
1222- />
1223- )
1224- }
1242+ { activeTab === "globals" && (
1243+ < GlobalVariablesTab
1244+ globalVariables = { globalVariables }
1245+ setGlobalVariables = { setGlobalVariables }
1246+ setActiveTab = { setActiveTab }
1247+ pythonCode = { pythonCode }
1248+ setPythonCode = { setPythonCode }
1249+ />
1250+ ) }
12251251
12261252 { /* Results Tab */ }
1227- {
1228- activeTab === 'results' && (
1229- < ResultsPanel
1230- simulationResults = { simulationResults }
1231- downloadHtml = { downloadHtml }
1232- downloadCsv = { downloadCsv }
1233- />
1234- )
1235- }
1253+ { activeTab === "results" && (
1254+ < ResultsPanel
1255+ simulationResults = { simulationResults }
1256+ downloadHtml = { downloadHtml }
1257+ downloadCsv = { downloadCsv }
1258+ />
1259+ ) }
12361260
12371261 { /* Share URL Modal */ }
12381262 < ShareModal
@@ -1241,8 +1265,7 @@ const DnDFlow = () => {
12411265 shareableURL = { shareableURL }
12421266 urlMetadata = { urlMetadata }
12431267 />
1244-
1245- </ div >
1268+ </ div >
12461269 ) ;
12471270}
12481271
0 commit comments