Unavailable. Nobody can download this version any more, with elm or with the Lamdera compiler: github.com/szubtsovskiy/elm-visualization is gone (deleted or private); Software Heritage not asked yet (this run's --swh-calls were used up); no fork with tag 1.0.0 found (54 same-name repos checked); no cached copy. Use another version.
Brushing is the interactive specification of a one- or two-dimensional selected region using a pointing gesture, such as by clicking and dragging the mouse. Brushing is often used to select discrete elements, such as dots in a scatterplot or files on a desktop. It can also be used to zoom-in to a region of interest, or to select continuous regions for cross-filtering data.
This module implements brushing for mouse events using SVG. Click and drag on the brush selection to translate the selection. Click and drag on one of the selection handles to move the corresponding edge (or edges) of the selection. Click and drag on the invisible overlay to define a new brush selection, or click anywhere within the brushable region while holding down the META (⌘) key. Holding down the ALT (⌥) key while moving the brush causes it to reposition around its center. Holding SHIFT (⇧) locks the dragging to a single dimension.
Initializing the brush always requires you to specify in local coordinates the rectangular region where the brush will be active.
Initializes a brush that allows brushing in the X axis.
Initializes a brush that allows brushing in the Y axis.
Initializes a two dimensional brush.
Defines a rectangular region.
By default the brush will use the meta/alt and shift keys to change behavior. You can disable this with this function.
Exposes the selection for a single dimensional brush, where the first number should always be less than the second.
Exposes the selection for a two dimensional brush.
This is the Msg type that this module uses for communicating between the update and the view.
Note that when handling these messages, it is also extremely likely that the brush selection has somehow changed, so you can also use that place in your update function to react to that.
Don't forget the subscriptions, otherwise drag gestures won't work!
Programatically set the selection of the Brush.
Programatically set the selection of the Brush (in two dimensions).
Clears the selection programmatically.
brush
|> Brush.clearSelection
|> Brush.selection1d --> NothingPerfom the update to the brush instantly, rather than with an animation (animations are not supported yet.)
Actually renders the the brush selection widget. You can customise the appearance by passing in functions to render the individual pieces.
The actual widget consists of:
An overlay invisible rectange which covers the interactive area.
The selection rectangle.
Handles in each direction the brush supports being dragged to.
This is a type used to customize the view function of this module. However most of the functions that produce the type may appear to also consume it. However, this is not the case, the functions take VirtualDom attributes, but produce this Attribute type.
Customize rendering for the rectangular region that is the selection.
The first argument is the actual coordinates of the selection, the second are the event handlers.
The default version renderes a <rect fill="#777" fill-opacity="0.3" stroke="white" shape-rendering="crispEdges">.
The number in pixels which determines the size of the handles.
The handle customization functions take a suggested extent for where you should draw them.
This is basically the line/point they represent extended by handleSize / 2 in each direction.
However, you do not need to abide by these dimensions exactly, you can render much larger or smaller objects there.
Customise how to render the bottom handle.
Customise how to render the left handle.
Customise how to render the right handle.
Customise how to render the top handle.
Customise how to render the top left handle. Only applies to a 2D brush.
Customise how to render the top right handle. Only applies to a 2D brush.
Customise how to render the bottom left handle. Only applies to a 2D brush.
Customise how to render the bottom right handle. Only applies to a 2D brush.
Encapsulates all the data we need to maintain the state of the brush. The dimension type variable can either be
OneDimensionalorTwoDimensional. This allows us to share a lot of the implementation details as well as implement generic UI customizations over brushes regardless of their dimensionality.You will typically want to store this in your model.