diff --git a/Manifest.toml b/Manifest.toml
index d6a98bc..91b77cb 100644
--- a/Manifest.toml
+++ b/Manifest.toml
@@ -2,7 +2,7 @@
julia_version = "1.11.2"
manifest_format = "2.0"
-project_hash = "e84343a015a9b60e7e39a0605149974e3d8cf1e0"
+project_hash = "e1be01554a547da63b1504fb440ab6cc4855bc9d"
[[deps.ATK_jll]]
deps = ["Artifacts", "Glib_jll", "JLLWrappers", "Libdl"]
diff --git a/Project.toml b/Project.toml
index 7105785..2909ef6 100644
--- a/Project.toml
+++ b/Project.toml
@@ -10,4 +10,5 @@ NativeFileDialog = "e1fe445b-aa65-4df4-81c1-2041507f0fd4"
NaturalSort = "c020b1a1-e9b0-503a-9c33-f039bfc54a85"
PlotlyBase = "a03496cd-edff-5a9b-9e67-9cda94a718b5"
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
+StipplePlotly = "ec984513-233d-481d-95b0-a3b58b97af2b"
julia_mzML_imzML = "38eb50d3-2fb6-4afa-992a-964ed8562ed9"
diff --git a/app.jl b/app.jl
index 55ece00..b2de8fb 100644
--- a/app.jl
+++ b/app.jl
@@ -12,6 +12,7 @@ using NaturalSort
using Images
using LinearAlgebra
using NativeFileDialog # Opens the file explorer depending on the OS
+using StipplePlotly
@genietools
# == Code import ==
@@ -148,6 +149,11 @@ end
@out plotdata=[traceSpectra]
@out plotlayout=layoutSpectra
+ # Interactive plot reactions
+ @in data_click = Dict{String,Any}()
+ #@in data_selected = Dict{String,Any}() # Selected is for areas, this can work for the masks
+ #
+
# Interface Plot Surface
layoutContour=PlotlyBase.Layout(
title="2D Topographic Map",
@@ -196,8 +202,6 @@ end
# Create conection to frontend
@out plotdata3d=[trace3D]
@out plotlayout3d=layout3D
-
- # println("3D trace defined: ", trace3D)
# == Reactive handlers ==
# Reactive handlers watch a variable and execute a block of code when its value changes
@@ -768,6 +772,20 @@ end
CompareDialog=true
end
+
+ # Event detection for clicking on the spectrum plot
+ @onchange data_click begin
+ println("Clicked data on sum spectrum plot : ", data_click)
+ # Now it needs to compare if there is a value from the spectrum close (to make sure it does not select invalid m/z)
+ # and then, add it to the mass-to-charge ratio of interest input to the frontend to ease with inputs
+ # optional: red line signaling which m/z got selected in the spectrum plot
+ end
+
+ # WIP add an x and y input and a plot to select pixels in an image and then calculate a plot (not the sum of plots)
+ # optional: red lines to signal which pixel is selected in the image plot
+
+ @mounted watchplots()
+
GC.gc() # Trigger garbage collection
if Sys.islinux()
ccall(:malloc_trim, Int32, (Int32,), 0) # Ensure julia returns the freed memory to OS
diff --git a/app.jl.html b/app.jl.html
index d57e93f..7c1cbf9 100644
--- a/app.jl.html
+++ b/app.jl.html
@@ -151,7 +151,8 @@
-
+
+
diff --git a/start_MSI_GUI.jl b/start_MSI_GUI.jl
index 72bec77..5d90613 100644
--- a/start_MSI_GUI.jl
+++ b/start_MSI_GUI.jl
@@ -7,6 +7,7 @@ Pkg.add("Libz") ; Pkg.add("PlotlyBase") ; Pkg.add("CairoMakie") ; Pkg.add("Color
Pkg.add(url="https://github.com/CINVESTAV-LABI/julia_mzML_imzML") # With this we ensure it uses the latest library iteration
Pkg.add("Images") ; Pkg.add("LinearAlgebra")
Pkg.add("NativeFileDialog")
+Pkg.add("StipplePlotly")
using Genie