svelteplot 0.4.10 → 0.5.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/Mark.svelte +87 -73
- package/dist/Mark.svelte.d.ts +36 -34
- package/dist/marks/Area.svelte.d.ts +36 -34
- package/dist/marks/AreaX.svelte.d.ts +36 -34
- package/dist/marks/Arrow.svelte.d.ts +36 -34
- package/dist/marks/AxisX.svelte.d.ts +36 -34
- package/dist/marks/AxisY.svelte.d.ts +36 -34
- package/dist/marks/BarX.svelte.d.ts +36 -34
- package/dist/marks/BarY.svelte.d.ts +36 -34
- package/dist/marks/BollingerX.svelte.d.ts +36 -34
- package/dist/marks/BollingerY.svelte.d.ts +36 -34
- package/dist/marks/BoxY.svelte.d.ts +36 -34
- package/dist/marks/Cell.svelte.d.ts +36 -34
- package/dist/marks/CustomMark.svelte.d.ts +36 -34
- package/dist/marks/CustomMarkHTML.svelte.d.ts +1 -1
- package/dist/marks/DifferenceY.svelte.d.ts +36 -34
- package/dist/marks/Dot.svelte +1 -1
- package/dist/marks/Dot.svelte.d.ts +36 -34
- package/dist/marks/DotX.svelte.d.ts +36 -34
- package/dist/marks/DotY.svelte.d.ts +36 -34
- package/dist/marks/Geo.svelte.d.ts +36 -34
- package/dist/marks/GridX.svelte.d.ts +36 -34
- package/dist/marks/GridY.svelte.d.ts +36 -34
- package/dist/marks/Line.svelte.d.ts +36 -34
- package/dist/marks/LineX.svelte.d.ts +36 -34
- package/dist/marks/LineY.svelte.d.ts +36 -34
- package/dist/marks/Link.svelte.d.ts +36 -34
- package/dist/marks/Rect.svelte.d.ts +36 -34
- package/dist/marks/RuleX.svelte.d.ts +36 -34
- package/dist/marks/RuleY.svelte.d.ts +36 -34
- package/dist/marks/Spike.svelte.d.ts +36 -34
- package/dist/marks/Text.svelte.d.ts +37 -35
- package/dist/marks/TickX.svelte.d.ts +36 -34
- package/dist/marks/TickY.svelte.d.ts +36 -34
- package/dist/marks/Vector.svelte.d.ts +36 -34
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +72 -68
- package/dist/marks/helpers/RectPath.svelte.d.ts +36 -34
- package/dist/transforms/bollinger.d.ts +2 -0
- package/dist/transforms/dodge.d.ts +17 -0
- package/dist/transforms/dodge.js +128 -0
- package/dist/transforms/interval.d.ts +4 -0
- package/dist/transforms/select.d.ts +14 -0
- package/dist/transforms/sort.d.ts +8 -0
- package/dist/transforms/window.d.ts +4 -0
- package/dist/types/mark.d.ts +37 -34
- package/package.json +2 -1
|
@@ -10,12 +10,14 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
10
10
|
width: number;
|
|
11
11
|
height: number;
|
|
12
12
|
options: BaseRectMarkProps<Datum> & Partial<{
|
|
13
|
-
filter
|
|
14
|
-
facet
|
|
13
|
+
filter: import("../../types/index.js").ConstantAccessor<boolean, Datum>;
|
|
14
|
+
facet: "auto" | "include" | "exclude";
|
|
15
15
|
fx: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
16
16
|
fy: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
17
17
|
dx: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
18
18
|
dy: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
19
|
+
dodgeX: import("../../transforms/dodge.js").DodgeXOptions;
|
|
20
|
+
dodgeY: import("../../transforms/dodge.js").DodgeYOptions;
|
|
19
21
|
fill: import("../../types/index.js").ChannelAccessor<Datum>;
|
|
20
22
|
fillOpacity: import("../../types/index.js").ConstantAccessor<number, Datum>;
|
|
21
23
|
sort: ((a: import("../../types/data.js").RawValue, b: import("../../types/data.js").RawValue) => number) | {
|
|
@@ -36,38 +38,38 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
36
38
|
imageFilter: import("../../types/index.js").ConstantAccessor<string, Datum>;
|
|
37
39
|
shapeRendering: import("../../types/index.js").ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
38
40
|
paintOrder: import("../../types/index.js").ConstantAccessor<string, Datum>;
|
|
39
|
-
onclick
|
|
40
|
-
ondblclick
|
|
41
|
-
onmouseup
|
|
42
|
-
onmousedown
|
|
43
|
-
onmouseenter
|
|
44
|
-
onmousemove
|
|
45
|
-
onmouseleave
|
|
46
|
-
onmouseout
|
|
47
|
-
onmouseover
|
|
48
|
-
onpointercancel
|
|
49
|
-
onpointerdown
|
|
50
|
-
onpointerup
|
|
51
|
-
onpointerenter
|
|
52
|
-
onpointerleave
|
|
53
|
-
onpointermove
|
|
54
|
-
onpointerover
|
|
55
|
-
onpointerout
|
|
56
|
-
ondrag
|
|
57
|
-
ondrop
|
|
58
|
-
ondragstart
|
|
59
|
-
ondragenter
|
|
60
|
-
ondragleave
|
|
61
|
-
ondragover
|
|
62
|
-
ondragend
|
|
63
|
-
ontouchstart
|
|
64
|
-
ontouchmove
|
|
65
|
-
ontouchend
|
|
66
|
-
ontouchcancel
|
|
67
|
-
oncontextmenu
|
|
68
|
-
onwheel
|
|
69
|
-
class
|
|
70
|
-
style
|
|
41
|
+
onclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
42
|
+
ondblclick: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
43
|
+
onmouseup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
44
|
+
onmousedown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
45
|
+
onmouseenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
46
|
+
onmousemove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
47
|
+
onmouseleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
48
|
+
onmouseout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
49
|
+
onmouseover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
50
|
+
onpointercancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
51
|
+
onpointerdown: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
52
|
+
onpointerup: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
53
|
+
onpointerenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
54
|
+
onpointerleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
55
|
+
onpointermove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
56
|
+
onpointerover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
57
|
+
onpointerout: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
58
|
+
ondrag: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
59
|
+
ondrop: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
60
|
+
ondragstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
61
|
+
ondragenter: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
62
|
+
ondragleave: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
63
|
+
ondragover: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
64
|
+
ondragend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
65
|
+
ontouchstart: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
66
|
+
ontouchmove: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
67
|
+
ontouchend: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
68
|
+
ontouchcancel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
69
|
+
oncontextmenu: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
70
|
+
onwheel: import("svelte/elements.js").MouseEventHandler<SVGPathElement>;
|
|
71
|
+
class: string;
|
|
72
|
+
style: string;
|
|
71
73
|
cursor: import("../../types/index.js").ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
72
74
|
}>;
|
|
73
75
|
/**
|
|
@@ -18,6 +18,8 @@ export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: Tran
|
|
|
18
18
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
19
19
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
20
20
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
21
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
22
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
21
23
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
22
24
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
23
25
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ScaledDataRecord, TransformArg, PlotState } from '../types';
|
|
2
|
+
type BaseDodgeOptions = {
|
|
3
|
+
anchor?: string;
|
|
4
|
+
padding?: number;
|
|
5
|
+
r?: number;
|
|
6
|
+
};
|
|
7
|
+
type AnchorX = 'left' | 'right' | 'middle';
|
|
8
|
+
type AnchorY = 'top' | 'bottom' | 'middle';
|
|
9
|
+
export type DodgeXOptions = AnchorX | (BaseDodgeOptions & {
|
|
10
|
+
anchor?: 'left' | 'right' | 'middle';
|
|
11
|
+
});
|
|
12
|
+
export type DodgeYOptions = AnchorY | (BaseDodgeOptions & {
|
|
13
|
+
anchor?: 'top' | 'bottom' | 'middle';
|
|
14
|
+
});
|
|
15
|
+
export declare function dodgeX(args: TransformArg<ScaledDataRecord>, plotState: PlotState): ScaledDataRecord[];
|
|
16
|
+
export declare function dodgeY(args: TransformArg<ScaledDataRecord>, plotState: PlotState): ScaledDataRecord[];
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import IntervalTree from 'interval-tree-1d';
|
|
2
|
+
import { groupFacetsAndZ } from '../helpers/group';
|
|
3
|
+
export function dodgeX(args, plotState) {
|
|
4
|
+
if (!args.dodgeX)
|
|
5
|
+
return args.data;
|
|
6
|
+
let { anchor = 'left', padding = 1, r = args.dodgeX.r } = maybeAnchor(args.dodgeX);
|
|
7
|
+
let anchorFunction;
|
|
8
|
+
switch (`${anchor}`.toLowerCase()) {
|
|
9
|
+
case 'left':
|
|
10
|
+
anchorFunction = anchorXLeft;
|
|
11
|
+
break;
|
|
12
|
+
case 'right':
|
|
13
|
+
anchorFunction = anchorXRight;
|
|
14
|
+
break;
|
|
15
|
+
case 'middle':
|
|
16
|
+
anchorFunction = anchorXMiddle;
|
|
17
|
+
break;
|
|
18
|
+
default:
|
|
19
|
+
throw new Error(`unknown dodge anchor: ${anchor}`);
|
|
20
|
+
}
|
|
21
|
+
return dodge('x', 'y', anchorFunction, Number(padding), r, args, plotState);
|
|
22
|
+
}
|
|
23
|
+
export function dodgeY(args, plotState) {
|
|
24
|
+
if (!args.dodgeY)
|
|
25
|
+
return args.data;
|
|
26
|
+
let { anchor = 'bottom', padding = 1, r = args.dodgeY.r } = maybeAnchor(args.dodgeY);
|
|
27
|
+
let anchorFunction;
|
|
28
|
+
switch (`${anchor}`.toLowerCase()) {
|
|
29
|
+
case 'top':
|
|
30
|
+
anchorFunction = anchorYTop;
|
|
31
|
+
break;
|
|
32
|
+
case 'bottom':
|
|
33
|
+
anchorFunction = anchorYBottom;
|
|
34
|
+
break;
|
|
35
|
+
case 'middle':
|
|
36
|
+
anchorFunction = anchorYMiddle;
|
|
37
|
+
break;
|
|
38
|
+
default:
|
|
39
|
+
throw new Error(`unknown dodge anchor: ${anchor}`);
|
|
40
|
+
}
|
|
41
|
+
return dodge('y', 'x', anchorFunction, Number(padding), r, args, plotState);
|
|
42
|
+
}
|
|
43
|
+
function dodge(y, x, anchor, padding, r, { data, ...channels }, plotState) {
|
|
44
|
+
if (r != null && typeof r !== 'number') {
|
|
45
|
+
// use the r channel
|
|
46
|
+
// let { channels, sort, reverse } = options;
|
|
47
|
+
// channels = maybeNamed(channels);
|
|
48
|
+
// if (channels?.r === undefined)
|
|
49
|
+
// options = { ...options, channels: { ...channels, r: { value: r, scale: 'r' } } };
|
|
50
|
+
// if (sort === undefined && reverse === undefined) options.sort = { channel: '-r' };
|
|
51
|
+
}
|
|
52
|
+
const { fx, fy } = channels;
|
|
53
|
+
let [ky, ty] = anchor(plotState);
|
|
54
|
+
const compare = ky ? compareAscending : compareSymmetric;
|
|
55
|
+
const cr = r !== undefined ? r : 3; // default radius if no r channel
|
|
56
|
+
// group data by facets
|
|
57
|
+
groupFacetsAndZ(data, { fx, fy }, (items) => {
|
|
58
|
+
// apply dodge within each facet
|
|
59
|
+
const tree = IntervalTree();
|
|
60
|
+
const data = items.filter((d) => (typeof d.r !== 'number' || d.r >= 0) && isFinite(d[x]) && isFinite(d[y]));
|
|
61
|
+
const intervals = new Float64Array(2 * data.length + 2);
|
|
62
|
+
data.forEach((d, i) => {
|
|
63
|
+
const ri = d.r ?? r ?? 3;
|
|
64
|
+
const y0 = ky ? ri + padding : 0; // offset baseline for varying radius
|
|
65
|
+
const l = d[x] - ri;
|
|
66
|
+
const h = d[x] + ri;
|
|
67
|
+
// The first two positions are 0 to test placing the dot on the baseline.
|
|
68
|
+
let k = 2;
|
|
69
|
+
// For any previously placed circles that may overlap this circle, compute
|
|
70
|
+
// the y-positions that place this circle tangent to these other circles.
|
|
71
|
+
// https://observablehq.com/@mbostock/circle-offset-along-line
|
|
72
|
+
tree.queryInterval(l - padding, h + padding, ([, , j]) => {
|
|
73
|
+
const yj = data[j][y] - y0;
|
|
74
|
+
const dx = d[x] - data[j][x];
|
|
75
|
+
const dr = padding + (channels.r ? d.r + data[j].r : 2 * cr);
|
|
76
|
+
const dy = Math.sqrt(dr * dr - dx * dx);
|
|
77
|
+
intervals[k++] = yj - dy;
|
|
78
|
+
intervals[k++] = yj + dy;
|
|
79
|
+
});
|
|
80
|
+
// Find the best y-value where this circle can fit.
|
|
81
|
+
let candidates = intervals.slice(0, k);
|
|
82
|
+
if (ky)
|
|
83
|
+
candidates = candidates.filter((y) => y >= 0);
|
|
84
|
+
out: for (const diff of candidates.sort(compare)) {
|
|
85
|
+
for (let j = 0; j < k; j += 2) {
|
|
86
|
+
if (intervals[j] + 1e-6 < diff && diff < intervals[j + 1] - 1e-6) {
|
|
87
|
+
continue out;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
d[y] = diff + y0;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
// Insert the placed circle into the interval tree.
|
|
94
|
+
tree.insert([l, h, i]);
|
|
95
|
+
});
|
|
96
|
+
if (!ky)
|
|
97
|
+
ky = 1;
|
|
98
|
+
data.forEach((d) => (d[y] = d[y] * ky + ty));
|
|
99
|
+
});
|
|
100
|
+
return data;
|
|
101
|
+
}
|
|
102
|
+
function maybeAnchor(anchor) {
|
|
103
|
+
return typeof anchor === 'string' ? { anchor } : anchor;
|
|
104
|
+
}
|
|
105
|
+
function anchorXLeft({ options: { marginLeft } }) {
|
|
106
|
+
return [1, marginLeft];
|
|
107
|
+
}
|
|
108
|
+
function anchorXRight({ facetWidth: width, options: { marginLeft } }) {
|
|
109
|
+
return [-1, marginLeft + width];
|
|
110
|
+
}
|
|
111
|
+
function anchorXMiddle({ facetWidth: width, options: { marginLeft } }) {
|
|
112
|
+
return [0, marginLeft + width / 2];
|
|
113
|
+
}
|
|
114
|
+
function anchorYTop({ options: { marginTop } }) {
|
|
115
|
+
return [1, marginTop];
|
|
116
|
+
}
|
|
117
|
+
function anchorYBottom({ facetHeight: height }) {
|
|
118
|
+
return [-1, height];
|
|
119
|
+
}
|
|
120
|
+
function anchorYMiddle({ facetHeight: height, options: { marginTop, marginBottom } }) {
|
|
121
|
+
return [0, (marginTop + height) / 2];
|
|
122
|
+
}
|
|
123
|
+
function compareSymmetric(a, b) {
|
|
124
|
+
return Math.abs(a) - Math.abs(b);
|
|
125
|
+
}
|
|
126
|
+
function compareAscending(a, b) {
|
|
127
|
+
return a - b;
|
|
128
|
+
}
|
|
@@ -8,6 +8,8 @@ export declare function intervalX<T>(args: TransformArg<T>, { plot }: {
|
|
|
8
8
|
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
9
9
|
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
10
10
|
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
11
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
12
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
11
13
|
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
12
14
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
13
15
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -72,6 +74,8 @@ export declare function intervalY<T>(args: TransformArg<T>, { plot }: {
|
|
|
72
74
|
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
73
75
|
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
74
76
|
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
77
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
78
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
75
79
|
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
76
80
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
77
81
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -12,6 +12,8 @@ export declare function select({ data, ...channels }: TransformArg<DataRecord>,
|
|
|
12
12
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
13
13
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
14
14
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
15
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
16
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
15
17
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
16
18
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
17
19
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -77,6 +79,8 @@ export declare function selectFirst(args: TransformArg<DataRecord>): {
|
|
|
77
79
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
78
80
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
79
81
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
82
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
83
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
80
84
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
81
85
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
82
86
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -142,6 +146,8 @@ export declare function selectLast(args: TransformArg<DataRecord>): {
|
|
|
142
146
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
143
147
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
144
148
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
149
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
150
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
145
151
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
146
152
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
147
153
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -204,6 +210,8 @@ export declare function selectMinX(args: TransformArg<DataRecord>): {
|
|
|
204
210
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
205
211
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
206
212
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
213
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
214
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
207
215
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
208
216
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
209
217
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -266,6 +274,8 @@ export declare function selectMaxX(args: TransformArg<DataRecord>): {
|
|
|
266
274
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
267
275
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
268
276
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
277
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
278
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
269
279
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
270
280
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
271
281
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -328,6 +338,8 @@ export declare function selectMinY(args: TransformArg<DataRecord>): {
|
|
|
328
338
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
329
339
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
330
340
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
341
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
342
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
331
343
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
332
344
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
333
345
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -390,6 +402,8 @@ export declare function selectMaxY(args: TransformArg<DataRecord>): {
|
|
|
390
402
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
391
403
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
392
404
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
405
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
406
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
393
407
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
394
408
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
395
409
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -15,6 +15,8 @@ export declare function sort<T>({ data, ...channels }: TransformArg<T>, options?
|
|
|
15
15
|
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
16
16
|
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
17
17
|
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
18
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
19
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
18
20
|
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
19
21
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
20
22
|
stroke?: import("../types/index.js").ChannelAccessor<T>;
|
|
@@ -74,6 +76,8 @@ export declare function sort<T>({ data, ...channels }: TransformArg<T>, options?
|
|
|
74
76
|
fy?: import("../types/index.js").ChannelAccessor<T>;
|
|
75
77
|
dx?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
76
78
|
dy?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
79
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
80
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
77
81
|
fill?: import("../types/index.js").ChannelAccessor<T>;
|
|
78
82
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, T>;
|
|
79
83
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -143,6 +147,8 @@ export declare function shuffle({ data, ...channels }: TransformArg<DataRow[]>,
|
|
|
143
147
|
fy?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
144
148
|
dx?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
145
149
|
dy?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
150
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
151
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
146
152
|
fill?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
147
153
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
148
154
|
stroke?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
@@ -206,6 +212,8 @@ export declare function reverse({ data, ...channels }: TransformArg<DataRow[]>):
|
|
|
206
212
|
fy?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
207
213
|
dx?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
208
214
|
dy?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
215
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
216
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
209
217
|
fill?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
210
218
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, DataRow[]>;
|
|
211
219
|
stroke?: import("../types/index.js").ChannelAccessor<DataRow[]>;
|
|
@@ -14,6 +14,8 @@ export declare function windowX(args: TransformArg<DataRecord>, options: WindowO
|
|
|
14
14
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
15
15
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
16
16
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
17
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
18
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
17
19
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
18
20
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
19
21
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
|
@@ -79,6 +81,8 @@ export declare function windowY(args: TransformArg<DataRecord>, options: WindowO
|
|
|
79
81
|
fy?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
80
82
|
dx?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
81
83
|
dy?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
84
|
+
dodgeX?: import("./dodge").DodgeXOptions | undefined;
|
|
85
|
+
dodgeY?: import("./dodge").DodgeYOptions | undefined;
|
|
82
86
|
fill?: import("../types/index.js").ChannelAccessor<Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
83
87
|
fillOpacity?: import("../types/index.js").ConstantAccessor<number, Record<string | symbol, import("../types/index.js").RawValue>>;
|
|
84
88
|
sort?: ((a: import("../types/index.js").RawValue, b: import("../types/index.js").RawValue) => number) | {
|
package/dist/types/mark.d.ts
CHANGED
|
@@ -12,16 +12,19 @@ import type { MouseEventHandler } from 'svelte/elements';
|
|
|
12
12
|
import type { ChannelAccessor, ConstantAccessor, DataRecord, RawValue } from './index.js';
|
|
13
13
|
import type * as CSS from 'csstype';
|
|
14
14
|
import type { ScaledChannelName, ScaleName } from './scale.js';
|
|
15
|
+
import type { DodgeXOptions, DodgeYOptions } from '../transforms/dodge.js';
|
|
15
16
|
export type BaseMarkProps<T> = Partial<{
|
|
16
17
|
/**
|
|
17
18
|
* Filter the data without modifying the inferred scales
|
|
18
19
|
*/
|
|
19
|
-
filter
|
|
20
|
-
facet
|
|
20
|
+
filter: ConstantAccessor<boolean, T>;
|
|
21
|
+
facet: 'auto' | 'include' | 'exclude';
|
|
21
22
|
fx: ChannelAccessor<T>;
|
|
22
23
|
fy: ChannelAccessor<T>;
|
|
23
24
|
dx: ConstantAccessor<number, T>;
|
|
24
25
|
dy: ConstantAccessor<number, T>;
|
|
26
|
+
dodgeX: DodgeXOptions;
|
|
27
|
+
dodgeY: DodgeYOptions;
|
|
25
28
|
fill: ChannelAccessor<T>;
|
|
26
29
|
fillOpacity: ConstantAccessor<number, T>;
|
|
27
30
|
sort: string | ConstantAccessor<RawValue, T> | ((a: RawValue, b: RawValue) => number) | {
|
|
@@ -44,44 +47,44 @@ export type BaseMarkProps<T> = Partial<{
|
|
|
44
47
|
imageFilter: ConstantAccessor<string, T>;
|
|
45
48
|
shapeRendering: ConstantAccessor<CSS.Property.ShapeRendering, T>;
|
|
46
49
|
paintOrder: ConstantAccessor<string, T>;
|
|
47
|
-
onclick
|
|
48
|
-
ondblclick
|
|
49
|
-
onmouseup
|
|
50
|
-
onmousedown
|
|
51
|
-
onmouseenter
|
|
52
|
-
onmousemove
|
|
53
|
-
onmouseleave
|
|
54
|
-
onmouseout
|
|
55
|
-
onmouseover
|
|
56
|
-
onpointercancel
|
|
57
|
-
onpointerdown
|
|
58
|
-
onpointerup
|
|
59
|
-
onpointerenter
|
|
60
|
-
onpointerleave
|
|
61
|
-
onpointermove
|
|
62
|
-
onpointerover
|
|
63
|
-
onpointerout
|
|
64
|
-
ondrag
|
|
65
|
-
ondrop
|
|
66
|
-
ondragstart
|
|
67
|
-
ondragenter
|
|
68
|
-
ondragleave
|
|
69
|
-
ondragover
|
|
70
|
-
ondragend
|
|
71
|
-
ontouchstart
|
|
72
|
-
ontouchmove
|
|
73
|
-
ontouchend
|
|
74
|
-
ontouchcancel
|
|
75
|
-
oncontextmenu
|
|
76
|
-
onwheel
|
|
50
|
+
onclick: MouseEventHandler<SVGPathElement>;
|
|
51
|
+
ondblclick: MouseEventHandler<SVGPathElement>;
|
|
52
|
+
onmouseup: MouseEventHandler<SVGPathElement>;
|
|
53
|
+
onmousedown: MouseEventHandler<SVGPathElement>;
|
|
54
|
+
onmouseenter: MouseEventHandler<SVGPathElement>;
|
|
55
|
+
onmousemove: MouseEventHandler<SVGPathElement>;
|
|
56
|
+
onmouseleave: MouseEventHandler<SVGPathElement>;
|
|
57
|
+
onmouseout: MouseEventHandler<SVGPathElement>;
|
|
58
|
+
onmouseover: MouseEventHandler<SVGPathElement>;
|
|
59
|
+
onpointercancel: MouseEventHandler<SVGPathElement>;
|
|
60
|
+
onpointerdown: MouseEventHandler<SVGPathElement>;
|
|
61
|
+
onpointerup: MouseEventHandler<SVGPathElement>;
|
|
62
|
+
onpointerenter: MouseEventHandler<SVGPathElement>;
|
|
63
|
+
onpointerleave: MouseEventHandler<SVGPathElement>;
|
|
64
|
+
onpointermove: MouseEventHandler<SVGPathElement>;
|
|
65
|
+
onpointerover: MouseEventHandler<SVGPathElement>;
|
|
66
|
+
onpointerout: MouseEventHandler<SVGPathElement>;
|
|
67
|
+
ondrag: MouseEventHandler<SVGPathElement>;
|
|
68
|
+
ondrop: MouseEventHandler<SVGPathElement>;
|
|
69
|
+
ondragstart: MouseEventHandler<SVGPathElement>;
|
|
70
|
+
ondragenter: MouseEventHandler<SVGPathElement>;
|
|
71
|
+
ondragleave: MouseEventHandler<SVGPathElement>;
|
|
72
|
+
ondragover: MouseEventHandler<SVGPathElement>;
|
|
73
|
+
ondragend: MouseEventHandler<SVGPathElement>;
|
|
74
|
+
ontouchstart: MouseEventHandler<SVGPathElement>;
|
|
75
|
+
ontouchmove: MouseEventHandler<SVGPathElement>;
|
|
76
|
+
ontouchend: MouseEventHandler<SVGPathElement>;
|
|
77
|
+
ontouchcancel: MouseEventHandler<SVGPathElement>;
|
|
78
|
+
oncontextmenu: MouseEventHandler<SVGPathElement>;
|
|
79
|
+
onwheel: MouseEventHandler<SVGPathElement>;
|
|
77
80
|
/**
|
|
78
81
|
* if you want to give your mark element an extra CSS class
|
|
79
82
|
*/
|
|
80
|
-
class
|
|
83
|
+
class: string;
|
|
81
84
|
/**
|
|
82
85
|
* if you want to give your mark element an extra inline style
|
|
83
86
|
*/
|
|
84
|
-
style
|
|
87
|
+
style: string;
|
|
85
88
|
cursor: ConstantAccessor<CSS.Property.Cursor, T>;
|
|
86
89
|
}>;
|
|
87
90
|
export type LinkableMarkProps<T> = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "svelteplot",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Gregor Aisch",
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"d3-time": "^3.1.0",
|
|
111
111
|
"es-toolkit": "^1.39.10",
|
|
112
112
|
"fast-equals": "^5.3.2",
|
|
113
|
+
"interval-tree-1d": "^1.0.4",
|
|
113
114
|
"merge-deep": "^3.0.3",
|
|
114
115
|
"svelte": "5.39.8"
|
|
115
116
|
},
|