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 x
y
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
x
upstream (Point)
(number) downstream

x specification

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

Overview

x extracts the x value from a Point stream.

Example usage:

stream.x()

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

MVP

Expose an x operator API

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

class MotionObservable<Point> {

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