svelteplot 0.10.3 → 0.11.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 +42 -25
- package/dist/Mark.svelte.d.ts +111 -32
- package/dist/Plot.svelte +21 -15
- package/dist/core/Facet.svelte +1 -1
- package/dist/core/FacetAxes.svelte +13 -8
- package/dist/core/FacetGrid.svelte +4 -4
- package/dist/core/Plot.svelte +41 -35
- package/dist/helpers/autoScales.d.ts +3 -3
- package/dist/helpers/autoScales.js +28 -18
- package/dist/helpers/autoTicks.js +2 -0
- package/dist/helpers/callWithProps.d.ts +1 -2
- package/dist/helpers/facets.js +0 -1
- package/dist/helpers/index.js +1 -1
- package/dist/helpers/mergeDeep.d.ts +1 -3
- package/dist/helpers/mergeDeep.js +15 -16
- package/dist/helpers/projection.d.ts +4 -3
- package/dist/helpers/projection.js +17 -5
- package/dist/helpers/reduce.d.ts +4 -4
- package/dist/helpers/reduce.js +6 -4
- package/dist/helpers/regressionLoess.js +2 -1
- package/dist/helpers/resolve.d.ts +6 -3
- package/dist/helpers/resolve.js +25 -16
- package/dist/helpers/scales.d.ts +10 -10
- package/dist/helpers/scales.js +43 -13
- package/dist/helpers/time.d.ts +10 -3
- package/dist/helpers/time.js +2 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/plotDefaults.d.ts +3 -1
- package/dist/hooks/plotDefaults.js +33 -1
- package/dist/hooks/usePlot.svelte.d.ts +10 -25
- package/dist/hooks/usePlot.svelte.js +8 -7
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -3
- package/dist/marks/Area.svelte +24 -13
- package/dist/marks/Area.svelte.d.ts +118 -34
- package/dist/marks/AreaX.svelte +42 -8
- package/dist/marks/AreaX.svelte.d.ts +154 -71
- package/dist/marks/AreaY.svelte +42 -8
- package/dist/marks/AreaY.svelte.d.ts +154 -71
- package/dist/marks/Arrow.svelte +42 -23
- package/dist/marks/Arrow.svelte.d.ts +114 -35
- package/dist/marks/AxisX.svelte +43 -28
- package/dist/marks/AxisX.svelte.d.ts +125 -40
- package/dist/marks/AxisY.svelte +43 -26
- package/dist/marks/AxisY.svelte.d.ts +127 -40
- package/dist/marks/BarX.svelte +12 -10
- package/dist/marks/BarX.svelte.d.ts +104 -32
- package/dist/marks/BarY.svelte +11 -10
- package/dist/marks/BarY.svelte.d.ts +106 -34
- package/dist/marks/BollingerX.svelte +4 -7
- package/dist/marks/BollingerX.svelte.d.ts +105 -30
- package/dist/marks/BollingerY.svelte +3 -0
- package/dist/marks/BollingerY.svelte.d.ts +105 -30
- package/dist/marks/BoxX.svelte +3 -3
- package/dist/marks/BoxY.svelte +12 -9
- package/dist/marks/BoxY.svelte.d.ts +128 -53
- package/dist/marks/Brush.svelte +26 -21
- package/dist/marks/Brush.svelte.d.ts +119 -60
- package/dist/marks/Cell.svelte +13 -9
- package/dist/marks/Cell.svelte.d.ts +105 -30
- package/dist/marks/CellX.svelte +2 -1
- package/dist/marks/CellX.svelte.d.ts +105 -32
- package/dist/marks/CellY.svelte +2 -1
- package/dist/marks/CellY.svelte.d.ts +105 -32
- package/dist/marks/ColorLegend.svelte +24 -13
- package/dist/marks/ColorLegend.svelte.d.ts +1 -0
- package/dist/marks/CustomMark.svelte +16 -10
- package/dist/marks/CustomMark.svelte.d.ts +112 -31
- package/dist/marks/CustomMarkHTML.svelte +8 -2
- package/dist/marks/CustomMarkHTML.svelte.d.ts +8 -2
- package/dist/marks/DifferenceY.svelte +31 -20
- package/dist/marks/DifferenceY.svelte.d.ts +134 -55
- package/dist/marks/Dot.svelte +21 -11
- package/dist/marks/Dot.svelte.d.ts +117 -38
- package/dist/marks/DotX.svelte +2 -0
- package/dist/marks/DotX.svelte.d.ts +136 -62
- package/dist/marks/DotY.svelte +1 -0
- package/dist/marks/DotY.svelte.d.ts +135 -62
- package/dist/marks/Frame.svelte +47 -9
- package/dist/marks/Frame.svelte.d.ts +124 -41
- package/dist/marks/Geo.svelte +21 -12
- package/dist/marks/Geo.svelte.d.ts +105 -30
- package/dist/marks/Graticule.svelte +3 -0
- package/dist/marks/Graticule.svelte.d.ts +3 -0
- package/dist/marks/GridX.svelte +31 -16
- package/dist/marks/GridX.svelte.d.ts +108 -32
- package/dist/marks/GridY.svelte +30 -15
- package/dist/marks/GridY.svelte.d.ts +108 -32
- package/dist/marks/HTMLTooltip.svelte +14 -7
- package/dist/marks/HTMLTooltip.svelte.d.ts +7 -0
- package/dist/marks/Image.svelte +50 -25
- package/dist/marks/Image.svelte.d.ts +117 -35
- package/dist/marks/Line.svelte +67 -44
- package/dist/marks/Line.svelte.d.ts +119 -30
- package/dist/marks/LineX.svelte +2 -1
- package/dist/marks/LineX.svelte.d.ts +142 -69
- package/dist/marks/LineY.svelte +2 -1
- package/dist/marks/LineY.svelte.d.ts +142 -69
- package/dist/marks/Link.svelte +70 -46
- package/dist/marks/Link.svelte.d.ts +126 -41
- package/dist/marks/Pointer.svelte +24 -15
- package/dist/marks/Pointer.svelte.d.ts +7 -0
- package/dist/marks/Rect.svelte +13 -5
- package/dist/marks/Rect.svelte.d.ts +116 -35
- package/dist/marks/RectX.svelte +6 -3
- package/dist/marks/RectX.svelte.d.ts +158 -12
- package/dist/marks/RectY.svelte +6 -3
- package/dist/marks/RectY.svelte.d.ts +158 -12
- package/dist/marks/RegressionX.svelte +13 -6
- package/dist/marks/RegressionX.svelte.d.ts +8 -3
- package/dist/marks/RegressionY.svelte +13 -6
- package/dist/marks/RegressionY.svelte.d.ts +8 -3
- package/dist/marks/RuleX.svelte +18 -11
- package/dist/marks/RuleX.svelte.d.ts +112 -32
- package/dist/marks/RuleY.svelte +19 -12
- package/dist/marks/RuleY.svelte.d.ts +114 -34
- package/dist/marks/Spike.svelte +11 -5
- package/dist/marks/Spike.svelte.d.ts +146 -68
- package/dist/marks/Text.svelte +24 -7
- package/dist/marks/Text.svelte.d.ts +253 -75
- package/dist/marks/TickX.svelte +56 -48
- package/dist/marks/TickX.svelte.d.ts +114 -40
- package/dist/marks/TickY.svelte +59 -51
- package/dist/marks/TickY.svelte.d.ts +117 -43
- package/dist/marks/Trail.svelte +25 -13
- package/dist/marks/Trail.svelte.d.ts +116 -33
- package/dist/marks/Vector.svelte +20 -11
- package/dist/marks/Vector.svelte.d.ts +116 -35
- package/dist/marks/WaffleX.svelte +18 -16
- package/dist/marks/WaffleX.svelte.d.ts +131 -57
- package/dist/marks/WaffleY.svelte +16 -15
- package/dist/marks/WaffleY.svelte.d.ts +129 -56
- package/dist/marks/helpers/Anchor.svelte +17 -2
- package/dist/marks/helpers/Anchor.svelte.d.ts +16 -1
- package/dist/marks/helpers/AreaCanvas.svelte +8 -8
- package/dist/marks/helpers/BaseAxisX.svelte +38 -41
- package/dist/marks/helpers/BaseAxisX.svelte.d.ts +11 -17
- package/dist/marks/helpers/BaseAxisY.svelte +35 -35
- package/dist/marks/helpers/BaseAxisY.svelte.d.ts +12 -15
- package/dist/marks/helpers/Box.svelte +35 -28
- package/dist/marks/helpers/Box.svelte.d.ts +122 -50
- package/dist/marks/helpers/DotCanvas.svelte +11 -9
- package/dist/marks/helpers/GeoCanvas.svelte +7 -6
- package/dist/marks/helpers/LineCanvas.svelte +7 -7
- package/dist/marks/helpers/LinearGradientX.svelte +2 -2
- package/dist/marks/helpers/LinearGradientX.svelte.d.ts +1 -1
- package/dist/marks/helpers/LinearGradientY.svelte +2 -2
- package/dist/marks/helpers/LinearGradientY.svelte.d.ts +1 -1
- package/dist/marks/helpers/Marker.svelte +2 -2
- package/dist/marks/helpers/MarkerPath.svelte +15 -12
- package/dist/marks/helpers/MarkerPath.svelte.d.ts +105 -32
- package/dist/marks/helpers/MultilineText.svelte +24 -17
- package/dist/marks/helpers/MultilineText.svelte.d.ts +1 -1
- package/dist/marks/helpers/RectCanvas.svelte +31 -26
- package/dist/marks/helpers/RectPath.svelte +2 -2
- package/dist/marks/helpers/Regression.svelte +176 -86
- package/dist/marks/helpers/Regression.svelte.d.ts +20 -8
- package/dist/marks/helpers/RuleCanvas.svelte +9 -6
- package/dist/marks/helpers/TextCanvas.svelte +13 -9
- package/dist/marks/helpers/TextCanvas.svelte.d.ts +6 -6
- package/dist/marks/helpers/TickCanvas.svelte +6 -5
- package/dist/marks/helpers/TrailCanvas.svelte +16 -18
- package/dist/marks/helpers/TrailCanvas.svelte.d.ts +3 -5
- package/dist/marks/helpers/canvas.js +16 -9
- package/dist/marks/helpers/events.d.ts +2 -2
- package/dist/marks/helpers/events.js +14 -7
- package/dist/marks/helpers/waffle.d.ts +3 -3
- package/dist/marks/helpers/waffle.js +6 -4
- package/dist/regression/polynomial.d.ts +1 -1
- package/dist/regression/polynomial.js +5 -5
- package/dist/regression/utils/determination.d.ts +1 -1
- package/dist/regression/utils/determination.js +1 -1
- package/dist/regression/utils/geometry.d.ts +1 -1
- package/dist/regression/utils/interpose.d.ts +1 -1
- package/dist/regression/utils/interpose.js +1 -1
- package/dist/regression/utils/points.d.ts +1 -1
- package/dist/transforms/bin.d.ts +3 -3
- package/dist/transforms/bin.js +29 -20
- package/dist/transforms/bollinger.d.ts +8 -0
- package/dist/transforms/bollinger.js +9 -1
- package/dist/transforms/centroid.d.ts +4 -0
- package/dist/transforms/centroid.js +4 -0
- package/dist/transforms/density.d.ts +4 -4
- package/dist/transforms/density.js +20 -13
- package/dist/transforms/dodge.d.ts +12 -1
- package/dist/transforms/dodge.js +15 -6
- package/dist/transforms/group.d.ts +141 -4
- package/dist/transforms/group.js +4 -1
- package/dist/transforms/interval.d.ts +204 -60
- package/dist/transforms/jitter.d.ts +421 -4
- package/dist/transforms/jitter.js +10 -1
- package/dist/transforms/map.d.ts +412 -4
- package/dist/transforms/map.js +3 -3
- package/dist/transforms/normalize.d.ts +276 -5
- package/dist/transforms/normalize.js +5 -3
- package/dist/transforms/recordize.d.ts +17 -5
- package/dist/transforms/recordize.js +13 -9
- package/dist/transforms/rename.d.ts +11 -4
- package/dist/transforms/rename.js +7 -2
- package/dist/transforms/select.d.ts +722 -210
- package/dist/transforms/select.js +13 -1
- package/dist/transforms/shift.d.ts +8 -0
- package/dist/transforms/shift.js +20 -6
- package/dist/transforms/sort.d.ts +13 -258
- package/dist/transforms/sort.js +13 -10
- package/dist/transforms/stack.d.ts +58 -9
- package/dist/transforms/stack.js +27 -11
- package/dist/transforms/window.d.ts +221 -66
- package/dist/transforms/window.js +8 -2
- package/dist/types/axes.d.ts +43 -0
- package/dist/types/axes.js +1 -0
- package/dist/types/channel.d.ts +30 -2
- package/dist/types/data.d.ts +14 -1
- package/dist/types/facet.d.ts +5 -0
- package/dist/types/index.d.ts +33 -8
- package/dist/types/index.js +11 -7
- package/dist/types/mark.d.ts +124 -35
- package/dist/types/plot.d.ts +118 -16
- package/dist/types/scale.d.ts +125 -8
- package/package.json +178 -175
- package/dist/helpers/autoTicks.d.ts +0 -12
package/dist/marks/Link.svelte
CHANGED
|
@@ -2,24 +2,26 @@
|
|
|
2
2
|
Creates connections between pairs of points with optional curve styling and markers
|
|
3
3
|
-->
|
|
4
4
|
|
|
5
|
-
<script lang="ts" generics="Datum
|
|
5
|
+
<script lang="ts" generics="Datum = DataRecord | GeoJSON.GeoJsonObject">
|
|
6
6
|
interface LinkMarkProps extends BaseMarkProps<Datum>, MarkerOptions {
|
|
7
|
-
data
|
|
8
|
-
|
|
7
|
+
/** the input data array; each element becomes one link */
|
|
8
|
+
data?: Datum[];
|
|
9
|
+
/** sort order for data points before rendering */
|
|
10
|
+
sort?: ConstantAccessor<RawValue, Datum> | { channel: 'stroke' | 'fill' };
|
|
9
11
|
/**
|
|
10
12
|
* the x1 channel accessor for the start of the link
|
|
11
13
|
*/
|
|
12
|
-
x1
|
|
14
|
+
x1?: ChannelAccessor<Datum>;
|
|
13
15
|
/**
|
|
14
16
|
* the y1 channel accessor for the start of the link
|
|
15
17
|
*/
|
|
16
|
-
y1
|
|
18
|
+
y1?: ChannelAccessor<Datum>;
|
|
17
19
|
/**
|
|
18
20
|
* the x2 channel accessor for the end of the link
|
|
19
21
|
*/
|
|
20
|
-
x2
|
|
21
|
-
|
|
22
|
-
y2
|
|
22
|
+
x2?: ChannelAccessor<Datum>;
|
|
23
|
+
/** the y2 channel accessor for the end of the link */
|
|
24
|
+
y2?: ChannelAccessor<Datum>;
|
|
23
25
|
/**
|
|
24
26
|
* the curve type, defaults to 'auto' which uses a linear curve for planar projections
|
|
25
27
|
* and a spherical line for geographic projections
|
|
@@ -29,10 +31,20 @@
|
|
|
29
31
|
* the tension of the curve, defaults to 0
|
|
30
32
|
*/
|
|
31
33
|
tension?: number;
|
|
34
|
+
/** legacy alias for link curvature */
|
|
35
|
+
bend?: number | boolean;
|
|
32
36
|
/**
|
|
33
37
|
* the text label for the link, can be a constant or a function
|
|
34
38
|
*/
|
|
35
39
|
text?: ConstantAccessor<string, Datum>;
|
|
40
|
+
/** the fill color for the text label rendered along the link */
|
|
41
|
+
textFill?: ConstantAccessor<string, Datum>;
|
|
42
|
+
/** the stroke color for the text label rendered along the link */
|
|
43
|
+
textStroke?: ConstantAccessor<string, Datum>;
|
|
44
|
+
/** the offset position for the text label along the link path */
|
|
45
|
+
textStartOffset?: ConstantAccessor<string, Datum>;
|
|
46
|
+
/** the stroke width for the text label rendered along the link */
|
|
47
|
+
textStrokeWidth?: ConstantAccessor<number, Datum>;
|
|
36
48
|
}
|
|
37
49
|
import type {
|
|
38
50
|
DataRecord,
|
|
@@ -48,8 +60,8 @@
|
|
|
48
60
|
import Mark from '../Mark.svelte';
|
|
49
61
|
import MarkerPath from './helpers/MarkerPath.svelte';
|
|
50
62
|
import { replaceChannels } from '../transforms/rename.js';
|
|
51
|
-
import { line, type CurveFactory } from 'd3-shape';
|
|
52
|
-
import
|
|
63
|
+
import { line, type CurveFactory, type Line as D3Line } from 'd3-shape';
|
|
64
|
+
import type { MarkerShape } from './helpers/Marker.svelte';
|
|
53
65
|
import { maybeCurve } from '../helpers/curves.js';
|
|
54
66
|
import { geoPath } from 'd3-geo';
|
|
55
67
|
import { pick } from 'es-toolkit';
|
|
@@ -67,6 +79,7 @@
|
|
|
67
79
|
data = [{} as Datum],
|
|
68
80
|
curve = 'auto',
|
|
69
81
|
tension = 0,
|
|
82
|
+
bend,
|
|
70
83
|
text,
|
|
71
84
|
class: className = '',
|
|
72
85
|
...options
|
|
@@ -80,9 +93,9 @@
|
|
|
80
93
|
const args = $derived(
|
|
81
94
|
replaceChannels(
|
|
82
95
|
sort({
|
|
83
|
-
data: indexData(data),
|
|
96
|
+
data: indexData(data as object[]) as DataRecord[],
|
|
84
97
|
stroke: 'currentColor',
|
|
85
|
-
...options
|
|
98
|
+
...(options as BaseMarkProps<DataRecord>)
|
|
86
99
|
}),
|
|
87
100
|
{ y: ['y1', 'y2'], x: ['x1', 'x2'] }
|
|
88
101
|
)
|
|
@@ -90,39 +103,44 @@
|
|
|
90
103
|
|
|
91
104
|
const sphericalLine = $derived(plot.scales.projection && curve === 'auto');
|
|
92
105
|
|
|
93
|
-
const linePath: (d: ScaledDataRecord, reversed
|
|
94
|
-
const fn =
|
|
95
|
-
curve
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
106
|
+
const linePath: (d: ScaledDataRecord, reversed?: boolean) => string | null = $derived.by(() => {
|
|
107
|
+
const fn: D3Line<[number, number]> = line<[number, number]>()
|
|
108
|
+
.curve(
|
|
109
|
+
maybeCurve(
|
|
110
|
+
curve === 'auto' ? 'linear' : curve,
|
|
111
|
+
bend === true ? 0.6 : bend === false ? 0 : (bend ?? tension ?? 0)
|
|
112
|
+
)
|
|
113
|
+
)
|
|
114
|
+
.x((d) => d[0])
|
|
115
|
+
.y((d) => d[1]);
|
|
99
116
|
|
|
100
117
|
return (d: ScaledDataRecord, reversed = false) =>
|
|
101
118
|
fn(
|
|
102
119
|
reversed
|
|
103
120
|
? [
|
|
104
|
-
[d.x2, d.y2],
|
|
105
|
-
[d.x1, d.y1]
|
|
121
|
+
[d.x2 as number, d.y2 as number],
|
|
122
|
+
[d.x1 as number, d.y1 as number]
|
|
106
123
|
]
|
|
107
124
|
: [
|
|
108
|
-
[d.x1, d.y1],
|
|
109
|
-
[d.x2, d.y2]
|
|
125
|
+
[d.x1 as number, d.y1 as number],
|
|
126
|
+
[d.x2 as number, d.y2 as number]
|
|
110
127
|
]
|
|
111
128
|
);
|
|
112
129
|
});
|
|
113
130
|
|
|
114
|
-
const sphericalLinePath: (d: ScaledDataRecord, reversed
|
|
115
|
-
() => {
|
|
131
|
+
const sphericalLinePath: (d: ScaledDataRecord, reversed?: boolean) => string | null =
|
|
132
|
+
$derived.by(() => {
|
|
116
133
|
const fn = sphereLine(plot.scales.projection);
|
|
117
134
|
return (d: ScaledDataRecord, reversed = false) => {
|
|
118
135
|
const x1 = resolveChannel('x1', d.datum, args);
|
|
119
136
|
const y1 = resolveChannel('y1', d.datum, args);
|
|
120
137
|
const x2 = resolveChannel('x2', d.datum, args);
|
|
121
138
|
const y2 = resolveChannel('y2', d.datum, args);
|
|
122
|
-
return reversed
|
|
139
|
+
return reversed
|
|
140
|
+
? fn(x2 as number, y2 as number, x1 as number, y1 as number)
|
|
141
|
+
: fn(x1 as number, y1 as number, x2 as number, y2 as number);
|
|
123
142
|
};
|
|
124
|
-
}
|
|
125
|
-
);
|
|
143
|
+
});
|
|
126
144
|
// sphericalLine
|
|
127
145
|
// ?
|
|
128
146
|
|
|
@@ -130,7 +148,7 @@
|
|
|
130
148
|
// :
|
|
131
149
|
// );
|
|
132
150
|
|
|
133
|
-
function sphereLine(projection) {
|
|
151
|
+
function sphereLine(projection: any) {
|
|
134
152
|
const path = geoPath(projection);
|
|
135
153
|
return (x1: number, y1: number, x2: number, y2: number) => {
|
|
136
154
|
return path({
|
|
@@ -165,10 +183,10 @@
|
|
|
165
183
|
d,
|
|
166
184
|
{
|
|
167
185
|
textAnchor: 'middle',
|
|
168
|
-
...pick(args, ['fontSize', 'fontWeight', 'fontStyle'
|
|
169
|
-
fill:
|
|
170
|
-
stroke:
|
|
171
|
-
strokeWidth:
|
|
186
|
+
...pick(args, ['fontSize', 'fontWeight', 'fontStyle']),
|
|
187
|
+
fill: options.textFill || args.stroke,
|
|
188
|
+
stroke: options.textStroke,
|
|
189
|
+
strokeWidth: options.textStrokeWidth
|
|
172
190
|
},
|
|
173
191
|
'fill',
|
|
174
192
|
usedScales
|
|
@@ -176,21 +194,27 @@
|
|
|
176
194
|
|
|
177
195
|
<MarkerPath
|
|
178
196
|
mark={{ ...mark, options: args }}
|
|
197
|
+
transform=""
|
|
179
198
|
scales={plot.scales}
|
|
180
|
-
markerStart={
|
|
181
|
-
markerEnd={
|
|
182
|
-
marker={
|
|
183
|
-
markerScale={
|
|
184
|
-
class={styleClass}
|
|
185
|
-
strokeWidth={
|
|
186
|
-
datum={d.datum}
|
|
187
|
-
color={d.stroke}
|
|
188
|
-
d={sphericalLine ? sphericalLinePath(d) : linePath(d)}
|
|
189
|
-
dInv={sphericalLine ? sphericalLinePath(d, true) : linePath(d, true)
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
{
|
|
199
|
+
markerStart={options.markerStart as boolean | MarkerShape | undefined}
|
|
200
|
+
markerEnd={options.markerEnd as boolean | MarkerShape | undefined}
|
|
201
|
+
marker={options.marker as boolean | MarkerShape | undefined}
|
|
202
|
+
markerScale={options.markerScale}
|
|
203
|
+
class={styleClass ?? undefined}
|
|
204
|
+
strokeWidth={options.strokeWidth as ConstantAccessor<number>}
|
|
205
|
+
datum={d.datum as DataRecord}
|
|
206
|
+
color={d.stroke ?? 'currentColor'}
|
|
207
|
+
d={(sphericalLine ? sphericalLinePath(d) : linePath(d)) ?? ''}
|
|
208
|
+
dInv={(sphericalLine ? sphericalLinePath(d, true) : linePath(d, true)) ??
|
|
209
|
+
undefined}
|
|
210
|
+
style={style ?? ''}
|
|
211
|
+
text={text ? ((resolveProp(text, d.datum as Datum) as string) ?? '') : ''}
|
|
212
|
+
startOffset={(resolveProp(
|
|
213
|
+
options.textStartOffset,
|
|
214
|
+
d.datum as Datum,
|
|
215
|
+
'50%'
|
|
216
|
+
) as string) ?? '50%'}
|
|
217
|
+
textStyle={textStyle ?? ''}
|
|
194
218
|
{textStyleClass} />
|
|
195
219
|
{/if}
|
|
196
220
|
{/each}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DataRecord, ConstantAccessor, ChannelAccessor, CurveName, MarkerOptions, RawValue } from '../types/index.js';
|
|
2
2
|
import { type CurveFactory } from 'd3-shape';
|
|
3
|
-
declare function $$render<Datum
|
|
3
|
+
declare function $$render<Datum = DataRecord | GeoJSON.GeoJsonObject>(): {
|
|
4
4
|
props: Partial<{
|
|
5
5
|
filter: ConstantAccessor<boolean, Datum>;
|
|
6
6
|
facet: "auto" | "include" | "exclude";
|
|
@@ -12,6 +12,16 @@ declare function $$render<Datum extends DataRecord>(): {
|
|
|
12
12
|
dodgeY: import("../transforms/dodge.js").DodgeYOptions;
|
|
13
13
|
fill: ChannelAccessor<Datum>;
|
|
14
14
|
fillOpacity: ConstantAccessor<number, Datum>;
|
|
15
|
+
fontFamily: ConstantAccessor<import("csstype").Property.FontFamily, Datum>;
|
|
16
|
+
fontSize: ConstantAccessor<number | "-moz-initial" | "inherit" | "initial" | "revert" | "revert-layer" | "unset" | "math" | (string & {}) | "large" | "medium" | "small" | "x-large" | "x-small" | "xx-large" | "xx-small" | "xxx-large" | "larger" | "smaller", Datum>;
|
|
17
|
+
fontStyle: ConstantAccessor<import("csstype").Property.FontStyle, Datum>;
|
|
18
|
+
fontVariant: ConstantAccessor<import("csstype").Property.FontVariant, Datum>;
|
|
19
|
+
fontWeight: ConstantAccessor<import("csstype").Property.FontWeight, Datum>;
|
|
20
|
+
letterSpacing: ConstantAccessor<import("csstype").Property.LetterSpacing<0 | (string & {})>, Datum>;
|
|
21
|
+
wordSpacing: ConstantAccessor<import("csstype").Property.WordSpacing<0 | (string & {})>, Datum>;
|
|
22
|
+
textAnchor: ConstantAccessor<import("csstype").Property.TextAnchor, Datum>;
|
|
23
|
+
textTransform: ConstantAccessor<import("csstype").Property.TextTransform, Datum>;
|
|
24
|
+
textDecoration: ConstantAccessor<import("csstype").Property.TextDecoration<0 | (string & {})>, Datum>;
|
|
15
25
|
sort: ((a: RawValue, b: RawValue) => number) | {
|
|
16
26
|
channel: string;
|
|
17
27
|
order?: "ascending" | "descending";
|
|
@@ -25,63 +35,128 @@ declare function $$render<Datum extends DataRecord>(): {
|
|
|
25
35
|
opacity: ChannelAccessor<Datum>;
|
|
26
36
|
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
27
37
|
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
38
|
+
blend: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
28
39
|
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
29
40
|
clipPath: string;
|
|
30
41
|
mask: string;
|
|
31
42
|
imageFilter: ConstantAccessor<string, Datum>;
|
|
32
43
|
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
33
44
|
paintOrder: ConstantAccessor<string, Datum>;
|
|
34
|
-
onclick:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
onclick: (event: Event & {
|
|
46
|
+
currentTarget: SVGPathElement;
|
|
47
|
+
}, datum: Datum, index: number) => void;
|
|
48
|
+
ondblclick: (event: Event & {
|
|
49
|
+
currentTarget: SVGPathElement;
|
|
50
|
+
}, datum: Datum, index: number) => void;
|
|
51
|
+
onmouseup: (event: Event & {
|
|
52
|
+
currentTarget: SVGPathElement;
|
|
53
|
+
}, datum: Datum, index: number) => void;
|
|
54
|
+
onmousedown: (event: Event & {
|
|
55
|
+
currentTarget: SVGPathElement;
|
|
56
|
+
}, datum: Datum, index: number) => void;
|
|
57
|
+
onmouseenter: (event: Event & {
|
|
58
|
+
currentTarget: SVGPathElement;
|
|
59
|
+
}, datum: Datum, index: number) => void;
|
|
60
|
+
onmousemove: (event: Event & {
|
|
61
|
+
currentTarget: SVGPathElement;
|
|
62
|
+
}, datum: Datum, index: number) => void;
|
|
63
|
+
onmouseleave: (event: Event & {
|
|
64
|
+
currentTarget: SVGPathElement;
|
|
65
|
+
}, datum: Datum, index: number) => void;
|
|
66
|
+
onmouseout: (event: Event & {
|
|
67
|
+
currentTarget: SVGPathElement;
|
|
68
|
+
}, datum: Datum, index: number) => void;
|
|
69
|
+
onmouseover: (event: Event & {
|
|
70
|
+
currentTarget: SVGPathElement;
|
|
71
|
+
}, datum: Datum, index: number) => void;
|
|
72
|
+
onpointercancel: (event: Event & {
|
|
73
|
+
currentTarget: SVGPathElement;
|
|
74
|
+
}, datum: Datum, index: number) => void;
|
|
75
|
+
onpointerdown: (event: Event & {
|
|
76
|
+
currentTarget: SVGPathElement;
|
|
77
|
+
}, datum: Datum, index: number) => void;
|
|
78
|
+
onpointerup: (event: Event & {
|
|
79
|
+
currentTarget: SVGPathElement;
|
|
80
|
+
}, datum: Datum, index: number) => void;
|
|
81
|
+
onpointerenter: (event: Event & {
|
|
82
|
+
currentTarget: SVGPathElement;
|
|
83
|
+
}, datum: Datum, index: number) => void;
|
|
84
|
+
onpointerleave: (event: Event & {
|
|
85
|
+
currentTarget: SVGPathElement;
|
|
86
|
+
}, datum: Datum, index: number) => void;
|
|
87
|
+
onpointermove: (event: Event & {
|
|
88
|
+
currentTarget: SVGPathElement;
|
|
89
|
+
}, datum: Datum, index: number) => void;
|
|
90
|
+
onpointerover: (event: Event & {
|
|
91
|
+
currentTarget: SVGPathElement;
|
|
92
|
+
}, datum: Datum, index: number) => void;
|
|
93
|
+
onpointerout: (event: Event & {
|
|
94
|
+
currentTarget: SVGPathElement;
|
|
95
|
+
}, datum: Datum, index: number) => void;
|
|
96
|
+
ondrag: (event: Event & {
|
|
97
|
+
currentTarget: SVGPathElement;
|
|
98
|
+
}, datum: Datum, index: number) => void;
|
|
99
|
+
ondrop: (event: Event & {
|
|
100
|
+
currentTarget: SVGPathElement;
|
|
101
|
+
}, datum: Datum, index: number) => void;
|
|
102
|
+
ondragstart: (event: Event & {
|
|
103
|
+
currentTarget: SVGPathElement;
|
|
104
|
+
}, datum: Datum, index: number) => void;
|
|
105
|
+
ondragenter: (event: Event & {
|
|
106
|
+
currentTarget: SVGPathElement;
|
|
107
|
+
}, datum: Datum, index: number) => void;
|
|
108
|
+
ondragleave: (event: Event & {
|
|
109
|
+
currentTarget: SVGPathElement;
|
|
110
|
+
}, datum: Datum, index: number) => void;
|
|
111
|
+
ondragover: (event: Event & {
|
|
112
|
+
currentTarget: SVGPathElement;
|
|
113
|
+
}, datum: Datum, index: number) => void;
|
|
114
|
+
ondragend: (event: Event & {
|
|
115
|
+
currentTarget: SVGPathElement;
|
|
116
|
+
}, datum: Datum, index: number) => void;
|
|
117
|
+
ontouchstart: (event: Event & {
|
|
118
|
+
currentTarget: SVGPathElement;
|
|
119
|
+
}, datum: Datum, index: number) => void;
|
|
120
|
+
ontouchmove: (event: Event & {
|
|
121
|
+
currentTarget: SVGPathElement;
|
|
122
|
+
}, datum: Datum, index: number) => void;
|
|
123
|
+
ontouchend: (event: Event & {
|
|
124
|
+
currentTarget: SVGPathElement;
|
|
125
|
+
}, datum: Datum, index: number) => void;
|
|
126
|
+
ontouchcancel: (event: Event & {
|
|
127
|
+
currentTarget: SVGPathElement;
|
|
128
|
+
}, datum: Datum, index: number) => void;
|
|
129
|
+
oncontextmenu: (event: Event & {
|
|
130
|
+
currentTarget: SVGPathElement;
|
|
131
|
+
}, datum: Datum, index: number) => void;
|
|
132
|
+
onwheel: (event: Event & {
|
|
133
|
+
currentTarget: SVGPathElement;
|
|
134
|
+
}, datum: Datum, index: number) => void;
|
|
64
135
|
class: string;
|
|
65
136
|
style: string;
|
|
66
137
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
138
|
+
title: ConstantAccessor<string, Datum>;
|
|
67
139
|
}> & MarkerOptions & {
|
|
68
|
-
data
|
|
69
|
-
|
|
140
|
+
/** the input data array; each element becomes one link */
|
|
141
|
+
data?: Datum[];
|
|
142
|
+
/** sort order for data points before rendering */
|
|
143
|
+
sort?: ConstantAccessor<RawValue, Datum> | {
|
|
70
144
|
channel: "stroke" | "fill";
|
|
71
145
|
};
|
|
72
146
|
/**
|
|
73
147
|
* the x1 channel accessor for the start of the link
|
|
74
148
|
*/
|
|
75
|
-
x1
|
|
149
|
+
x1?: ChannelAccessor<Datum>;
|
|
76
150
|
/**
|
|
77
151
|
* the y1 channel accessor for the start of the link
|
|
78
152
|
*/
|
|
79
|
-
y1
|
|
153
|
+
y1?: ChannelAccessor<Datum>;
|
|
80
154
|
/**
|
|
81
155
|
* the x2 channel accessor for the end of the link
|
|
82
156
|
*/
|
|
83
|
-
x2
|
|
84
|
-
y2
|
|
157
|
+
x2?: ChannelAccessor<Datum>;
|
|
158
|
+
/** the y2 channel accessor for the end of the link */
|
|
159
|
+
y2?: ChannelAccessor<Datum>;
|
|
85
160
|
/**
|
|
86
161
|
* the curve type, defaults to 'auto' which uses a linear curve for planar projections
|
|
87
162
|
* and a spherical line for geographic projections
|
|
@@ -91,17 +166,27 @@ declare function $$render<Datum extends DataRecord>(): {
|
|
|
91
166
|
* the tension of the curve, defaults to 0
|
|
92
167
|
*/
|
|
93
168
|
tension?: number;
|
|
169
|
+
/** legacy alias for link curvature */
|
|
170
|
+
bend?: number | boolean;
|
|
94
171
|
/**
|
|
95
172
|
* the text label for the link, can be a constant or a function
|
|
96
173
|
*/
|
|
97
174
|
text?: ConstantAccessor<string, Datum>;
|
|
175
|
+
/** the fill color for the text label rendered along the link */
|
|
176
|
+
textFill?: ConstantAccessor<string, Datum>;
|
|
177
|
+
/** the stroke color for the text label rendered along the link */
|
|
178
|
+
textStroke?: ConstantAccessor<string, Datum>;
|
|
179
|
+
/** the offset position for the text label along the link path */
|
|
180
|
+
textStartOffset?: ConstantAccessor<string, Datum>;
|
|
181
|
+
/** the stroke width for the text label rendered along the link */
|
|
182
|
+
textStrokeWidth?: ConstantAccessor<number, Datum>;
|
|
98
183
|
};
|
|
99
184
|
exports: {};
|
|
100
185
|
bindings: "";
|
|
101
186
|
slots: {};
|
|
102
187
|
events: {};
|
|
103
188
|
};
|
|
104
|
-
declare class __sveltets_Render<Datum
|
|
189
|
+
declare class __sveltets_Render<Datum = DataRecord | GeoJSON.GeoJsonObject> {
|
|
105
190
|
props(): ReturnType<typeof $$render<Datum>>['props'];
|
|
106
191
|
events(): ReturnType<typeof $$render<Datum>>['events'];
|
|
107
192
|
slots(): ReturnType<typeof $$render<Datum>>['slots'];
|
|
@@ -109,13 +194,13 @@ declare class __sveltets_Render<Datum extends DataRecord> {
|
|
|
109
194
|
exports(): {};
|
|
110
195
|
}
|
|
111
196
|
interface $$IsomorphicComponent {
|
|
112
|
-
new <Datum
|
|
197
|
+
new <Datum = DataRecord | GeoJSON.GeoJsonObject>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<Datum>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<Datum>['props']>, ReturnType<__sveltets_Render<Datum>['events']>, ReturnType<__sveltets_Render<Datum>['slots']>> & {
|
|
113
198
|
$$bindings?: ReturnType<__sveltets_Render<Datum>['bindings']>;
|
|
114
199
|
} & ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
115
|
-
<Datum
|
|
200
|
+
<Datum = DataRecord | GeoJSON.GeoJsonObject>(internal: unknown, props: ReturnType<__sveltets_Render<Datum>['props']> & {}): ReturnType<__sveltets_Render<Datum>['exports']>;
|
|
116
201
|
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
117
202
|
}
|
|
118
203
|
/** Creates connections between pairs of points with optional curve styling and markers */
|
|
119
204
|
declare const Link: $$IsomorphicComponent;
|
|
120
|
-
type Link<Datum
|
|
205
|
+
type Link<Datum = DataRecord | GeoJSON.GeoJsonObject> = InstanceType<typeof Link<Datum>>;
|
|
121
206
|
export default Link;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script lang="ts" generics="Datum extends DataRow">
|
|
2
2
|
interface PointerMarkProps {
|
|
3
|
+
/** the input data array */
|
|
3
4
|
data: Datum[];
|
|
5
|
+
/** snippet rendered with the currently selected data points */
|
|
4
6
|
children?: Snippet<[{ data: Datum[] }]>;
|
|
7
|
+
/** the horizontal position channel; bound to the x scale */
|
|
5
8
|
x?: ChannelAccessor<Datum>;
|
|
9
|
+
/** the vertical position channel; bound to the y scale */
|
|
6
10
|
y?: ChannelAccessor<Datum>;
|
|
11
|
+
/** grouping channel for splitting data into separate search trees */
|
|
7
12
|
z?: ChannelAccessor<Datum>;
|
|
13
|
+
/** the horizontal facet channel */
|
|
8
14
|
fx?: ChannelAccessor<Datum>;
|
|
15
|
+
/** the vertical facet channel */
|
|
9
16
|
fy?: ChannelAccessor<Datum>;
|
|
10
17
|
/**
|
|
11
18
|
* maximum cursor distance to select data points
|
|
@@ -46,7 +53,7 @@
|
|
|
46
53
|
};
|
|
47
54
|
|
|
48
55
|
const {
|
|
49
|
-
data = [
|
|
56
|
+
data = [] as Datum[],
|
|
50
57
|
children,
|
|
51
58
|
x,
|
|
52
59
|
y,
|
|
@@ -55,20 +62,20 @@
|
|
|
55
62
|
fy,
|
|
56
63
|
maxDistance = 15,
|
|
57
64
|
tolerance = Number.NEGATIVE_INFINITY,
|
|
58
|
-
onupdate =
|
|
65
|
+
onupdate = undefined
|
|
59
66
|
}: PointerMarkProps = $derived({
|
|
60
67
|
...DEFAULTS,
|
|
61
68
|
...markProps
|
|
62
69
|
});
|
|
63
70
|
|
|
64
|
-
let selectedData = $state([]);
|
|
71
|
+
let selectedData = $state<any[]>([]);
|
|
65
72
|
|
|
66
73
|
function onPointerMove(evt: MouseEvent) {
|
|
67
|
-
let facetEl = evt.target as
|
|
74
|
+
let facetEl: Element | null = evt.target as Element;
|
|
68
75
|
while (facetEl && !facetEl.classList.contains('facet')) {
|
|
69
|
-
facetEl = facetEl.parentElement;
|
|
76
|
+
facetEl = facetEl.parentElement as Element | null;
|
|
70
77
|
}
|
|
71
|
-
const facetRect = (facetEl?.firstChild ?? plot.body).getBoundingClientRect();
|
|
78
|
+
const facetRect = ((facetEl?.firstChild as Element) ?? plot.body).getBoundingClientRect();
|
|
72
79
|
|
|
73
80
|
const relativeX = evt.clientX - facetRect.left + (plot.options.marginLeft ?? 0);
|
|
74
81
|
const relativeY = evt.clientY - facetRect.top + (plot.options.marginTop ?? 0);
|
|
@@ -93,11 +100,11 @@
|
|
|
93
100
|
.data()
|
|
94
101
|
.filter((d) => d !== points[i])
|
|
95
102
|
.filter(
|
|
96
|
-
(d) =>
|
|
103
|
+
(d: any) =>
|
|
97
104
|
(!isFinite(d[POINTER_X]) ||
|
|
98
|
-
Math.abs(d[POINTER_X] - points[i]?.[POINTER_X]) < tolerance) &&
|
|
105
|
+
Math.abs(d[POINTER_X] - (points[i] as any)?.[POINTER_X]) < tolerance) &&
|
|
99
106
|
(!isFinite(d[POINTER_Y]) ||
|
|
100
|
-
Math.abs(d[POINTER_Y] - points[i]?.[POINTER_Y]) < tolerance)
|
|
107
|
+
Math.abs(d[POINTER_Y] - (points[i] as any)?.[POINTER_Y]) < tolerance)
|
|
101
108
|
);
|
|
102
109
|
});
|
|
103
110
|
selectedData = [...points, ...otherPoints].filter((d) => d != null);
|
|
@@ -115,18 +122,20 @@
|
|
|
115
122
|
});
|
|
116
123
|
|
|
117
124
|
const groups = $derived.by(() => {
|
|
118
|
-
const groups = [];
|
|
119
|
-
groupFacetsAndZ(indexData(data), { x, y, z, fx, fy }, (d) =>
|
|
125
|
+
const groups: any[][] = [];
|
|
126
|
+
groupFacetsAndZ(indexData(data as object[]) as any, { x, y, z, fx, fy }, (d) =>
|
|
127
|
+
groups.push(d)
|
|
128
|
+
);
|
|
120
129
|
return groups;
|
|
121
130
|
});
|
|
122
131
|
|
|
123
132
|
const trees = $derived(
|
|
124
133
|
groups.map((items) =>
|
|
125
|
-
quadtree()
|
|
126
|
-
.x(x != null ? (d) => d[POINTER_X] : () => 0)
|
|
127
|
-
.y(y != null ? (d) => d[POINTER_Y] : () => 0)
|
|
134
|
+
quadtree<any>()
|
|
135
|
+
.x(x != null ? (d: any) => d[POINTER_X] : () => 0)
|
|
136
|
+
.y(y != null ? (d: any) => d[POINTER_Y] : () => 0)
|
|
128
137
|
.addAll(
|
|
129
|
-
items?.map((d) => {
|
|
138
|
+
items?.map((d: any) => {
|
|
130
139
|
const [px, py] = projectXY(
|
|
131
140
|
plot.scales,
|
|
132
141
|
resolveChannel('x', d, { x }),
|
|
@@ -2,14 +2,21 @@ import { type Snippet } from 'svelte';
|
|
|
2
2
|
import type { ChannelAccessor, DataRow } from '../types/index.js';
|
|
3
3
|
declare function $$render<Datum extends DataRow>(): {
|
|
4
4
|
props: {
|
|
5
|
+
/** the input data array */
|
|
5
6
|
data: Datum[];
|
|
7
|
+
/** snippet rendered with the currently selected data points */
|
|
6
8
|
children?: Snippet<[{
|
|
7
9
|
data: Datum[];
|
|
8
10
|
}]>;
|
|
11
|
+
/** the horizontal position channel; bound to the x scale */
|
|
9
12
|
x?: ChannelAccessor<Datum>;
|
|
13
|
+
/** the vertical position channel; bound to the y scale */
|
|
10
14
|
y?: ChannelAccessor<Datum>;
|
|
15
|
+
/** grouping channel for splitting data into separate search trees */
|
|
11
16
|
z?: ChannelAccessor<Datum>;
|
|
17
|
+
/** the horizontal facet channel */
|
|
12
18
|
fx?: ChannelAccessor<Datum>;
|
|
19
|
+
/** the vertical facet channel */
|
|
13
20
|
fy?: ChannelAccessor<Datum>;
|
|
14
21
|
/**
|
|
15
22
|
* maximum cursor distance to select data points
|
package/dist/marks/Rect.svelte
CHANGED
|
@@ -5,19 +5,27 @@
|
|
|
5
5
|
<script lang="ts" generics="Datum extends DataRecord">
|
|
6
6
|
interface RectMarkProps
|
|
7
7
|
extends BaseMarkProps<Datum>, LinkableMarkProps<Datum>, BaseRectMarkProps<Datum> {
|
|
8
|
-
data
|
|
8
|
+
/** the input data array; each element becomes one rectangle */
|
|
9
|
+
data?: Datum[];
|
|
10
|
+
/** the horizontal position channel; used as shorthand for x1 and x2 with an interval */
|
|
9
11
|
x?: ChannelAccessor<Datum>;
|
|
12
|
+
/** the starting horizontal position channel */
|
|
10
13
|
x1?: ChannelAccessor<Datum>;
|
|
14
|
+
/** the ending horizontal position channel */
|
|
11
15
|
x2?: ChannelAccessor<Datum>;
|
|
16
|
+
/** the vertical position channel; used as shorthand for y1 and y2 with an interval */
|
|
12
17
|
y?: ChannelAccessor<Datum>;
|
|
18
|
+
/** the starting vertical position channel */
|
|
13
19
|
y1?: ChannelAccessor<Datum>;
|
|
20
|
+
/** the ending vertical position channel */
|
|
14
21
|
y2?: ChannelAccessor<Datum>;
|
|
22
|
+
/** converts x/y into x1/x2 or y1/y2 ranges based on the provided interval */
|
|
15
23
|
interval?: number | string;
|
|
24
|
+
/** additional CSS class name(s) for the rect element */
|
|
16
25
|
class?: string;
|
|
17
26
|
/**
|
|
18
27
|
* Renders using Canvas instead of SVG.
|
|
19
28
|
*/
|
|
20
|
-
|
|
21
29
|
canvas?: boolean;
|
|
22
30
|
}
|
|
23
31
|
import Mark from '../Mark.svelte';
|
|
@@ -33,7 +41,7 @@
|
|
|
33
41
|
import RectPath from './helpers/RectPath.svelte';
|
|
34
42
|
import RectCanvas from './helpers/RectCanvas.svelte';
|
|
35
43
|
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
36
|
-
import { IS_SORTED } from '../transforms/sort';
|
|
44
|
+
import { IS_SORTED } from '../transforms/sort.js';
|
|
37
45
|
import { usePlot } from '../hooks/usePlot.svelte.js';
|
|
38
46
|
|
|
39
47
|
let markProps: RectMarkProps = $props();
|
|
@@ -58,11 +66,11 @@
|
|
|
58
66
|
</script>
|
|
59
67
|
|
|
60
68
|
<Mark
|
|
61
|
-
type="rect"
|
|
62
69
|
required={[]}
|
|
63
70
|
channels={['x1', 'x2', 'y1', 'y2', 'fill', 'stroke', 'opacity', 'fillOpacity', 'strokeOpacity']}
|
|
64
71
|
{...markProps}
|
|
65
|
-
{...args}
|
|
72
|
+
{...args}
|
|
73
|
+
type="rect">
|
|
66
74
|
{#snippet children({ usedScales, scaledData })}
|
|
67
75
|
{#if canvas}
|
|
68
76
|
{@const rectCanvasData = scaledData.map((d) => {
|