d3_interpolate library

d3-interpolate 3.0.1 in native Dart, with no Flutter import (D3 ADR 0008 §6).

Import it with a prefix, as import 'package:flutter_d3_interpolate_port/d3_interpolate.dart' as d3;. Then the code reads d3.interpolateNumber(0, 10) and d3.interpolateRgb(a, b). The library compiles for the VM, for JavaScript and for WebAssembly with no Flutter engine.

Classes

InterpolateCubehelix
cubehelix.js:4 cubehelix(hue) with cubehelix.js:5 cubehelixGamma(y): a Cubehelix interpolator factory with the hue interpolation of its kind and the gamma of its creation.
InterpolateRgb
rgb.js:6 the function rgb of rgbGamma(y), with its property gamma: an RGB interpolator factory with the gamma of its creation.
InterpolateZoom
zoom.js:15 zoomRho(rho, rho2, rho4): the zoom interpolator of the curvature rho, with rho2 = rho * rho and rho4 = rho2 * rho2.
TransformParts
The parts of a 2D transform, in the order of the CSS text translate(translateX, translateY) rotate(rotate) skewX(skewX) scale(scaleX, scaleY): the object of decompose.js:3 and decompose.js:18.
ZoomInterpolator
zoom.js:31 and zoom.js:48 the interpolator i of InterpolateZoom.call with its property duration (zoom.js:60).

Constants

d3InterpolateVersion → const String
The d3-interpolate release that this port tracks.
interpolateCubehelix → const InterpolateCubehelix
cubehelix.js:28 the default export, cubehelix(hue): the Cubehelix interpolator factory on the shortest path between the hues, with the gamma 1.
interpolateCubehelixLong → const InterpolateCubehelix
index.js:19 cubehelixLong as interpolateCubehelixLong: the Cubehelix interpolator factory with no shortest path between the hues, with the gamma 1 and its method gamma, cubehelixLong of cubehelix.dart.
interpolateHclLong → const Hcl Function(double t) Function(Color start, Color end)
index.js:18 hclLong as interpolateHclLong: the interpolator of two colors in HCL, with no shortest path between the hues, hclLong of hcl.dart.
interpolateHslLong → const Hsl Function(double t) Function(Color start, Color end)
index.js:16 hslLong as interpolateHslLong: the interpolator of two colors in HSL, with no shortest path between the hues, hslLong of hsl.dart.
interpolateRgb → const InterpolateRgb
rgb.js:6 the default export, rgbGamma(1): the RGB interpolator factory with the gamma 1.
interpolateRgbBasis → const Rgb Function(double t) Function(List<Color> colors)
index.js:15 rgbBasis as interpolateRgbBasis: a uniform nonrational B-spline through a list of colors in RGB, rgbBasis of rgb.dart.
interpolateRgbBasisClosed → const Rgb Function(double t) Function(List<Color> colors)
index.js:15 rgbBasisClosed as interpolateRgbBasisClosed: a closed uniform nonrational B-spline through a list of colors in RGB, rgbBasisClosed of rgb.dart.
interpolateZoom → const InterpolateZoom
zoom.js:15 the default export: the zoom interpolator of the curvature sqrt(2) (zoom.js:71), the value that van Wijk and Nuij recommend.

Functions

decompose(double a, double b, double c, double d, double e, double f) → TransformParts
decompose.js:12 decompose(a, b, c, d, e, f): the parts of the 2D affine matrix matrix(a, b, c, d, e, f) of CSS, that is
interpolate<T>(T a, T b) → T Function(double t)
value.js:11 the default export (interpolate of index.js:1): the interpolator from a to b, of the type of b.
interpolateArray<E>(List<E> a, List<E> b) → List<E> Function(double t)
array.js:4 the default export (interpolateArray of index.js:2): the interpolator from the items of a to the items of b.
interpolateBasis(List<double> values) → double Function(double t)
basis.js:9 the default export (interpolateBasis of index.js:3): a uniform nonrational B-spline interpolator through values.
interpolateBasisClosed(List<double> values) → double Function(double t)
basisClosed.js:3 the default export (interpolateBasisClosed of index.js:4): a closed uniform nonrational B-spline interpolator through values.
interpolateDate(DateTime a, DateTime b) → DateTime Function(double t)
date.js:1 the default export (interpolateDate of index.js:5): the interpolator from the date a to the date b.
interpolateDiscrete<T>(List<T> range) → T Function(double t)
discrete.js:1 the default export (interpolateDiscrete of index.js:6): a discrete interpolator over range.
interpolateHcl(Color start, Color end) → Hcl Function(double t)
hcl.js:20 the default export, hcl(hue): the interpolator from start to end in HCL, on the shortest path between the hues.
interpolateHsl(Color start, Color end) → Hsl Function(double t)
hsl.js:20 the default export, hsl(hue): the interpolator from start to end in HSL, on the shortest path between the hues.
interpolateHue(double a, double b) → double Function(double t)
hue.js:3 the default export (interpolateHue of index.js:7): the interpolator from the angle a to the angle b in degrees, along the shortest path.
interpolateLab(Color start, Color end) → Lab Function(double t)
lab.js:4 lab(start, end), exported as interpolateLab: the interpolator from start to end in CIELAB.
interpolateNumber(double a, double b) → double Function(double t)
number.js:1 the default export (interpolateNumber of index.js:8): the interpolator from the number a to the number b.
interpolateNumberArray<T extends List<num>>(List<num> a, T b) → T Function(double t)
numberArray.js:1 the default export (interpolateNumberArray of index.js:9): the interpolator from the numbers of a to the numbers of b.
interpolateRound(double a, double b) → double Function(double t)
round.js:1 the default export (interpolateRound of index.js:11): the interpolator from the number a to the number b that rounds its result to the nearest whole number.
interpolateTransform(TransformParts a, TransformParts b) → TransformParts Function(double t)
index.js:45 the interpolator of interpolateTransform(parse, ...): the transform between the parts a and b.
piecewise<T>(List<T> values, {T Function(double t) interpolate(T a, T b)?}) → T Function(double t)
piecewise.js:3 the default export (piecewise of index.js:20): the piecewise interpolator through values, with the interpolator factory interpolate for each pair of adjacent values.
quantize<T>(T interpolator(double t), int n) → List<T>
quantize.js:1 the default export (quantize of index.js:21): n uniformly-spaced samples of interpolator, at t = i / (n - 1) for i from 0 to n - 1.

Typedefs

ZoomView = (double, double, double)
zoom.js:17 the view [ux, uy, w] of upstream: the center (ux, uy) of the viewport and its width w.