From ee4be1e9f483d934647ae98fd4be05523b000655 Mon Sep 17 00:00:00 2001 From: RemDelaporteMathurin Date: Tue, 12 Aug 2025 11:18:12 -0400 Subject: [PATCH] add version info to json file --- example_graphs/baby.json | 56 ++- example_graphs/events.json | 20 +- example_graphs/events_advanced.json | 32 +- example_graphs/festim_two_walls.json | 32 +- example_graphs/harmonic_oscillator.json | 26 +- example_graphs/isotopic_exchange.json | 602 ------------------------ example_graphs/linear_feedback.json | 23 +- example_graphs/pid.json | 29 +- example_graphs/spectrum.json | 31 +- src/App.jsx | 3 +- src/backend.py | 4 +- 11 files changed, 180 insertions(+), 678 deletions(-) delete mode 100644 example_graphs/isotopic_exchange.json diff --git a/example_graphs/baby.json b/example_graphs/baby.json index 4287de6d..f9377337 100644 --- a/example_graphs/baby.json +++ b/example_graphs/baby.json @@ -1,9 +1,14 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "data": { "gain": "-1", - "label": "x (-1)" + "label": "x (-1)", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "4", @@ -23,7 +28,8 @@ "label": "Neutron rate", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "6", @@ -41,7 +47,8 @@ { "data": { "gain": "3e-3", - "label": "TBR" + "label": "TBR", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "7", @@ -61,7 +68,8 @@ "initial_value": "", "label": "BABY", "residence_time": "(k_IV + k_OV)/baby_vol", - "source_term": "" + "source_term": "", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "8", @@ -81,7 +89,8 @@ "label": "IV vial activity", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "21", @@ -100,7 +109,8 @@ "data": { "f1": "0.01", "f2": "0.99", - "label": "soluble vs insoluble" + "label": "soluble vs insoluble", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "1", @@ -126,7 +136,8 @@ "label": "IV bubbler", "conversion_efficiency": "0.95", "vial_efficiency": "0.9", - "replacement_times": "np.arange(5, 50, step=3)" + "replacement_times": "np.arange(5, 50, step=3)", + "nodeColor": "#DDE6ED" }, "measured": { "width": 230, @@ -145,7 +156,8 @@ "data": { "label": "IV vs OV", "f1": "k_IV/(k_IV + k_OV)", - "f2": "k_OV/(k_IV + k_OV)" + "f2": "k_OV/(k_IV + k_OV)", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -164,7 +176,8 @@ "data": { "label": "soluble vs insoluble", "f1": "0.01", - "f2": "0.99" + "f2": "0.99", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -184,7 +197,8 @@ "label": "OV bubbler", "conversion_efficiency": "0.95", "vial_efficiency": "0.9", - "replacement_times": "np.arange(5, 50, step=5)" + "replacement_times": "np.arange(5, 50, step=5)", + "nodeColor": "#DDE6ED" }, "measured": { "width": 230, @@ -203,7 +217,8 @@ "data": { "label": "environment", "initial_value": "", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -223,7 +238,8 @@ "label": "OV vial activity", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -243,7 +259,8 @@ "label": "BABY inventory", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -262,7 +279,8 @@ "data": { "label": "Stepsource", "amplitude": "1", - "tau": "4" + "tau": "4", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -281,7 +299,8 @@ "data": { "label": "Stepsource", "amplitude": "1", - "tau": "2" + "tau": "2", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -301,7 +320,8 @@ "label": "Neutron source", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -800,5 +820,7 @@ "value": "1", "nameError": false } - ] + ], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/events.json b/example_graphs/events.json index 47c11737..56f111c8 100644 --- a/example_graphs/events.json +++ b/example_graphs/events.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "0", @@ -9,11 +13,12 @@ }, "data": { "label": "source", - "value": "" + "value": "", + "nodeColor": "#DDE6ED" }, "measured": { - "width": 205, - "height": 53 + "width": 206, + "height": 54 }, "selected": true }, @@ -27,7 +32,8 @@ "data": { "label": "integrator", "initial_value": "", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -47,7 +53,8 @@ "label": "scope 2", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -136,5 +143,6 @@ "tolerance": "1e-8", "id": 1754342253698 } - ] + ], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/events_advanced.json b/example_graphs/events_advanced.json index e642150a..1b9ddd35 100644 --- a/example_graphs/events_advanced.json +++ b/example_graphs/events_advanced.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "2", @@ -11,7 +15,8 @@ "label": "process 2", "initial_value": "", "residence_time": "30", - "source_term": "" + "source_term": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -29,7 +34,8 @@ }, "data": { "label": "amplifier 5", - "gain": "-1" + "gain": "-1", + "nodeColor": "#DDE6ED" }, "measured": { "width": 90, @@ -49,7 +55,8 @@ "label": "scope 6", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -69,7 +76,8 @@ "label": "scope 7", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -87,7 +95,8 @@ }, "data": { "label": "adder 8", - "operations": "" + "operations": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 64, @@ -106,7 +115,8 @@ "data": { "label": "storage", "initial_value": "startup_inv", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -129,11 +139,12 @@ "duty": "", "t_fall": "", "t_rise": "", - "tau": "" + "tau": "", + "nodeColor": "#DDE6ED" }, "measured": { - "width": 205, - "height": 53 + "width": 206, + "height": 54 }, "selected": true, "dragging": false @@ -147,7 +158,8 @@ }, "data": { "label": "amplifier 12", - "gain": "1.1" + "gain": "1.1", + "nodeColor": "#DDE6ED" }, "measured": { "width": 90, diff --git a/example_graphs/festim_two_walls.json b/example_graphs/festim_two_walls.json index 4b0c7f27..835cef34 100644 --- a/example_graphs/festim_two_walls.json +++ b/example_graphs/festim_two_walls.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "4", @@ -14,7 +18,8 @@ "n_vertices": "10", "surface_area": "", "temperature": "300", - "thickness": "2" + "thickness": "2", + "nodeColor": "#DDE6ED" }, "measured": { "width": 70, @@ -33,7 +38,8 @@ "data": { "label": "presure", "initial_value": "0", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -56,7 +62,8 @@ "n_vertices": "100", "surface_area": "", "temperature": "300", - "thickness": "2" + "thickness": "2", + "nodeColor": "#DDE6ED" }, "measured": { "width": 70, @@ -74,7 +81,8 @@ }, "data": { "label": "constant 21", - "value": "0" + "value": "0", + "nodeColor": "#DDE6ED" }, "measured": { "width": 206, @@ -94,7 +102,8 @@ "label": "Pressure scope", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -113,7 +122,8 @@ "data": { "label": "stepsource 23", "amplitude": "1", - "tau": "0.5" + "tau": "0.5", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -133,7 +143,8 @@ "label": "scope 24", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -153,7 +164,8 @@ "label": "Wall 1 scope", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -391,5 +403,7 @@ "simulation_duration": "3", "extra_params": "{}" }, - "globalVariables": [] + "globalVariables": [], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/harmonic_oscillator.json b/example_graphs/harmonic_oscillator.json index d8210ecd..69054135 100644 --- a/example_graphs/harmonic_oscillator.json +++ b/example_graphs/harmonic_oscillator.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "1", @@ -10,7 +14,8 @@ "data": { "label": "integrator x(t)", "initial_value": "x0", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -30,7 +35,8 @@ "label": "scope 2", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -48,7 +54,8 @@ }, "data": { "label": "adder 3", - "operations": "" + "operations": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 64, @@ -67,7 +74,8 @@ "data": { "label": "integrator v(t)", "initial_value": "v0", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -85,7 +93,8 @@ }, "data": { "label": "Amp 1", - "gain": "-c/m" + "gain": "-c/m", + "nodeColor": "#DDE6ED" }, "measured": { "width": 90, @@ -103,7 +112,8 @@ }, "data": { "label": "Amp 2", - "gain": "-k/m" + "gain": "-k/m", + "nodeColor": "#DDE6ED" }, "measured": { "width": 90, @@ -310,5 +320,7 @@ "value": "1.5", "nameError": false } - ] + ], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/isotopic_exchange.json b/example_graphs/isotopic_exchange.json deleted file mode 100644 index e42a4581..00000000 --- a/example_graphs/isotopic_exchange.json +++ /dev/null @@ -1,602 +0,0 @@ -{ - "nodes": [ - { - "data": { - "initial_value": "", - "label": "piping", - "reset_times": "" - }, - "dragging": false, - "id": "1", - "measured": { - "height": 48, - "width": 200 - }, - "position": { - "x": 635, - "y": 349 - }, - "selected": false, - "type": "integrator" - }, - { - "data": { - "label": "adder 6" - }, - "dragging": false, - "id": "6", - "measured": { - "height": 64, - "width": 64 - }, - "position": { - "x": 1589.1016907897247, - "y": 503.9483894383452 - }, - "selected": false, - "type": "adder" - }, - { - "data": { - "label": "multiplier 7" - }, - "dragging": false, - "id": "7", - "measured": { - "height": 64, - "width": 64 - }, - "position": { - "x": 1234.6909058659276, - "y": 474.8992703080042 - }, - "selected": false, - "type": "multiplier" - }, - { - "data": { - "label": "adder 16" - }, - "dragging": false, - "id": "16", - "measured": { - "height": 64, - "width": 64 - }, - "position": { - "x": 525, - "y": 359 - }, - "selected": false, - "type": "adder" - }, - { - "data": { - "gain": "kr", - "label": "kr c_h2 c_T" - }, - "dragging": false, - "id": "21", - "measured": { - "height": 80, - "width": 90 - }, - "position": { - "x": 1365, - "y": 455 - }, - "selected": false, - "type": "amplifier" - }, - { - "id": "22", - "type": "function", - "position": { - "x": 267.19109456561245, - "y": 288.1459390106112 - }, - "data": { - "label": "f(x) = source_T-x", - "func": "lambda x: source_T-x" - }, - "measured": { - "width": 200, - "height": 80 - }, - "selected": false, - "dragging": false - }, - { - "id": "23", - "type": "stepsource", - "position": { - "x": 127.73632538464565, - "y": 164.47850218975373 - }, - "data": { - "label": "Stepsource", - "amplitude": "source_T", - "tau": "3" - }, - "measured": { - "width": 120, - "height": 120 - }, - "selected": false, - "dragging": false - }, - { - "id": "24", - "type": "stepsource", - "position": { - "x": 1107.8801044607478, - "y": 69.76806974840379 - }, - "data": { - "label": "c_H2", - "amplitude": "1", - "tau": "10" - }, - "measured": { - "width": 120, - "height": 120 - }, - "selected": false, - "dragging": false - }, - { - "id": "25", - "type": "scope", - "position": { - "x": 625.0372947280937, - "y": 10.552011678686554 - }, - "data": { - "label": "isotopes sources", - "labels": "", - "sampling_rate": "", - "t_wait": "" - }, - "measured": { - "width": 120, - "height": 140 - }, - "selected": false, - "dragging": false - }, - { - "id": "26", - "type": "scope", - "position": { - "x": 911.8540609893888, - "y": 9.90776788298875 - }, - "data": { - "label": "Piping inventory", - "labels": "", - "sampling_rate": "", - "t_wait": "" - }, - "measured": { - "width": 120, - "height": 140 - }, - "selected": false, - "dragging": false - }, - { - "id": "27", - "type": "function", - "position": { - "x": 913.1696720193979, - "y": 367.0961625304652 - }, - "data": { - "label": "f(I) = I/S = c", - "func": "lambda I: I/S" - }, - "measured": { - "width": 200, - "height": 80 - }, - "selected": false, - "dragging": false - }, - { - "id": "28", - "type": "function", - "position": { - "x": 1290.0328243310123, - "y": 192.22961978902407 - }, - "data": { - "label": "f(c_T) = kr c_T^2", - "func": "lambda x: kr* x**2" - }, - "measured": { - "width": 200, - "height": 80 - }, - "selected": false, - "dragging": false - }, - { - "id": "29", - "type": "scope", - "position": { - "x": 1685.446908354059, - "y": 221.73470543376408 - }, - "data": { - "label": "Fluxes out", - "labels": "", - "sampling_rate": "", - "t_wait": "" - }, - "measured": { - "width": 120, - "height": 140 - }, - "selected": false, - "dragging": false - }, - { - "id": "31", - "type": "amplifier_reverse", - "position": { - "x": 625.4713468779164, - "y": 539.6484141642767 - }, - "data": { - "label": "x (-1)", - "gain": "-1" - }, - "measured": { - "width": 90, - "height": 80 - }, - "selected": false, - "dragging": false - } - ], - "edges": [ - { - "data": {}, - "id": "e16-1", - "markerEnd": { - "color": "#ECDFCC", - "height": 20, - "type": "arrowclosed", - "width": 20 - }, - "source": "16", - "sourceHandle": null, - "style": { - "stroke": "#ECDFCC", - "strokeWidth": 2 - }, - "target": "1", - "targetHandle": null, - "type": "smoothstep" - }, - { - "data": {}, - "id": "e21-6", - "markerEnd": { - "color": "#ECDFCC", - "height": 20, - "type": "arrowclosed", - "width": 20 - }, - "source": "21", - "sourceHandle": null, - "style": { - "stroke": "#ECDFCC", - "strokeWidth": 2 - }, - "target": "6", - "targetHandle": null, - "type": "smoothstep", - "selected": false - }, - { - "data": {}, - "id": "e7-21", - "markerEnd": { - "color": "#ECDFCC", - "height": 20, - "type": "arrowclosed", - "width": 20 - }, - "source": "7", - "sourceHandle": null, - "style": { - "stroke": "#ECDFCC", - "strokeWidth": 2 - }, - "target": "21", - "targetHandle": null, - "type": "smoothstep" - }, - { - "id": "e22-16-from_source-0", - "source": "22", - "target": "16", - "sourceHandle": "source-0", - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e23-22-to_target-0", - "source": "23", - "target": "22", - "sourceHandle": null, - "targetHandle": "target-0", - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e24-7", - "source": "24", - "target": "7", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e22-25-from_source-0", - "source": "22", - "target": "25", - "sourceHandle": "source-0", - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e24-25", - "source": "24", - "target": "25", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e1-26", - "source": "1", - "target": "26", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e1-27-to_target-0", - "source": "1", - "target": "27", - "sourceHandle": null, - "targetHandle": "target-0", - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e28-29-from_source-0", - "source": "28", - "target": "29", - "sourceHandle": "source-0", - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - }, - "selected": false - }, - { - "id": "e21-29", - "source": "21", - "target": "29", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e31-16", - "source": "31", - "target": "16", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e6-31", - "source": "6", - "target": "31", - "sourceHandle": null, - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e27-28-from_source-0-to_target-0", - "source": "27", - "target": "28", - "sourceHandle": "source-0", - "targetHandle": "target-0", - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - }, - { - "id": "e27-7-from_source-0", - "source": "27", - "target": "7", - "sourceHandle": "source-0", - "targetHandle": null, - "type": "smoothstep", - "data": {}, - "style": { - "strokeWidth": 2, - "stroke": "#ECDFCC" - }, - "markerEnd": { - "type": "arrowclosed", - "width": 20, - "height": 20, - "color": "#ECDFCC" - } - } - ], - "nodeCounter": 32, - "solverParams": { - "Solver": "SSPRK22", - "dt": "0.01", - "dt_max": "1.0", - "dt_min": "1e-6", - "extra_params": "{}", - "iterations_max": "100", - "log": "true", - "simulation_duration": "60", - "tolerance_fpi": "1e-6" - }, - "globalVariables": [ - { - "id": "1753822667212", - "name": "S", - "nameError": false, - "value": "20" - }, - { - "id": "1753824144003", - "name": "source_T", - "nameError": false, - "value": "0.1" - }, - { - "id": "1753824419338", - "name": "kr", - "nameError": false, - "value": "2" - } - ] -} \ No newline at end of file diff --git a/example_graphs/linear_feedback.json b/example_graphs/linear_feedback.json index 5c3c24b3..ca9a4c10 100644 --- a/example_graphs/linear_feedback.json +++ b/example_graphs/linear_feedback.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "1", @@ -10,7 +14,8 @@ "data": { "label": "Source s(t)", "amplitude": "1", - "tau": "tau" + "tau": "tau", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -30,7 +35,8 @@ "label": "Scope", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -48,7 +54,8 @@ }, "data": { "label": "Amp a", - "gain": "a" + "gain": "a", + "nodeColor": "#DDE6ED" }, "measured": { "width": 90, @@ -67,7 +74,8 @@ "data": { "label": "Integrator x(t)", "initial_value": "x0", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -85,7 +93,8 @@ }, "data": { "label": "adder 6", - "operations": "" + "operations": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 64, @@ -240,5 +249,7 @@ "value": "3", "nameError": false } - ] + ], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/pid.json b/example_graphs/pid.json index 7ebce98a..171071e7 100644 --- a/example_graphs/pid.json +++ b/example_graphs/pid.json @@ -1,8 +1,13 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "data": { - "label": "Error" + "label": "Error", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "error_summer", @@ -20,7 +25,8 @@ { "data": { "gain": "0.4", - "label": "Feedback Gain" + "label": "Feedback Gain", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "feedback_gain", @@ -38,7 +44,8 @@ { "data": { "gain": "-1", - "label": "x -1" + "label": "x -1", + "nodeColor": "#DDE6ED" }, "dragging": false, "id": "minus_one", @@ -63,7 +70,8 @@ "data": { "label": "integrator 1", "initial_value": "", - "reset_times": "" + "reset_times": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -84,7 +92,8 @@ "Kp": "1.5", "Ki": "0.5", "Kd": "0.1", - "f_max": "10" + "f_max": "10", + "nodeColor": "#DDE6ED" }, "measured": { "width": 200, @@ -103,7 +112,8 @@ "data": { "label": "Reference Input", "amplitude": "1", - "tau": "1" + "tau": "1", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -123,7 +133,8 @@ "label": "scope 5", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -319,5 +330,7 @@ "simulation_duration": "35", "extra_params": "{}" }, - "globalVariables": [] + "globalVariables": [], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/example_graphs/spectrum.json b/example_graphs/spectrum.json index d10b08b7..ce0c7fa6 100644 --- a/example_graphs/spectrum.json +++ b/example_graphs/spectrum.json @@ -1,4 +1,8 @@ { + "version": { + "pathsim_version": "0.8.2", + "pathview_version": "0.1.dev470+g017515800.d20250812" + }, "nodes": [ { "id": "0", @@ -12,7 +16,8 @@ "alpha": "", "freq": "np.linspace(0, 1*np.pi, 600)", "labels": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -30,11 +35,12 @@ }, "data": { "label": "High frequency", - "func": "lambda t: np.sin(1.5*t *2*np.pi)" + "func": "lambda t: np.sin(1.5*t *2*np.pi)", + "nodeColor": "#DDE6ED" }, "measured": { - "width": 205, - "height": 53 + "width": 206, + "height": 54 }, "selected": false, "dragging": false @@ -50,7 +56,8 @@ "label": "scope 2", "labels": "", "sampling_rate": "", - "t_wait": "" + "t_wait": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 120, @@ -68,11 +75,12 @@ }, "data": { "label": "Low frequency", - "func": "lambda t: np.sin(0.5*t * 2*np.pi)" + "func": "lambda t: np.sin(0.5*t * 2*np.pi)", + "nodeColor": "#DDE6ED" }, "measured": { - "width": 205, - "height": 53 + "width": 206, + "height": 54 }, "selected": false, "dragging": false @@ -86,7 +94,8 @@ }, "data": { "label": "adder 4", - "operations": "" + "operations": "", + "nodeColor": "#DDE6ED" }, "measured": { "width": 64, @@ -184,5 +193,7 @@ "simulation_duration": "2*2*np.pi", "extra_params": "{}" }, - "globalVariables": [] + "globalVariables": [], + "events": [], + "pythonCode": "# Define your Python variables and functions here\n# Example:\n# my_variable = 42\n# def my_function(x):\n# return x * 2\n" } \ No newline at end of file diff --git a/src/App.jsx b/src/App.jsx index 6eed68e7..5f5406cf 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,5 +1,5 @@ // * Imports * -import { useState, useCallback, useEffect, useRef } from 'react'; +import { useState, useCallback, useEffect, useRef, version } from 'react'; import { ReactFlow, ReactFlowProvider, @@ -305,6 +305,7 @@ const DnDFlow = () => { // Function to save a graph to computer with "Save As" dialog const saveGraph = async () => { const graphData = { + version: versionInfo ? Object.fromEntries(Object.entries(versionInfo).filter(([key]) => key !== 'status')) : 'unknown', nodes, edges, nodeCounter, diff --git a/src/backend.py b/src/backend.py index 4a9d2097..059a0dd7 100644 --- a/src/backend.py +++ b/src/backend.py @@ -151,12 +151,12 @@ def get_version(): import pathview - fcs_version = getattr(pathview, "__version__", "Unknown") + pathview_version = getattr(pathview, "__version__", "Unknown") return jsonify( { "pathsim_version": pathsim_version, - "pathview_version": fcs_version, + "pathview_version": pathview_version, "status": "success", } ), 200