Skip to content

Commit 683643c

Browse files
committed
Fixed list format in 'Dash' and 'String' properties.
1 parent 9ddde0f commit 683643c

File tree

667 files changed

+6384
-3202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

667 files changed

+6384
-3202
lines changed

_plotly_utils/basevalidators.py

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ def fullmatch(regex, string, flags=0):
2121
regex_string = regex
2222
return re.match("(?:" + regex_string + r")\Z", string, flags=flags)
2323

24+
# Constants
25+
INDENT = 8
26+
2427

2528
# Utility functions
2629
# -----------------
@@ -537,8 +540,8 @@ def description(self):
537540
enum_vals_str = "\n".join(
538541
textwrap.wrap(
539542
repr(enum_vals),
540-
initial_indent=" " * 8,
541-
subsequent_indent=" " * 8,
543+
initial_indent=" " * INDENT,
544+
subsequent_indent=" " * INDENT,
542545
break_on_hyphens=False,
543546
)
544547
)
@@ -554,8 +557,8 @@ def description(self):
554557
enum_regexs_str = "\n".join(
555558
textwrap.wrap(
556559
repr(enum_regexs),
557-
initial_indent=" " * 8,
558-
subsequent_indent=" " * 8,
560+
initial_indent=" " * INDENT,
561+
subsequent_indent=" " * INDENT,
559562
break_on_hyphens=False,
560563
break_long_words=False,
561564
)
@@ -1010,44 +1013,44 @@ def description(self):
10101013
if self.no_blank:
10111014
desc = (
10121015
desc
1013-
+ """
1014-
- A non-empty string"""
1016+
+ """\n
1017+
- A non-empty string"""
10151018
)
10161019
elif self.values:
10171020
valid_str = "\n".join(
10181021
textwrap.wrap(
10191022
repr(self.values),
1020-
initial_indent=" " * 12,
1021-
subsequent_indent=" " * 12,
1023+
initial_indent=" " * INDENT,
1024+
subsequent_indent=" " * INDENT,
10221025
break_on_hyphens=False,
10231026
)
10241027
)
10251028

10261029
desc = (
10271030
desc
1028-
+ """
1029-
- One of the following strings:
1031+
+ """\n
1032+
- One of the following strings:
10301033
{valid_str}""".format(valid_str=valid_str)
10311034
)
10321035
else:
10331036
desc = (
10341037
desc
1035-
+ """
1036-
- A string"""
1038+
+ """\n
1039+
- A string"""
10371040
)
10381041

10391042
if not self.strict:
10401043
desc = (
10411044
desc
1042-
+ """
1043-
- A number that will be converted to a string"""
1045+
+ """\n
1046+
- A number that will be converted to a string"""
10441047
)
10451048

10461049
if self.array_ok:
10471050
desc = (
10481051
desc
1049-
+ """
1050-
- A tuple, list, or one-dimensional numpy array of the above"""
1052+
+ """\n
1053+
- A tuple, list, or one-dimensional numpy array of the above"""
10511054
)
10521055

10531056
return desc
@@ -2284,25 +2287,25 @@ def description(self):
22842287
enum_vals_str = "\n".join(
22852288
textwrap.wrap(
22862289
repr(enum_vals),
2287-
initial_indent=" " * 12,
2288-
subsequent_indent=" " * 12,
2290+
initial_indent=" " * INDENT,
2291+
subsequent_indent=" " * INDENT,
22892292
break_on_hyphens=False,
22902293
width=80,
22912294
)
22922295
)
22932296

22942297
desc = (
22952298
desc
2296-
+ """
2297-
- One of the following dash styles:
2299+
+ """\n
2300+
- One of the following dash styles:\n
22982301
{enum_vals_str}""".format(enum_vals_str=enum_vals_str)
22992302
)
23002303

23012304
desc = (
23022305
desc
2303-
+ """
2304-
- A string containing a dash length list in pixels or percentages
2305-
(e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.)
2306+
+ """\n
2307+
- A string containing a dash length list in pixels or percentages\n
2308+
(e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.)
23062309
"""
23072310
)
23082311
return desc

plotly/graph_objects/_bar.py

Lines changed: 52 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,10 @@ def alignmentgroup(self):
9494
compute their positional range dependently or independently.
9595
9696
The 'alignmentgroup' property is a string and must be specified as:
97-
- A string
98-
- A number that will be converted to a string
97+
98+
- A string
99+
100+
- A number that will be converted to a string
99101
100102
Returns
101103
-------
@@ -395,9 +397,12 @@ def hovertemplate(self):
395397
`<extra></extra>`.
396398
397399
The 'hovertemplate' property is a string and must be specified as:
398-
- A string
399-
- A number that will be converted to a string
400-
- A tuple, list, or one-dimensional numpy array of the above
400+
401+
- A string
402+
403+
- A number that will be converted to a string
404+
405+
- A tuple, list, or one-dimensional numpy array of the above
401406
402407
Returns
403408
-------
@@ -438,9 +443,12 @@ def hovertext(self):
438443
`hoverinfo` must contain a "text" flag.
439444
440445
The 'hovertext' property is a string and must be specified as:
441-
- A string
442-
- A number that will be converted to a string
443-
- A tuple, list, or one-dimensional numpy array of the above
446+
447+
- A string
448+
449+
- A number that will be converted to a string
450+
451+
- A tuple, list, or one-dimensional numpy array of the above
444452
445453
Returns
446454
-------
@@ -583,8 +591,10 @@ def legendgroup(self):
583591
legend items.
584592
585593
The 'legendgroup' property is a string and must be specified as:
586-
- A string
587-
- A number that will be converted to a string
594+
595+
- A string
596+
597+
- A number that will be converted to a string
588598
589599
Returns
590600
-------
@@ -731,8 +741,10 @@ def name(self):
731741
and on hover.
732742
733743
The 'name' property is a string and must be specified as:
734-
- A string
735-
- A number that will be converted to a string
744+
745+
- A string
746+
747+
- A number that will be converted to a string
736748
737749
Returns
738750
-------
@@ -775,8 +787,10 @@ def offsetgroup(self):
775787
coordinate will line up.
776788
777789
The 'offsetgroup' property is a string and must be specified as:
778-
- A string
779-
- A number that will be converted to a string
790+
791+
- A string
792+
793+
- A number that will be converted to a string
780794
781795
Returns
782796
-------
@@ -958,9 +972,12 @@ def text(self):
958972
seen in the hover labels.
959973
960974
The 'text' property is a string and must be specified as:
961-
- A string
962-
- A number that will be converted to a string
963-
- A tuple, list, or one-dimensional numpy array of the above
975+
976+
- A string
977+
978+
- A number that will be converted to a string
979+
980+
- A tuple, list, or one-dimensional numpy array of the above
964981
965982
Returns
966983
-------
@@ -1102,9 +1119,12 @@ def texttemplate(self):
11021119
and `label`.
11031120
11041121
The 'texttemplate' property is a string and must be specified as:
1105-
- A string
1106-
- A number that will be converted to a string
1107-
- A tuple, list, or one-dimensional numpy array of the above
1122+
1123+
- A string
1124+
1125+
- A number that will be converted to a string
1126+
1127+
- A tuple, list, or one-dimensional numpy array of the above
11081128
11091129
Returns
11101130
-------
@@ -1142,8 +1162,10 @@ def uid(self):
11421162
constancy between traces during animations and transitions.
11431163
11441164
The 'uid' property is a string and must be specified as:
1145-
- A string
1146-
- A number that will be converted to a string
1165+
1166+
- A string
1167+
1168+
- A number that will be converted to a string
11471169
11481170
Returns
11491171
-------
@@ -1367,8 +1389,10 @@ def xhoverformat(self):
13671389
are formatted using `xaxis.hoverformat`.
13681390
13691391
The 'xhoverformat' property is a string and must be specified as:
1370-
- A string
1371-
- A number that will be converted to a string
1392+
1393+
- A string
1394+
1395+
- A number that will be converted to a string
13721396
13731397
Returns
13741398
-------
@@ -1561,8 +1585,10 @@ def yhoverformat(self):
15611585
are formatted using `yaxis.hoverformat`.
15621586
15631587
The 'yhoverformat' property is a string and must be specified as:
1564-
- A string
1565-
- A number that will be converted to a string
1588+
1589+
- A string
1590+
1591+
- A number that will be converted to a string
15661592
15671593
Returns
15681594
-------

plotly/graph_objects/_barpolar.py

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,12 @@ def hovertemplate(self):
266266
secondary box completely, use an empty tag `<extra></extra>`.
267267
268268
The 'hovertemplate' property is a string and must be specified as:
269-
- A string
270-
- A number that will be converted to a string
271-
- A tuple, list, or one-dimensional numpy array of the above
269+
270+
- A string
271+
272+
- A number that will be converted to a string
273+
274+
- A tuple, list, or one-dimensional numpy array of the above
272275
273276
Returns
274277
-------
@@ -305,9 +308,12 @@ def hovertext(self):
305308
Same as `text`.
306309
307310
The 'hovertext' property is a string and must be specified as:
308-
- A string
309-
- A number that will be converted to a string
310-
- A tuple, list, or one-dimensional numpy array of the above
311+
312+
- A string
313+
314+
- A number that will be converted to a string
315+
316+
- A tuple, list, or one-dimensional numpy array of the above
311317
312318
Returns
313319
-------
@@ -407,8 +413,10 @@ def legendgroup(self):
407413
legend items.
408414
409415
The 'legendgroup' property is a string and must be specified as:
410-
- A string
411-
- A number that will be converted to a string
416+
417+
- A string
418+
419+
- A number that will be converted to a string
412420
413421
Returns
414422
-------
@@ -555,8 +563,10 @@ def name(self):
555563
and on hover.
556564
557565
The 'name' property is a string and must be specified as:
558-
- A string
559-
- A number that will be converted to a string
566+
567+
- A string
568+
569+
- A number that will be converted to a string
560570
561571
Returns
562572
-------
@@ -793,9 +803,12 @@ def text(self):
793803
coordinates.
794804
795805
The 'text' property is a string and must be specified as:
796-
- A string
797-
- A number that will be converted to a string
798-
- A tuple, list, or one-dimensional numpy array of the above
806+
807+
- A string
808+
809+
- A number that will be converted to a string
810+
811+
- A tuple, list, or one-dimensional numpy array of the above
799812
800813
Returns
801814
-------
@@ -909,8 +922,10 @@ def uid(self):
909922
constancy between traces during animations and transitions.
910923
911924
The 'uid' property is a string and must be specified as:
912-
- A string
913-
- A number that will be converted to a string
925+
926+
- A string
927+
928+
- A number that will be converted to a string
914929
915930
Returns
916931
-------

0 commit comments

Comments
 (0)