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 y
x
Status Interface level Implementation level Library
Stable as of February 21, 2016 L2: Interaction creator L3: Stream creator material-motion
platformsrctests
Android View
iOS (Swift) View View
y
upstream (Point)
(number) downstream

y specification

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

Overview

y extracts the y value from a Point stream.

Example usage:

stream.y()

upstream        |  downstream
{x: 20, y: 25}  |  25
{x: 40, y: 10}  |  10
{x: 70, y: 30}  |  30

MVP

Expose a y operator API

Use _map to implement the operator. Return the x value. Exposed on streams of type Point.

class MotionObservable<Point> {

  public func y() -> MotionObservable<Float> { return _map { return $0.y } }