MakieDraw

Documentation for MakieDraw.

MakieDraw.CanvasSelectType
CanvasSelect <: AbstractCanvasSelect

CanvasSelect(figure; [layers])

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.

Keywords

  • layers: A Dict{Symbol,Orbservable{Bool}} where the Symbols are the names that will appear in the Menu, and the Observables are the initial

Example

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)
source
MakieDraw.GeometryCanvasType
GeometryCanvas{T<:GeometryBasics.Geometry} <: AbstractCanvas

GeometryCanvas{T}(; kw...)

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.
  • Rick 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 will 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: an Observable{Bool}(false) to track mouse dragging.
  • active: an Observable{Bool}(true) to set if the canvas is active.
  • accuracy_scale: control how accurate selection needs to be. 1.0 by default.
  • name: A Symbol: name for the canvas. Will appear in a CanvasSelect.
  • propertynames: names for feaure properties to create.
  • properties: an existin table of properties.
  • click_property: which property is set with left and right click, shold be a Bool.
  • figure: a figure to plot on.
  • axis: an axis to plot on.
  • current_point: an 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 to the other.
  • text_input: wether to add text input boxes for property input.
source
MakieDraw.PaintCanvasType
PaintCanvas <: AbstractCanvas

PaintCanvas(; kw...)
PaintCanvas(f, data; kw...)

A canvas for painting into a Matrix Real numbers or colors.

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 dimesion ticks of data. axes(data) by default.
  • drawing: an Observable{Bool}(false) to track if drawing is occuring.
  • drawbutton: the currently clicked mouse button while drawing, e.g. Mouse.left.
  • active: an Observable{Bool}(true) to set if the canvas is active.
  • name: A 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
source