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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CurveFactory } from 'd3-shape';
|
|
1
|
+
import { type Area, type CurveFactory } from 'd3-shape';
|
|
2
2
|
import type { CurveName, DataRecord, ConstantAccessor, ChannelAccessor, LinkableMarkProps, RawValue } from '../types/index.js';
|
|
3
3
|
import type { StackOptions } from '../transforms/stack.js';
|
|
4
4
|
declare function $$render<Datum extends DataRecord>(): {
|
|
@@ -9,10 +9,20 @@ declare function $$render<Datum extends DataRecord>(): {
|
|
|
9
9
|
fy: ChannelAccessor<Datum>;
|
|
10
10
|
dx: ConstantAccessor<number, Datum>;
|
|
11
11
|
dy: ConstantAccessor<number, Datum>;
|
|
12
|
-
dodgeX: import("../transforms/dodge").DodgeXOptions;
|
|
13
|
-
dodgeY: import("../transforms/dodge").DodgeYOptions;
|
|
12
|
+
dodgeX: import("../transforms/dodge.js").DodgeXOptions;
|
|
13
|
+
dodgeY: import("../transforms/dodge.js").DodgeYOptions;
|
|
14
14
|
fill: ChannelAccessor<Datum>;
|
|
15
15
|
fillOpacity: ConstantAccessor<number, Datum>;
|
|
16
|
+
fontFamily: ConstantAccessor<import("csstype").Property.FontFamily, Datum>;
|
|
17
|
+
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>;
|
|
18
|
+
fontStyle: ConstantAccessor<import("csstype").Property.FontStyle, Datum>;
|
|
19
|
+
fontVariant: ConstantAccessor<import("csstype").Property.FontVariant, Datum>;
|
|
20
|
+
fontWeight: ConstantAccessor<import("csstype").Property.FontWeight, Datum>;
|
|
21
|
+
letterSpacing: ConstantAccessor<import("csstype").Property.LetterSpacing<0 | (string & {})>, Datum>;
|
|
22
|
+
wordSpacing: ConstantAccessor<import("csstype").Property.WordSpacing<0 | (string & {})>, Datum>;
|
|
23
|
+
textAnchor: ConstantAccessor<import("csstype").Property.TextAnchor, Datum>;
|
|
24
|
+
textTransform: ConstantAccessor<import("csstype").Property.TextTransform, Datum>;
|
|
25
|
+
textDecoration: ConstantAccessor<import("csstype").Property.TextDecoration<0 | (string & {})>, Datum>;
|
|
16
26
|
sort: ((a: RawValue, b: RawValue) => number) | {
|
|
17
27
|
channel: string;
|
|
18
28
|
order?: "ascending" | "descending";
|
|
@@ -26,59 +36,133 @@ declare function $$render<Datum extends DataRecord>(): {
|
|
|
26
36
|
opacity: ChannelAccessor<Datum>;
|
|
27
37
|
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
28
38
|
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
39
|
+
blend: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
29
40
|
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
30
41
|
clipPath: string;
|
|
31
42
|
mask: string;
|
|
32
43
|
imageFilter: ConstantAccessor<string, Datum>;
|
|
33
44
|
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
34
45
|
paintOrder: ConstantAccessor<string, Datum>;
|
|
35
|
-
onclick:
|
|
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
|
-
|
|
64
|
-
|
|
46
|
+
onclick: (event: Event & {
|
|
47
|
+
currentTarget: SVGPathElement;
|
|
48
|
+
}, datum: Datum, index: number) => void;
|
|
49
|
+
ondblclick: (event: Event & {
|
|
50
|
+
currentTarget: SVGPathElement;
|
|
51
|
+
}, datum: Datum, index: number) => void;
|
|
52
|
+
onmouseup: (event: Event & {
|
|
53
|
+
currentTarget: SVGPathElement;
|
|
54
|
+
}, datum: Datum, index: number) => void;
|
|
55
|
+
onmousedown: (event: Event & {
|
|
56
|
+
currentTarget: SVGPathElement;
|
|
57
|
+
}, datum: Datum, index: number) => void;
|
|
58
|
+
onmouseenter: (event: Event & {
|
|
59
|
+
currentTarget: SVGPathElement;
|
|
60
|
+
}, datum: Datum, index: number) => void;
|
|
61
|
+
onmousemove: (event: Event & {
|
|
62
|
+
currentTarget: SVGPathElement;
|
|
63
|
+
}, datum: Datum, index: number) => void;
|
|
64
|
+
onmouseleave: (event: Event & {
|
|
65
|
+
currentTarget: SVGPathElement;
|
|
66
|
+
}, datum: Datum, index: number) => void;
|
|
67
|
+
onmouseout: (event: Event & {
|
|
68
|
+
currentTarget: SVGPathElement;
|
|
69
|
+
}, datum: Datum, index: number) => void;
|
|
70
|
+
onmouseover: (event: Event & {
|
|
71
|
+
currentTarget: SVGPathElement;
|
|
72
|
+
}, datum: Datum, index: number) => void;
|
|
73
|
+
onpointercancel: (event: Event & {
|
|
74
|
+
currentTarget: SVGPathElement;
|
|
75
|
+
}, datum: Datum, index: number) => void;
|
|
76
|
+
onpointerdown: (event: Event & {
|
|
77
|
+
currentTarget: SVGPathElement;
|
|
78
|
+
}, datum: Datum, index: number) => void;
|
|
79
|
+
onpointerup: (event: Event & {
|
|
80
|
+
currentTarget: SVGPathElement;
|
|
81
|
+
}, datum: Datum, index: number) => void;
|
|
82
|
+
onpointerenter: (event: Event & {
|
|
83
|
+
currentTarget: SVGPathElement;
|
|
84
|
+
}, datum: Datum, index: number) => void;
|
|
85
|
+
onpointerleave: (event: Event & {
|
|
86
|
+
currentTarget: SVGPathElement;
|
|
87
|
+
}, datum: Datum, index: number) => void;
|
|
88
|
+
onpointermove: (event: Event & {
|
|
89
|
+
currentTarget: SVGPathElement;
|
|
90
|
+
}, datum: Datum, index: number) => void;
|
|
91
|
+
onpointerover: (event: Event & {
|
|
92
|
+
currentTarget: SVGPathElement;
|
|
93
|
+
}, datum: Datum, index: number) => void;
|
|
94
|
+
onpointerout: (event: Event & {
|
|
95
|
+
currentTarget: SVGPathElement;
|
|
96
|
+
}, datum: Datum, index: number) => void;
|
|
97
|
+
ondrag: (event: Event & {
|
|
98
|
+
currentTarget: SVGPathElement;
|
|
99
|
+
}, datum: Datum, index: number) => void;
|
|
100
|
+
ondrop: (event: Event & {
|
|
101
|
+
currentTarget: SVGPathElement;
|
|
102
|
+
}, datum: Datum, index: number) => void;
|
|
103
|
+
ondragstart: (event: Event & {
|
|
104
|
+
currentTarget: SVGPathElement;
|
|
105
|
+
}, datum: Datum, index: number) => void;
|
|
106
|
+
ondragenter: (event: Event & {
|
|
107
|
+
currentTarget: SVGPathElement;
|
|
108
|
+
}, datum: Datum, index: number) => void;
|
|
109
|
+
ondragleave: (event: Event & {
|
|
110
|
+
currentTarget: SVGPathElement;
|
|
111
|
+
}, datum: Datum, index: number) => void;
|
|
112
|
+
ondragover: (event: Event & {
|
|
113
|
+
currentTarget: SVGPathElement;
|
|
114
|
+
}, datum: Datum, index: number) => void;
|
|
115
|
+
ondragend: (event: Event & {
|
|
116
|
+
currentTarget: SVGPathElement;
|
|
117
|
+
}, datum: Datum, index: number) => void;
|
|
118
|
+
ontouchstart: (event: Event & {
|
|
119
|
+
currentTarget: SVGPathElement;
|
|
120
|
+
}, datum: Datum, index: number) => void;
|
|
121
|
+
ontouchmove: (event: Event & {
|
|
122
|
+
currentTarget: SVGPathElement;
|
|
123
|
+
}, datum: Datum, index: number) => void;
|
|
124
|
+
ontouchend: (event: Event & {
|
|
125
|
+
currentTarget: SVGPathElement;
|
|
126
|
+
}, datum: Datum, index: number) => void;
|
|
127
|
+
ontouchcancel: (event: Event & {
|
|
128
|
+
currentTarget: SVGPathElement;
|
|
129
|
+
}, datum: Datum, index: number) => void;
|
|
130
|
+
oncontextmenu: (event: Event & {
|
|
131
|
+
currentTarget: SVGPathElement;
|
|
132
|
+
}, datum: Datum, index: number) => void;
|
|
133
|
+
onwheel: (event: Event & {
|
|
134
|
+
currentTarget: SVGPathElement;
|
|
135
|
+
}, datum: Datum, index: number) => void;
|
|
65
136
|
class: string;
|
|
66
137
|
style: string;
|
|
67
138
|
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
139
|
+
title: ConstantAccessor<string, Datum>;
|
|
68
140
|
}> & LinkableMarkProps<Datum> & {
|
|
69
|
-
data
|
|
141
|
+
/** the input data array; each element becomes one point in the area */
|
|
142
|
+
data?: Datum[];
|
|
143
|
+
/** the starting horizontal position channel for the area baseline */
|
|
70
144
|
x1?: ChannelAccessor<Datum>;
|
|
145
|
+
/** the ending horizontal position channel for the area topline */
|
|
71
146
|
x2?: ChannelAccessor<Datum>;
|
|
147
|
+
/** the starting vertical position channel for the area baseline */
|
|
72
148
|
y1?: ChannelAccessor<Datum>;
|
|
149
|
+
/** the ending vertical position channel for the area topline */
|
|
73
150
|
y2?: ChannelAccessor<Datum>;
|
|
151
|
+
/** the series channel; data is grouped into separate areas by unique z values */
|
|
74
152
|
z?: ChannelAccessor<Datum>;
|
|
153
|
+
/** the curve interpolation method for connecting data points */
|
|
75
154
|
curve?: CurveName | CurveFactory;
|
|
155
|
+
/** the tension parameter for cardinal or Catmull-Rom curve interpolation */
|
|
76
156
|
tension?: number;
|
|
157
|
+
/** controls the order of data points before rendering */
|
|
77
158
|
sort?: ConstantAccessor<RawValue> | {
|
|
78
159
|
channel: "stroke" | "fill";
|
|
79
160
|
};
|
|
161
|
+
/** options for stacking area data values */
|
|
80
162
|
stack?: Partial<StackOptions>;
|
|
163
|
+
/** if true, renders using Canvas instead of SVG */
|
|
81
164
|
canvas?: boolean;
|
|
165
|
+
/** CSS class name(s) to apply to individual area path elements */
|
|
82
166
|
areaClass?: ConstantAccessor<string, Datum>;
|
|
83
167
|
};
|
|
84
168
|
exports: {};
|
package/dist/marks/AreaX.svelte
CHANGED
|
@@ -3,33 +3,67 @@
|
|
|
3
3
|
stacked horizontally if just the x channel is defined.
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts" generics="Datum extends DataRow">
|
|
6
|
-
interface AreaXMarkProps extends
|
|
6
|
+
interface AreaXMarkProps extends BaseMarkProps<Datum>, LinkableMarkProps<Datum> {
|
|
7
|
+
/** the input data array; each element becomes one point in the area */
|
|
8
|
+
data?: Datum[];
|
|
9
|
+
/** the horizontal position channel, implicit stacking is used to derive x1 and x2 channels */
|
|
7
10
|
x?: ChannelAccessor<Datum>;
|
|
11
|
+
/** the horizontal position channel of the lower end of bands */
|
|
12
|
+
x1?: ChannelAccessor<Datum>;
|
|
13
|
+
/** the horizontal position channel of the upper end of bands */
|
|
14
|
+
x2?: ChannelAccessor<Datum>;
|
|
15
|
+
/** the vertical position channel */
|
|
8
16
|
y?: ChannelAccessor<Datum>;
|
|
17
|
+
/** the series channel; data is grouped into separate areas by unique z values */
|
|
18
|
+
z?: ChannelAccessor<Datum>;
|
|
19
|
+
/** the curve interpolation method for connecting data points */
|
|
20
|
+
curve?: CurveName | CurveFactory;
|
|
21
|
+
/** the tension parameter for cardinal or Catmull-Rom curve interpolation */
|
|
22
|
+
tension?: number;
|
|
23
|
+
/** controls the order of data points before rendering */
|
|
24
|
+
sort?: ConstantAccessor<RawValue, Datum> | { channel: 'stroke' | 'fill' };
|
|
25
|
+
/** options for stacking area data values */
|
|
26
|
+
stack?: Partial<StackOptions>;
|
|
27
|
+
/** if true, renders using Canvas instead of SVG */
|
|
28
|
+
canvas?: boolean;
|
|
29
|
+
/** CSS class name(s) to apply to individual area path elements */
|
|
30
|
+
areaClass?: ConstantAccessor<string, Datum>;
|
|
9
31
|
}
|
|
10
32
|
import Area from './Area.svelte';
|
|
11
33
|
import { renameChannels } from '../transforms/rename.js';
|
|
12
34
|
import { stackX } from '../transforms/stack.js';
|
|
13
35
|
import { recordizeX } from '../transforms/recordize.js';
|
|
14
|
-
import type {
|
|
15
|
-
import {
|
|
36
|
+
import type { CurveFactory } from 'd3-shape';
|
|
37
|
+
import type { StackOptions } from '../transforms/stack.js';
|
|
38
|
+
import type {
|
|
39
|
+
BaseMarkProps,
|
|
40
|
+
ChannelAccessor,
|
|
41
|
+
ConstantAccessor,
|
|
42
|
+
CurveName,
|
|
43
|
+
DataRow,
|
|
44
|
+
LinkableMarkProps,
|
|
45
|
+
RawValue
|
|
46
|
+
} from '../types/index.js';
|
|
16
47
|
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
17
48
|
|
|
18
49
|
let markProps: AreaXMarkProps = $props();
|
|
19
50
|
|
|
20
51
|
const DEFAULTS = getPlotDefaults().areaX;
|
|
21
52
|
|
|
22
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
data = [],
|
|
55
|
+
stack,
|
|
56
|
+
...options
|
|
57
|
+
}: AreaXMarkProps = $derived({
|
|
23
58
|
...(markProps.x == undefined ? { x1: 0, x2: 0 } : {}),
|
|
24
59
|
...DEFAULTS,
|
|
25
60
|
...markProps
|
|
26
61
|
});
|
|
27
62
|
|
|
28
63
|
const args = $derived(
|
|
29
|
-
renameChannels
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
64
|
+
renameChannels(stackX(recordizeX({ data, ...options, y1: null, y2: null }), stack), {
|
|
65
|
+
y: 'y1'
|
|
66
|
+
})
|
|
33
67
|
);
|
|
34
68
|
</script>
|
|
35
69
|
|
|
@@ -1,86 +1,169 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CurveFactory } from 'd3-shape';
|
|
2
|
+
import type { StackOptions } from '../transforms/stack.js';
|
|
3
|
+
import type { ChannelAccessor, ConstantAccessor, CurveName, DataRow, LinkableMarkProps, RawValue } from '../types/index.js';
|
|
2
4
|
declare function $$render<Datum extends DataRow>(): {
|
|
3
|
-
props:
|
|
4
|
-
filter:
|
|
5
|
+
props: Partial<{
|
|
6
|
+
filter: ConstantAccessor<boolean, Datum>;
|
|
5
7
|
facet: "auto" | "include" | "exclude";
|
|
6
|
-
fx: ChannelAccessor<
|
|
7
|
-
fy: ChannelAccessor<
|
|
8
|
-
dx:
|
|
9
|
-
dy:
|
|
10
|
-
dodgeX: import("../transforms/dodge").DodgeXOptions;
|
|
11
|
-
dodgeY: import("../transforms/dodge").DodgeYOptions;
|
|
12
|
-
fill: ChannelAccessor<
|
|
13
|
-
fillOpacity:
|
|
14
|
-
|
|
8
|
+
fx: ChannelAccessor<Datum>;
|
|
9
|
+
fy: ChannelAccessor<Datum>;
|
|
10
|
+
dx: ConstantAccessor<number, Datum>;
|
|
11
|
+
dy: ConstantAccessor<number, Datum>;
|
|
12
|
+
dodgeX: import("../transforms/dodge.js").DodgeXOptions;
|
|
13
|
+
dodgeY: import("../transforms/dodge.js").DodgeYOptions;
|
|
14
|
+
fill: ChannelAccessor<Datum>;
|
|
15
|
+
fillOpacity: ConstantAccessor<number, Datum>;
|
|
16
|
+
fontFamily: ConstantAccessor<import("csstype").Property.FontFamily, Datum>;
|
|
17
|
+
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>;
|
|
18
|
+
fontStyle: ConstantAccessor<import("csstype").Property.FontStyle, Datum>;
|
|
19
|
+
fontVariant: ConstantAccessor<import("csstype").Property.FontVariant, Datum>;
|
|
20
|
+
fontWeight: ConstantAccessor<import("csstype").Property.FontWeight, Datum>;
|
|
21
|
+
letterSpacing: ConstantAccessor<import("csstype").Property.LetterSpacing<0 | (string & {})>, Datum>;
|
|
22
|
+
wordSpacing: ConstantAccessor<import("csstype").Property.WordSpacing<0 | (string & {})>, Datum>;
|
|
23
|
+
textAnchor: ConstantAccessor<import("csstype").Property.TextAnchor, Datum>;
|
|
24
|
+
textTransform: ConstantAccessor<import("csstype").Property.TextTransform, Datum>;
|
|
25
|
+
textDecoration: ConstantAccessor<import("csstype").Property.TextDecoration<0 | (string & {})>, Datum>;
|
|
26
|
+
sort: ((a: RawValue, b: RawValue) => number) | {
|
|
15
27
|
channel: string;
|
|
16
28
|
order?: "ascending" | "descending";
|
|
17
|
-
} |
|
|
18
|
-
stroke: ChannelAccessor<
|
|
19
|
-
strokeWidth:
|
|
20
|
-
strokeOpacity:
|
|
21
|
-
strokeLinejoin:
|
|
22
|
-
strokeLinecap:
|
|
23
|
-
strokeMiterlimit:
|
|
24
|
-
opacity: ChannelAccessor<
|
|
25
|
-
strokeDasharray:
|
|
26
|
-
strokeDashoffset:
|
|
27
|
-
|
|
29
|
+
} | ConstantAccessor<RawValue, Datum>;
|
|
30
|
+
stroke: ChannelAccessor<Datum>;
|
|
31
|
+
strokeWidth: ConstantAccessor<number, Datum>;
|
|
32
|
+
strokeOpacity: ConstantAccessor<number, Datum>;
|
|
33
|
+
strokeLinejoin: ConstantAccessor<import("csstype").Property.StrokeLinejoin, Datum>;
|
|
34
|
+
strokeLinecap: ConstantAccessor<import("csstype").Property.StrokeLinecap, Datum>;
|
|
35
|
+
strokeMiterlimit: ConstantAccessor<number, Datum>;
|
|
36
|
+
opacity: ChannelAccessor<Datum>;
|
|
37
|
+
strokeDasharray: ConstantAccessor<string, Datum>;
|
|
38
|
+
strokeDashoffset: ConstantAccessor<number, Datum>;
|
|
39
|
+
blend: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
40
|
+
mixBlendMode: ConstantAccessor<import("csstype").Property.MixBlendMode, Datum>;
|
|
28
41
|
clipPath: string;
|
|
29
42
|
mask: string;
|
|
30
|
-
imageFilter:
|
|
31
|
-
shapeRendering:
|
|
32
|
-
paintOrder:
|
|
33
|
-
onclick:
|
|
34
|
-
|
|
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
|
-
|
|
43
|
+
imageFilter: ConstantAccessor<string, Datum>;
|
|
44
|
+
shapeRendering: ConstantAccessor<import("csstype").Property.ShapeRendering, Datum>;
|
|
45
|
+
paintOrder: ConstantAccessor<string, Datum>;
|
|
46
|
+
onclick: (event: Event & {
|
|
47
|
+
currentTarget: SVGPathElement;
|
|
48
|
+
}, datum: Datum, index: number) => void;
|
|
49
|
+
ondblclick: (event: Event & {
|
|
50
|
+
currentTarget: SVGPathElement;
|
|
51
|
+
}, datum: Datum, index: number) => void;
|
|
52
|
+
onmouseup: (event: Event & {
|
|
53
|
+
currentTarget: SVGPathElement;
|
|
54
|
+
}, datum: Datum, index: number) => void;
|
|
55
|
+
onmousedown: (event: Event & {
|
|
56
|
+
currentTarget: SVGPathElement;
|
|
57
|
+
}, datum: Datum, index: number) => void;
|
|
58
|
+
onmouseenter: (event: Event & {
|
|
59
|
+
currentTarget: SVGPathElement;
|
|
60
|
+
}, datum: Datum, index: number) => void;
|
|
61
|
+
onmousemove: (event: Event & {
|
|
62
|
+
currentTarget: SVGPathElement;
|
|
63
|
+
}, datum: Datum, index: number) => void;
|
|
64
|
+
onmouseleave: (event: Event & {
|
|
65
|
+
currentTarget: SVGPathElement;
|
|
66
|
+
}, datum: Datum, index: number) => void;
|
|
67
|
+
onmouseout: (event: Event & {
|
|
68
|
+
currentTarget: SVGPathElement;
|
|
69
|
+
}, datum: Datum, index: number) => void;
|
|
70
|
+
onmouseover: (event: Event & {
|
|
71
|
+
currentTarget: SVGPathElement;
|
|
72
|
+
}, datum: Datum, index: number) => void;
|
|
73
|
+
onpointercancel: (event: Event & {
|
|
74
|
+
currentTarget: SVGPathElement;
|
|
75
|
+
}, datum: Datum, index: number) => void;
|
|
76
|
+
onpointerdown: (event: Event & {
|
|
77
|
+
currentTarget: SVGPathElement;
|
|
78
|
+
}, datum: Datum, index: number) => void;
|
|
79
|
+
onpointerup: (event: Event & {
|
|
80
|
+
currentTarget: SVGPathElement;
|
|
81
|
+
}, datum: Datum, index: number) => void;
|
|
82
|
+
onpointerenter: (event: Event & {
|
|
83
|
+
currentTarget: SVGPathElement;
|
|
84
|
+
}, datum: Datum, index: number) => void;
|
|
85
|
+
onpointerleave: (event: Event & {
|
|
86
|
+
currentTarget: SVGPathElement;
|
|
87
|
+
}, datum: Datum, index: number) => void;
|
|
88
|
+
onpointermove: (event: Event & {
|
|
89
|
+
currentTarget: SVGPathElement;
|
|
90
|
+
}, datum: Datum, index: number) => void;
|
|
91
|
+
onpointerover: (event: Event & {
|
|
92
|
+
currentTarget: SVGPathElement;
|
|
93
|
+
}, datum: Datum, index: number) => void;
|
|
94
|
+
onpointerout: (event: Event & {
|
|
95
|
+
currentTarget: SVGPathElement;
|
|
96
|
+
}, datum: Datum, index: number) => void;
|
|
97
|
+
ondrag: (event: Event & {
|
|
98
|
+
currentTarget: SVGPathElement;
|
|
99
|
+
}, datum: Datum, index: number) => void;
|
|
100
|
+
ondrop: (event: Event & {
|
|
101
|
+
currentTarget: SVGPathElement;
|
|
102
|
+
}, datum: Datum, index: number) => void;
|
|
103
|
+
ondragstart: (event: Event & {
|
|
104
|
+
currentTarget: SVGPathElement;
|
|
105
|
+
}, datum: Datum, index: number) => void;
|
|
106
|
+
ondragenter: (event: Event & {
|
|
107
|
+
currentTarget: SVGPathElement;
|
|
108
|
+
}, datum: Datum, index: number) => void;
|
|
109
|
+
ondragleave: (event: Event & {
|
|
110
|
+
currentTarget: SVGPathElement;
|
|
111
|
+
}, datum: Datum, index: number) => void;
|
|
112
|
+
ondragover: (event: Event & {
|
|
113
|
+
currentTarget: SVGPathElement;
|
|
114
|
+
}, datum: Datum, index: number) => void;
|
|
115
|
+
ondragend: (event: Event & {
|
|
116
|
+
currentTarget: SVGPathElement;
|
|
117
|
+
}, datum: Datum, index: number) => void;
|
|
118
|
+
ontouchstart: (event: Event & {
|
|
119
|
+
currentTarget: SVGPathElement;
|
|
120
|
+
}, datum: Datum, index: number) => void;
|
|
121
|
+
ontouchmove: (event: Event & {
|
|
122
|
+
currentTarget: SVGPathElement;
|
|
123
|
+
}, datum: Datum, index: number) => void;
|
|
124
|
+
ontouchend: (event: Event & {
|
|
125
|
+
currentTarget: SVGPathElement;
|
|
126
|
+
}, datum: Datum, index: number) => void;
|
|
127
|
+
ontouchcancel: (event: Event & {
|
|
128
|
+
currentTarget: SVGPathElement;
|
|
129
|
+
}, datum: Datum, index: number) => void;
|
|
130
|
+
oncontextmenu: (event: Event & {
|
|
131
|
+
currentTarget: SVGPathElement;
|
|
132
|
+
}, datum: Datum, index: number) => void;
|
|
133
|
+
onwheel: (event: Event & {
|
|
134
|
+
currentTarget: SVGPathElement;
|
|
135
|
+
}, datum: Datum, index: number) => void;
|
|
63
136
|
class: string;
|
|
64
137
|
style: string;
|
|
65
|
-
cursor:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
138
|
+
cursor: ConstantAccessor<import("csstype").Property.Cursor, Datum>;
|
|
139
|
+
title: ConstantAccessor<string, Datum>;
|
|
140
|
+
}> & LinkableMarkProps<Datum> & {
|
|
141
|
+
/** the input data array; each element becomes one point in the area */
|
|
142
|
+
data?: Datum[];
|
|
143
|
+
/** the horizontal position channel, implicit stacking is used to derive x1 and x2 channels */
|
|
144
|
+
x?: ChannelAccessor<Datum>;
|
|
145
|
+
/** the horizontal position channel of the lower end of bands */
|
|
146
|
+
x1?: ChannelAccessor<Datum>;
|
|
147
|
+
/** the horizontal position channel of the upper end of bands */
|
|
148
|
+
x2?: ChannelAccessor<Datum>;
|
|
149
|
+
/** the vertical position channel */
|
|
150
|
+
y?: ChannelAccessor<Datum>;
|
|
151
|
+
/** the series channel; data is grouped into separate areas by unique z values */
|
|
152
|
+
z?: ChannelAccessor<Datum>;
|
|
153
|
+
/** the curve interpolation method for connecting data points */
|
|
154
|
+
curve?: CurveName | CurveFactory;
|
|
155
|
+
/** the tension parameter for cardinal or Catmull-Rom curve interpolation */
|
|
74
156
|
tension?: number;
|
|
75
|
-
|
|
157
|
+
/** controls the order of data points before rendering */
|
|
158
|
+
sort?: ConstantAccessor<RawValue, Datum> | {
|
|
76
159
|
channel: "stroke" | "fill";
|
|
77
160
|
};
|
|
78
|
-
|
|
161
|
+
/** options for stacking area data values */
|
|
162
|
+
stack?: Partial<StackOptions>;
|
|
163
|
+
/** if true, renders using Canvas instead of SVG */
|
|
79
164
|
canvas?: boolean;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
x?: ChannelAccessor<Datum>;
|
|
83
|
-
y?: ChannelAccessor<Datum>;
|
|
165
|
+
/** CSS class name(s) to apply to individual area path elements */
|
|
166
|
+
areaClass?: ConstantAccessor<string, Datum>;
|
|
84
167
|
};
|
|
85
168
|
exports: {};
|
|
86
169
|
bindings: "";
|
package/dist/marks/AreaY.svelte
CHANGED
|
@@ -3,33 +3,67 @@
|
|
|
3
3
|
stacked vertically if just the y channel is defined.
|
|
4
4
|
-->
|
|
5
5
|
<script lang="ts" generics="Datum extends DataRow">
|
|
6
|
-
interface AreaYMarkProps extends
|
|
6
|
+
interface AreaYMarkProps extends BaseMarkProps<Datum>, LinkableMarkProps<Datum> {
|
|
7
|
+
/** the input data array; each element becomes one point in the area */
|
|
8
|
+
data?: Datum[];
|
|
9
|
+
/** the horizontal position channel */
|
|
7
10
|
x?: ChannelAccessor<Datum>;
|
|
11
|
+
/** the vertical position channel. Implicit stacking is used to derive y1 and y2 */
|
|
8
12
|
y?: ChannelAccessor<Datum>;
|
|
13
|
+
/** the vertical position channel of the lower end of bands */
|
|
14
|
+
y1?: ChannelAccessor<Datum>;
|
|
15
|
+
/** the vertical position channel of the upper end of bands */
|
|
16
|
+
y2?: ChannelAccessor<Datum>;
|
|
17
|
+
/** the series channel; data is grouped into separate areas by unique z values */
|
|
18
|
+
z?: ChannelAccessor<Datum>;
|
|
19
|
+
/** the curve interpolation method for connecting data points */
|
|
20
|
+
curve?: CurveName | CurveFactory;
|
|
21
|
+
/** the tension parameter for cardinal or Catmull-Rom curve interpolation */
|
|
22
|
+
tension?: number;
|
|
23
|
+
/** controls the order of data points before rendering */
|
|
24
|
+
sort?: ConstantAccessor<RawValue, Datum> | { channel: 'stroke' | 'fill' };
|
|
25
|
+
/** options for stacking area data values */
|
|
26
|
+
stack?: Partial<StackOptions>;
|
|
27
|
+
/** if true, renders using Canvas instead of SVG */
|
|
28
|
+
canvas?: boolean;
|
|
29
|
+
/** CSS class name(s) to apply to individual area path elements */
|
|
30
|
+
areaClass?: ConstantAccessor<string, Datum>;
|
|
9
31
|
}
|
|
10
32
|
import Area from './Area.svelte';
|
|
11
33
|
import { renameChannels } from '../transforms/rename.js';
|
|
12
34
|
import { stackY } from '../transforms/stack.js';
|
|
13
35
|
import { recordizeY } from '../transforms/recordize.js';
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
36
|
+
import type { CurveFactory } from 'd3-shape';
|
|
37
|
+
import type { StackOptions } from '../transforms/stack.js';
|
|
38
|
+
import type {
|
|
39
|
+
BaseMarkProps,
|
|
40
|
+
ChannelAccessor,
|
|
41
|
+
ConstantAccessor,
|
|
42
|
+
CurveName,
|
|
43
|
+
DataRow,
|
|
44
|
+
LinkableMarkProps,
|
|
45
|
+
RawValue
|
|
46
|
+
} from '../types/index.js';
|
|
16
47
|
import { getPlotDefaults } from '../hooks/plotDefaults.js';
|
|
17
48
|
|
|
18
49
|
let markProps: AreaYMarkProps = $props();
|
|
19
50
|
|
|
20
51
|
const DEFAULTS = getPlotDefaults().areaY;
|
|
21
52
|
|
|
22
|
-
const {
|
|
53
|
+
const {
|
|
54
|
+
data = [],
|
|
55
|
+
stack,
|
|
56
|
+
...options
|
|
57
|
+
}: AreaYMarkProps = $derived({
|
|
23
58
|
...(markProps.y == undefined ? { y1: 0, y2: 0 } : {}),
|
|
24
59
|
...DEFAULTS,
|
|
25
60
|
...markProps
|
|
26
61
|
});
|
|
27
62
|
|
|
28
63
|
const args = $derived(
|
|
29
|
-
renameChannels
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
)
|
|
64
|
+
renameChannels(stackY(recordizeY({ data, ...options, x1: null, x2: null }), stack), {
|
|
65
|
+
x: 'x1'
|
|
66
|
+
})
|
|
33
67
|
);
|
|
34
68
|
</script>
|
|
35
69
|
|