vgplot 0.29.0__py3-none-any.whl
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.
- vgplot/__init__.py +102 -0
- vgplot/_generated/__init__.py +10 -0
- vgplot/_generated/attributes.py +1293 -0
- vgplot/_generated/encodings.py +252 -0
- vgplot/_generated/marks.py +4124 -0
- vgplot/_types.py +29 -0
- vgplot/data.py +55 -0
- vgplot/encodings.py +11 -0
- vgplot/params.py +90 -0
- vgplot/plot.py +546 -0
- vgplot/spec.py +304 -0
- vgplot/util.py +14 -0
- vgplot-0.29.0.dist-info/METADATA +136 -0
- vgplot-0.29.0.dist-info/RECORD +15 -0
- vgplot-0.29.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
# DO NOT EDIT. Generated from the Mosaic JSON schema by bin/generate-python-api.js.
|
|
2
|
+
# Regenerate with: pnpm run generate:python-api
|
|
3
|
+
|
|
4
|
+
from typing import Any
|
|
5
|
+
|
|
6
|
+
from .._types import UNSET, TransformArg
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def _transform(
|
|
10
|
+
name: str, args: tuple[Any, ...], options: dict[str, Any]
|
|
11
|
+
) -> dict[str, Any]:
|
|
12
|
+
vals = [a for a in args if a is not UNSET]
|
|
13
|
+
value: Any = vals[0] if len(vals) == 1 else vals or ""
|
|
14
|
+
return {name: value, **options}
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def argmax(col: TransformArg, by: TransformArg, **options: Any) -> dict[str, Any]:
|
|
18
|
+
"""Find a value of the first column that maximizes the second column."""
|
|
19
|
+
return _transform("argmax", (col, by), options)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def argmin(col: TransformArg, by: TransformArg, **options: Any) -> dict[str, Any]:
|
|
23
|
+
"""Find a value of the first column that minimizes the second column."""
|
|
24
|
+
return _transform("argmin", (col, by), options)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def avg(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
28
|
+
"""Compute the average (mean) value of the given column."""
|
|
29
|
+
return _transform("avg", (col,), options)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def bin(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
33
|
+
"""Bin a continuous variable into discrete intervals."""
|
|
34
|
+
return _transform("bin", (col,), options)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def centroid(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
38
|
+
"""Compute the 2D centroid of geometry-typed data."""
|
|
39
|
+
return _transform("centroid", (col,), options)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
def centroid_x(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
43
|
+
"""Compute the centroid x-coordinate of geometry-typed data."""
|
|
44
|
+
return _transform("centroidX", (col,), options)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
def centroid_y(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
48
|
+
"""Compute the centroid y-coordinate of geometry-typed data."""
|
|
49
|
+
return _transform("centroidY", (col,), options)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def column(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
53
|
+
"""Interpret a string or param-value as a column reference."""
|
|
54
|
+
return _transform("column", (col,), options)
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def count(col: TransformArg = UNSET, **options: Any) -> dict[str, Any]:
|
|
58
|
+
"""Compute the count of records in an aggregation group."""
|
|
59
|
+
return _transform("count", (col,), options)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def cume_dist(**options: Any) -> dict[str, Any]:
|
|
63
|
+
"""Compute the cumulative distribution value over an ordered window partition."""
|
|
64
|
+
return {"cume_dist": None, **options}
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
def date_day(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
68
|
+
"""Transform a Date value to a day of the month for cyclic comparison."""
|
|
69
|
+
return _transform("dateDay", (col,), options)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def date_month(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
73
|
+
"""Transform a Date value to a month boundary for cyclic comparison."""
|
|
74
|
+
return _transform("dateMonth", (col,), options)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
def date_month_day(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
78
|
+
"""Transform a Date value to a month and day boundary for cyclic comparison."""
|
|
79
|
+
return _transform("dateMonthDay", (col,), options)
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
def dense_rank(**options: Any) -> dict[str, Any]:
|
|
83
|
+
"""Compute the dense row rank (no gaps) over an ordered window partition."""
|
|
84
|
+
return {"dense_rank": None, **options}
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def first(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
88
|
+
"""Return the first column value found in an aggregation group."""
|
|
89
|
+
return _transform("first", (col,), options)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def first_value(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
93
|
+
"""Get the first value of the given column in the current window frame."""
|
|
94
|
+
return _transform("first_value", (col,), options)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def geojson(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
98
|
+
"""Compute a GeoJSON-formatted string from geometry-typed data."""
|
|
99
|
+
return _transform("geojson", (col,), options)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def lag(
|
|
103
|
+
col: TransformArg,
|
|
104
|
+
offset: TransformArg = UNSET,
|
|
105
|
+
default: TransformArg = UNSET,
|
|
106
|
+
**options: Any,
|
|
107
|
+
) -> dict[str, Any]:
|
|
108
|
+
"""Compute lagging values in a column."""
|
|
109
|
+
return _transform("lag", (col, offset, default), options)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def last(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
113
|
+
"""Return the last column value found in an aggregation group."""
|
|
114
|
+
return _transform("last", (col,), options)
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def last_value(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
118
|
+
"""Get the last value of the given column in the current window frame."""
|
|
119
|
+
return _transform("last_value", (col,), options)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def lead(
|
|
123
|
+
col: TransformArg,
|
|
124
|
+
offset: TransformArg = UNSET,
|
|
125
|
+
default: TransformArg = UNSET,
|
|
126
|
+
**options: Any,
|
|
127
|
+
) -> dict[str, Any]:
|
|
128
|
+
"""Compute leading values in a column."""
|
|
129
|
+
return _transform("lead", (col, offset, default), options)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
def max(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
133
|
+
"""Compute the maximum value of the given column."""
|
|
134
|
+
return _transform("max", (col,), options)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def median(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
138
|
+
"""Compute the median value of the given column."""
|
|
139
|
+
return _transform("median", (col,), options)
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def min(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
143
|
+
"""Compute the minimum value of the given column."""
|
|
144
|
+
return _transform("min", (col,), options)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def mode(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
148
|
+
"""Compute the mode value of the given column."""
|
|
149
|
+
return _transform("mode", (col,), options)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
def nth_value(
|
|
153
|
+
col: TransformArg, offset: TransformArg = UNSET, **options: Any
|
|
154
|
+
) -> dict[str, Any]:
|
|
155
|
+
"""Get the nth value of the given column in the current window frame, counting from one."""
|
|
156
|
+
return _transform("nth_value", (col, offset), options)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def ntile(buckets: TransformArg, **options: Any) -> dict[str, Any]:
|
|
160
|
+
"""Compute an n-tile integer ranging from 1 to the provided argument (num_buckets), dividing the partition as equally as possible."""
|
|
161
|
+
return _transform("ntile", (buckets,), options)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
def percent_rank(**options: Any) -> dict[str, Any]:
|
|
165
|
+
"""Compute the percentage rank over an ordered window partition."""
|
|
166
|
+
return {"percent_rank": None, **options}
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def product(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
170
|
+
"""Compute the product of the given column."""
|
|
171
|
+
return _transform("product", (col,), options)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
def quantile(col: TransformArg, p: TransformArg, **options: Any) -> dict[str, Any]:
|
|
175
|
+
"""Compute the quantile value of the given column at the provided probability threshold."""
|
|
176
|
+
return _transform("quantile", (col, p), options)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
def rank(**options: Any) -> dict[str, Any]:
|
|
180
|
+
"""Compute the row rank over an ordered window partition."""
|
|
181
|
+
return {"rank": None, **options}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
def row_number(**options: Any) -> dict[str, Any]:
|
|
185
|
+
"""Compute the 1-based row number over an ordered window partition."""
|
|
186
|
+
return {"row_number": None, **options}
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
def stddev(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
190
|
+
"""Compute the sum of the given column."""
|
|
191
|
+
return _transform("stddev", (col,), options)
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
def stddev_pop(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
195
|
+
"""Compute the sum of the given column."""
|
|
196
|
+
return _transform("stddevPop", (col,), options)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
def sum(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
200
|
+
"""Compute the sum of the given column."""
|
|
201
|
+
return _transform("sum", (col,), options)
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
def variance(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
205
|
+
"""Compute the sample variance of the given column."""
|
|
206
|
+
return _transform("variance", (col,), options)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def var_pop(col: TransformArg, **options: Any) -> dict[str, Any]:
|
|
210
|
+
"""Compute the population variance of the given column."""
|
|
211
|
+
return _transform("varPop", (col,), options)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
__all__ = [
|
|
215
|
+
"argmax",
|
|
216
|
+
"argmin",
|
|
217
|
+
"avg",
|
|
218
|
+
"bin",
|
|
219
|
+
"centroid",
|
|
220
|
+
"centroid_x",
|
|
221
|
+
"centroid_y",
|
|
222
|
+
"column",
|
|
223
|
+
"count",
|
|
224
|
+
"cume_dist",
|
|
225
|
+
"date_day",
|
|
226
|
+
"date_month",
|
|
227
|
+
"date_month_day",
|
|
228
|
+
"dense_rank",
|
|
229
|
+
"first",
|
|
230
|
+
"first_value",
|
|
231
|
+
"geojson",
|
|
232
|
+
"lag",
|
|
233
|
+
"last",
|
|
234
|
+
"last_value",
|
|
235
|
+
"lead",
|
|
236
|
+
"max",
|
|
237
|
+
"median",
|
|
238
|
+
"min",
|
|
239
|
+
"mode",
|
|
240
|
+
"nth_value",
|
|
241
|
+
"ntile",
|
|
242
|
+
"percent_rank",
|
|
243
|
+
"product",
|
|
244
|
+
"quantile",
|
|
245
|
+
"rank",
|
|
246
|
+
"row_number",
|
|
247
|
+
"stddev",
|
|
248
|
+
"stddev_pop",
|
|
249
|
+
"sum",
|
|
250
|
+
"variance",
|
|
251
|
+
"var_pop",
|
|
252
|
+
]
|