完成世界书、骰子、apiconfig页面处理
This commit is contained in:
13
frontend/node_modules/d3-interpolate/src/basisClosed.js
generated
vendored
Normal file
13
frontend/node_modules/d3-interpolate/src/basisClosed.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
import {basis} from "./basis.js";
|
||||
|
||||
export default function(values) {
|
||||
var n = values.length;
|
||||
return function(t) {
|
||||
var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),
|
||||
v0 = values[(i + n - 1) % n],
|
||||
v1 = values[i % n],
|
||||
v2 = values[(i + 1) % n],
|
||||
v3 = values[(i + 2) % n];
|
||||
return basis((t - i / n) * n, v0, v1, v2, v3);
|
||||
};
|
||||
}
|
||||
29
frontend/node_modules/d3-interpolate/src/color.js
generated
vendored
Normal file
29
frontend/node_modules/d3-interpolate/src/color.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import constant from "./constant.js";
|
||||
|
||||
function linear(a, d) {
|
||||
return function(t) {
|
||||
return a + t * d;
|
||||
};
|
||||
}
|
||||
|
||||
function exponential(a, b, y) {
|
||||
return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {
|
||||
return Math.pow(a + t * b, y);
|
||||
};
|
||||
}
|
||||
|
||||
export function hue(a, b) {
|
||||
var d = b - a;
|
||||
return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : constant(isNaN(a) ? b : a);
|
||||
}
|
||||
|
||||
export function gamma(y) {
|
||||
return (y = +y) === 1 ? nogamma : function(a, b) {
|
||||
return b - a ? exponential(a, b, y) : constant(isNaN(a) ? b : a);
|
||||
};
|
||||
}
|
||||
|
||||
export default function nogamma(a, b) {
|
||||
var d = b - a;
|
||||
return d ? linear(a, d) : constant(isNaN(a) ? b : a);
|
||||
}
|
||||
1
frontend/node_modules/d3-interpolate/src/constant.js
generated
vendored
Normal file
1
frontend/node_modules/d3-interpolate/src/constant.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default x => () => x;
|
||||
29
frontend/node_modules/d3-interpolate/src/cubehelix.js
generated
vendored
Normal file
29
frontend/node_modules/d3-interpolate/src/cubehelix.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import {cubehelix as colorCubehelix} from "d3-color";
|
||||
import color, {hue} from "./color.js";
|
||||
|
||||
function cubehelix(hue) {
|
||||
return (function cubehelixGamma(y) {
|
||||
y = +y;
|
||||
|
||||
function cubehelix(start, end) {
|
||||
var h = hue((start = colorCubehelix(start)).h, (end = colorCubehelix(end)).h),
|
||||
s = color(start.s, end.s),
|
||||
l = color(start.l, end.l),
|
||||
opacity = color(start.opacity, end.opacity);
|
||||
return function(t) {
|
||||
start.h = h(t);
|
||||
start.s = s(t);
|
||||
start.l = l(Math.pow(t, y));
|
||||
start.opacity = opacity(t);
|
||||
return start + "";
|
||||
};
|
||||
}
|
||||
|
||||
cubehelix.gamma = cubehelixGamma;
|
||||
|
||||
return cubehelix;
|
||||
})(1);
|
||||
}
|
||||
|
||||
export default cubehelix(hue);
|
||||
export var cubehelixLong = cubehelix(color);
|
||||
5
frontend/node_modules/d3-interpolate/src/number.js
generated
vendored
Normal file
5
frontend/node_modules/d3-interpolate/src/number.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function(a, b) {
|
||||
return a = +a, b = +b, function(t) {
|
||||
return a * (1 - t) + b * t;
|
||||
};
|
||||
}
|
||||
5
frontend/node_modules/d3-interpolate/src/quantize.js
generated
vendored
Normal file
5
frontend/node_modules/d3-interpolate/src/quantize.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
export default function(interpolator, n) {
|
||||
var samples = new Array(n);
|
||||
for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));
|
||||
return samples;
|
||||
}
|
||||
55
frontend/node_modules/d3-interpolate/src/rgb.js
generated
vendored
Normal file
55
frontend/node_modules/d3-interpolate/src/rgb.js
generated
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
import {rgb as colorRgb} from "d3-color";
|
||||
import basis from "./basis.js";
|
||||
import basisClosed from "./basisClosed.js";
|
||||
import nogamma, {gamma} from "./color.js";
|
||||
|
||||
export default (function rgbGamma(y) {
|
||||
var color = gamma(y);
|
||||
|
||||
function rgb(start, end) {
|
||||
var r = color((start = colorRgb(start)).r, (end = colorRgb(end)).r),
|
||||
g = color(start.g, end.g),
|
||||
b = color(start.b, end.b),
|
||||
opacity = nogamma(start.opacity, end.opacity);
|
||||
return function(t) {
|
||||
start.r = r(t);
|
||||
start.g = g(t);
|
||||
start.b = b(t);
|
||||
start.opacity = opacity(t);
|
||||
return start + "";
|
||||
};
|
||||
}
|
||||
|
||||
rgb.gamma = rgbGamma;
|
||||
|
||||
return rgb;
|
||||
})(1);
|
||||
|
||||
function rgbSpline(spline) {
|
||||
return function(colors) {
|
||||
var n = colors.length,
|
||||
r = new Array(n),
|
||||
g = new Array(n),
|
||||
b = new Array(n),
|
||||
i, color;
|
||||
for (i = 0; i < n; ++i) {
|
||||
color = colorRgb(colors[i]);
|
||||
r[i] = color.r || 0;
|
||||
g[i] = color.g || 0;
|
||||
b[i] = color.b || 0;
|
||||
}
|
||||
r = spline(r);
|
||||
g = spline(g);
|
||||
b = spline(b);
|
||||
color.opacity = 1;
|
||||
return function(t) {
|
||||
color.r = r(t);
|
||||
color.g = g(t);
|
||||
color.b = b(t);
|
||||
return color + "";
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export var rgbBasis = rgbSpline(basis);
|
||||
export var rgbBasisClosed = rgbSpline(basisClosed);
|
||||
Reference in New Issue
Block a user