|
2 | 2 | from ._doc import make_docstring
|
3 | 3 | import plotly.graph_objs as go
|
4 | 4 |
|
| 5 | +_wide_mode_xy_append = [ |
| 6 | + "Either `x` or `y` can optionally be a list of column references or array_likes, ", |
| 7 | + "in which case the data will be treated as if it were 'wide' rather than 'long'.", |
| 8 | +] |
| 9 | +_cartesian_append_dict = dict(x=_wide_mode_xy_append, y=_wide_mode_xy_append) |
| 10 | + |
5 | 11 |
|
6 | 12 | def scatter(
|
7 | 13 | data_frame=None,
|
@@ -56,7 +62,7 @@ def scatter(
|
56 | 62 | return make_figure(args=locals(), constructor=go.Scatter)
|
57 | 63 |
|
58 | 64 |
|
59 |
| -scatter.__doc__ = make_docstring(scatter) |
| 65 | +scatter.__doc__ = make_docstring(scatter, append_dict=_cartesian_append_dict) |
60 | 66 |
|
61 | 67 |
|
62 | 68 | def density_contour(
|
@@ -114,7 +120,16 @@ def density_contour(
|
114 | 120 | )
|
115 | 121 |
|
116 | 122 |
|
117 |
| -density_contour.__doc__ = make_docstring(density_contour) |
| 123 | +density_contour.__doc__ = make_docstring( |
| 124 | + density_contour, |
| 125 | + append_dict=dict( |
| 126 | + x=_wide_mode_xy_append, |
| 127 | + y=_wide_mode_xy_append, |
| 128 | + z=[ |
| 129 | + "For `density_heatmap` and `density_contour` these values are used as the inputs to `histfunc`.", |
| 130 | + ], |
| 131 | + ), |
| 132 | +) |
118 | 133 |
|
119 | 134 |
|
120 | 135 | def density_heatmap(
|
@@ -170,7 +185,16 @@ def density_heatmap(
|
170 | 185 | )
|
171 | 186 |
|
172 | 187 |
|
173 |
| -density_heatmap.__doc__ = make_docstring(density_heatmap) |
| 188 | +density_heatmap.__doc__ = make_docstring( |
| 189 | + density_heatmap, |
| 190 | + append_dict=dict( |
| 191 | + x=_wide_mode_xy_append, |
| 192 | + y=_wide_mode_xy_append, |
| 193 | + z=[ |
| 194 | + "For `density_heatmap` and `density_contour` these values are used as the inputs to `histfunc`.", |
| 195 | + ], |
| 196 | + ), |
| 197 | +) |
174 | 198 |
|
175 | 199 |
|
176 | 200 | def line(
|
@@ -218,7 +242,7 @@ def line(
|
218 | 242 | return make_figure(args=locals(), constructor=go.Scatter)
|
219 | 243 |
|
220 | 244 |
|
221 |
| -line.__doc__ = make_docstring(line) |
| 245 | +line.__doc__ = make_docstring(line, append_dict=_cartesian_append_dict) |
222 | 246 |
|
223 | 247 |
|
224 | 248 | def area(
|
@@ -264,7 +288,7 @@ def area(
|
264 | 288 | )
|
265 | 289 |
|
266 | 290 |
|
267 |
| -area.__doc__ = make_docstring(area) |
| 291 | +area.__doc__ = make_docstring(area, append_dict=_cartesian_append_dict) |
268 | 292 |
|
269 | 293 |
|
270 | 294 | def bar(
|
@@ -316,7 +340,7 @@ def bar(
|
316 | 340 | )
|
317 | 341 |
|
318 | 342 |
|
319 |
| -bar.__doc__ = make_docstring(bar) |
| 343 | +bar.__doc__ = make_docstring(bar, append_dict=_cartesian_append_dict) |
320 | 344 |
|
321 | 345 |
|
322 | 346 | def histogram(
|
@@ -369,7 +393,15 @@ def histogram(
|
369 | 393 | )
|
370 | 394 |
|
371 | 395 |
|
372 |
| -histogram.__doc__ = make_docstring(histogram) |
| 396 | +histogram.__doc__ = make_docstring( |
| 397 | + histogram, |
| 398 | + append_dict=dict( |
| 399 | + x=["For horizontal histograms, these values are used as inputs to `histfunc`."] |
| 400 | + + _wide_mode_xy_append, |
| 401 | + y=["For vertical histograms, these values are used as inputs to `histfunc`."] |
| 402 | + + _wide_mode_xy_append, |
| 403 | + ), |
| 404 | +) |
373 | 405 |
|
374 | 406 |
|
375 | 407 | def violin(
|
@@ -416,7 +448,7 @@ def violin(
|
416 | 448 | )
|
417 | 449 |
|
418 | 450 |
|
419 |
| -violin.__doc__ = make_docstring(violin) |
| 451 | +violin.__doc__ = make_docstring(violin, append_dict=_cartesian_append_dict) |
420 | 452 |
|
421 | 453 |
|
422 | 454 | def box(
|
@@ -466,7 +498,7 @@ def box(
|
466 | 498 | )
|
467 | 499 |
|
468 | 500 |
|
469 |
| -box.__doc__ = make_docstring(box) |
| 501 | +box.__doc__ = make_docstring(box, append_dict=_cartesian_append_dict) |
470 | 502 |
|
471 | 503 |
|
472 | 504 | def strip(
|
@@ -517,7 +549,7 @@ def strip(
|
517 | 549 | )
|
518 | 550 |
|
519 | 551 |
|
520 |
| -strip.__doc__ = make_docstring(strip) |
| 552 | +strip.__doc__ = make_docstring(strip, append_dict=_cartesian_append_dict) |
521 | 553 |
|
522 | 554 |
|
523 | 555 | def scatter_3d(
|
@@ -1389,7 +1421,7 @@ def funnel(
|
1389 | 1421 | return make_figure(args=locals(), constructor=go.Funnel)
|
1390 | 1422 |
|
1391 | 1423 |
|
1392 |
| -funnel.__doc__ = make_docstring(funnel) |
| 1424 | +funnel.__doc__ = make_docstring(funnel, append_dict=_cartesian_append_dict) |
1393 | 1425 |
|
1394 | 1426 |
|
1395 | 1427 | def funnel_area(
|
|
0 commit comments