Options
All
  • Public
  • Public/Protected
  • All
Menu

Library @swim/mapping

@swim/mapping

package documentation chat

@swim/mapping implements functional maps, interpolators, and scales. @swim/mapping is part of the @swim/core framework.

Installation

npm

For an npm-managed project, npm install @swim/mapping to make it a dependency. TypeScript sources will be installed into node_modules/@swim/mapping/main. Transpiled JavaScript and TypeScript definition files install into node_modules/@swim/mapping/lib/main. And a pre-built UMD script can be found in node_modules/@swim/mapping/dist/main/swim-mapping.js.

Browser

Browser applications can load swim-core.js, which comes bundled with the @swim/mapping library, directly from the SwimOS CDN.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-core.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-core.min.js"></script>

Alternatively, the standalone swim-system.js script may be loaded from the SwimOS CDN, which bundles @swim/mapping together with all other @swim/system libraries.

<!-- Development -->
<script src="https://cdn.swimos.org/js/latest/swim-system.js"></script>

<!-- Production -->
<script src="https://cdn.swimos.org/js/latest/swim-system.min.js"></script>

Usage

ES6/TypeScript

@swim/mapping can be imported as an ES6 module from TypeScript and other ES6-compatible environments.

import * as mapping from "@swim/mapping";

CommonJS/Node.js

@swim/mapping can also be used as a CommonJS module in Node.js applications.

var mapping = require("@swim/mapping");

Browser

When loaded by a web browser, the swim-core.js script adds all @swim/mapping library exports to the global swim namespace.

The swim-system.js script also adds all @swim/mapping library exports to the global swim namespace, making it a drop-in replacement for swim-core.js when additional @swim/system libraries are needed.

Index

Type aliases

AnyDomain

AnyDomain<X>: Domain<X> | readonly [X, X]

Type parameters

  • X

AnyEasing

AnyEasing: Easing | EasingType

AnyRange

AnyRange<Y>: Range<Y> | readonly [Y, Y]

Type parameters

  • Y

AnyTiming

AnyTiming: Timing | TimingInit

EasingType

EasingType: "linear" | "quad-in" | "quad-out" | "quad-in-out" | "cubic-in" | "cubic-out" | "cubic-in-out" | "quart-in" | "quart-out" | "quart-in-out" | "expo-in" | "expo-out" | "expo-in-out" | "circ-in" | "circ-out" | "circ-in-out" | "back-in" | "back-out" | "back-in-out" | "elastic-in" | "elastic-out" | "elastic-in-out" | "bounce-in" | "bounce-out" | "bounce-in-out"

Variables

ArrayInterpolator

ArrayInterpolator: { prototype: ArrayInterpolator<any> }

Type declaration

ContinuousScale

ContinuousScale: { prototype: ContinuousScale<any, any> }

Type declaration

Domain

Domain: { prototype: Domain<any>; unit: LinearDomain }

Type declaration

Easing

Easing: { backIn: Easing; backInOut: Easing; backOut: Easing; bounceIn: Easing; bounceInOut: Easing; bounceOut: Easing; circIn: Easing; circInOut: Easing; circOut: Easing; cubicIn: Easing; cubicInOut: Easing; cubicOut: Easing; elasticIn: Easing; elasticInOut: Easing; elasticOut: Easing; expoIn: Easing; expoInOut: Easing; expoOut: Easing; linear: Easing; prototype: Easing; quadIn: Easing; quadInOut: Easing; quadOut: Easing; quartIn: Easing; quartInOut: Easing; quartOut: Easing; fromAny: any }

Type declaration

IdentityInterpolator

IdentityInterpolator: { prototype: IdentityInterpolator<any> }

Type declaration

Interpolate

Interpolate: { is: any }

Type declaration

    • Type parameters

      • T

      Parameters

      Returns null | Interpolator<T>

    • Parameters

      • x: unknown
      • y: unknown

      Returns null | Interpolator<unknown>

  • is: function
    • Parameters

      • object: unknown

      Returns object is Interpolate<unknown>

Interpolator

Interpolator: { prototype: Interpolator<any> }

Type declaration

Const InterpolatorInterpolator

InterpolatorInterpolator: { prototype: Interpolator<any> }

Type declaration

InterpolatorMap

InterpolatorMap: { prototype: InterpolatorMap<any, any> }

Type declaration

LinearDomain

LinearDomain: { prototype: LinearDomain }

Type declaration

Const LinearDomainInterpolator

LinearDomainInterpolator: { prototype: Interpolator<LinearDomain> }

Type declaration

LinearRange

LinearRange: { prototype: LinearRange }

Type declaration

Const LinearRangeInterpolator

LinearRangeInterpolator: { prototype: Interpolator<LinearRange> }

Type declaration

LinearScale

LinearScale: { prototype: LinearScale }

Type declaration

Const LinearScaleInterpolator

LinearScaleInterpolator: { prototype: Interpolator<LinearScale> }

Type declaration

Mapping

Mapping: { prototype: Mapping<any, any> }

Type declaration

Const NumberInterpolator

NumberInterpolator: { prototype: Interpolator<number> }

Type declaration

Range

Range: { prototype: Range<any>; unit: LinearRange }

Type declaration

    • <Y>(y0: Y, y1: Y): Range<Y>
    • Type parameters

      • Y

      Parameters

      • y0: Y
      • y1: Y

      Returns Range<Y>

  • prototype: Range<any>
  • Readonly unit: LinearRange

Scale

Scale: { prototype: Scale<any, any> }

Type declaration

    • (): never
    • Returns never

  • prototype: Scale<any, any>

Const StepInterpolator

StepInterpolator: { prototype: Interpolator<any> }

Type declaration

Timing

Timing: { prototype: Timing; fromAny: any; fromInit: any }

Type declaration

    • Parameters

      • easing: Easing
      • t0: number
      • t1: number

      Returns Timing

  • prototype: Timing
  • fromAny: function
    • Parameters

      Returns Timing

    • Parameters

      • value: undefined | null | boolean | AnyTiming

      Returns boolean | Timing

  • fromInit: function
    • Parameters

      Returns Timing

Tweening

Tweening: { prototype: Tweening<any> }

Type declaration

Generated using TypeDoc