完成世界书、骰子、apiconfig页面处理
This commit is contained in:
268
frontend/node_modules/d3-shape/src/arc.js
generated
vendored
Normal file
268
frontend/node_modules/d3-shape/src/arc.js
generated
vendored
Normal file
@@ -0,0 +1,268 @@
|
||||
import constant from "./constant.js";
|
||||
import {abs, acos, asin, atan2, cos, epsilon, halfPi, max, min, pi, sin, sqrt, tau} from "./math.js";
|
||||
import {withPath} from "./path.js";
|
||||
|
||||
function arcInnerRadius(d) {
|
||||
return d.innerRadius;
|
||||
}
|
||||
|
||||
function arcOuterRadius(d) {
|
||||
return d.outerRadius;
|
||||
}
|
||||
|
||||
function arcStartAngle(d) {
|
||||
return d.startAngle;
|
||||
}
|
||||
|
||||
function arcEndAngle(d) {
|
||||
return d.endAngle;
|
||||
}
|
||||
|
||||
function arcPadAngle(d) {
|
||||
return d && d.padAngle; // Note: optional!
|
||||
}
|
||||
|
||||
function intersect(x0, y0, x1, y1, x2, y2, x3, y3) {
|
||||
var x10 = x1 - x0, y10 = y1 - y0,
|
||||
x32 = x3 - x2, y32 = y3 - y2,
|
||||
t = y32 * x10 - x32 * y10;
|
||||
if (t * t < epsilon) return;
|
||||
t = (x32 * (y0 - y2) - y32 * (x0 - x2)) / t;
|
||||
return [x0 + t * x10, y0 + t * y10];
|
||||
}
|
||||
|
||||
// Compute perpendicular offset line of length rc.
|
||||
// http://mathworld.wolfram.com/Circle-LineIntersection.html
|
||||
function cornerTangents(x0, y0, x1, y1, r1, rc, cw) {
|
||||
var x01 = x0 - x1,
|
||||
y01 = y0 - y1,
|
||||
lo = (cw ? rc : -rc) / sqrt(x01 * x01 + y01 * y01),
|
||||
ox = lo * y01,
|
||||
oy = -lo * x01,
|
||||
x11 = x0 + ox,
|
||||
y11 = y0 + oy,
|
||||
x10 = x1 + ox,
|
||||
y10 = y1 + oy,
|
||||
x00 = (x11 + x10) / 2,
|
||||
y00 = (y11 + y10) / 2,
|
||||
dx = x10 - x11,
|
||||
dy = y10 - y11,
|
||||
d2 = dx * dx + dy * dy,
|
||||
r = r1 - rc,
|
||||
D = x11 * y10 - x10 * y11,
|
||||
d = (dy < 0 ? -1 : 1) * sqrt(max(0, r * r * d2 - D * D)),
|
||||
cx0 = (D * dy - dx * d) / d2,
|
||||
cy0 = (-D * dx - dy * d) / d2,
|
||||
cx1 = (D * dy + dx * d) / d2,
|
||||
cy1 = (-D * dx + dy * d) / d2,
|
||||
dx0 = cx0 - x00,
|
||||
dy0 = cy0 - y00,
|
||||
dx1 = cx1 - x00,
|
||||
dy1 = cy1 - y00;
|
||||
|
||||
// Pick the closer of the two intersection points.
|
||||
// TODO Is there a faster way to determine which intersection to use?
|
||||
if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
|
||||
|
||||
return {
|
||||
cx: cx0,
|
||||
cy: cy0,
|
||||
x01: -ox,
|
||||
y01: -oy,
|
||||
x11: cx0 * (r1 / r - 1),
|
||||
y11: cy0 * (r1 / r - 1)
|
||||
};
|
||||
}
|
||||
|
||||
export default function() {
|
||||
var innerRadius = arcInnerRadius,
|
||||
outerRadius = arcOuterRadius,
|
||||
cornerRadius = constant(0),
|
||||
padRadius = null,
|
||||
startAngle = arcStartAngle,
|
||||
endAngle = arcEndAngle,
|
||||
padAngle = arcPadAngle,
|
||||
context = null,
|
||||
path = withPath(arc);
|
||||
|
||||
function arc() {
|
||||
var buffer,
|
||||
r,
|
||||
r0 = +innerRadius.apply(this, arguments),
|
||||
r1 = +outerRadius.apply(this, arguments),
|
||||
a0 = startAngle.apply(this, arguments) - halfPi,
|
||||
a1 = endAngle.apply(this, arguments) - halfPi,
|
||||
da = abs(a1 - a0),
|
||||
cw = a1 > a0;
|
||||
|
||||
if (!context) context = buffer = path();
|
||||
|
||||
// Ensure that the outer radius is always larger than the inner radius.
|
||||
if (r1 < r0) r = r1, r1 = r0, r0 = r;
|
||||
|
||||
// Is it a point?
|
||||
if (!(r1 > epsilon)) context.moveTo(0, 0);
|
||||
|
||||
// Or is it a circle or annulus?
|
||||
else if (da > tau - epsilon) {
|
||||
context.moveTo(r1 * cos(a0), r1 * sin(a0));
|
||||
context.arc(0, 0, r1, a0, a1, !cw);
|
||||
if (r0 > epsilon) {
|
||||
context.moveTo(r0 * cos(a1), r0 * sin(a1));
|
||||
context.arc(0, 0, r0, a1, a0, cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is it a circular or annular sector?
|
||||
else {
|
||||
var a01 = a0,
|
||||
a11 = a1,
|
||||
a00 = a0,
|
||||
a10 = a1,
|
||||
da0 = da,
|
||||
da1 = da,
|
||||
ap = padAngle.apply(this, arguments) / 2,
|
||||
rp = (ap > epsilon) && (padRadius ? +padRadius.apply(this, arguments) : sqrt(r0 * r0 + r1 * r1)),
|
||||
rc = min(abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments)),
|
||||
rc0 = rc,
|
||||
rc1 = rc,
|
||||
t0,
|
||||
t1;
|
||||
|
||||
// Apply padding? Note that since r1 ≥ r0, da1 ≥ da0.
|
||||
if (rp > epsilon) {
|
||||
var p0 = asin(rp / r0 * sin(ap)),
|
||||
p1 = asin(rp / r1 * sin(ap));
|
||||
if ((da0 -= p0 * 2) > epsilon) p0 *= (cw ? 1 : -1), a00 += p0, a10 -= p0;
|
||||
else da0 = 0, a00 = a10 = (a0 + a1) / 2;
|
||||
if ((da1 -= p1 * 2) > epsilon) p1 *= (cw ? 1 : -1), a01 += p1, a11 -= p1;
|
||||
else da1 = 0, a01 = a11 = (a0 + a1) / 2;
|
||||
}
|
||||
|
||||
var x01 = r1 * cos(a01),
|
||||
y01 = r1 * sin(a01),
|
||||
x10 = r0 * cos(a10),
|
||||
y10 = r0 * sin(a10);
|
||||
|
||||
// Apply rounded corners?
|
||||
if (rc > epsilon) {
|
||||
var x11 = r1 * cos(a11),
|
||||
y11 = r1 * sin(a11),
|
||||
x00 = r0 * cos(a00),
|
||||
y00 = r0 * sin(a00),
|
||||
oc;
|
||||
|
||||
// Restrict the corner radius according to the sector angle. If this
|
||||
// intersection fails, it’s probably because the arc is too small, so
|
||||
// disable the corner radius entirely.
|
||||
if (da < pi) {
|
||||
if (oc = intersect(x01, y01, x00, y00, x11, y11, x10, y10)) {
|
||||
var ax = x01 - oc[0],
|
||||
ay = y01 - oc[1],
|
||||
bx = x11 - oc[0],
|
||||
by = y11 - oc[1],
|
||||
kc = 1 / sin(acos((ax * bx + ay * by) / (sqrt(ax * ax + ay * ay) * sqrt(bx * bx + by * by))) / 2),
|
||||
lc = sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
|
||||
rc0 = min(rc, (r0 - lc) / (kc - 1));
|
||||
rc1 = min(rc, (r1 - lc) / (kc + 1));
|
||||
} else {
|
||||
rc0 = rc1 = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Is the sector collapsed to a line?
|
||||
if (!(da1 > epsilon)) context.moveTo(x01, y01);
|
||||
|
||||
// Does the sector’s outer ring have rounded corners?
|
||||
else if (rc1 > epsilon) {
|
||||
t0 = cornerTangents(x00, y00, x01, y01, r1, rc1, cw);
|
||||
t1 = cornerTangents(x11, y11, x10, y10, r1, rc1, cw);
|
||||
|
||||
context.moveTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc1 < rc) context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc1, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r1, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), !cw);
|
||||
context.arc(t1.cx, t1.cy, rc1, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the outer ring just a circular arc?
|
||||
else context.moveTo(x01, y01), context.arc(0, 0, r1, a01, a11, !cw);
|
||||
|
||||
// Is there no inner ring, and it’s a circular sector?
|
||||
// Or perhaps it’s an annular sector collapsed due to padding?
|
||||
if (!(r0 > epsilon) || !(da0 > epsilon)) context.lineTo(x10, y10);
|
||||
|
||||
// Does the sector’s inner ring (or point) have rounded corners?
|
||||
else if (rc0 > epsilon) {
|
||||
t0 = cornerTangents(x10, y10, x11, y11, r0, -rc0, cw);
|
||||
t1 = cornerTangents(x01, y01, x00, y00, r0, -rc0, cw);
|
||||
|
||||
context.lineTo(t0.cx + t0.x01, t0.cy + t0.y01);
|
||||
|
||||
// Have the corners merged?
|
||||
if (rc0 < rc) context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t1.y01, t1.x01), !cw);
|
||||
|
||||
// Otherwise, draw the two corners and the ring.
|
||||
else {
|
||||
context.arc(t0.cx, t0.cy, rc0, atan2(t0.y01, t0.x01), atan2(t0.y11, t0.x11), !cw);
|
||||
context.arc(0, 0, r0, atan2(t0.cy + t0.y11, t0.cx + t0.x11), atan2(t1.cy + t1.y11, t1.cx + t1.x11), cw);
|
||||
context.arc(t1.cx, t1.cy, rc0, atan2(t1.y11, t1.x11), atan2(t1.y01, t1.x01), !cw);
|
||||
}
|
||||
}
|
||||
|
||||
// Or is the inner ring just a circular arc?
|
||||
else context.arc(0, 0, r0, a10, a00, cw);
|
||||
}
|
||||
|
||||
context.closePath();
|
||||
|
||||
if (buffer) return context = null, buffer + "" || null;
|
||||
}
|
||||
|
||||
arc.centroid = function() {
|
||||
var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2,
|
||||
a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - pi / 2;
|
||||
return [cos(a) * r, sin(a) * r];
|
||||
};
|
||||
|
||||
arc.innerRadius = function(_) {
|
||||
return arguments.length ? (innerRadius = typeof _ === "function" ? _ : constant(+_), arc) : innerRadius;
|
||||
};
|
||||
|
||||
arc.outerRadius = function(_) {
|
||||
return arguments.length ? (outerRadius = typeof _ === "function" ? _ : constant(+_), arc) : outerRadius;
|
||||
};
|
||||
|
||||
arc.cornerRadius = function(_) {
|
||||
return arguments.length ? (cornerRadius = typeof _ === "function" ? _ : constant(+_), arc) : cornerRadius;
|
||||
};
|
||||
|
||||
arc.padRadius = function(_) {
|
||||
return arguments.length ? (padRadius = _ == null ? null : typeof _ === "function" ? _ : constant(+_), arc) : padRadius;
|
||||
};
|
||||
|
||||
arc.startAngle = function(_) {
|
||||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), arc) : startAngle;
|
||||
};
|
||||
|
||||
arc.endAngle = function(_) {
|
||||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), arc) : endAngle;
|
||||
};
|
||||
|
||||
arc.padAngle = function(_) {
|
||||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), arc) : padAngle;
|
||||
};
|
||||
|
||||
arc.context = function(_) {
|
||||
return arguments.length ? ((context = _ == null ? null : _), arc) : context;
|
||||
};
|
||||
|
||||
return arc;
|
||||
}
|
||||
29
frontend/node_modules/d3-shape/src/areaRadial.js
generated
vendored
Normal file
29
frontend/node_modules/d3-shape/src/areaRadial.js
generated
vendored
Normal file
@@ -0,0 +1,29 @@
|
||||
import curveRadial, {curveRadialLinear} from "./curve/radial.js";
|
||||
import area from "./area.js";
|
||||
import {lineRadial} from "./lineRadial.js";
|
||||
|
||||
export default function() {
|
||||
var a = area().curve(curveRadialLinear),
|
||||
c = a.curve,
|
||||
x0 = a.lineX0,
|
||||
x1 = a.lineX1,
|
||||
y0 = a.lineY0,
|
||||
y1 = a.lineY1;
|
||||
|
||||
a.angle = a.x, delete a.x;
|
||||
a.startAngle = a.x0, delete a.x0;
|
||||
a.endAngle = a.x1, delete a.x1;
|
||||
a.radius = a.y, delete a.y;
|
||||
a.innerRadius = a.y0, delete a.y0;
|
||||
a.outerRadius = a.y1, delete a.y1;
|
||||
a.lineStartAngle = function() { return lineRadial(x0()); }, delete a.lineX0;
|
||||
a.lineEndAngle = function() { return lineRadial(x1()); }, delete a.lineX1;
|
||||
a.lineInnerRadius = function() { return lineRadial(y0()); }, delete a.lineY0;
|
||||
a.lineOuterRadius = function() { return lineRadial(y1()); }, delete a.lineY1;
|
||||
|
||||
a.curve = function(_) {
|
||||
return arguments.length ? c(curveRadial(_)) : c()._curve;
|
||||
};
|
||||
|
||||
return a;
|
||||
}
|
||||
56
frontend/node_modules/d3-shape/src/curve/bundle.js
generated
vendored
Normal file
56
frontend/node_modules/d3-shape/src/curve/bundle.js
generated
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
import {Basis} from "./basis.js";
|
||||
|
||||
function Bundle(context, beta) {
|
||||
this._basis = new Basis(context);
|
||||
this._beta = beta;
|
||||
}
|
||||
|
||||
Bundle.prototype = {
|
||||
lineStart: function() {
|
||||
this._x = [];
|
||||
this._y = [];
|
||||
this._basis.lineStart();
|
||||
},
|
||||
lineEnd: function() {
|
||||
var x = this._x,
|
||||
y = this._y,
|
||||
j = x.length - 1;
|
||||
|
||||
if (j > 0) {
|
||||
var x0 = x[0],
|
||||
y0 = y[0],
|
||||
dx = x[j] - x0,
|
||||
dy = y[j] - y0,
|
||||
i = -1,
|
||||
t;
|
||||
|
||||
while (++i <= j) {
|
||||
t = i / j;
|
||||
this._basis.point(
|
||||
this._beta * x[i] + (1 - this._beta) * (x0 + t * dx),
|
||||
this._beta * y[i] + (1 - this._beta) * (y0 + t * dy)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
this._x = this._y = null;
|
||||
this._basis.lineEnd();
|
||||
},
|
||||
point: function(x, y) {
|
||||
this._x.push(+x);
|
||||
this._y.push(+y);
|
||||
}
|
||||
};
|
||||
|
||||
export default (function custom(beta) {
|
||||
|
||||
function bundle(context) {
|
||||
return beta === 1 ? new Basis(context) : new Bundle(context, beta);
|
||||
}
|
||||
|
||||
bundle.beta = function(beta) {
|
||||
return custom(+beta);
|
||||
};
|
||||
|
||||
return bundle;
|
||||
})(0.85);
|
||||
61
frontend/node_modules/d3-shape/src/curve/cardinalClosed.js
generated
vendored
Normal file
61
frontend/node_modules/d3-shape/src/curve/cardinalClosed.js
generated
vendored
Normal file
@@ -0,0 +1,61 @@
|
||||
import noop from "../noop.js";
|
||||
import {point} from "./cardinal.js";
|
||||
|
||||
export function CardinalClosed(context, tension) {
|
||||
this._context = context;
|
||||
this._k = (1 - tension) / 6;
|
||||
}
|
||||
|
||||
CardinalClosed.prototype = {
|
||||
areaStart: noop,
|
||||
areaEnd: noop,
|
||||
lineStart: function() {
|
||||
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
|
||||
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
|
||||
this._point = 0;
|
||||
},
|
||||
lineEnd: function() {
|
||||
switch (this._point) {
|
||||
case 1: {
|
||||
this._context.moveTo(this._x3, this._y3);
|
||||
this._context.closePath();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
this._context.lineTo(this._x3, this._y3);
|
||||
this._context.closePath();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
this.point(this._x3, this._y3);
|
||||
this.point(this._x4, this._y4);
|
||||
this.point(this._x5, this._y5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
point: function(x, y) {
|
||||
x = +x, y = +y;
|
||||
switch (this._point) {
|
||||
case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
|
||||
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
|
||||
case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
|
||||
default: point(this, x, y); break;
|
||||
}
|
||||
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
||||
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
||||
}
|
||||
};
|
||||
|
||||
export default (function custom(tension) {
|
||||
|
||||
function cardinal(context) {
|
||||
return new CardinalClosed(context, tension);
|
||||
}
|
||||
|
||||
cardinal.tension = function(tension) {
|
||||
return custom(+tension);
|
||||
};
|
||||
|
||||
return cardinal;
|
||||
})(0);
|
||||
74
frontend/node_modules/d3-shape/src/curve/catmullRomClosed.js
generated
vendored
Normal file
74
frontend/node_modules/d3-shape/src/curve/catmullRomClosed.js
generated
vendored
Normal file
@@ -0,0 +1,74 @@
|
||||
import {CardinalClosed} from "./cardinalClosed.js";
|
||||
import noop from "../noop.js";
|
||||
import {point} from "./catmullRom.js";
|
||||
|
||||
function CatmullRomClosed(context, alpha) {
|
||||
this._context = context;
|
||||
this._alpha = alpha;
|
||||
}
|
||||
|
||||
CatmullRomClosed.prototype = {
|
||||
areaStart: noop,
|
||||
areaEnd: noop,
|
||||
lineStart: function() {
|
||||
this._x0 = this._x1 = this._x2 = this._x3 = this._x4 = this._x5 =
|
||||
this._y0 = this._y1 = this._y2 = this._y3 = this._y4 = this._y5 = NaN;
|
||||
this._l01_a = this._l12_a = this._l23_a =
|
||||
this._l01_2a = this._l12_2a = this._l23_2a =
|
||||
this._point = 0;
|
||||
},
|
||||
lineEnd: function() {
|
||||
switch (this._point) {
|
||||
case 1: {
|
||||
this._context.moveTo(this._x3, this._y3);
|
||||
this._context.closePath();
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
this._context.lineTo(this._x3, this._y3);
|
||||
this._context.closePath();
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
this.point(this._x3, this._y3);
|
||||
this.point(this._x4, this._y4);
|
||||
this.point(this._x5, this._y5);
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
point: function(x, y) {
|
||||
x = +x, y = +y;
|
||||
|
||||
if (this._point) {
|
||||
var x23 = this._x2 - x,
|
||||
y23 = this._y2 - y;
|
||||
this._l23_a = Math.sqrt(this._l23_2a = Math.pow(x23 * x23 + y23 * y23, this._alpha));
|
||||
}
|
||||
|
||||
switch (this._point) {
|
||||
case 0: this._point = 1; this._x3 = x, this._y3 = y; break;
|
||||
case 1: this._point = 2; this._context.moveTo(this._x4 = x, this._y4 = y); break;
|
||||
case 2: this._point = 3; this._x5 = x, this._y5 = y; break;
|
||||
default: point(this, x, y); break;
|
||||
}
|
||||
|
||||
this._l01_a = this._l12_a, this._l12_a = this._l23_a;
|
||||
this._l01_2a = this._l12_2a, this._l12_2a = this._l23_2a;
|
||||
this._x0 = this._x1, this._x1 = this._x2, this._x2 = x;
|
||||
this._y0 = this._y1, this._y1 = this._y2, this._y2 = y;
|
||||
}
|
||||
};
|
||||
|
||||
export default (function custom(alpha) {
|
||||
|
||||
function catmullRom(context) {
|
||||
return alpha ? new CatmullRomClosed(context, alpha) : new CardinalClosed(context, 0);
|
||||
}
|
||||
|
||||
catmullRom.alpha = function(alpha) {
|
||||
return custom(+alpha);
|
||||
};
|
||||
|
||||
return catmullRom;
|
||||
})(0.5);
|
||||
25
frontend/node_modules/d3-shape/src/curve/linearClosed.js
generated
vendored
Normal file
25
frontend/node_modules/d3-shape/src/curve/linearClosed.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import noop from "../noop.js";
|
||||
|
||||
function LinearClosed(context) {
|
||||
this._context = context;
|
||||
}
|
||||
|
||||
LinearClosed.prototype = {
|
||||
areaStart: noop,
|
||||
areaEnd: noop,
|
||||
lineStart: function() {
|
||||
this._point = 0;
|
||||
},
|
||||
lineEnd: function() {
|
||||
if (this._point) this._context.closePath();
|
||||
},
|
||||
point: function(x, y) {
|
||||
x = +x, y = +y;
|
||||
if (this._point) this._context.lineTo(x, y);
|
||||
else this._point = 1, this._context.moveTo(x, y);
|
||||
}
|
||||
};
|
||||
|
||||
export default function(context) {
|
||||
return new LinearClosed(context);
|
||||
}
|
||||
36
frontend/node_modules/d3-shape/src/curve/radial.js
generated
vendored
Normal file
36
frontend/node_modules/d3-shape/src/curve/radial.js
generated
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
import curveLinear from "./linear.js";
|
||||
|
||||
export var curveRadialLinear = curveRadial(curveLinear);
|
||||
|
||||
function Radial(curve) {
|
||||
this._curve = curve;
|
||||
}
|
||||
|
||||
Radial.prototype = {
|
||||
areaStart: function() {
|
||||
this._curve.areaStart();
|
||||
},
|
||||
areaEnd: function() {
|
||||
this._curve.areaEnd();
|
||||
},
|
||||
lineStart: function() {
|
||||
this._curve.lineStart();
|
||||
},
|
||||
lineEnd: function() {
|
||||
this._curve.lineEnd();
|
||||
},
|
||||
point: function(a, r) {
|
||||
this._curve.point(r * Math.sin(a), r * -Math.cos(a));
|
||||
}
|
||||
};
|
||||
|
||||
export default function curveRadial(curve) {
|
||||
|
||||
function radial(context) {
|
||||
return new Radial(curve(context));
|
||||
}
|
||||
|
||||
radial._curve = curve;
|
||||
|
||||
return radial;
|
||||
}
|
||||
53
frontend/node_modules/d3-shape/src/curve/step.js
generated
vendored
Normal file
53
frontend/node_modules/d3-shape/src/curve/step.js
generated
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
function Step(context, t) {
|
||||
this._context = context;
|
||||
this._t = t;
|
||||
}
|
||||
|
||||
Step.prototype = {
|
||||
areaStart: function() {
|
||||
this._line = 0;
|
||||
},
|
||||
areaEnd: function() {
|
||||
this._line = NaN;
|
||||
},
|
||||
lineStart: function() {
|
||||
this._x = this._y = NaN;
|
||||
this._point = 0;
|
||||
},
|
||||
lineEnd: function() {
|
||||
if (0 < this._t && this._t < 1 && this._point === 2) this._context.lineTo(this._x, this._y);
|
||||
if (this._line || (this._line !== 0 && this._point === 1)) this._context.closePath();
|
||||
if (this._line >= 0) this._t = 1 - this._t, this._line = 1 - this._line;
|
||||
},
|
||||
point: function(x, y) {
|
||||
x = +x, y = +y;
|
||||
switch (this._point) {
|
||||
case 0: this._point = 1; this._line ? this._context.lineTo(x, y) : this._context.moveTo(x, y); break;
|
||||
case 1: this._point = 2; // falls through
|
||||
default: {
|
||||
if (this._t <= 0) {
|
||||
this._context.lineTo(this._x, y);
|
||||
this._context.lineTo(x, y);
|
||||
} else {
|
||||
var x1 = this._x * (1 - this._t) + x * this._t;
|
||||
this._context.lineTo(x1, this._y);
|
||||
this._context.lineTo(x1, y);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
this._x = x, this._y = y;
|
||||
}
|
||||
};
|
||||
|
||||
export default function(context) {
|
||||
return new Step(context, 0.5);
|
||||
}
|
||||
|
||||
export function stepBefore(context) {
|
||||
return new Step(context, 0);
|
||||
}
|
||||
|
||||
export function stepAfter(context) {
|
||||
return new Step(context, 1);
|
||||
}
|
||||
3
frontend/node_modules/d3-shape/src/descending.js
generated
vendored
Normal file
3
frontend/node_modules/d3-shape/src/descending.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function(a, b) {
|
||||
return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
|
||||
}
|
||||
3
frontend/node_modules/d3-shape/src/identity.js
generated
vendored
Normal file
3
frontend/node_modules/d3-shape/src/identity.js
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
export default function(d) {
|
||||
return d;
|
||||
}
|
||||
58
frontend/node_modules/d3-shape/src/line.js
generated
vendored
Normal file
58
frontend/node_modules/d3-shape/src/line.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import array from "./array.js";
|
||||
import constant from "./constant.js";
|
||||
import curveLinear from "./curve/linear.js";
|
||||
import {withPath} from "./path.js";
|
||||
import {x as pointX, y as pointY} from "./point.js";
|
||||
|
||||
export default function(x, y) {
|
||||
var defined = constant(true),
|
||||
context = null,
|
||||
curve = curveLinear,
|
||||
output = null,
|
||||
path = withPath(line);
|
||||
|
||||
x = typeof x === "function" ? x : (x === undefined) ? pointX : constant(x);
|
||||
y = typeof y === "function" ? y : (y === undefined) ? pointY : constant(y);
|
||||
|
||||
function line(data) {
|
||||
var i,
|
||||
n = (data = array(data)).length,
|
||||
d,
|
||||
defined0 = false,
|
||||
buffer;
|
||||
|
||||
if (context == null) output = curve(buffer = path());
|
||||
|
||||
for (i = 0; i <= n; ++i) {
|
||||
if (!(i < n && defined(d = data[i], i, data)) === defined0) {
|
||||
if (defined0 = !defined0) output.lineStart();
|
||||
else output.lineEnd();
|
||||
}
|
||||
if (defined0) output.point(+x(d, i, data), +y(d, i, data));
|
||||
}
|
||||
|
||||
if (buffer) return output = null, buffer + "" || null;
|
||||
}
|
||||
|
||||
line.x = function(_) {
|
||||
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), line) : x;
|
||||
};
|
||||
|
||||
line.y = function(_) {
|
||||
return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), line) : y;
|
||||
};
|
||||
|
||||
line.defined = function(_) {
|
||||
return arguments.length ? (defined = typeof _ === "function" ? _ : constant(!!_), line) : defined;
|
||||
};
|
||||
|
||||
line.curve = function(_) {
|
||||
return arguments.length ? (curve = _, context != null && (output = curve(context)), line) : curve;
|
||||
};
|
||||
|
||||
line.context = function(_) {
|
||||
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), line) : context;
|
||||
};
|
||||
|
||||
return line;
|
||||
}
|
||||
19
frontend/node_modules/d3-shape/src/lineRadial.js
generated
vendored
Normal file
19
frontend/node_modules/d3-shape/src/lineRadial.js
generated
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
import curveRadial, {curveRadialLinear} from "./curve/radial.js";
|
||||
import line from "./line.js";
|
||||
|
||||
export function lineRadial(l) {
|
||||
var c = l.curve;
|
||||
|
||||
l.angle = l.x, delete l.x;
|
||||
l.radius = l.y, delete l.y;
|
||||
|
||||
l.curve = function(_) {
|
||||
return arguments.length ? c(curveRadial(_)) : c()._curve;
|
||||
};
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
export default function() {
|
||||
return lineRadial(line().curve(curveRadialLinear));
|
||||
}
|
||||
73
frontend/node_modules/d3-shape/src/link.js
generated
vendored
Normal file
73
frontend/node_modules/d3-shape/src/link.js
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
import {slice} from "./array.js";
|
||||
import constant from "./constant.js";
|
||||
import {bumpX, bumpY, bumpRadial} from "./curve/bump.js";
|
||||
import {withPath} from "./path.js";
|
||||
import {x as pointX, y as pointY} from "./point.js";
|
||||
|
||||
function linkSource(d) {
|
||||
return d.source;
|
||||
}
|
||||
|
||||
function linkTarget(d) {
|
||||
return d.target;
|
||||
}
|
||||
|
||||
export function link(curve) {
|
||||
let source = linkSource,
|
||||
target = linkTarget,
|
||||
x = pointX,
|
||||
y = pointY,
|
||||
context = null,
|
||||
output = null,
|
||||
path = withPath(link);
|
||||
|
||||
function link() {
|
||||
let buffer;
|
||||
const argv = slice.call(arguments);
|
||||
const s = source.apply(this, argv);
|
||||
const t = target.apply(this, argv);
|
||||
if (context == null) output = curve(buffer = path());
|
||||
output.lineStart();
|
||||
argv[0] = s, output.point(+x.apply(this, argv), +y.apply(this, argv));
|
||||
argv[0] = t, output.point(+x.apply(this, argv), +y.apply(this, argv));
|
||||
output.lineEnd();
|
||||
if (buffer) return output = null, buffer + "" || null;
|
||||
}
|
||||
|
||||
link.source = function(_) {
|
||||
return arguments.length ? (source = _, link) : source;
|
||||
};
|
||||
|
||||
link.target = function(_) {
|
||||
return arguments.length ? (target = _, link) : target;
|
||||
};
|
||||
|
||||
link.x = function(_) {
|
||||
return arguments.length ? (x = typeof _ === "function" ? _ : constant(+_), link) : x;
|
||||
};
|
||||
|
||||
link.y = function(_) {
|
||||
return arguments.length ? (y = typeof _ === "function" ? _ : constant(+_), link) : y;
|
||||
};
|
||||
|
||||
link.context = function(_) {
|
||||
return arguments.length ? (_ == null ? context = output = null : output = curve(context = _), link) : context;
|
||||
};
|
||||
|
||||
return link;
|
||||
}
|
||||
|
||||
export function linkHorizontal() {
|
||||
return link(bumpX);
|
||||
}
|
||||
|
||||
export function linkVertical() {
|
||||
return link(bumpY);
|
||||
}
|
||||
|
||||
export function linkRadial() {
|
||||
const l = link(bumpRadial);
|
||||
l.angle = l.x, delete l.x;
|
||||
l.radius = l.y, delete l.y;
|
||||
return l;
|
||||
}
|
||||
1
frontend/node_modules/d3-shape/src/noop.js
generated
vendored
Normal file
1
frontend/node_modules/d3-shape/src/noop.js
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export default function() {}
|
||||
14
frontend/node_modules/d3-shape/src/offset/diverging.js
generated
vendored
Normal file
14
frontend/node_modules/d3-shape/src/offset/diverging.js
generated
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
export default function(series, order) {
|
||||
if (!((n = series.length) > 0)) return;
|
||||
for (var i, j = 0, d, dy, yp, yn, n, m = series[order[0]].length; j < m; ++j) {
|
||||
for (yp = yn = 0, i = 0; i < n; ++i) {
|
||||
if ((dy = (d = series[order[i]][j])[1] - d[0]) > 0) {
|
||||
d[0] = yp, d[1] = yp += dy;
|
||||
} else if (dy < 0) {
|
||||
d[1] = yn, d[0] = yn += dy;
|
||||
} else {
|
||||
d[0] = 0, d[1] = dy;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
frontend/node_modules/d3-shape/src/offset/expand.js
generated
vendored
Normal file
10
frontend/node_modules/d3-shape/src/offset/expand.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import none from "./none.js";
|
||||
|
||||
export default function(series, order) {
|
||||
if (!((n = series.length) > 0)) return;
|
||||
for (var i, n, j = 0, m = series[0].length, y; j < m; ++j) {
|
||||
for (y = i = 0; i < n; ++i) y += series[i][j][1] || 0;
|
||||
if (y) for (i = 0; i < n; ++i) series[i][j][1] /= y;
|
||||
}
|
||||
none(series, order);
|
||||
}
|
||||
10
frontend/node_modules/d3-shape/src/offset/silhouette.js
generated
vendored
Normal file
10
frontend/node_modules/d3-shape/src/offset/silhouette.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import none from "./none.js";
|
||||
|
||||
export default function(series, order) {
|
||||
if (!((n = series.length) > 0)) return;
|
||||
for (var j = 0, s0 = series[order[0]], n, m = s0.length; j < m; ++j) {
|
||||
for (var i = 0, y = 0; i < n; ++i) y += series[i][j][1] || 0;
|
||||
s0[j][1] += s0[j][0] = -y / 2;
|
||||
}
|
||||
none(series, order);
|
||||
}
|
||||
24
frontend/node_modules/d3-shape/src/offset/wiggle.js
generated
vendored
Normal file
24
frontend/node_modules/d3-shape/src/offset/wiggle.js
generated
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
import none from "./none.js";
|
||||
|
||||
export default function(series, order) {
|
||||
if (!((n = series.length) > 0) || !((m = (s0 = series[order[0]]).length) > 0)) return;
|
||||
for (var y = 0, j = 1, s0, m, n; j < m; ++j) {
|
||||
for (var i = 0, s1 = 0, s2 = 0; i < n; ++i) {
|
||||
var si = series[order[i]],
|
||||
sij0 = si[j][1] || 0,
|
||||
sij1 = si[j - 1][1] || 0,
|
||||
s3 = (sij0 - sij1) / 2;
|
||||
for (var k = 0; k < i; ++k) {
|
||||
var sk = series[order[k]],
|
||||
skj0 = sk[j][1] || 0,
|
||||
skj1 = sk[j - 1][1] || 0;
|
||||
s3 += skj0 - skj1;
|
||||
}
|
||||
s1 += sij0, s2 += s3 * sij0;
|
||||
}
|
||||
s0[j - 1][1] += s0[j - 1][0] = y;
|
||||
if (s1) y -= s2 / s1;
|
||||
}
|
||||
s0[j - 1][1] += s0[j - 1][0] = y;
|
||||
none(series, order);
|
||||
}
|
||||
5
frontend/node_modules/d3-shape/src/order/reverse.js
generated
vendored
Normal file
5
frontend/node_modules/d3-shape/src/order/reverse.js
generated
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
import none from "./none.js";
|
||||
|
||||
export default function(series) {
|
||||
return none(series).reverse();
|
||||
}
|
||||
80
frontend/node_modules/d3-shape/src/pie.js
generated
vendored
Normal file
80
frontend/node_modules/d3-shape/src/pie.js
generated
vendored
Normal file
@@ -0,0 +1,80 @@
|
||||
import array from "./array.js";
|
||||
import constant from "./constant.js";
|
||||
import descending from "./descending.js";
|
||||
import identity from "./identity.js";
|
||||
import {tau} from "./math.js";
|
||||
|
||||
export default function() {
|
||||
var value = identity,
|
||||
sortValues = descending,
|
||||
sort = null,
|
||||
startAngle = constant(0),
|
||||
endAngle = constant(tau),
|
||||
padAngle = constant(0);
|
||||
|
||||
function pie(data) {
|
||||
var i,
|
||||
n = (data = array(data)).length,
|
||||
j,
|
||||
k,
|
||||
sum = 0,
|
||||
index = new Array(n),
|
||||
arcs = new Array(n),
|
||||
a0 = +startAngle.apply(this, arguments),
|
||||
da = Math.min(tau, Math.max(-tau, endAngle.apply(this, arguments) - a0)),
|
||||
a1,
|
||||
p = Math.min(Math.abs(da) / n, padAngle.apply(this, arguments)),
|
||||
pa = p * (da < 0 ? -1 : 1),
|
||||
v;
|
||||
|
||||
for (i = 0; i < n; ++i) {
|
||||
if ((v = arcs[index[i] = i] = +value(data[i], i, data)) > 0) {
|
||||
sum += v;
|
||||
}
|
||||
}
|
||||
|
||||
// Optionally sort the arcs by previously-computed values or by data.
|
||||
if (sortValues != null) index.sort(function(i, j) { return sortValues(arcs[i], arcs[j]); });
|
||||
else if (sort != null) index.sort(function(i, j) { return sort(data[i], data[j]); });
|
||||
|
||||
// Compute the arcs! They are stored in the original data's order.
|
||||
for (i = 0, k = sum ? (da - n * pa) / sum : 0; i < n; ++i, a0 = a1) {
|
||||
j = index[i], v = arcs[j], a1 = a0 + (v > 0 ? v * k : 0) + pa, arcs[j] = {
|
||||
data: data[j],
|
||||
index: i,
|
||||
value: v,
|
||||
startAngle: a0,
|
||||
endAngle: a1,
|
||||
padAngle: p
|
||||
};
|
||||
}
|
||||
|
||||
return arcs;
|
||||
}
|
||||
|
||||
pie.value = function(_) {
|
||||
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), pie) : value;
|
||||
};
|
||||
|
||||
pie.sortValues = function(_) {
|
||||
return arguments.length ? (sortValues = _, sort = null, pie) : sortValues;
|
||||
};
|
||||
|
||||
pie.sort = function(_) {
|
||||
return arguments.length ? (sort = _, sortValues = null, pie) : sort;
|
||||
};
|
||||
|
||||
pie.startAngle = function(_) {
|
||||
return arguments.length ? (startAngle = typeof _ === "function" ? _ : constant(+_), pie) : startAngle;
|
||||
};
|
||||
|
||||
pie.endAngle = function(_) {
|
||||
return arguments.length ? (endAngle = typeof _ === "function" ? _ : constant(+_), pie) : endAngle;
|
||||
};
|
||||
|
||||
pie.padAngle = function(_) {
|
||||
return arguments.length ? (padAngle = typeof _ === "function" ? _ : constant(+_), pie) : padAngle;
|
||||
};
|
||||
|
||||
return pie;
|
||||
}
|
||||
58
frontend/node_modules/d3-shape/src/stack.js
generated
vendored
Normal file
58
frontend/node_modules/d3-shape/src/stack.js
generated
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
import array from "./array.js";
|
||||
import constant from "./constant.js";
|
||||
import offsetNone from "./offset/none.js";
|
||||
import orderNone from "./order/none.js";
|
||||
|
||||
function stackValue(d, key) {
|
||||
return d[key];
|
||||
}
|
||||
|
||||
function stackSeries(key) {
|
||||
const series = [];
|
||||
series.key = key;
|
||||
return series;
|
||||
}
|
||||
|
||||
export default function() {
|
||||
var keys = constant([]),
|
||||
order = orderNone,
|
||||
offset = offsetNone,
|
||||
value = stackValue;
|
||||
|
||||
function stack(data) {
|
||||
var sz = Array.from(keys.apply(this, arguments), stackSeries),
|
||||
i, n = sz.length, j = -1,
|
||||
oz;
|
||||
|
||||
for (const d of data) {
|
||||
for (i = 0, ++j; i < n; ++i) {
|
||||
(sz[i][j] = [0, +value(d, sz[i].key, j, data)]).data = d;
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0, oz = array(order(sz)); i < n; ++i) {
|
||||
sz[oz[i]].index = i;
|
||||
}
|
||||
|
||||
offset(sz, oz);
|
||||
return sz;
|
||||
}
|
||||
|
||||
stack.keys = function(_) {
|
||||
return arguments.length ? (keys = typeof _ === "function" ? _ : constant(Array.from(_)), stack) : keys;
|
||||
};
|
||||
|
||||
stack.value = function(_) {
|
||||
return arguments.length ? (value = typeof _ === "function" ? _ : constant(+_), stack) : value;
|
||||
};
|
||||
|
||||
stack.order = function(_) {
|
||||
return arguments.length ? (order = _ == null ? orderNone : typeof _ === "function" ? _ : constant(Array.from(_)), stack) : order;
|
||||
};
|
||||
|
||||
stack.offset = function(_) {
|
||||
return arguments.length ? (offset = _ == null ? offsetNone : _, stack) : offset;
|
||||
};
|
||||
|
||||
return stack;
|
||||
}
|
||||
17
frontend/node_modules/d3-shape/src/symbol/asterisk.js
generated
vendored
Normal file
17
frontend/node_modules/d3-shape/src/symbol/asterisk.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
import {min, sqrt} from "../math.js";
|
||||
|
||||
const sqrt3 = sqrt(3);
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const r = sqrt(size + min(size / 28, 0.75)) * 0.59436;
|
||||
const t = r / 2;
|
||||
const u = t * sqrt3;
|
||||
context.moveTo(0, r);
|
||||
context.lineTo(0, -r);
|
||||
context.moveTo(-u, -t);
|
||||
context.lineTo(u, t);
|
||||
context.moveTo(-u, t);
|
||||
context.lineTo(u, -t);
|
||||
}
|
||||
};
|
||||
9
frontend/node_modules/d3-shape/src/symbol/circle.js
generated
vendored
Normal file
9
frontend/node_modules/d3-shape/src/symbol/circle.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import {pi, sqrt, tau} from "../math.js";
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const r = sqrt(size / pi);
|
||||
context.moveTo(r, 0);
|
||||
context.arc(0, 0, r, 0, tau);
|
||||
}
|
||||
};
|
||||
16
frontend/node_modules/d3-shape/src/symbol/diamond.js
generated
vendored
Normal file
16
frontend/node_modules/d3-shape/src/symbol/diamond.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
import {sqrt} from "../math.js";
|
||||
|
||||
const tan30 = sqrt(1 / 3);
|
||||
const tan30_2 = tan30 * 2;
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const y = sqrt(size / tan30_2);
|
||||
const x = y * tan30;
|
||||
context.moveTo(0, -y);
|
||||
context.lineTo(x, 0);
|
||||
context.lineTo(0, y);
|
||||
context.lineTo(-x, 0);
|
||||
context.closePath();
|
||||
}
|
||||
};
|
||||
9
frontend/node_modules/d3-shape/src/symbol/square.js
generated
vendored
Normal file
9
frontend/node_modules/d3-shape/src/symbol/square.js
generated
vendored
Normal file
@@ -0,0 +1,9 @@
|
||||
import {sqrt} from "../math.js";
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const w = sqrt(size);
|
||||
const x = -w / 2;
|
||||
context.rect(x, x, w, w);
|
||||
}
|
||||
};
|
||||
12
frontend/node_modules/d3-shape/src/symbol/square2.js
generated
vendored
Normal file
12
frontend/node_modules/d3-shape/src/symbol/square2.js
generated
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
import {sqrt} from "../math.js";
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const r = sqrt(size) * 0.4431;
|
||||
context.moveTo(r, r);
|
||||
context.lineTo(r, -r);
|
||||
context.lineTo(-r, -r);
|
||||
context.lineTo(-r, r);
|
||||
context.closePath();
|
||||
}
|
||||
};
|
||||
11
frontend/node_modules/d3-shape/src/symbol/times.js
generated
vendored
Normal file
11
frontend/node_modules/d3-shape/src/symbol/times.js
generated
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
import {min, sqrt} from "../math.js";
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const r = sqrt(size - min(size / 6, 1.7)) * 0.6189;
|
||||
context.moveTo(-r, -r);
|
||||
context.lineTo(r, r);
|
||||
context.moveTo(-r, r);
|
||||
context.lineTo(r, -r);
|
||||
}
|
||||
};
|
||||
25
frontend/node_modules/d3-shape/src/symbol/wye.js
generated
vendored
Normal file
25
frontend/node_modules/d3-shape/src/symbol/wye.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import {sqrt} from "../math.js";
|
||||
|
||||
const c = -0.5;
|
||||
const s = sqrt(3) / 2;
|
||||
const k = 1 / sqrt(12);
|
||||
const a = (k / 2 + 1) * 3;
|
||||
|
||||
export default {
|
||||
draw(context, size) {
|
||||
const r = sqrt(size / a);
|
||||
const x0 = r / 2, y0 = r * k;
|
||||
const x1 = x0, y1 = r * k + r;
|
||||
const x2 = -x1, y2 = y1;
|
||||
context.moveTo(x0, y0);
|
||||
context.lineTo(x1, y1);
|
||||
context.lineTo(x2, y2);
|
||||
context.lineTo(c * x0 - s * y0, s * x0 + c * y0);
|
||||
context.lineTo(c * x1 - s * y1, s * x1 + c * y1);
|
||||
context.lineTo(c * x2 - s * y2, s * x2 + c * y2);
|
||||
context.lineTo(c * x0 + s * y0, c * y0 - s * x0);
|
||||
context.lineTo(c * x1 + s * y1, c * y1 - s * x1);
|
||||
context.lineTo(c * x2 + s * y2, c * y2 - s * x2);
|
||||
context.closePath();
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user