Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create interaction for threshold + velocity #232

Open
appsforartists opened this issue Oct 8, 2017 · 0 comments
Open

Create interaction for threshold + velocity #232

appsforartists opened this issue Oct 8, 2017 · 0 comments

Comments

@appsforartists
Copy link
Member

The most useful abstraction missing from MM right now is something that synthesizes velocity and threshold. Our inputs look something like this:

  • An axis
  • A series of stops, where the dragged item will potentially land when released
  • Some way of mapping velocity to a distance or number of stops to advance
  • A velocity stream
  • A translate stream

We need at least these outputs:

  • preview index (e.g. which index is active, based on the current translate)
  • index (only updated on release)
  • destination (e.g. thresholds[index])

This has all been done in prototype code and not landed in the library because it wasn't clear what the right abstraction is. Given its a common need with complex inputs and outputs, this should probably be an interaction.

Open questions:

  • What should be configurable?
    • Should the velocity mapping and drag thresholds be tunable, or shared across all uses of this interaction?
  • Do we need to support both absolute and relative thresholds?
    • What about an infinitely long carousel?
    • What about a bottom sheet?
  • Should it set the spring's destination upon release?
  • How does it interact with application state?
  • Does the application listen to this interaction's outputs and update its own state?
  • Is there an index$ property on this interaction, which holds the canonical state?
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

No branches or pull requests

1 participant