Macaw.Frame.Hooks.Brush (macaw_frame v0.1.0)

Copy Markdown View Source

The brush's selection helpers (spec/10 §7.5), visualize's Visualize.Hooks.Brush selection_to_domain/2: FrameBrush emits "brush" with a window in domain units it worked out in the browser; window(selection, frame) is the server's inverse, a pixel selection of the frame's plot (%{x0, x1}, and %{y0, y1} for a y or xy brush) read back through the frame's continuous scales, {:ok, %{"from" => lo, "to" => hi}} with lo ≤ hi (and "y_from", "y_to" for the y edges), or {:error, :no_scale} for a frame with no continuous scale on the brushed axis. visualize raised on a missing scale.

Summary

Functions

The window a pixel selection of frame's plot stands for.

Functions

window(selection, frame)

@spec window(map(), Macaw.Frame.Coordinates.Model.t()) ::
  {:ok, map()} | {:error, :no_scale | [Macaw.Base.Fault.t()]}

The window a pixel selection of frame's plot stands for.