svelteplot 0.4.6 → 0.4.7-pr-219.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/Plot.svelte +54 -31
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/scales.d.ts +2 -2
- package/dist/helpers/scales.js +21 -10
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/hooks/plotDefaults.d.ts +3 -0
- package/dist/hooks/plotDefaults.js +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/marks/Area.svelte +2 -1
- package/dist/marks/AreaX.svelte +4 -3
- package/dist/marks/AreaX.svelte.d.ts +2 -1
- package/dist/marks/AreaY.svelte +4 -5
- package/dist/marks/Arrow.svelte +3 -2
- package/dist/marks/AxisX.svelte +3 -4
- package/dist/marks/AxisX.svelte.d.ts +1 -1
- package/dist/marks/AxisY.svelte +3 -4
- package/dist/marks/AxisY.svelte.d.ts +6 -7
- package/dist/marks/BarX.svelte +4 -4
- package/dist/marks/BarX.svelte.d.ts +1 -1
- package/dist/marks/BarY.svelte +3 -3
- package/dist/marks/BollingerX.svelte.d.ts +2 -74
- package/dist/marks/BollingerY.svelte.d.ts +2 -74
- package/dist/marks/BoxX.svelte +4 -4
- package/dist/marks/BoxY.svelte +4 -4
- package/dist/marks/BoxY.svelte.d.ts +1 -0
- package/dist/marks/Brush.svelte +13 -7
- package/dist/marks/Brush.svelte.d.ts +10 -1
- package/dist/marks/BrushX.svelte +4 -4
- package/dist/marks/BrushY.svelte +4 -4
- package/dist/marks/Cell.svelte +3 -4
- package/dist/marks/ColorLegend.svelte +5 -4
- package/dist/marks/CustomMark.svelte.d.ts +2 -81
- package/dist/marks/DifferenceY.svelte +3 -3
- package/dist/marks/DifferenceY.svelte.d.ts +7 -67
- package/dist/marks/Dot.svelte +2 -2
- package/dist/marks/Frame.svelte +2 -2
- package/dist/marks/Geo.svelte +2 -2
- package/dist/marks/Graticule.svelte +3 -3
- package/dist/marks/GridX.svelte +3 -3
- package/dist/marks/GridY.svelte +4 -9
- package/dist/marks/Line.svelte +3 -2
- package/dist/marks/Line.svelte.d.ts +2 -2
- package/dist/marks/LineX.svelte.d.ts +2 -1
- package/dist/marks/LineY.svelte.d.ts +2 -1
- package/dist/marks/Link.svelte +3 -3
- package/dist/marks/Pointer.svelte +3 -3
- package/dist/marks/Rect.svelte +2 -3
- package/dist/marks/RectX.svelte +4 -3
- package/dist/marks/RectY.svelte +4 -3
- package/dist/marks/RuleX.svelte +3 -3
- package/dist/marks/RuleY.svelte +4 -4
- package/dist/marks/Sphere.svelte +2 -2
- package/dist/marks/Spike.svelte +4 -3
- package/dist/marks/Text.svelte +4 -4
- package/dist/marks/TickX.svelte +3 -3
- package/dist/marks/TickY.svelte +4 -4
- package/dist/marks/Vector.svelte +3 -3
- package/dist/marks/helpers/CanvasLayer.svelte +1 -1
- package/dist/marks/helpers/Marker.svelte +2 -1
- package/dist/marks/helpers/MarkerPath.svelte +4 -4
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +17 -2
- package/dist/marks/helpers/RectPath.svelte.d.ts +3 -63
- package/dist/marks/helpers/Regression.svelte +1 -1
- package/dist/regression/exponential.d.ts +17 -0
- package/dist/regression/exponential.js +56 -0
- package/dist/regression/index.d.ts +10 -0
- package/dist/regression/index.js +10 -0
- package/dist/regression/linear.d.ts +17 -0
- package/dist/regression/linear.js +59 -0
- package/dist/regression/loess.d.ts +14 -0
- package/dist/regression/loess.js +122 -0
- package/dist/regression/logarithmic.d.ts +20 -0
- package/dist/regression/logarithmic.js +60 -0
- package/dist/regression/polynomial.d.ts +21 -0
- package/dist/regression/polynomial.js +160 -0
- package/dist/regression/power.d.ts +18 -0
- package/dist/regression/power.js +56 -0
- package/dist/regression/quadratic.d.ts +19 -0
- package/dist/regression/quadratic.js +70 -0
- package/dist/regression/types.d.ts +4 -0
- package/dist/regression/types.js +1 -0
- package/dist/regression/utils/determination.d.ts +6 -0
- package/dist/regression/utils/determination.js +16 -0
- package/dist/regression/utils/geometry.d.ts +9 -0
- package/dist/regression/utils/geometry.js +12 -0
- package/dist/regression/utils/interpose.d.ts +6 -0
- package/dist/regression/utils/interpose.js +37 -0
- package/dist/regression/utils/median.d.ts +4 -0
- package/dist/regression/utils/median.js +8 -0
- package/dist/regression/utils/ols.d.ts +6 -0
- package/dist/regression/utils/ols.js +9 -0
- package/dist/regression/utils/points.d.ts +11 -0
- package/dist/regression/utils/points.js +45 -0
- package/dist/transforms/bollinger.d.ts +1 -67
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -124
- package/dist/transforms/recordize.d.ts +1 -4
- package/dist/transforms/select.d.ts +7 -434
- package/dist/transforms/sort.d.ts +3 -246
- package/dist/transforms/stack.d.ts +3 -23
- package/dist/transforms/window.d.ts +2 -130
- package/dist/types/plot.d.ts +15 -8
- package/dist/types/scale.d.ts +6 -0
- package/package.json +128 -128
- package/dist/marks/AreaY.svelte.d.ts +0 -99
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from https://github.com/HarryStevens/d3-regression
|
|
3
|
+
*/
|
|
4
|
+
import { determination } from './utils/determination.js';
|
|
5
|
+
import { interpose } from './utils/interpose.js';
|
|
6
|
+
import { points, visitPoints } from './utils/points.js';
|
|
7
|
+
export default function quadratic() {
|
|
8
|
+
let x = (d) => d[0], y = (d) => d[1], domain;
|
|
9
|
+
const quadraticRegression = function quadraticRegression(data) {
|
|
10
|
+
const [xv, yv, ux, uy] = points(data, (dd) => x(dd), (dd) => y(dd));
|
|
11
|
+
const n = xv.length;
|
|
12
|
+
let X2 = 0, X3 = 0, X4 = 0, XY = 0, X2Y = 0, i, dx, dy, x2;
|
|
13
|
+
for (i = 0; i < n;) {
|
|
14
|
+
dx = xv[i];
|
|
15
|
+
dy = yv[i++];
|
|
16
|
+
x2 = dx * dx;
|
|
17
|
+
X2 += (x2 - X2) / i;
|
|
18
|
+
X3 += (x2 * dx - X3) / i;
|
|
19
|
+
X4 += (x2 * x2 - X4) / i;
|
|
20
|
+
XY += (dx * dy - XY) / i;
|
|
21
|
+
X2Y += (x2 * dy - X2Y) / i;
|
|
22
|
+
}
|
|
23
|
+
let Y = 0, n0 = 0, xmin = domain ? +domain[0] : Infinity, xmax = domain ? +domain[1] : -Infinity;
|
|
24
|
+
visitPoints(data, x, y, (dx2, dy2) => {
|
|
25
|
+
n0++;
|
|
26
|
+
Y += (dy2 - Y) / n0;
|
|
27
|
+
if (!domain) {
|
|
28
|
+
if (dx2 < xmin)
|
|
29
|
+
xmin = dx2;
|
|
30
|
+
if (dx2 > xmax)
|
|
31
|
+
xmax = dx2;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const X2X2 = X4 - X2 * X2;
|
|
35
|
+
const d = X2 * X2X2 - X3 * X3;
|
|
36
|
+
const a = (X2Y * X2 - XY * X3) / d;
|
|
37
|
+
const b = (XY * X2X2 - X2Y * X3) / d;
|
|
38
|
+
const c = -a * X2;
|
|
39
|
+
const fn = (xx) => {
|
|
40
|
+
const shifted = xx - ux;
|
|
41
|
+
return a * shifted * shifted + b * shifted + c + uy;
|
|
42
|
+
};
|
|
43
|
+
const out = interpose(xmin, xmax, fn);
|
|
44
|
+
out.a = a;
|
|
45
|
+
out.b = b - 2 * a * ux;
|
|
46
|
+
out.c = c - b * ux + a * ux * ux + uy;
|
|
47
|
+
out.predict = fn;
|
|
48
|
+
out.rSquared = determination(data, x, y, Y, fn);
|
|
49
|
+
return out;
|
|
50
|
+
};
|
|
51
|
+
quadraticRegression.domain = function (arr) {
|
|
52
|
+
if (!arguments.length)
|
|
53
|
+
return domain;
|
|
54
|
+
domain = arr;
|
|
55
|
+
return quadraticRegression;
|
|
56
|
+
};
|
|
57
|
+
quadraticRegression.x = function (fn) {
|
|
58
|
+
if (!arguments.length)
|
|
59
|
+
return x;
|
|
60
|
+
x = fn;
|
|
61
|
+
return quadraticRegression;
|
|
62
|
+
};
|
|
63
|
+
quadraticRegression.y = function (fn) {
|
|
64
|
+
if (!arguments.length)
|
|
65
|
+
return y;
|
|
66
|
+
y = fn;
|
|
67
|
+
return quadraticRegression;
|
|
68
|
+
};
|
|
69
|
+
return quadraticRegression;
|
|
70
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Accessor, PredictFunction } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Given a dataset, x- and y-accessors, the mean center of the y-values (uY),
|
|
4
|
+
* and a prediction function, return the coefficient of determination, R^2.
|
|
5
|
+
*/
|
|
6
|
+
export declare function determination<T>(data: T[], x: Accessor<T>, y: Accessor<T>, uY: number, predict: PredictFunction): number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { visitPoints } from './points';
|
|
2
|
+
/**
|
|
3
|
+
* Given a dataset, x- and y-accessors, the mean center of the y-values (uY),
|
|
4
|
+
* and a prediction function, return the coefficient of determination, R^2.
|
|
5
|
+
*/
|
|
6
|
+
export function determination(data, x, y, uY, predict) {
|
|
7
|
+
let SSE = 0, // Sum of Squared Errors
|
|
8
|
+
SST = 0; // Total Sum of Squares
|
|
9
|
+
visitPoints(data, x, y, (dx, dy) => {
|
|
10
|
+
const sse = dy - predict(dx);
|
|
11
|
+
const sst = dy - uY;
|
|
12
|
+
SSE += sse * sse;
|
|
13
|
+
SST += sst * sst;
|
|
14
|
+
});
|
|
15
|
+
return 1 - SSE / SST;
|
|
16
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DataPoint } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the angle of a line in degrees.
|
|
4
|
+
*/
|
|
5
|
+
export declare function angle(line: [DataPoint, DataPoint]): number;
|
|
6
|
+
/**
|
|
7
|
+
* Returns the midpoint of a line.
|
|
8
|
+
*/
|
|
9
|
+
export declare function midpoint(line: [DataPoint, DataPoint]): DataPoint;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the angle of a line in degrees.
|
|
3
|
+
*/
|
|
4
|
+
export function angle(line) {
|
|
5
|
+
return Math.atan2(line[1][1] - line[0][1], line[1][0] - line[0][0]) * (180 / Math.PI);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Returns the midpoint of a line.
|
|
9
|
+
*/
|
|
10
|
+
export function midpoint(line) {
|
|
11
|
+
return [(line[0][0] + line[1][0]) / 2, (line[0][1] + line[1][1]) / 2];
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { PredictFunction, DataPoint } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Given a start point (xmin), an end point (xmax),
|
|
4
|
+
* and a prediction function, returns a smooth line.
|
|
5
|
+
*/
|
|
6
|
+
export declare function interpose(xmin: number, xmax: number, predict: PredictFunction): [DataPoint, DataPoint];
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { angle, midpoint } from './geometry';
|
|
2
|
+
/**
|
|
3
|
+
* Given a start point (xmin), an end point (xmax),
|
|
4
|
+
* and a prediction function, returns a smooth line.
|
|
5
|
+
*/
|
|
6
|
+
export function interpose(xmin, xmax, predict) {
|
|
7
|
+
const l = (Math.log(xmax - xmin) * Math.LOG10E + 1) | 0;
|
|
8
|
+
const precision = Math.pow(10, -l / 2 - 1);
|
|
9
|
+
const maxIter = 1e4;
|
|
10
|
+
let points = [px(xmin), px(xmax)];
|
|
11
|
+
let iter = 0;
|
|
12
|
+
while (find(points) && iter < maxIter)
|
|
13
|
+
;
|
|
14
|
+
return points;
|
|
15
|
+
function px(x) {
|
|
16
|
+
return [x, predict(x)];
|
|
17
|
+
}
|
|
18
|
+
function find(points) {
|
|
19
|
+
iter++;
|
|
20
|
+
const n = points.length;
|
|
21
|
+
let found = false;
|
|
22
|
+
for (let i = 0; i < n - 1; i++) {
|
|
23
|
+
const p0 = points[i];
|
|
24
|
+
const p1 = points[i + 1];
|
|
25
|
+
const m = midpoint([p0, p1]);
|
|
26
|
+
const mp = px(m[0]);
|
|
27
|
+
const a0 = angle([p0, m]);
|
|
28
|
+
const a1 = angle([p0, mp]);
|
|
29
|
+
const a = Math.abs(a0 - a1);
|
|
30
|
+
if (a > precision) {
|
|
31
|
+
points.splice(i + 1, 0, mp);
|
|
32
|
+
found = true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return found;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordinary Least Squares from vega-statistics by Jeffrey Heer
|
|
3
|
+
* License: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/LICENSE
|
|
4
|
+
* Source: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/packages/vega-statistics/src/regression/ols.js
|
|
5
|
+
*/
|
|
6
|
+
export declare function ols(uX: number, uY: number, uXY: number, uX2: number): [number, number];
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ordinary Least Squares from vega-statistics by Jeffrey Heer
|
|
3
|
+
* License: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/LICENSE
|
|
4
|
+
* Source: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/packages/vega-statistics/src/regression/ols.js
|
|
5
|
+
*/
|
|
6
|
+
export function ols(uX, uY, uXY, uX2) {
|
|
7
|
+
const delta = uX2 - uX * uX, slope = Math.abs(delta) < 1e-24 ? 0 : (uXY - uX * uY) / delta, intercept = uY - slope * uX;
|
|
8
|
+
return [intercept, slope];
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Accessor } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Adapted from vega-statistics by Jeffrey Heer
|
|
4
|
+
* License: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/LICENSE
|
|
5
|
+
* Source: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/packages/vega-statistics/src/regression/points.js
|
|
6
|
+
*/
|
|
7
|
+
export declare function points<T>(data: T[], x: Accessor<T>, y: Accessor<T>, sort?: boolean): [Float64Array, Float64Array, number, number];
|
|
8
|
+
/**
|
|
9
|
+
* Iterates over valid data points, invoking a callback for each.
|
|
10
|
+
*/
|
|
11
|
+
export declare function visitPoints<T>(data: T[], x: Accessor<T>, y: Accessor<T>, cb: (dx: number, dy: number, index: number) => void): void;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adapted from vega-statistics by Jeffrey Heer
|
|
3
|
+
* License: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/LICENSE
|
|
4
|
+
* Source: https://github.com/vega/vega/blob/f058b099decad9db78301405dd0d2e9d8ba3d51a/packages/vega-statistics/src/regression/points.js
|
|
5
|
+
*/
|
|
6
|
+
export function points(data, x, y, sort) {
|
|
7
|
+
data = data.filter((d, i) => {
|
|
8
|
+
let u = x(d, i), v = y(d, i);
|
|
9
|
+
return u != null && isFinite(u) && v != null && isFinite(v);
|
|
10
|
+
});
|
|
11
|
+
if (sort) {
|
|
12
|
+
data.sort((a, b) => x(a) - x(b));
|
|
13
|
+
}
|
|
14
|
+
const n = data.length, X = new Float64Array(n), Y = new Float64Array(n);
|
|
15
|
+
// extract values, calculate means
|
|
16
|
+
let ux = 0, uy = 0, xv, yv, d;
|
|
17
|
+
for (let i = 0; i < n;) {
|
|
18
|
+
d = data[i];
|
|
19
|
+
X[i] = xv = +x(d, i, data);
|
|
20
|
+
Y[i] = yv = +y(d, i, data);
|
|
21
|
+
++i;
|
|
22
|
+
ux += (xv - ux) / i;
|
|
23
|
+
uy += (yv - uy) / i;
|
|
24
|
+
}
|
|
25
|
+
// mean center the data
|
|
26
|
+
for (let i = 0; i < n; ++i) {
|
|
27
|
+
X[i] -= ux;
|
|
28
|
+
Y[i] -= uy;
|
|
29
|
+
}
|
|
30
|
+
return [X, Y, ux, uy];
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Iterates over valid data points, invoking a callback for each.
|
|
34
|
+
*/
|
|
35
|
+
export function visitPoints(data, x, y, cb) {
|
|
36
|
+
let iterations = 0;
|
|
37
|
+
for (let i = 0; i < data.length; i++) {
|
|
38
|
+
const d = data[i];
|
|
39
|
+
const dx = +x(d, i, data);
|
|
40
|
+
const dy = +y(d, i, data);
|
|
41
|
+
if (dx != null && isFinite(dx) && dy != null && isFinite(dy)) {
|
|
42
|
+
cb(dx, dy, iterations++);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -11,70 +11,4 @@ export type BollingerOptions = {
|
|
|
11
11
|
};
|
|
12
12
|
export declare function bollingerX(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
|
|
13
13
|
export declare function bollingerY(args: TransformArg<DataRecord>, options?: BollingerOptions): TransformArg<DataRecord>;
|
|
14
|
-
export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions):
|
|
15
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
16
|
-
facet?: "auto" | "include" | "exclude" | undefined;
|
|
17
|
-
fx?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
18
|
-
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
19
|
-
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
20
|
-
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
21
|
-
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
22
|
-
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
23
|
-
sort?: {
|
|
24
|
-
channel: string;
|
|
25
|
-
order?: "ascending" | "descending";
|
|
26
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
27
|
-
stroke?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
28
|
-
strokeWidth?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
29
|
-
strokeOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
30
|
-
strokeLinejoin?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
31
|
-
strokeLinecap?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
32
|
-
strokeMiterlimit?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
33
|
-
opacity?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
34
|
-
strokeDasharray?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
35
|
-
strokeDashoffset?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
36
|
-
mixBlendMode?: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
37
|
-
clipPath?: string | undefined;
|
|
38
|
-
imageFilter?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
39
|
-
shapeRendering?: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
40
|
-
paintOrder?: import("../types/index.js").ConstantAccessor<string, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
41
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
42
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
43
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
44
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
45
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
46
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
47
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
48
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
49
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
50
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
51
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
52
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
53
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
54
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
55
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
56
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
57
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
58
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
59
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
60
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
61
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
62
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
63
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
64
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
65
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
66
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
67
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
68
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
69
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
70
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
71
|
-
class?: string | undefined;
|
|
72
|
-
style?: string | undefined;
|
|
73
|
-
cursor?: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
74
|
-
data: {
|
|
75
|
-
__x: import("../types/index.js").RawValue;
|
|
76
|
-
__lo: number;
|
|
77
|
-
__avg: number;
|
|
78
|
-
__hi: number;
|
|
79
|
-
}[];
|
|
80
|
-
};
|
|
14
|
+
export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions): any;
|
|
@@ -38,29 +38,21 @@ type GroupZOptions = GroupXOptions | GroupYOptions;
|
|
|
38
38
|
* groups the dataset by x and y channel and optionally reduces the group items
|
|
39
39
|
* to output channels fill, stroke, r, opacity, fillOpacity, or strokeOpacity
|
|
40
40
|
*/
|
|
41
|
-
export declare function group({ data, ...channels }: TransformArg<T, DataRecord>, options?: GroupXOptions):
|
|
42
|
-
data: Record<string | symbol, RawValue>[];
|
|
43
|
-
};
|
|
41
|
+
export declare function group({ data, ...channels }: TransformArg<T, DataRecord>, options?: GroupXOptions): any;
|
|
44
42
|
/**
|
|
45
43
|
* groups the dataset by the x channel and optionally reduces the group items
|
|
46
44
|
* to output channels y, y1, y2, fill, stroke, r, opacity, fillOpacity, or strokeOpacity
|
|
47
45
|
*/
|
|
48
|
-
export declare function groupX(input: TransformArg<T, DataRecord>, options?: GroupXOptions):
|
|
49
|
-
data: Record<string | symbol, RawValue>[];
|
|
50
|
-
};
|
|
46
|
+
export declare function groupX(input: TransformArg<T, DataRecord>, options?: GroupXOptions): any;
|
|
51
47
|
/**
|
|
52
48
|
* groups the dataset by the y channel and optionally reduces the group items
|
|
53
49
|
* to output channels x, x1, x2, fill, stroke, r, opacity, fillOpacity, or strokeOpacity
|
|
54
50
|
*/
|
|
55
|
-
export declare function groupY(input: TransformArg<T, DataRecord>, options?: GroupYOptions):
|
|
56
|
-
data: Record<string | symbol, RawValue>[];
|
|
57
|
-
};
|
|
51
|
+
export declare function groupY(input: TransformArg<T, DataRecord>, options?: GroupYOptions): any;
|
|
58
52
|
/**
|
|
59
53
|
* groups the dataset by the z channel and optionally reduces the group items
|
|
60
54
|
* to output channels x, x1, x2, y, y1, y2, fill, stroke, r, opacity, fillOpacity,
|
|
61
55
|
* or strokeOpacity
|
|
62
56
|
*/
|
|
63
|
-
export declare function groupZ(input: TransformArg<T, DataRecord>, options?: GroupZOptions):
|
|
64
|
-
data: Record<string | symbol, RawValue>[];
|
|
65
|
-
};
|
|
57
|
+
export declare function groupZ(input: TransformArg<T, DataRecord>, options?: GroupZOptions): any;
|
|
66
58
|
export {};
|
|
@@ -1,129 +1,7 @@
|
|
|
1
1
|
import type { PlotState, TransformArg } from '../types/index.js';
|
|
2
2
|
export declare function intervalX<T>(args: TransformArg<T>, { plot }: {
|
|
3
3
|
plot: PlotState;
|
|
4
|
-
}):
|
|
5
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, T>;
|
|
6
|
-
facet?: "auto" | "include" | "exclude" | undefined;
|
|
7
|
-
fx?: import("../types/index.js").ChannelAccessor<T>;
|
|
8
|
-
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
9
|
-
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
10
|
-
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
11
|
-
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
12
|
-
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
13
|
-
sort?: {
|
|
14
|
-
channel: string;
|
|
15
|
-
order?: "ascending" | "descending";
|
|
16
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, T>;
|
|
17
|
-
stroke?: import("../types/index.js").ChannelAccessor<T>;
|
|
18
|
-
strokeWidth?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
19
|
-
strokeOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
20
|
-
strokeLinejoin?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, T>;
|
|
21
|
-
strokeLinecap?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, T>;
|
|
22
|
-
strokeMiterlimit?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
23
|
-
opacity?: import("../types/index.js").ChannelAccessor<T>;
|
|
24
|
-
strokeDasharray?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
25
|
-
strokeDashoffset?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
26
|
-
mixBlendMode?: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, T>;
|
|
27
|
-
clipPath?: string | undefined;
|
|
28
|
-
imageFilter?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
29
|
-
shapeRendering?: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, T>;
|
|
30
|
-
paintOrder?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
31
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
32
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
33
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
34
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
35
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
36
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
37
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
38
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
39
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
40
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
41
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
42
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
43
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
44
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
45
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
46
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
47
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
48
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
49
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
50
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
51
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
52
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
53
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
54
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
55
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
56
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
57
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
58
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
59
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
60
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
61
|
-
class?: string | undefined;
|
|
62
|
-
style?: string | undefined;
|
|
63
|
-
cursor?: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, T>;
|
|
64
|
-
data: T[];
|
|
65
|
-
};
|
|
4
|
+
}): any;
|
|
66
5
|
export declare function intervalY<T>(args: TransformArg<T>, { plot }: {
|
|
67
6
|
plot: PlotState;
|
|
68
|
-
}):
|
|
69
|
-
filter?: import("../types/index.js").ConstantAccessor<boolean, T>;
|
|
70
|
-
facet?: "auto" | "include" | "exclude" | undefined;
|
|
71
|
-
fx?: import("../types/index.js").ChannelAccessor<T>;
|
|
72
|
-
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
73
|
-
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
74
|
-
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
75
|
-
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
76
|
-
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
77
|
-
sort?: {
|
|
78
|
-
channel: string;
|
|
79
|
-
order?: "ascending" | "descending";
|
|
80
|
-
} | ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | import("../types/index.js").ConstantAccessor<import("../types/index.js").RawValue, T>;
|
|
81
|
-
stroke?: import("../types/index.js").ChannelAccessor<T>;
|
|
82
|
-
strokeWidth?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
83
|
-
strokeOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
84
|
-
strokeLinejoin?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinejoin, T>;
|
|
85
|
-
strokeLinecap?: import("../types/index.js").ConstantAccessor<import("csstype").Property.StrokeLinecap, T>;
|
|
86
|
-
strokeMiterlimit?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
87
|
-
opacity?: import("../types/index.js").ChannelAccessor<T>;
|
|
88
|
-
strokeDasharray?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
89
|
-
strokeDashoffset?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
90
|
-
mixBlendMode?: import("../types/index.js").ConstantAccessor<import("csstype").Property.MixBlendMode, T>;
|
|
91
|
-
clipPath?: string | undefined;
|
|
92
|
-
imageFilter?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
93
|
-
shapeRendering?: import("../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, T>;
|
|
94
|
-
paintOrder?: import("../types/index.js").ConstantAccessor<string, T>;
|
|
95
|
-
onclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
96
|
-
ondblclick?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
97
|
-
onmouseup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
98
|
-
onmousedown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
99
|
-
onmouseenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
100
|
-
onmousemove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
101
|
-
onmouseleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
102
|
-
onmouseout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
103
|
-
onmouseover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
104
|
-
onpointercancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
105
|
-
onpointerdown?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
106
|
-
onpointerup?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
107
|
-
onpointerenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
108
|
-
onpointerleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
109
|
-
onpointermove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
110
|
-
onpointerover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
111
|
-
onpointerout?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
112
|
-
ondrag?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
113
|
-
ondrop?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
114
|
-
ondragstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
115
|
-
ondragenter?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
116
|
-
ondragleave?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
117
|
-
ondragover?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
118
|
-
ondragend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
119
|
-
ontouchstart?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
120
|
-
ontouchmove?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
121
|
-
ontouchend?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
122
|
-
ontouchcancel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
123
|
-
oncontextmenu?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
124
|
-
onwheel?: import("svelte/elements").MouseEventHandler<SVGPathElement> | undefined;
|
|
125
|
-
class?: string | undefined;
|
|
126
|
-
style?: string | undefined;
|
|
127
|
-
cursor?: import("../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, T>;
|
|
128
|
-
data: T[];
|
|
129
|
-
};
|
|
7
|
+
}): any;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import type { TransformArgsRow, TransformArgsRecord } from '../types/index.js';
|
|
2
|
-
import { INDEX } from '../constants';
|
|
3
2
|
export declare const X: unique symbol;
|
|
4
3
|
export declare const Y: unique symbol;
|
|
5
4
|
export declare const RAW_VALUE: unique symbol;
|
|
6
|
-
export declare function indexData<T extends object>(data: T[]): (T & {
|
|
7
|
-
[INDEX]: number;
|
|
8
|
-
})[];
|
|
5
|
+
export declare function indexData<T extends object>(data: T[]): (T & {})[];
|
|
9
6
|
export declare function recordizeX<T>({ data, ...channels }: TransformArgsRow<T>, { withIndex }?: {
|
|
10
7
|
withIndex: boolean;
|
|
11
8
|
}): TransformArgsRecord<T>;
|