-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
721 additions
and
214 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,21 @@ | ||
export {default as interpolate} from "./src/interpolate"; | ||
export {default as interpolateArray} from "./src/interpolateArray"; | ||
export {default as interpolateNumber} from "./src/interpolateNumber"; | ||
export {default as interpolateObject} from "./src/interpolateObject"; | ||
export {default as interpolateRound} from "./src/interpolateRound"; | ||
export {default as interpolateString} from "./src/interpolateString"; | ||
export {default as interpolateTransform} from "./src/interpolateTransform"; | ||
export {default as interpolateZoom} from "./src/interpolateZoom"; | ||
export {default as interpolators} from "./src/interpolators"; | ||
export {default as array} from "./src/array"; | ||
export {default as number} from "./src/number"; | ||
export {default as object} from "./src/object"; | ||
export {default as round} from "./src/round"; | ||
export {default as string} from "./src/string"; | ||
export {default as transform} from "./src/transform"; | ||
export {default as values} from "./src/values"; | ||
export {default as value} from "./src/value"; | ||
export {default as zoom} from "./src/zoom"; | ||
export {default as rgb} from "./src/rgb"; | ||
export {default as hsl} from "./src/hsl"; | ||
export {default as hslLong} from "./src/hslLong"; | ||
export {default as lab} from "./src/lab"; | ||
export {default as hcl} from "./src/hcl"; | ||
export {default as hclLong} from "./src/hclLong"; | ||
|
||
import cubehelixGamma from "./src/cubehelixGamma"; | ||
import cubehelixGammaLong from "./src/cubehelixGammaLong"; | ||
export var cubehelix = cubehelixGamma(1); | ||
export var cubehelixLong = cubehelixGammaLong(1); | ||
export {cubehelixGamma, cubehelixGammaLong}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import {cubehelix} from "d3-color"; | ||
import deltaHue from "./deltaHue"; | ||
|
||
export default function(gamma) { | ||
return function(a, b) { | ||
a = cubehelix(a); | ||
b = cubehelix(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
as = isNaN(a.s) ? b.s : a.s, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah), | ||
bs = isNaN(b.s) ? 0 : b.s - as, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.s = as + bs * t; | ||
a.l = al + bl * Math.pow(t, gamma); | ||
return a + ""; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {cubehelix} from "d3-color"; | ||
|
||
export default function(gamma) { | ||
return function(a, b) { | ||
a = cubehelix(a); | ||
b = cubehelix(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
as = isNaN(a.s) ? b.s : a.s, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : b.h - ah, | ||
bs = isNaN(b.s) ? 0 : b.s - as, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.s = as + bs * t; | ||
a.l = al + bl * Math.pow(t, gamma); | ||
return a + ""; | ||
}; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
export default function(h1, h0) { | ||
var delta = h1 - h0; | ||
return delta > 180 || delta < -180 | ||
? delta - 360 * Math.round(delta / 360) | ||
: delta; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {hcl} from "d3-color"; | ||
import deltaHue from "./deltaHue"; | ||
|
||
export default function(a, b) { | ||
a = hcl(a); | ||
b = hcl(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
ac = isNaN(a.c) ? b.c : a.c, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah), | ||
bc = isNaN(b.c) ? 0 : b.c - ac, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.c = ac + bc * t; | ||
a.l = al + bl * t; | ||
return a + ""; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {hcl} from "d3-color"; | ||
|
||
export default function(a, b) { | ||
a = hcl(a); | ||
b = hcl(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
ac = isNaN(a.c) ? b.c : a.c, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : b.h - ah, | ||
bc = isNaN(b.c) ? 0 : b.c - ac, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.c = ac + bc * t; | ||
a.l = al + bl * t; | ||
return a + ""; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {hsl} from "d3-color"; | ||
import deltaHue from "./deltaHue"; | ||
|
||
export default function(a, b) { | ||
a = hsl(a); | ||
b = hsl(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
as = isNaN(a.s) ? b.s : a.s, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : deltaHue(b.h, ah), | ||
bs = isNaN(b.s) ? 0 : b.s - as, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.s = as + bs * t; | ||
a.l = al + bl * t; | ||
return a + ""; | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {hsl} from "d3-color"; | ||
|
||
export default function(a, b) { | ||
a = hsl(a); | ||
b = hsl(b); | ||
var ah = isNaN(a.h) ? b.h : a.h, | ||
as = isNaN(a.s) ? b.s : a.s, | ||
al = a.l, | ||
bh = isNaN(b.h) ? 0 : b.h - ah, | ||
bs = isNaN(b.s) ? 0 : b.s - as, | ||
bl = b.l - al; | ||
return function(t) { | ||
a.h = ah + bh * t; | ||
a.s = as + bs * t; | ||
a.l = al + bl * t; | ||
return a + ""; | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {lab} from "d3-color"; | ||
|
||
export default function(a, b) { | ||
a = lab(a); | ||
b = lab(b); | ||
var al = a.l, | ||
aa = a.a, | ||
ab = a.b, | ||
bl = b.l - al, | ||
ba = b.a - aa, | ||
bb = b.b - ab; | ||
return function(t) { | ||
a.l = al + bl * t; | ||
a.a = aa + ba * t; | ||
a.b = ab + bb * t; | ||
return a + ""; | ||
}; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {rgb} from "d3-color"; | ||
|
||
export default function(a, b) { | ||
a = rgb(a); | ||
b = rgb(b); | ||
var ar = a.r, | ||
ag = a.g, | ||
ab = a.b, | ||
br = b.r - ar, | ||
bg = b.g - ag, | ||
bb = b.b - ab; | ||
return function(t) { | ||
a.r = ar + br * t; | ||
a.g = ag + bg * t; | ||
a.b = ab + bb * t; | ||
return a + ""; | ||
}; | ||
}; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import values from "./values"; | ||
|
||
export default function(a, b) { | ||
var i = values.length, f; | ||
while (--i >= 0 && !(f = values[i](a, b))); | ||
return f; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import {color} from "d3-color"; | ||
import rgb from "./rgb"; | ||
import array from "./array"; | ||
import number from "./number"; | ||
import object from "./object"; | ||
import string from "./string"; | ||
|
||
export default [ | ||
function(a, b) { | ||
var t = typeof b, c; | ||
return (t === "string" ? ((c = color(b)) ? (b = c, rgb) : string) | ||
: b instanceof color ? rgb | ||
: Array.isArray(b) ? array | ||
: t === "object" && isNaN(b) ? object | ||
: number)(a, b); | ||
} | ||
]; |
File renamed without changes.
Oops, something went wrong.