Skip to content

Initial brushing implementation#124

Merged
gampleman merged 14 commits intomasterfrom
brush
May 10, 2021
Merged

Initial brushing implementation#124
gampleman merged 14 commits intomasterfrom
brush

Conversation

@gampleman
Copy link
Owner

This adds a new interactive behavior: Brush.

@gampleman gampleman marked this pull request as ready for review May 7, 2021 09:46
selection


{-| -}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a description here?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What would you suggest? At the moment it's a bit of a pointless value, but I'm hoping to add a animated function in a later iteration (see how this works in the Zoom module).

-}
clearSelection : Brush dim -> Brush dim
clearSelection (Brush model) =
Brush { model | selection = Nothing }
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does clearSelection also get called implicitly when you click outside the brush selection? I didn't see this command in the timeseries example.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is intended for programmatic use.

When using the built in event handling, if you click, but don't drag we will clear the selection rather than have a zero width selection.



{-| 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.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we have an example of customizing the view function in this way? Is it possible to, say, have the selected area be a circle? Would the handles, etc. still work?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A circle would be pretty weird, but possible (although it would be very weird for a 2D brush). I could imagine a (slightly) rounded rect for instance, and certainly a different combination of fill/stroke/filter etc attributes.

@gampleman gampleman merged commit a6c58a8 into master May 10, 2021
@gampleman gampleman deleted the brush branch May 10, 2021 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants