### Initialize CanvasSelect Menu Source: https://makieorg.github.io/MakieDraw.jl/dev Create a CanvasSelect widget to manage active canvases within a figure. The 'layers' dictionary maps display names to observables that control canvas visibility. ```julia using MakieDraw, GLMakie layers = Dict( :paint=>paint_canvas.active, :point=>point_canvas.active, :line=>line_canvas.active, :poly=>poly_canvas.active, ) fig = Figure() cs = CanvasSelect(fig[2, 1]; layers) ``` -------------------------------- ### arrow_key_navigation Source: https://makieorg.github.io/MakieDraw.jl/dev Allows moving the Makie.jl axis using the keyboard arrow keys. ```APIDOC ## `MakieDraw.arrow_key_navigation` — Method ### Description Allow moving the axis with keyboard arrow keys. ### Arguments * `fig`: The figure containing the axis. * `axis`: The axis to navigate. ``` -------------------------------- ### Enable Arrow Key Navigation for Axis Source: https://makieorg.github.io/MakieDraw.jl/dev This method allows the user to move the Makie.jl axis using the keyboard's arrow keys. It requires the figure and axis objects as arguments. ```julia arrow_key_navigation(fig, axis) ``` -------------------------------- ### PaintCanvas Source: https://makieorg.github.io/MakieDraw.jl/dev A canvas for painting into a Matrix of Real numbers or colors using Makie.jl. ```APIDOC ## `MakieDraw.PaintCanvas` — Type ### Description A canvas for painting into a Matrix Real numbers or colors. `data` is an `AbstractMatrix` plotted with `Makie.image!`, or a function `f` that plots `f(axis, dimsions..., data)` onto `axis`. ### Arguments * `data`: An `AbstractMatrix` that will plot with `Makie.image!`, or your function `f`. * `f`: A function, like `image!` or `heatmap!,` that will plot `f(axis, dimsions..., data)` onto `axis`. ### Keywords * `dimension`: The dimension ticks of data. `axes(data)` by default. * `drawing`: Observable{Bool}(false) to track if drawing is occurring. * `drawbutton`: The currently clicked mouse button while drawing, e.g. `Mouse.left`. * `active`: Observable{Bool}(true) to set if the canvas is active. * `name`: Symbol: name for the canvas. Will appear in a `CanvasSelect`. * `figure`: A figure to plot on. * `axis`: An axis to plot on. * `fill_left`: Observable value for left click drawing. * `fill_right`: Observable value for right click drawing. * `fill_middle`: Observable value for middle click drawing. ### Mouse and Key commands * Left click/drag: draw with value of `fill_left`. * Right click/drag: draw with value of `fill_right`. * Middle click/drag: draw with value of `fill_middle`. ``` -------------------------------- ### GeometryCanvas Source: https://makieorg.github.io/MakieDraw.jl/dev A canvas for drawing GeometryBasics.jl geometries onto a Makie.jl Axis. Supports Point, LineString, and Polygon types. ```APIDOC ## `MakieDraw.GeometryCanvas` — Type ### Description A canvas for drawing GeometryBasics.jl geometries onto a Makie.jl `Axis`. `T` must be `Point`, `LineString` or `Polygon`. ### Mouse and Key commands * Left click: select point, or add point with property 1 if `click_property` is set. * Right click: select point, or add point with property 2 if `click_property` is set. * Middle click: select point, or add point with property 3 if `click_property` is set. * Alt+click: delete points, dragging while click is held will continue deleting. * Shift+click: start new polygons and linstrings on `Polygon` and `LineString` canvas. Has no effect for `Point`. * Delete: delete selected points. * Shift+Delete: delete selected linestring/polygon. ### Keywords * `dragging`: Observable{Bool}(false) to track mouse dragging. * `active`: Observable{Bool}(true) to set if the canvas is active. * `accuracy_scale`: Control selection accuracy. `1.0` by default. * `name`: Symbol: name for the canvas, appears in `CanvasSelect`. * `propertynames`: Names for feature properties to create. * `properties`: An existing table of properties. * `click_property`: Which property is set with left and right click, should be a `Bool`. * `figure`: A figure to plot on. * `axis`: An axis to plot on. * `current_point`: Observable to track the currently focused point index. * `scatter_kw`: Keywords to pass to `scatter`. * `lines_kw`: Keywords to pass to `lines`. * `poly_kw`: Keywords to pass to `poly`. * `current_point_kw`: Keywords for the current point `scatter`. * `show_current_point`: Whether to show the current point differently. * `text_input`: Whether to add text input boxes for property input. ``` -------------------------------- ### CanvasSelect Source: https://makieorg.github.io/MakieDraw.jl/dev A menu widget for selecting active canvases. It deactivates non-selected canvases and activates the chosen one. ```APIDOC ## `MakieDraw.CanvasSelect` — Type ### Description A menu widget for selecting active canvases. It will deactivate all non-selected canvases, and select the active one. ### Arguments * `figure::Union{Figure,GridPosition}`: A Figure or `GridPosition` to attach the menu to. ### Keywords * `layers`: A `Dict{Symbol,Orbservable{Bool}}` where Symbols are menu names and Observables control initial active state. ### Example ```julia using MakieDraw, GLMakie layers = Dict( :paint=>paint_canvas.active, :point=>point_canvas.active, :line=>line_canvas.active, :poly=>poly_canvas.active, ) fig = Figure() cs = CanvasSelect(fig[2, 1]; layers) ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.