https://github.com/clemapfel/mousetrapmakie.jl
Allows for integrating Makie Plots into Mousetrap.jl Applications
https://github.com/clemapfel/mousetrapmakie.jl
Last synced: about 1 year ago
JSON representation
Allows for integrating Makie Plots into Mousetrap.jl Applications
- Host: GitHub
- URL: https://github.com/clemapfel/mousetrapmakie.jl
- Owner: Clemapfel
- License: lgpl-3.0
- Created: 2023-09-22T13:57:32.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-07-18T12:12:42.000Z (almost 2 years ago)
- Last Synced: 2025-03-28T19:51:17.834Z (about 1 year ago)
- Language: Julia
- Homepage:
- Size: 68.4 KB
- Stars: 14
- Watchers: 7
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MousetrapMakie.jl
Experimental package that adds `GLMakieArea`, a [Mousetrap](https://github.com/Clemapfel/Mousetrap.jl/) widget that allows displaying [GLMakie](https://github.com/MakieOrg/Makie.jl) plots, similar to how [Gtk4Makie.jl](https://github.com/JuliaGtk/Gtk4Makie.jl) allows the same for GTK4.jl.
This package is not production ready and should be considered in early alpha. The following features are still missing:
+ Applying a post-processing config is not yet implemented
+ Modifying the screen after it is realized remains untested
+ Setups with multiple `GLMakie.Screen`s remain untested
+ `runtests.jl` is unimplemented, meaning CI through GitHub actions is not yet set up
+ The Makie event model is ignored completely, only Mousetraps event controllers allow for user input
If you are experienced with Makie, consider opening a PR to fully implement this package and extend its functionalities. Any significant contributor will be credited as an author. See [`src/MousetrapMakie.jl`](./src/MousetrapMakie.jl), which is heavily commented to make understanding and extending the package easier.
See the [Mousetrap.jl manual chapter on OpenGL integration](https://clemens-cords.com/mousetrap/01_manual/12_opengl_integration/) for more information.
# Installation
```julia
import Pkg
begin
Pkg.add(url="https://github.com/clemapfel/mousetrap_jll")
Pkg.add(url="https://github.com/clemapfel/Mousetrap.jl")
Pkg.add(url="https://github.com/clemapfel/MousetrapMakie.jl")
end
```
# Showcase
```julia
using Mousetrap, MousetrapMakie, GLMakie
main() do app::Application
window = Window(app)
canvas = GLMakieArea()
set_child!(window, canvas)
set_size_request!(canvas, Vector2f(200, 200))
screen = Ref{Union{Nothing, GLMakie.Screen{GLMakieArea}}}(nothing)
connect_signal_realize!(canvas) do self
screen[] = create_glmakie_screen(canvas)
display(screen[], scatter(rand(123)))
return nothing
end
present!(window)
end
```

## Credits & Contribution
`MousetrapMakie` was created by `Mousetrap.jl`s main developer, [C. Cords](https://clemens-cords.com).
## License
Licensed [lGPL-3.0](https://www.gnu.org/licenses/lgpl-3.0.de.html), meaning it available for both open-source, as well as closed-source, commercial use.