Material Motion Exploring solutions that will empower creators with the tools needed to describe and implement rich, interactive motion on any platform. Edit this page · History
$._map yLockedTo
Status Interface level Implementation level Library
Proposed as of March 30, 2016 L2: Interaction creator L3: Stream creator material-motion
UpdatesCurrent StatusInitiation dateCompletion date
First proposed Stable March 30, 2017
platformsrctests
iOS (Swift) View View
yLockedTo
upstream (Point)
yValue (number)
(Point) downstream

yLockedTo specification

This is the engineering specification for the MotionObservable operator: yLockedTo.

Overview

yLockedTo sets the upstream point’s y value to the provided value and emits the result.

Example usage

stream.yLocked(to: 50)

upstream  yValue  |  downstream
20, 50    50      |  20, 50
40, 80    50      |  40, 50
60, 90    50      |  60, 50

MVP

Expose an yLockedTo operator API

Use _map to implement the operator. Accept an yValue number. Emit {upstream.x, yValue}.

class MotionObservable<number> {
  public func yLocked(to yValue: number) -> MotionObservable<Point>
}