|
2 | 2 | from textwrap import fill, indent
|
3 | 3 |
|
4 | 4 |
|
5 |
| -colref = ("str or int or Series or array-like", |
6 |
| - "Either a name of a column in `data_frame`, or a pandas Series or array_like object.") |
7 |
| - |
8 |
| -colref_list = ("list of str or int, or Series or array-like", |
9 |
| - "Either names of columns in `data_frame`, or pandas Series, or array_like objects") |
10 |
| - |
11 | 5 | # TODO contents of columns
|
12 | 6 | # TODO explain categorical
|
13 | 7 | # TODO handle color
|
|
16 | 10 | # TODO document "or `None`, default `None`" in various places
|
17 | 11 | # TODO standardize positioning and casing of 'default'
|
18 | 12 |
|
| 13 | +colref = ("str or int or Series or array-like", |
| 14 | + "Either a name of a column in `data_frame`, or a pandas Series or array_like object.") |
| 15 | + |
| 16 | +colref_list = ("list of str or int, or Series or array-like", |
| 17 | + "Either names of columns in `data_frame`, or pandas Series, or array_like objects") |
| 18 | + |
19 | 19 | docs = dict(
|
20 | 20 | data_frame=[
|
21 | 21 | "DataFrame or array-like or dict",
|
|
70 | 70 | "Values from this column or array_like are to be interpreted according to `locationmode` and mapped to longitude/latitude.",
|
71 | 71 | ],
|
72 | 72 | dimensions=[
|
73 |
| - "list of strings", |
| 73 | + "list of str", |
74 | 74 | "Names of columns in `data_frame` to be used in multidimensional visualization.",
|
75 | 75 | ],
|
76 | 76 | error_x=[
|
|
143 | 143 | "Values from this column or array_like appear in the figure as text labels.",
|
144 | 144 | ],
|
145 | 145 | locationmode=[
|
146 |
| - "string", |
| 146 | + "str", |
147 | 147 | "One of 'ISO-3', 'USA-states', or 'country names'",
|
148 | 148 | "Determines the set of locations used to match entries in `locations` to regions on the map.",
|
149 | 149 | ],
|
|
164 | 164 | "Values from this column or array_like are used to provide object-constancy across animation frames: rows with matching `animation_group`s will be treated as if they describe the same object in each frame.",
|
165 | 165 | ],
|
166 | 166 | symbol_sequence=[
|
167 |
| - "list of strings" |
| 167 | + "list of str" |
168 | 168 | "Strings should define valid plotly.js symbols.",
|
169 | 169 | "When `symbol` is set, values in that column are assigned symbols by cycling through `symbol_sequence` in the order described in `category_orders`, unless the value of `symbol` is a key in `symbol_map`.",
|
170 | 170 | ],
|
171 | 171 | symbol_map=[
|
172 |
| - "dict with string keys and string values (default `{}`)", |
| 172 | + "dict with str keys and str values (default `{}`)", |
173 | 173 | "String values should define plotly.js symbols",
|
174 | 174 | "Used to override `symbol_sequence` to assign a specific symbols to marks corresponding with specific values.",
|
175 | 175 | "Keys in `symbol_map` should be values in the column denoted by `symbol`.",
|
176 | 176 | ],
|
177 | 177 | line_dash_map=[
|
178 |
| - "dict with string keys and string values (default `{}`)", |
| 178 | + "dict with str keys and str values (default `{}`)", |
179 | 179 | "Strings values define plotly.js dash-patterns.",
|
180 | 180 | "Used to override `line_dash_sequences` to assign a specific dash-patterns to lines corresponding with specific values.",
|
181 | 181 | "Keys in `line_dash_map` should be values in the column denoted by `line_dash`.",
|
182 | 182 | ],
|
183 | 183 | line_dash_sequence=[
|
184 |
| - "list of strings", |
| 184 | + "list of str", |
185 | 185 | "Strings should define valid plotly.js dash-patterns.",
|
186 | 186 | "When `line_dash` is set, values in that column are assigned dash-patterns by cycling through `line_dash_sequence` in the order described in `category_orders`, unless the value of `line_dash` is a key in `line_dash_map`.",
|
187 | 187 | ],
|
188 | 188 | color_discrete_sequence=[
|
189 |
| - "list of strings", |
| 189 | + "list of str", |
190 | 190 | "Strings should define valid CSS-colors.",
|
191 | 191 | "When `color` is set and the values in the corresponding column are not numeric, values in that column are assigned colors by cycling through `color_discrete_sequence` in the order described in `category_orders`, unless the value of `color` is a key in `color_discrete_map`.",
|
192 | 192 | "Various useful color sequences are available in the `plotly_express.colors` submodules, specifically `plotly_express.colors.qualitative`.",
|
193 | 193 | ],
|
194 | 194 | color_discrete_map=[
|
195 |
| - "dict with string keys and string values (default `{}`)", |
| 195 | + "dict with str keys and str values (default `{}`)", |
196 | 196 | "String values should define valid CSS-colors",
|
197 | 197 | "Used to override `color_discrete_sequence` to assign a specific colors to marks corresponding with specific values.",
|
198 | 198 | "Keys in `color_discrete_map` should be values in the column denoted by `color`.",
|
199 | 199 | ],
|
200 | 200 | color_continuous_scale=[
|
201 |
| - "list of strings", |
| 201 | + "list of str", |
202 | 202 | "Strings should define valid CSS-colors",
|
203 | 203 | "This list is used to build a continuous color scale when the column denoted by `color` contains numeric data.",
|
204 | 204 | "Various useful color scales are available in the `plotly_express.colors` submodules, specifically `plotly_express.colors.sequential`, `plotly_express.colors.diverging` and `plotly_express.colors.cyclical`.",
|
|
208 | 208 | "If set, computes the bounds of the continuous color scale to have the desired midpoint.",
|
209 | 209 | "Setting this value is recommended when using `plotly_express.colors.diverging` color scales as the inputs to `color_continuous_scale`.",
|
210 | 210 | ],
|
211 |
| - size_max=["integer (default `20`)", "Set the maximum mark size when using `size`."], |
| 211 | + size_max=["int (default `20`)", "Set the maximum mark size when using `size`."], |
212 | 212 | log_x=[
|
213 | 213 | "boolean (default `False`)",
|
214 | 214 | "If `True`, the x-axis is log-scaled in cartesian coordinates.",
|
|
245 | 245 | "list of two numbers",
|
246 | 246 | "If provided, overrides auto-scaling on the radial axis in polar coordinates.",
|
247 | 247 | ],
|
248 |
| - title=["string", "The figure title."], |
| 248 | + title=["str", "The figure title."], |
249 | 249 | template=[
|
250 |
| - "string or Plotly.py template object", |
| 250 | + "str or Plotly.py template object", |
251 | 251 | "The figure template name or definition.",
|
252 | 252 | ],
|
253 |
| - width=["integer (default `None`)", "The figure width in pixels."], |
254 |
| - height=["integer (default `600`)", "The figure height in pixels."], |
| 253 | + width=["int (default `None`)", "The figure width in pixels."], |
| 254 | + height=["int (default `600`)", "The figure height in pixels."], |
255 | 255 | labels=[
|
256 |
| - "dict with string keys and string values (default `{}`)", |
| 256 | + "dict with str keys and str values (default `{}`)", |
257 | 257 | "By default, column names are used in the figure for axis titles, legend entries and hovers.",
|
258 | 258 | "This parameter allows this to be overridden.",
|
259 | 259 | "The keys of this dict should correspond to column names, and the values should correspond to the desired label to be displayed.",
|
260 | 260 | ],
|
261 | 261 | category_orders=[
|
262 |
| - "dict with string keys and list-of-string values (default `{}`)", |
| 262 | + "dict with str keys and list of str values (default `{}`)", |
263 | 263 | "By default, in Python 3.6+, the order of categorical values in axes, legends and facets depends on the order in which these values are first encountered in `data_frame` (and no order is guaranteed by default in Python below 3.6).",
|
264 | 264 | "This parameter is used to force a specific ordering of values per column.",
|
265 | 265 | "The keys of this dict should correspond to column names, and the values should be lists of strings corresponding to the specific display order desired.",
|
266 | 266 | ],
|
267 | 267 | marginal=[
|
268 |
| - "string", |
| 268 | + "str", |
269 | 269 | "One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
|
270 | 270 | "If set, a subplot is drawn alongside the main plot, visualizing the distribution.",
|
271 | 271 | ],
|
272 | 272 | marginal_x=[
|
273 |
| - "string", |
| 273 | + "str", |
274 | 274 | "One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
|
275 | 275 | "If set, a horizontal subplot is drawn above the main plot, visualizing the x-distribution.",
|
276 | 276 | ],
|
277 | 277 | marginal_y=[
|
278 |
| - "string", |
| 278 | + "str", |
279 | 279 | "One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
|
280 | 280 | "If set, a vertical subplot is drawn to the right of the main plot, visualizing the y-distribution.",
|
281 | 281 | ],
|
282 | 282 | trendline=[
|
283 |
| - "string", |
| 283 | + "str", |
284 | 284 | "One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
|
285 | 285 | "If `'ols'`, an Ordinary Least Squares regression line will be drawn for each discrete-color/symbol group.",
|
286 | 286 | "If `'lowess`', a Locally Weighted Scatterplot Smoothing line will be drawn for each discrete-color/symbol group.",
|
287 | 287 | ],
|
288 | 288 | trendline_color_override=[
|
289 |
| - "string", |
| 289 | + "str", |
290 | 290 | "Valid CSS color.",
|
291 | 291 | "If provided, and if `trendline` is set, all trendlines will be drawn in this color.",
|
292 | 292 | ],
|
293 | 293 | render_mode=[
|
294 |
| - "string", |
| 294 | + "str", |
295 | 295 | "One of `'auto'`, `'svg'` or `'webgl'`, default `'auto'`",
|
296 | 296 | "Controls the browser API used to draw marks.",
|
297 | 297 | "`'svg`' is appropriate for figures of less than 1000 data points, and will allow for fully-vectorized output.",
|
298 | 298 | "`'webgl'` is likely necessary for acceptable performance above 1000 points but rasterizes part of the output. ",
|
299 | 299 | "`'auto'` uses heuristics to choose the mode.",
|
300 | 300 | ],
|
301 | 301 | direction=[
|
302 |
| - "string", |
| 302 | + "str", |
303 | 303 | "One of '`counterclockwise'`, `'clockwise'`. Default is `'clockwise'`",
|
304 | 304 | "Sets the direction in which increasing values of the angular axis are drawn.",
|
305 | 305 | ],
|
306 | 306 | start_angle=[
|
307 |
| - "integer (default `90`)", |
| 307 | + "int (default `90`)", |
308 | 308 | "Sets start angle for the angular axis, with 0 being due east and 90 being due north.",
|
309 | 309 | ],
|
310 | 310 | histfunc=[
|
311 |
| - "string (default `'count'`)", |
| 311 | + "str (default `'count'`)", |
312 | 312 | "One of `'count'`, `'sum'`, `'avg'`, `'min'`, `'max'`."
|
313 | 313 | "Function used to aggregate values for summarization (note: can be normalized with `histnorm`).",
|
314 | 314 | "The arguments to this function for `histogram` are the values of `y` if `orientation` is `'v'`,",
|
315 | 315 | "otherwise the arguements are the values of `x`.",
|
316 | 316 | "The arguments to this function for `density_heatmap` and `density_contour` are the values of `z`.",
|
317 | 317 | ],
|
318 | 318 | histnorm=[
|
319 |
| - "string (default `None`)", |
| 319 | + "str (default `None`)", |
320 | 320 | "One of `'percent'`, `'probability'`, `'density'`, `'probability density'`",
|
321 | 321 | "If `None`, the output of `histfunc` is used as is.",
|
322 | 322 | "If `'probability'`, the output of `histfunc` for a given bin is divided by the sum of the output of `histfunc` for all bins.",
|
|
325 | 325 | "If `'probability density'`, the output of `histfunc` for a given bin is normalized such that it corresponds to the probability that a random event whose distribution is described by the output of `histfunc` will fall into that bin.",
|
326 | 326 | ],
|
327 | 327 | barnorm=[
|
328 |
| - "string (default `None`)", |
| 328 | + "str (default `None`)", |
329 | 329 | "One of `'fraction'` or `'percent'`.",
|
330 | 330 | "If `'fraction'`, the value of each bar is divided by the sum of all values at that location coordinate.",
|
331 | 331 | "`'percent'` is the same but multiplied by 100 to show percentages.",
|
332 | 332 | "`None` will stack up all values at each location coordinate.",
|
333 | 333 | ],
|
334 | 334 | groupnorm=[
|
335 |
| - "string (default `None`)", |
| 335 | + "str (default `None`)", |
336 | 336 | "One of `'fraction'` or `'percent'`.",
|
337 | 337 | "If `'fraction'`, the value of each point is divided by the sum of all values at that location coordinate.",
|
338 | 338 | "`'percent'` is the same but multiplied by 100 to show percentages.",
|
339 | 339 | "`None` will stack up all values at each location coordinate.",
|
340 | 340 | ],
|
341 | 341 | barmode=[
|
342 |
| - "string (default `'relative'`)" |
| 342 | + "str (default `'relative'`)" |
343 | 343 | "One of `'group'`, `'overlay'` or `'relative'`",
|
344 | 344 | "In `'relative'` mode, bars are stacked above zero for positive values and below zero for negative values.",
|
345 | 345 | "In `'overlay'` mode, bars are drawn on top of one another.",
|
346 | 346 | "In `'group'` mode, bars are placed beside each other.",
|
347 | 347 | ],
|
348 | 348 | boxmode=[
|
349 |
| - "string (default `'group'`)" |
| 349 | + "str (default `'group'`)" |
350 | 350 | "One of `'group'` or `'overlay'`",
|
351 | 351 | "In `'overlay'` mode, boxes are on drawn top of one another.",
|
352 | 352 | "In `'group'` mode, baxes are placed beside each other.",
|
353 | 353 | ],
|
354 | 354 | violinmode=[
|
355 |
| - "string (default `'group'`)" |
| 355 | + "str (default `'group'`)" |
356 | 356 | "One of `'group'` or `'overlay'`",
|
357 | 357 | "In `'overlay'` mode, violins are on drawn top of one another.",
|
358 | 358 | "In `'group'` mode, violins are placed beside each other.",
|
359 | 359 | ],
|
360 | 360 | stripmode=[
|
361 |
| - "string (default `'group'`)" |
| 361 | + "str (default `'group'`)" |
362 | 362 | "One of `'group'` or `'overlay'`",
|
363 | 363 | "In `'overlay'` mode, strips are on drawn top of one another.",
|
364 | 364 | "In `'group'` mode, strips are placed beside each other.",
|
365 | 365 | ],
|
366 |
| - zoom=["integer (default `8`)", "Between 0 and 20.", "Sets map zoom level."], |
| 366 | + zoom=["int (default `8`)", "Between 0 and 20.", "Sets map zoom level."], |
367 | 367 | orientation=[
|
368 |
| - "string (default `'v'`)", "One of `'h'` for horizontal or `'v'` for vertical)", |
| 368 | + "str (default `'v'`)", "One of `'h'` for horizontal or `'v'` for vertical)", |
369 | 369 | ],
|
370 | 370 | line_close=[
|
371 | 371 | "boolean (default `False`)",
|
372 | 372 | "If `True`, an extra line segment is drawn between the first and last point.",
|
373 | 373 | ],
|
374 |
| - line_shape=["string (default `'linear'`)", "One of `'linear'` or `'spline'`."], |
| 374 | + line_shape=["str (default `'linear'`)", "One of `'linear'` or `'spline'`."], |
375 | 375 | scope=[
|
376 |
| - "string (default `'world'`).", |
| 376 | + "str (default `'world'`).", |
377 | 377 | "One of `'world'`, `'usa'`, `'europe'`, `'asia'`, `'africa'`, `'north america'`, `'south america'`)"
|
378 | 378 | "Default is `'world'` unless `projection` is set to `'albers usa'`, which forces `'usa'`."
|
379 | 379 | ],
|
380 | 380 | projection=[
|
381 |
| - "string ", |
| 381 | + "str ", |
382 | 382 | "One of `'equirectangular'`, `'mercator'`, `'orthographic'`, `'natural earth'`, `'kavrayskiy7'`, `'miller'`, `'robinson'`, `'eckert4'`, `'azimuthal equal area'`, `'azimuthal equidistant'`, `'conic equal area'`, `'conic conformal'`, `'conic equidistant'`, `'gnomonic'`, `'stereographic'`, `'mollweide'`, `'hammer'`, `'transverse mercator'`, `'albers usa'`, `'winkel tripel'`, `'aitoff'`, `'sinusoidal'`"
|
383 | 383 | "Default depends on `scope`."
|
384 | 384 | ],
|
385 | 385 | center=["dict", "Dict keys are `'lat'` and `'lon'`", "Sets the center point of the map."],
|
386 | 386 | points=[
|
387 |
| - "string or boolean (default `'outliers'`)", |
| 387 | + "str or boolean (default `'outliers'`)", |
388 | 388 | "One of `'all'`, `'outliers'`, or `False`.",
|
389 | 389 | "If `'outliers'`, only the sample points lying outside the whiskers are shown.",
|
390 | 390 | "If `'all'`, all sample points are shown.",
|
|
0 commit comments