svelteplot 0.2.8 → 0.2.9-pr-95.1
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/Plot.svelte +81 -69
- package/dist/core/Plot.svelte +1 -1
- package/dist/helpers/autoTicks.js +9 -8
- package/dist/helpers/colors.d.ts +1 -1
- package/dist/helpers/index.d.ts +2 -2
- package/dist/helpers/scales.d.ts +1 -1
- package/dist/helpers/scales.js +18 -1
- package/dist/helpers/typeChecks.d.ts +4 -4
- package/dist/marks/AxisX.svelte +33 -6
- package/dist/marks/AxisX.svelte.d.ts +12 -1
- package/dist/marks/AxisY.svelte +32 -4
- package/dist/marks/AxisY.svelte.d.ts +12 -1
- package/dist/marks/BollingerX.svelte.d.ts +1 -1
- package/dist/marks/BollingerY.svelte.d.ts +1 -1
- package/dist/marks/Sphere.svelte.d.ts +1 -56
- package/dist/marks/helpers/BaseAxisX.svelte +59 -53
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +1 -0
- package/dist/marks/helpers/BaseAxisY.svelte +24 -18
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +1 -0
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +1 -41
- package/dist/transforms/bollinger.d.ts +1 -8
- package/dist/transforms/centroid.d.ts +1 -8
- package/dist/transforms/group.d.ts +4 -12
- package/dist/transforms/interval.d.ts +2 -6
- package/dist/transforms/map.d.ts +4 -10
- package/dist/transforms/normalize.d.ts +2 -6
- package/dist/transforms/select.d.ts +7 -21
- package/dist/transforms/sort.d.ts +3 -16
- package/dist/transforms/window.d.ts +2 -14
- package/dist/ui/ExamplesGrid.svelte +64 -0
- package/dist/ui/ExamplesGrid.svelte.d.ts +11 -0
- package/package.json +121 -117
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
dy: ConstantAccessor<number>;
|
|
34
34
|
filter: ChannelAccessor;
|
|
35
35
|
};
|
|
36
|
+
text: boolean;
|
|
36
37
|
plot: PlotState;
|
|
37
38
|
};
|
|
38
39
|
|
|
@@ -50,7 +51,8 @@
|
|
|
50
51
|
height,
|
|
51
52
|
options,
|
|
52
53
|
plot,
|
|
53
|
-
title
|
|
54
|
+
title,
|
|
55
|
+
text = true
|
|
54
56
|
}: BaseAxisXProps = $props();
|
|
55
57
|
|
|
56
58
|
function splitTick(tick: string | string[]) {
|
|
@@ -86,15 +88,17 @@
|
|
|
86
88
|
})
|
|
87
89
|
);
|
|
88
90
|
const T = tickObjects.length;
|
|
89
|
-
|
|
90
|
-
let
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
91
|
+
if (text) {
|
|
92
|
+
for (let i = 0; i < T; i++) {
|
|
93
|
+
let j = i;
|
|
94
|
+
// find the preceding tick that was not hidden
|
|
95
|
+
do {
|
|
96
|
+
j--;
|
|
97
|
+
} while (j >= 0 && tickObjects[j].hidden);
|
|
98
|
+
if (j >= 0) {
|
|
99
|
+
const tickLabelSpace = Math.abs(tickObjects[i].x - tickObjects[j].x);
|
|
100
|
+
tickObjects[i].hidden = tickLabelSpace < 15;
|
|
101
|
+
}
|
|
98
102
|
}
|
|
99
103
|
}
|
|
100
104
|
return tickObjects;
|
|
@@ -102,6 +106,7 @@
|
|
|
102
106
|
|
|
103
107
|
$effect(() => {
|
|
104
108
|
untrack(() => [$autoMarginTop, $autoMarginBottom]);
|
|
109
|
+
if (!text) return;
|
|
105
110
|
const outsideTextAnchor = anchor === 'top' ? 'end' : 'start';
|
|
106
111
|
// measure tick label heights
|
|
107
112
|
const maxLabelHeight =
|
|
@@ -144,26 +149,7 @@
|
|
|
144
149
|
<g class="axis-x">
|
|
145
150
|
{#each positionedTicks as tick, t (t)}
|
|
146
151
|
{#if testFilter(tick.value, options) && !tick.hidden}
|
|
147
|
-
{@const textLines = tick.text}
|
|
148
|
-
{@const prevTextLines = t && positionedTicks[t - 1].text}
|
|
149
|
-
{@const fontSize = resolveProp(tickFontSize, tick)}
|
|
150
152
|
{@const tickClass_ = resolveProp(tickClass, tick.value)}
|
|
151
|
-
{@const estLabelWidth = max(textLines.map((t) => t.length)) * fontSize * 0.2}
|
|
152
|
-
{@const moveDown =
|
|
153
|
-
(tickSize + tickPadding + (tickRotate !== 0 ? tickFontSize * 0.35 : 0)) *
|
|
154
|
-
(anchor === 'bottom' ? 1 : -1)}
|
|
155
|
-
{@const [textStyle, textClass] = resolveStyles(
|
|
156
|
-
plot,
|
|
157
|
-
tick,
|
|
158
|
-
{
|
|
159
|
-
fontVariant: isQuantitative ? 'tabular-nums' : 'normal',
|
|
160
|
-
...options,
|
|
161
|
-
fontSize: tickFontSize,
|
|
162
|
-
stroke: null
|
|
163
|
-
},
|
|
164
|
-
'fill',
|
|
165
|
-
{ x: true }
|
|
166
|
-
)}
|
|
167
153
|
<g
|
|
168
154
|
class="tick {tickClass_ || ''}"
|
|
169
155
|
transform="translate({tick.x + tick.dx}, {tickY + tick.dy})"
|
|
@@ -182,31 +168,51 @@
|
|
|
182
168
|
y2={anchor === 'bottom' ? tickSize : -tickSize} />
|
|
183
169
|
{/if}
|
|
184
170
|
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
171
|
+
{#if text}
|
|
172
|
+
{@const textLines = tick.text}
|
|
173
|
+
{@const prevTextLines = t && positionedTicks[t - 1].text}
|
|
174
|
+
|
|
175
|
+
{@const moveDown =
|
|
176
|
+
(tickSize + tickPadding + (tickRotate !== 0 ? tickFontSize * 0.35 : 0)) *
|
|
177
|
+
(anchor === 'bottom' ? 1 : -1)}
|
|
178
|
+
{@const [textStyle, textClass] = resolveStyles(
|
|
179
|
+
plot,
|
|
180
|
+
tick,
|
|
181
|
+
{
|
|
182
|
+
fontVariant: isQuantitative ? 'tabular-nums' : 'normal',
|
|
183
|
+
...options,
|
|
184
|
+
fontSize: tickFontSize,
|
|
185
|
+
stroke: null
|
|
186
|
+
},
|
|
187
|
+
'fill',
|
|
188
|
+
{ x: true }
|
|
189
|
+
)}
|
|
190
|
+
<text
|
|
191
|
+
bind:this={tickTextElements[t]}
|
|
192
|
+
transform="translate(0, {moveDown}) rotate({tickRotate})"
|
|
193
|
+
style={textStyle}
|
|
194
|
+
class={textClass}
|
|
195
|
+
x={0}
|
|
196
|
+
y={0}
|
|
197
|
+
dominant-baseline={tickRotate !== 0
|
|
198
|
+
? 'central'
|
|
199
|
+
: anchor === 'bottom'
|
|
200
|
+
? 'hanging'
|
|
201
|
+
: 'auto'}>
|
|
202
|
+
{#if ticks.length > 0 || t === 0 || t === ticks.length - 1}
|
|
203
|
+
{#if textLines.length === 1}
|
|
204
|
+
{textLines[0]}
|
|
205
|
+
{:else}
|
|
206
|
+
{#each textLines as line, i (i)}
|
|
207
|
+
<tspan x="0" dy={i ? 12 : 0}
|
|
208
|
+
>{!prevTextLines || prevTextLines[i] !== line
|
|
209
|
+
? line
|
|
210
|
+
: ''}</tspan>
|
|
211
|
+
{/each}
|
|
212
|
+
{/if}
|
|
207
213
|
{/if}
|
|
208
|
-
|
|
209
|
-
|
|
214
|
+
</text>
|
|
215
|
+
{/if}
|
|
210
216
|
</g>
|
|
211
217
|
{/if}
|
|
212
218
|
{/each}
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
dy: ConstantAccessor<number>;
|
|
30
30
|
};
|
|
31
31
|
plot: PlotState;
|
|
32
|
+
text: boolean | null;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
35
|
let {
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
width,
|
|
47
48
|
title,
|
|
48
49
|
plot,
|
|
49
|
-
options
|
|
50
|
+
options,
|
|
51
|
+
text = true
|
|
50
52
|
}: BaseAxisYProps = $props();
|
|
51
53
|
|
|
52
54
|
const LINE_ANCHOR = {
|
|
@@ -67,16 +69,18 @@
|
|
|
67
69
|
element: null as SVGTextElement | null
|
|
68
70
|
};
|
|
69
71
|
});
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
let
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
72
|
+
if (text) {
|
|
73
|
+
const T = tickObjects.length;
|
|
74
|
+
for (let i = 0; i < T; i++) {
|
|
75
|
+
let j = i;
|
|
76
|
+
// find the preceding tick that was not hidden
|
|
77
|
+
do {
|
|
78
|
+
j--;
|
|
79
|
+
} while (j >= 0 && tickObjects[j].hidden);
|
|
80
|
+
if (j >= 0) {
|
|
81
|
+
const tickLabelSpace = Math.abs(tickObjects[i].y - tickObjects[j].y);
|
|
82
|
+
tickObjects[i].hidden = tickLabelSpace < 15;
|
|
83
|
+
}
|
|
80
84
|
}
|
|
81
85
|
}
|
|
82
86
|
return tickObjects;
|
|
@@ -176,13 +180,15 @@
|
|
|
176
180
|
class={tickLineClass}
|
|
177
181
|
x2={anchor === 'left' ? -tickSize : tickSize} />
|
|
178
182
|
{/if}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
{#if text}
|
|
184
|
+
<text
|
|
185
|
+
bind:this={tickTexts[t]}
|
|
186
|
+
class={[textClass, { 'is-left': anchor === 'left' }]}
|
|
187
|
+
style={textStyle}
|
|
188
|
+
x={(tickSize + tickPadding) * (anchor === 'left' ? -1 : 1)}
|
|
189
|
+
dominant-baseline={LINE_ANCHOR[lineAnchor]}
|
|
190
|
+
>{Array.isArray(tick.text) ? tick.text.join(' ') : tick.text}</text>
|
|
191
|
+
{/if}
|
|
186
192
|
</g>
|
|
187
193
|
{/if}
|
|
188
194
|
{/each}
|
|
@@ -1,44 +1,4 @@
|
|
|
1
|
-
import { type MarkerShape } from './Marker.svelte';
|
|
2
|
-
import type { BaseMarkProps, ConstantAccessor, DataRecord, Mark, PlotScales } from '../../types.js';
|
|
3
|
-
type MarkerPathProps = BaseMarkProps & {
|
|
4
|
-
/**
|
|
5
|
-
* the datum associated with this path, usually the first
|
|
6
|
-
* element of the data array group
|
|
7
|
-
*/
|
|
8
|
-
datum: DataRecord;
|
|
9
|
-
/**
|
|
10
|
-
* the marker shape to use at the start of the path, defaults to
|
|
11
|
-
* circle
|
|
12
|
-
*/
|
|
13
|
-
markerStart?: boolean | MarkerShape;
|
|
14
|
-
/**
|
|
15
|
-
* the marker shape to use at the middle of the path, defaults to circle
|
|
16
|
-
*/
|
|
17
|
-
markerMid?: boolean | MarkerShape;
|
|
18
|
-
/**
|
|
19
|
-
* the marker shape to use at the end of the path, defaults to circle
|
|
20
|
-
*/
|
|
21
|
-
markerEnd?: boolean | MarkerShape;
|
|
22
|
-
/**
|
|
23
|
-
* shorthand for setting all markers
|
|
24
|
-
*/
|
|
25
|
-
marker?: boolean | MarkerShape;
|
|
26
|
-
/**
|
|
27
|
-
* path string
|
|
28
|
-
*/
|
|
29
|
-
d: string;
|
|
30
|
-
style: string;
|
|
31
|
-
startOffset: string;
|
|
32
|
-
textStyle: string;
|
|
33
|
-
textStyleClass?: string | null;
|
|
34
|
-
text: string;
|
|
35
|
-
transform: string;
|
|
36
|
-
color: string;
|
|
37
|
-
strokeWidth: ConstantAccessor<number>;
|
|
38
|
-
mark: Mark<BaseMarkProps>;
|
|
39
|
-
scales: PlotScales;
|
|
40
|
-
};
|
|
41
1
|
/** Helper component for paths with markers and optional text along the path. */
|
|
42
|
-
declare const MarkerPath: import("svelte").Component<
|
|
2
|
+
declare const MarkerPath: import("svelte").Component<any, {}, "">;
|
|
43
3
|
type MarkerPath = ReturnType<typeof MarkerPath>;
|
|
44
4
|
export default MarkerPath;
|
|
@@ -11,11 +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
|
-
data: {
|
|
16
|
-
__x: import("../types.js").RawValue;
|
|
17
|
-
__lo: number;
|
|
18
|
-
__avg: number;
|
|
19
|
-
__hi: number;
|
|
20
|
-
}[];
|
|
21
|
-
};
|
|
14
|
+
export declare function bollingerDim(dim: 'x' | 'y', { data, ...channels }: TransformArg<DataRecord>, options?: BollingerOptions): any;
|
|
@@ -1,9 +1,2 @@
|
|
|
1
1
|
import type { DataRecord, TransformArg } from '../types.js';
|
|
2
|
-
export declare function geoCentroid({ data, ...options }: TransformArg<DataRecord>):
|
|
3
|
-
x: (d: any) => any;
|
|
4
|
-
y: (d: any) => any;
|
|
5
|
-
data: {
|
|
6
|
-
__centroid__: [number, number];
|
|
7
|
-
___orig___?: import("../types.js").RawValue | [import("../types.js").RawValue, import("../types.js").RawValue];
|
|
8
|
-
}[];
|
|
9
|
-
};
|
|
2
|
+
export declare function geoCentroid({ data, ...options }: TransformArg<DataRecord>): 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: DataRecord[];
|
|
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: DataRecord[];
|
|
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: DataRecord[];
|
|
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: DataRecord[];
|
|
65
|
-
};
|
|
57
|
+
export declare function groupZ(input: TransformArg<T, DataRecord>, options?: GroupZOptions): any;
|
|
66
58
|
export {};
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { PlotState, TransformArg } from '../types.js';
|
|
2
2
|
export declare function intervalX<T>(args: TransformArg<T>, { plot }: {
|
|
3
3
|
plot: PlotState;
|
|
4
|
-
}):
|
|
5
|
-
data: T[];
|
|
6
|
-
};
|
|
4
|
+
}): any;
|
|
7
5
|
export declare function intervalY<T>(args: TransformArg<T>, { plot }: {
|
|
8
6
|
plot: PlotState;
|
|
9
|
-
}):
|
|
10
|
-
data: T[];
|
|
11
|
-
};
|
|
7
|
+
}): any;
|
package/dist/transforms/map.d.ts
CHANGED
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
import type { TransformArg, MapOptions, MapMethod
|
|
2
|
-
export declare function map<T>(args: TransformArg<T>, options: MapOptions):
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export declare function mapX<T>(args: TransformArg<T>, mapper: MapMethod): {
|
|
6
|
-
data: DataRecord[];
|
|
7
|
-
};
|
|
8
|
-
export declare function mapY<T>(args: TransformArg<T>, mapper: MapMethod): {
|
|
9
|
-
data: DataRecord[];
|
|
10
|
-
};
|
|
1
|
+
import type { TransformArg, MapOptions, MapMethod } from '../types.js';
|
|
2
|
+
export declare function map<T>(args: TransformArg<T>, options: MapOptions): any;
|
|
3
|
+
export declare function mapX<T>(args: TransformArg<T>, mapper: MapMethod): any;
|
|
4
|
+
export declare function mapY<T>(args: TransformArg<T>, mapper: MapMethod): any;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { TransformArg, MapIndexObject } from '../types.js';
|
|
2
2
|
type NormalizeBasis = 'deviation' | 'first' | 'last' | 'min' | 'max' | 'mean' | 'median' | 'sum' | 'extent' | MapIndexObject;
|
|
3
|
-
export declare function normalizeX<T>(args: TransformArg<T>, basis: NormalizeBasis):
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
export declare function normalizeY<T>(args: TransformArg<T>, basis: NormalizeBasis): {
|
|
7
|
-
data: import("../types.js").DataRecord[];
|
|
8
|
-
};
|
|
3
|
+
export declare function normalizeX<T>(args: TransformArg<T>, basis: NormalizeBasis): any;
|
|
4
|
+
export declare function normalizeY<T>(args: TransformArg<T>, basis: NormalizeBasis): any;
|
|
9
5
|
export {};
|
|
@@ -5,31 +5,17 @@ type AtLeastOne<T, U = {
|
|
|
5
5
|
type SelectOptions = 'first' | 'last' | AtLeastOne<{
|
|
6
6
|
[k in ChannelName]: 'min' | 'max';
|
|
7
7
|
}>;
|
|
8
|
-
export declare function select({ data, ...channels }: TransformArg<DataRecord>, options: SelectOptions):
|
|
9
|
-
data: DataRecord[];
|
|
10
|
-
};
|
|
8
|
+
export declare function select({ data, ...channels }: TransformArg<DataRecord>, options: SelectOptions): any;
|
|
11
9
|
/**
|
|
12
10
|
* Keeps only the first item of each group
|
|
13
11
|
*/
|
|
14
|
-
export declare function selectFirst(args: TransformArg<DataRecord>):
|
|
15
|
-
data: DataRecord[];
|
|
16
|
-
};
|
|
12
|
+
export declare function selectFirst(args: TransformArg<DataRecord>): any;
|
|
17
13
|
/**
|
|
18
14
|
* Keeps only the last item of each group
|
|
19
15
|
*/
|
|
20
|
-
export declare function selectLast(args: TransformArg<DataRecord>):
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export declare function
|
|
24
|
-
|
|
25
|
-
};
|
|
26
|
-
export declare function selectMaxX(args: TransformArg<DataRecord>): {
|
|
27
|
-
data: DataRecord[];
|
|
28
|
-
};
|
|
29
|
-
export declare function selectMinY(args: TransformArg<DataRecord>): {
|
|
30
|
-
data: DataRecord[];
|
|
31
|
-
};
|
|
32
|
-
export declare function selectMaxY(args: TransformArg<DataRecord>): {
|
|
33
|
-
data: DataRecord[];
|
|
34
|
-
};
|
|
16
|
+
export declare function selectLast(args: TransformArg<DataRecord>): any;
|
|
17
|
+
export declare function selectMinX(args: TransformArg<DataRecord>): any;
|
|
18
|
+
export declare function selectMaxX(args: TransformArg<DataRecord>): any;
|
|
19
|
+
export declare function selectMinY(args: TransformArg<DataRecord>): any;
|
|
20
|
+
export declare function selectMaxY(args: TransformArg<DataRecord>): any;
|
|
35
21
|
export {};
|
|
@@ -2,27 +2,14 @@ import type { DataRecord, DataRow, TransformArg } from '../types.js';
|
|
|
2
2
|
export declare const SORT_KEY: unique symbol;
|
|
3
3
|
export declare function sort({ data, ...channels }: TransformArg<DataRecord>, options?: {
|
|
4
4
|
reverse?: boolean;
|
|
5
|
-
}):
|
|
6
|
-
sort: null;
|
|
7
|
-
data: {
|
|
8
|
-
___orig___?: import("../types.js").RawValue | [import("../types.js").RawValue, import("../types.js").RawValue];
|
|
9
|
-
}[];
|
|
10
|
-
} | {
|
|
11
|
-
data: DataRecord[];
|
|
12
|
-
};
|
|
5
|
+
}): any;
|
|
13
6
|
/**
|
|
14
7
|
* reverses the data row order
|
|
15
8
|
*/
|
|
16
9
|
export declare function shuffle({ data, ...channels }: TransformArg<DataRow[]>, options?: {
|
|
17
10
|
seed?: number;
|
|
18
|
-
}):
|
|
19
|
-
sort: null;
|
|
20
|
-
data: DataRow[][];
|
|
21
|
-
};
|
|
11
|
+
}): any;
|
|
22
12
|
/**
|
|
23
13
|
* reverses the data row order
|
|
24
14
|
*/
|
|
25
|
-
export declare function reverse({ data, ...channels }: TransformArg<DataRow[]>):
|
|
26
|
-
sort: null;
|
|
27
|
-
data: DataRow[][];
|
|
28
|
-
};
|
|
15
|
+
export declare function reverse({ data, ...channels }: TransformArg<DataRow[]>): any;
|
|
@@ -7,18 +7,6 @@ type WindowOptions = {
|
|
|
7
7
|
reduce: ReducerName;
|
|
8
8
|
strict: boolean;
|
|
9
9
|
};
|
|
10
|
-
export declare function windowX(args: TransformArg<DataRecord>, options: WindowOptions):
|
|
11
|
-
|
|
12
|
-
[x: string]: import("../types.js").RawValue;
|
|
13
|
-
[x: symbol]: import("../types.js").RawValue;
|
|
14
|
-
___orig___?: import("../types.js").RawValue | [import("../types.js").RawValue, import("../types.js").RawValue];
|
|
15
|
-
}[];
|
|
16
|
-
};
|
|
17
|
-
export declare function windowY(args: TransformArg<DataRecord>, options: WindowOptions): {
|
|
18
|
-
data: {
|
|
19
|
-
[x: string]: import("../types.js").RawValue;
|
|
20
|
-
[x: symbol]: import("../types.js").RawValue;
|
|
21
|
-
___orig___?: import("../types.js").RawValue | [import("../types.js").RawValue, import("../types.js").RawValue];
|
|
22
|
-
}[];
|
|
23
|
-
};
|
|
10
|
+
export declare function windowX(args: TransformArg<DataRecord>, options: WindowOptions): any;
|
|
11
|
+
export declare function windowY(args: TransformArg<DataRecord>, options: WindowOptions): any;
|
|
24
12
|
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
let { examples } = $props();
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="list">
|
|
6
|
+
{#each examples as page, i (i)}
|
|
7
|
+
<a href={page.url}>
|
|
8
|
+
<div>
|
|
9
|
+
{#if page.screenshot}
|
|
10
|
+
<img src={page.screenshot} alt={page.title} />{/if}
|
|
11
|
+
</div>
|
|
12
|
+
<h4>
|
|
13
|
+
{page.title}
|
|
14
|
+
</h4>
|
|
15
|
+
</a>
|
|
16
|
+
{/each}
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<style>
|
|
20
|
+
.list {
|
|
21
|
+
display: grid;
|
|
22
|
+
grid-template-columns: repeat(3, 1fr);
|
|
23
|
+
gap: 1rem;
|
|
24
|
+
width: 100%;
|
|
25
|
+
margin: 2rem 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.list > a {
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: left;
|
|
32
|
+
row-gap: 0.3rem;
|
|
33
|
+
text-decoration: none;
|
|
34
|
+
|
|
35
|
+
> div {
|
|
36
|
+
border: 1px solid #88888822;
|
|
37
|
+
border-radius: 2px;
|
|
38
|
+
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
|
|
39
|
+
padding: 1.5ex;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&:hover {
|
|
43
|
+
text-decoration: underline;
|
|
44
|
+
color: var(--svp-text);
|
|
45
|
+
> div {
|
|
46
|
+
border: 1px solid var(--svp-text);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.list img {
|
|
52
|
+
width: 100%;
|
|
53
|
+
box-sizing: border-box;
|
|
54
|
+
border-radius: 3px;
|
|
55
|
+
transition: transform 0.2s ease-in-out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.list h4 {
|
|
59
|
+
margin: 0rem;
|
|
60
|
+
font-weight: normal;
|
|
61
|
+
font-size: 13px;
|
|
62
|
+
line-height: 1;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export default ExamplesGrid;
|
|
2
|
+
type ExamplesGrid = {
|
|
3
|
+
$on?(type: string, callback: (e: any) => void): () => void;
|
|
4
|
+
$set?(props: Partial<$$ComponentProps>): void;
|
|
5
|
+
};
|
|
6
|
+
declare const ExamplesGrid: import("svelte").Component<{
|
|
7
|
+
examples: any;
|
|
8
|
+
}, {}, "">;
|
|
9
|
+
type $$ComponentProps = {
|
|
10
|
+
examples: any;
|
|
11
|
+
};
|