Skip to content

Commit 6973229

Browse files
committed
Change type abbreviation for consistency with make_subplots.py
1 parent 97a1e41 commit 6973229

File tree

1 file changed

+44
-44
lines changed
  • packages/python/plotly/plotly/express

1 file changed

+44
-44
lines changed

packages/python/plotly/plotly/express/_doc.py

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22
from textwrap import fill, indent
33

44

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-
115
# TODO contents of columns
126
# TODO explain categorical
137
# TODO handle color
@@ -16,6 +10,12 @@
1610
# TODO document "or `None`, default `None`" in various places
1711
# TODO standardize positioning and casing of 'default'
1812

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+
1919
docs = dict(
2020
data_frame=[
2121
"DataFrame or array-like or dict",
@@ -70,7 +70,7 @@
7070
"Values from this column or array_like are to be interpreted according to `locationmode` and mapped to longitude/latitude.",
7171
],
7272
dimensions=[
73-
"list of strings",
73+
"list of str",
7474
"Names of columns in `data_frame` to be used in multidimensional visualization.",
7575
],
7676
error_x=[
@@ -143,7 +143,7 @@
143143
"Values from this column or array_like appear in the figure as text labels.",
144144
],
145145
locationmode=[
146-
"string",
146+
"str",
147147
"One of 'ISO-3', 'USA-states', or 'country names'",
148148
"Determines the set of locations used to match entries in `locations` to regions on the map.",
149149
],
@@ -164,41 +164,41 @@
164164
"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.",
165165
],
166166
symbol_sequence=[
167-
"list of strings"
167+
"list of str"
168168
"Strings should define valid plotly.js symbols.",
169169
"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`.",
170170
],
171171
symbol_map=[
172-
"dict with string keys and string values (default `{}`)",
172+
"dict with str keys and str values (default `{}`)",
173173
"String values should define plotly.js symbols",
174174
"Used to override `symbol_sequence` to assign a specific symbols to marks corresponding with specific values.",
175175
"Keys in `symbol_map` should be values in the column denoted by `symbol`.",
176176
],
177177
line_dash_map=[
178-
"dict with string keys and string values (default `{}`)",
178+
"dict with str keys and str values (default `{}`)",
179179
"Strings values define plotly.js dash-patterns.",
180180
"Used to override `line_dash_sequences` to assign a specific dash-patterns to lines corresponding with specific values.",
181181
"Keys in `line_dash_map` should be values in the column denoted by `line_dash`.",
182182
],
183183
line_dash_sequence=[
184-
"list of strings",
184+
"list of str",
185185
"Strings should define valid plotly.js dash-patterns.",
186186
"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`.",
187187
],
188188
color_discrete_sequence=[
189-
"list of strings",
189+
"list of str",
190190
"Strings should define valid CSS-colors.",
191191
"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`.",
192192
"Various useful color sequences are available in the `plotly_express.colors` submodules, specifically `plotly_express.colors.qualitative`.",
193193
],
194194
color_discrete_map=[
195-
"dict with string keys and string values (default `{}`)",
195+
"dict with str keys and str values (default `{}`)",
196196
"String values should define valid CSS-colors",
197197
"Used to override `color_discrete_sequence` to assign a specific colors to marks corresponding with specific values.",
198198
"Keys in `color_discrete_map` should be values in the column denoted by `color`.",
199199
],
200200
color_continuous_scale=[
201-
"list of strings",
201+
"list of str",
202202
"Strings should define valid CSS-colors",
203203
"This list is used to build a continuous color scale when the column denoted by `color` contains numeric data.",
204204
"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,7 +208,7 @@
208208
"If set, computes the bounds of the continuous color scale to have the desired midpoint.",
209209
"Setting this value is recommended when using `plotly_express.colors.diverging` color scales as the inputs to `color_continuous_scale`.",
210210
],
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`."],
212212
log_x=[
213213
"boolean (default `False`)",
214214
"If `True`, the x-axis is log-scaled in cartesian coordinates.",
@@ -245,78 +245,78 @@
245245
"list of two numbers",
246246
"If provided, overrides auto-scaling on the radial axis in polar coordinates.",
247247
],
248-
title=["string", "The figure title."],
248+
title=["str", "The figure title."],
249249
template=[
250-
"string or Plotly.py template object",
250+
"str or Plotly.py template object",
251251
"The figure template name or definition.",
252252
],
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."],
255255
labels=[
256-
"dict with string keys and string values (default `{}`)",
256+
"dict with str keys and str values (default `{}`)",
257257
"By default, column names are used in the figure for axis titles, legend entries and hovers.",
258258
"This parameter allows this to be overridden.",
259259
"The keys of this dict should correspond to column names, and the values should correspond to the desired label to be displayed.",
260260
],
261261
category_orders=[
262-
"dict with string keys and list-of-string values (default `{}`)",
262+
"dict with str keys and list of str values (default `{}`)",
263263
"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).",
264264
"This parameter is used to force a specific ordering of values per column.",
265265
"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.",
266266
],
267267
marginal=[
268-
"string",
268+
"str",
269269
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
270270
"If set, a subplot is drawn alongside the main plot, visualizing the distribution.",
271271
],
272272
marginal_x=[
273-
"string",
273+
"str",
274274
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
275275
"If set, a horizontal subplot is drawn above the main plot, visualizing the x-distribution.",
276276
],
277277
marginal_y=[
278-
"string",
278+
"str",
279279
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
280280
"If set, a vertical subplot is drawn to the right of the main plot, visualizing the y-distribution.",
281281
],
282282
trendline=[
283-
"string",
283+
"str",
284284
"One of `'rug'`, `'box'`, `'violin'`, `'histogram'`.",
285285
"If `'ols'`, an Ordinary Least Squares regression line will be drawn for each discrete-color/symbol group.",
286286
"If `'lowess`', a Locally Weighted Scatterplot Smoothing line will be drawn for each discrete-color/symbol group.",
287287
],
288288
trendline_color_override=[
289-
"string",
289+
"str",
290290
"Valid CSS color.",
291291
"If provided, and if `trendline` is set, all trendlines will be drawn in this color.",
292292
],
293293
render_mode=[
294-
"string",
294+
"str",
295295
"One of `'auto'`, `'svg'` or `'webgl'`, default `'auto'`",
296296
"Controls the browser API used to draw marks.",
297297
"`'svg`' is appropriate for figures of less than 1000 data points, and will allow for fully-vectorized output.",
298298
"`'webgl'` is likely necessary for acceptable performance above 1000 points but rasterizes part of the output. ",
299299
"`'auto'` uses heuristics to choose the mode.",
300300
],
301301
direction=[
302-
"string",
302+
"str",
303303
"One of '`counterclockwise'`, `'clockwise'`. Default is `'clockwise'`",
304304
"Sets the direction in which increasing values of the angular axis are drawn.",
305305
],
306306
start_angle=[
307-
"integer (default `90`)",
307+
"int (default `90`)",
308308
"Sets start angle for the angular axis, with 0 being due east and 90 being due north.",
309309
],
310310
histfunc=[
311-
"string (default `'count'`)",
311+
"str (default `'count'`)",
312312
"One of `'count'`, `'sum'`, `'avg'`, `'min'`, `'max'`."
313313
"Function used to aggregate values for summarization (note: can be normalized with `histnorm`).",
314314
"The arguments to this function for `histogram` are the values of `y` if `orientation` is `'v'`,",
315315
"otherwise the arguements are the values of `x`.",
316316
"The arguments to this function for `density_heatmap` and `density_contour` are the values of `z`.",
317317
],
318318
histnorm=[
319-
"string (default `None`)",
319+
"str (default `None`)",
320320
"One of `'percent'`, `'probability'`, `'density'`, `'probability density'`",
321321
"If `None`, the output of `histfunc` is used as is.",
322322
"If `'probability'`, the output of `histfunc` for a given bin is divided by the sum of the output of `histfunc` for all bins.",
@@ -325,66 +325,66 @@
325325
"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.",
326326
],
327327
barnorm=[
328-
"string (default `None`)",
328+
"str (default `None`)",
329329
"One of `'fraction'` or `'percent'`.",
330330
"If `'fraction'`, the value of each bar is divided by the sum of all values at that location coordinate.",
331331
"`'percent'` is the same but multiplied by 100 to show percentages.",
332332
"`None` will stack up all values at each location coordinate.",
333333
],
334334
groupnorm=[
335-
"string (default `None`)",
335+
"str (default `None`)",
336336
"One of `'fraction'` or `'percent'`.",
337337
"If `'fraction'`, the value of each point is divided by the sum of all values at that location coordinate.",
338338
"`'percent'` is the same but multiplied by 100 to show percentages.",
339339
"`None` will stack up all values at each location coordinate.",
340340
],
341341
barmode=[
342-
"string (default `'relative'`)"
342+
"str (default `'relative'`)"
343343
"One of `'group'`, `'overlay'` or `'relative'`",
344344
"In `'relative'` mode, bars are stacked above zero for positive values and below zero for negative values.",
345345
"In `'overlay'` mode, bars are drawn on top of one another.",
346346
"In `'group'` mode, bars are placed beside each other.",
347347
],
348348
boxmode=[
349-
"string (default `'group'`)"
349+
"str (default `'group'`)"
350350
"One of `'group'` or `'overlay'`",
351351
"In `'overlay'` mode, boxes are on drawn top of one another.",
352352
"In `'group'` mode, baxes are placed beside each other.",
353353
],
354354
violinmode=[
355-
"string (default `'group'`)"
355+
"str (default `'group'`)"
356356
"One of `'group'` or `'overlay'`",
357357
"In `'overlay'` mode, violins are on drawn top of one another.",
358358
"In `'group'` mode, violins are placed beside each other.",
359359
],
360360
stripmode=[
361-
"string (default `'group'`)"
361+
"str (default `'group'`)"
362362
"One of `'group'` or `'overlay'`",
363363
"In `'overlay'` mode, strips are on drawn top of one another.",
364364
"In `'group'` mode, strips are placed beside each other.",
365365
],
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."],
367367
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)",
369369
],
370370
line_close=[
371371
"boolean (default `False`)",
372372
"If `True`, an extra line segment is drawn between the first and last point.",
373373
],
374-
line_shape=["string (default `'linear'`)", "One of `'linear'` or `'spline'`."],
374+
line_shape=["str (default `'linear'`)", "One of `'linear'` or `'spline'`."],
375375
scope=[
376-
"string (default `'world'`).",
376+
"str (default `'world'`).",
377377
"One of `'world'`, `'usa'`, `'europe'`, `'asia'`, `'africa'`, `'north america'`, `'south america'`)"
378378
"Default is `'world'` unless `projection` is set to `'albers usa'`, which forces `'usa'`."
379379
],
380380
projection=[
381-
"string ",
381+
"str ",
382382
"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'`"
383383
"Default depends on `scope`."
384384
],
385385
center=["dict", "Dict keys are `'lat'` and `'lon'`", "Sets the center point of the map."],
386386
points=[
387-
"string or boolean (default `'outliers'`)",
387+
"str or boolean (default `'outliers'`)",
388388
"One of `'all'`, `'outliers'`, or `False`.",
389389
"If `'outliers'`, only the sample points lying outside the whiskers are shown.",
390390
"If `'all'`, all sample points are shown.",

0 commit comments

Comments
 (0)