Search is not available for this dataset
identifier
stringlengths 1
155
| parameters
stringlengths 2
6.09k
| docstring
stringlengths 11
63.4k
| docstring_summary
stringlengths 0
63.4k
| function
stringlengths 29
99.8k
| function_tokens
list | start_point
list | end_point
list | language
stringclasses 1
value | docstring_language
stringlengths 2
7
| docstring_language_predictions
stringlengths 18
23
| is_langid_reliable
stringclasses 2
values |
---|---|---|---|---|---|---|---|---|---|---|---|
AngularAxis.showline | (self) |
Determines whether or not a line bounding this axis is drawn.
The 'showline' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not a line bounding this axis is drawn.
The 'showline' property must be specified as a bool
(either True, or False) | def showline(self):
"""
Determines whether or not a line bounding this axis is drawn.
The 'showline' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showline"] | [
"def",
"showline",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showline\"",
"]"
] | [
639,
4
] | [
650,
31
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.showticklabels | (self) |
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False) | def showticklabels(self):
"""
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showticklabels"] | [
"def",
"showticklabels",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticklabels\"",
"]"
] | [
659,
4
] | [
670,
37
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.showtickprefix | (self) |
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showtickprefix(self):
"""
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showtickprefix"] | [
"def",
"showtickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showtickprefix\"",
"]"
] | [
679,
4
] | [
694,
37
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.showticksuffix | (self) |
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showticksuffix(self):
"""
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showticksuffix"] | [
"def",
"showticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticksuffix\"",
"]"
] | [
703,
4
] | [
715,
37
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.thetaunit | (self) |
Sets the format unit of the formatted "theta" values. Has an
effect only when `angularaxis.type` is "linear".
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees']
Returns
-------
Any
|
Sets the format unit of the formatted "theta" values. Has an
effect only when `angularaxis.type` is "linear".
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees'] | def thetaunit(self):
"""
Sets the format unit of the formatted "theta" values. Has an
effect only when `angularaxis.type` is "linear".
The 'thetaunit' property is an enumeration that may be specified as:
- One of the following enumeration values:
['radians', 'degrees']
Returns
-------
Any
"""
return self["thetaunit"] | [
"def",
"thetaunit",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thetaunit\"",
"]"
] | [
724,
4
] | [
737,
32
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tick0 | (self) |
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
|
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type | def tick0(self):
"""
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
"""
return self["tick0"] | [
"def",
"tick0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tick0\"",
"]"
] | [
746,
4
] | [
764,
28
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickangle | (self) |
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
|
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90). | def tickangle(self):
"""
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
"""
return self["tickangle"] | [
"def",
"tickangle",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickangle\"",
"]"
] | [
773,
4
] | [
788,
32
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickcolor | (self) |
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def tickcolor(self):
"""
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["tickcolor"] | [
"def",
"tickcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickcolor\"",
"]"
] | [
797,
4
] | [
847,
32
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickfont | (self) |
Sets the tick font.
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.layout.polar.angularaxis.Tickfont
|
Sets the tick font.
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | def tickfont(self):
"""
Sets the tick font.
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.layout.polar.angularaxis.Tickfont
"""
return self["tickfont"] | [
"def",
"tickfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickfont\"",
"]"
] | [
856,
4
] | [
893,
31
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickformat | (self) |
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def tickformat(self):
"""
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickformat"] | [
"def",
"tickformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformat\"",
"]"
] | [
902,
4
] | [
922,
33
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickformatstops | (self) |
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.polar.angularaxis.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.layout.polar.angularaxis.Tickformatstop]
|
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.polar.angularaxis.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat" | def tickformatstops(self):
"""
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.polar.angularaxis.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.layout.polar.angularaxis.Tickformatstop]
"""
return self["tickformatstops"] | [
"def",
"tickformatstops",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstops\"",
"]"
] | [
931,
4
] | [
979,
38
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickformatstopdefaults | (self) |
When used in a template (as layout.template.layout.polar.angula
raxis.tickformatstopdefaults), sets the default property values
to use for elements of layout.polar.angularaxis.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.layout.polar.angularaxis.Tickformatstop
|
When used in a template (as layout.template.layout.polar.angula
raxis.tickformatstopdefaults), sets the default property values
to use for elements of layout.polar.angularaxis.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties: | def tickformatstopdefaults(self):
"""
When used in a template (as layout.template.layout.polar.angula
raxis.tickformatstopdefaults), sets the default property values
to use for elements of layout.polar.angularaxis.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.layout.polar.angularaxis.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.layout.polar.angularaxis.Tickformatstop
"""
return self["tickformatstopdefaults"] | [
"def",
"tickformatstopdefaults",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstopdefaults\"",
"]"
] | [
988,
4
] | [
1006,
45
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.ticklen | (self) |
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def ticklen(self):
"""
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["ticklen"] | [
"def",
"ticklen",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticklen\"",
"]"
] | [
1015,
4
] | [
1026,
30
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickmode | (self) |
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
|
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array'] | def tickmode(self):
"""
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
"""
return self["tickmode"] | [
"def",
"tickmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickmode\"",
"]"
] | [
1035,
4
] | [
1053,
31
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickprefix | (self) |
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def tickprefix(self):
"""
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickprefix"] | [
"def",
"tickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickprefix\"",
"]"
] | [
1062,
4
] | [
1074,
33
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.ticks | (self) |
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', '']
Returns
-------
Any
|
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', ''] | def ticks(self):
"""
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', '']
Returns
-------
Any
"""
return self["ticks"] | [
"def",
"ticks",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticks\"",
"]"
] | [
1083,
4
] | [
1097,
28
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.ticksuffix | (self) |
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def ticksuffix(self):
"""
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["ticksuffix"] | [
"def",
"ticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticksuffix\"",
"]"
] | [
1106,
4
] | [
1118,
33
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.ticktext | (self) |
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ticktext(self):
"""
Sets the text displayed at the ticks position via `tickvals`.
Only has an effect if `tickmode` is set to "array". Used with
`tickvals`.
The 'ticktext' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["ticktext"] | [
"def",
"ticktext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticktext\"",
"]"
] | [
1127,
4
] | [
1140,
31
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.ticktextsrc | (self) |
Sets the source reference on Chart Studio Cloud for ticktext .
The 'ticktextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for ticktext .
The 'ticktextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def ticktextsrc(self):
"""
Sets the source reference on Chart Studio Cloud for ticktext .
The 'ticktextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["ticktextsrc"] | [
"def",
"ticktextsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticktextsrc\"",
"]"
] | [
1149,
4
] | [
1160,
34
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickvals | (self) |
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def tickvals(self):
"""
Sets the values at which ticks on this axis appear. Only has an
effect if `tickmode` is set to "array". Used with `ticktext`.
The 'tickvals' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["tickvals"] | [
"def",
"tickvals",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickvals\"",
"]"
] | [
1169,
4
] | [
1181,
31
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickvalssrc | (self) |
Sets the source reference on Chart Studio Cloud for tickvals .
The 'tickvalssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for tickvals .
The 'tickvalssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def tickvalssrc(self):
"""
Sets the source reference on Chart Studio Cloud for tickvals .
The 'tickvalssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["tickvalssrc"] | [
"def",
"tickvalssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickvalssrc\"",
"]"
] | [
1190,
4
] | [
1201,
34
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.tickwidth | (self) |
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def tickwidth(self):
"""
Sets the tick width (in px).
The 'tickwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["tickwidth"] | [
"def",
"tickwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickwidth\"",
"]"
] | [
1210,
4
] | [
1221,
32
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.type | (self) |
Sets the angular axis type. If "linear", set `thetaunit` to
determine the unit in which axis value are shown. If *category,
use `period` to set the number of integer coordinates around
polar axis.
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['-', 'linear', 'category']
Returns
-------
Any
|
Sets the angular axis type. If "linear", set `thetaunit` to
determine the unit in which axis value are shown. If *category,
use `period` to set the number of integer coordinates around
polar axis.
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['-', 'linear', 'category'] | def type(self):
"""
Sets the angular axis type. If "linear", set `thetaunit` to
determine the unit in which axis value are shown. If *category,
use `period` to set the number of integer coordinates around
polar axis.
The 'type' property is an enumeration that may be specified as:
- One of the following enumeration values:
['-', 'linear', 'category']
Returns
-------
Any
"""
return self["type"] | [
"def",
"type",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"type\"",
"]"
] | [
1230,
4
] | [
1245,
27
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.uirevision | (self) |
Controls persistence of user-driven changes in axis `rotation`.
Defaults to `polar<N>.uirevision`.
The 'uirevision' property accepts values of any type
Returns
-------
Any
|
Controls persistence of user-driven changes in axis `rotation`.
Defaults to `polar<N>.uirevision`.
The 'uirevision' property accepts values of any type | def uirevision(self):
"""
Controls persistence of user-driven changes in axis `rotation`.
Defaults to `polar<N>.uirevision`.
The 'uirevision' property accepts values of any type
Returns
-------
Any
"""
return self["uirevision"] | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
1254,
4
] | [
1265,
33
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.visible | (self) |
A single toggle to hide the axis while preserving interaction
like dragging. Default is true when a cheater plot is present
on the axis, otherwise false
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
A single toggle to hide the axis while preserving interaction
like dragging. Default is true when a cheater plot is present
on the axis, otherwise false
The 'visible' property must be specified as a bool
(either True, or False) | def visible(self):
"""
A single toggle to hide the axis while preserving interaction
like dragging. Default is true when a cheater plot is present
on the axis, otherwise false
The 'visible' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
1274,
4
] | [
1287,
30
] | python | en | ['en', 'error', 'th'] | False |
AngularAxis.__init__ | (
self,
arg=None,
categoryarray=None,
categoryarraysrc=None,
categoryorder=None,
color=None,
direction=None,
dtick=None,
exponentformat=None,
gridcolor=None,
gridwidth=None,
hoverformat=None,
layer=None,
linecolor=None,
linewidth=None,
nticks=None,
period=None,
rotation=None,
separatethousands=None,
showexponent=None,
showgrid=None,
showline=None,
showticklabels=None,
showtickprefix=None,
showticksuffix=None,
thetaunit=None,
tick0=None,
tickangle=None,
tickcolor=None,
tickfont=None,
tickformat=None,
tickformatstops=None,
tickformatstopdefaults=None,
ticklen=None,
tickmode=None,
tickprefix=None,
ticks=None,
ticksuffix=None,
ticktext=None,
ticktextsrc=None,
tickvals=None,
tickvalssrc=None,
tickwidth=None,
type=None,
uirevision=None,
visible=None,
**kwargs
) |
Construct a new AngularAxis object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.polar.AngularAxis`
categoryarray
Sets the order in which categories on this axis appear.
Only has an effect if `categoryorder` is set to
"array". Used with `categoryorder`.
categoryarraysrc
Sets the source reference on Chart Studio Cloud for
categoryarray .
categoryorder
Specifies the ordering logic for the case of
categorical variables. By default, plotly uses "trace",
which specifies the order that is present in the data
supplied. Set `categoryorder` to *category ascending*
or *category descending* if order should be determined
by the alphanumerical order of the category names. Set
`categoryorder` to "array" to derive the ordering from
the attribute `categoryarray`. If a category is not
found in the `categoryarray` array, the sorting
behavior for that attribute will be identical to the
"trace" mode. The unspecified categories will follow
the categories in `categoryarray`. Set `categoryorder`
to *total ascending* or *total descending* if order
should be determined by the numerical order of the
values. Similarly, the order can be determined by the
min, max, sum, mean or median of all the values.
color
Sets default for all colors associated with this axis
all at once: line, font, tick, and grid colors. Grid
color is lightened by blending this with the plot
background Individual pieces can override this.
direction
Sets the direction corresponding to positive angles.
dtick
Sets the step in-between ticks on this axis. Use with
`tick0`. Must be a positive number, or special strings
available to "log" and "date" axes. If the axis `type`
is "log", then ticks are set every 10^(n*dtick) where n
is the tick number. For example, to set a tick mark at
1, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick exponents.
For example, consider the number 1,000,000,000. If
"none", it appears as 1,000,000,000. If "e", 1e+9. If
"E", 1E+9. If "power", 1x10^9 (with 9 in a super
script). If "SI", 1G. If "B", 1B.
gridcolor
Sets the color of the grid lines.
gridwidth
Sets the width (in px) of the grid lines.
hoverformat
Sets the hover text formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
layer
Sets the layer on which this axis is displayed. If
*above traces*, this axis is displayed above all the
subplot's traces If *below traces*, this axis is
displayed below all the subplot's traces, but above the
grid lines. Useful when used together with scatter-like
traces with `cliponaxis` set to False to show markers
and/or text nodes above this axis.
linecolor
Sets the axis line color.
linewidth
Sets the width (in px) of the axis line.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks will be
chosen automatically to be less than or equal to
`nticks`. Has an effect only if `tickmode` is set to
"auto".
period
Set the angular period. Has an effect only when
`angularaxis.type` is "category".
rotation
Sets that start position (in degrees) of the angular
axis By default, polar subplots with `direction` set to
"counterclockwise" get a `rotation` of 0 which
corresponds to due East (like what mathematicians
prefer). In turn, polar with `direction` set to
"clockwise" get a rotation of 90 which corresponds to
due North (like on a compass),
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of the
first tick is shown. If "last", only the exponent of
the last tick is shown. If "none", no exponents appear.
showgrid
Determines whether or not grid lines are drawn. If
True, the grid lines are drawn at every tick mark.
showline
Determines whether or not a line bounding this axis is
drawn.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
If "all", all tick labels are displayed with a prefix.
If "first", only the first tick is displayed with a
prefix. If "last", only the last tick is displayed with
a suffix. If "none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thetaunit
Sets the format unit of the formatted "theta" values.
Has an effect only when `angularaxis.type` is "linear".
tick0
Sets the placement of the first tick on this axis. Use
with `dtick`. If the axis `type` is "log", then you
must take the log of your starting tick (e.g. to set
the starting tick to 100, set the `tick0` to 2) except
when `dtick`=*L<f>* (see `dtick` for more info). If the
axis `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the tick font.
tickformat
Sets the tick label formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.layout.polar.an
gularaxis.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.layout.pola
r.angularaxis.tickformatstopdefaults), sets the default
property values to use for elements of
layout.polar.angularaxis.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto", the number
of ticks is set via `nticks`. If "linear", the
placement of the ticks is determined by a starting
position `tick0` and a tick step `dtick` ("linear" is
the default value if `tick0` and `dtick` are provided).
If "array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If "", this
axis' ticks are not drawn. If "outside" ("inside"),
this axis' are drawn outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
type
Sets the angular axis type. If "linear", set
`thetaunit` to determine the unit in which axis value
are shown. If *category, use `period` to set the number
of integer coordinates around polar axis.
uirevision
Controls persistence of user-driven changes in axis
`rotation`. Defaults to `polar<N>.uirevision`.
visible
A single toggle to hide the axis while preserving
interaction like dragging. Default is true when a
cheater plot is present on the axis, otherwise false
Returns
-------
AngularAxis
|
Construct a new AngularAxis object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.polar.AngularAxis`
categoryarray
Sets the order in which categories on this axis appear.
Only has an effect if `categoryorder` is set to
"array". Used with `categoryorder`.
categoryarraysrc
Sets the source reference on Chart Studio Cloud for
categoryarray .
categoryorder
Specifies the ordering logic for the case of
categorical variables. By default, plotly uses "trace",
which specifies the order that is present in the data
supplied. Set `categoryorder` to *category ascending*
or *category descending* if order should be determined
by the alphanumerical order of the category names. Set
`categoryorder` to "array" to derive the ordering from
the attribute `categoryarray`. If a category is not
found in the `categoryarray` array, the sorting
behavior for that attribute will be identical to the
"trace" mode. The unspecified categories will follow
the categories in `categoryarray`. Set `categoryorder`
to *total ascending* or *total descending* if order
should be determined by the numerical order of the
values. Similarly, the order can be determined by the
min, max, sum, mean or median of all the values.
color
Sets default for all colors associated with this axis
all at once: line, font, tick, and grid colors. Grid
color is lightened by blending this with the plot
background Individual pieces can override this.
direction
Sets the direction corresponding to positive angles.
dtick
Sets the step in-between ticks on this axis. Use with
`tick0`. Must be a positive number, or special strings
available to "log" and "date" axes. If the axis `type`
is "log", then ticks are set every 10^(n*dtick) where n
is the tick number. For example, to set a tick mark at
1, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick exponents.
For example, consider the number 1,000,000,000. If
"none", it appears as 1,000,000,000. If "e", 1e+9. If
"E", 1E+9. If "power", 1x10^9 (with 9 in a super
script). If "SI", 1G. If "B", 1B.
gridcolor
Sets the color of the grid lines.
gridwidth
Sets the width (in px) of the grid lines.
hoverformat
Sets the hover text formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
layer
Sets the layer on which this axis is displayed. If
*above traces*, this axis is displayed above all the
subplot's traces If *below traces*, this axis is
displayed below all the subplot's traces, but above the
grid lines. Useful when used together with scatter-like
traces with `cliponaxis` set to False to show markers
and/or text nodes above this axis.
linecolor
Sets the axis line color.
linewidth
Sets the width (in px) of the axis line.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks will be
chosen automatically to be less than or equal to
`nticks`. Has an effect only if `tickmode` is set to
"auto".
period
Set the angular period. Has an effect only when
`angularaxis.type` is "category".
rotation
Sets that start position (in degrees) of the angular
axis By default, polar subplots with `direction` set to
"counterclockwise" get a `rotation` of 0 which
corresponds to due East (like what mathematicians
prefer). In turn, polar with `direction` set to
"clockwise" get a rotation of 90 which corresponds to
due North (like on a compass),
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of the
first tick is shown. If "last", only the exponent of
the last tick is shown. If "none", no exponents appear.
showgrid
Determines whether or not grid lines are drawn. If
True, the grid lines are drawn at every tick mark.
showline
Determines whether or not a line bounding this axis is
drawn.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
If "all", all tick labels are displayed with a prefix.
If "first", only the first tick is displayed with a
prefix. If "last", only the last tick is displayed with
a suffix. If "none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thetaunit
Sets the format unit of the formatted "theta" values.
Has an effect only when `angularaxis.type` is "linear".
tick0
Sets the placement of the first tick on this axis. Use
with `dtick`. If the axis `type` is "log", then you
must take the log of your starting tick (e.g. to set
the starting tick to 100, set the `tick0` to 2) except
when `dtick`=*L<f>* (see `dtick` for more info). If the
axis `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the tick font.
tickformat
Sets the tick label formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.layout.polar.an
gularaxis.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.layout.pola
r.angularaxis.tickformatstopdefaults), sets the default
property values to use for elements of
layout.polar.angularaxis.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto", the number
of ticks is set via `nticks`. If "linear", the
placement of the ticks is determined by a starting
position `tick0` and a tick step `dtick` ("linear" is
the default value if `tick0` and `dtick` are provided).
If "array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If "", this
axis' ticks are not drawn. If "outside" ("inside"),
this axis' are drawn outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
type
Sets the angular axis type. If "linear", set
`thetaunit` to determine the unit in which axis value
are shown. If *category, use `period` to set the number
of integer coordinates around polar axis.
uirevision
Controls persistence of user-driven changes in axis
`rotation`. Defaults to `polar<N>.uirevision`.
visible
A single toggle to hide the axis while preserving
interaction like dragging. Default is true when a
cheater plot is present on the axis, otherwise false | def __init__(
self,
arg=None,
categoryarray=None,
categoryarraysrc=None,
categoryorder=None,
color=None,
direction=None,
dtick=None,
exponentformat=None,
gridcolor=None,
gridwidth=None,
hoverformat=None,
layer=None,
linecolor=None,
linewidth=None,
nticks=None,
period=None,
rotation=None,
separatethousands=None,
showexponent=None,
showgrid=None,
showline=None,
showticklabels=None,
showtickprefix=None,
showticksuffix=None,
thetaunit=None,
tick0=None,
tickangle=None,
tickcolor=None,
tickfont=None,
tickformat=None,
tickformatstops=None,
tickformatstopdefaults=None,
ticklen=None,
tickmode=None,
tickprefix=None,
ticks=None,
ticksuffix=None,
ticktext=None,
ticktextsrc=None,
tickvals=None,
tickvalssrc=None,
tickwidth=None,
type=None,
uirevision=None,
visible=None,
**kwargs
):
"""
Construct a new AngularAxis object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.polar.AngularAxis`
categoryarray
Sets the order in which categories on this axis appear.
Only has an effect if `categoryorder` is set to
"array". Used with `categoryorder`.
categoryarraysrc
Sets the source reference on Chart Studio Cloud for
categoryarray .
categoryorder
Specifies the ordering logic for the case of
categorical variables. By default, plotly uses "trace",
which specifies the order that is present in the data
supplied. Set `categoryorder` to *category ascending*
or *category descending* if order should be determined
by the alphanumerical order of the category names. Set
`categoryorder` to "array" to derive the ordering from
the attribute `categoryarray`. If a category is not
found in the `categoryarray` array, the sorting
behavior for that attribute will be identical to the
"trace" mode. The unspecified categories will follow
the categories in `categoryarray`. Set `categoryorder`
to *total ascending* or *total descending* if order
should be determined by the numerical order of the
values. Similarly, the order can be determined by the
min, max, sum, mean or median of all the values.
color
Sets default for all colors associated with this axis
all at once: line, font, tick, and grid colors. Grid
color is lightened by blending this with the plot
background Individual pieces can override this.
direction
Sets the direction corresponding to positive angles.
dtick
Sets the step in-between ticks on this axis. Use with
`tick0`. Must be a positive number, or special strings
available to "log" and "date" axes. If the axis `type`
is "log", then ticks are set every 10^(n*dtick) where n
is the tick number. For example, to set a tick mark at
1, 10, 100, 1000, ... set dtick to 1. To set tick marks
at 1, 100, 10000, ... set dtick to 2. To set tick marks
at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special
values; "L<f>", where `f` is a positive number, gives
ticks linearly spaced in value (but not position). For
example `tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10 plus
small digits between, use "D1" (all digits) or "D2"
(only 2 and 5). `tick0` is ignored for "D1" and "D2".
If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to 86400000.0.
"date" also has special values "M<n>" gives ticks
spaced by a number of months. `n` must be a positive
integer. To set ticks on the 15th of every third month,
set `tick0` to "2000-01-15" and `dtick` to "M3". To set
ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick exponents.
For example, consider the number 1,000,000,000. If
"none", it appears as 1,000,000,000. If "e", 1e+9. If
"E", 1E+9. If "power", 1x10^9 (with 9 in a super
script). If "SI", 1G. If "B", 1B.
gridcolor
Sets the color of the grid lines.
gridwidth
Sets the width (in px) of the grid lines.
hoverformat
Sets the hover text formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
layer
Sets the layer on which this axis is displayed. If
*above traces*, this axis is displayed above all the
subplot's traces If *below traces*, this axis is
displayed below all the subplot's traces, but above the
grid lines. Useful when used together with scatter-like
traces with `cliponaxis` set to False to show markers
and/or text nodes above this axis.
linecolor
Sets the axis line color.
linewidth
Sets the width (in px) of the axis line.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks will be
chosen automatically to be less than or equal to
`nticks`. Has an effect only if `tickmode` is set to
"auto".
period
Set the angular period. Has an effect only when
`angularaxis.type` is "category".
rotation
Sets that start position (in degrees) of the angular
axis By default, polar subplots with `direction` set to
"counterclockwise" get a `rotation` of 0 which
corresponds to due East (like what mathematicians
prefer). In turn, polar with `direction` set to
"clockwise" get a rotation of 90 which corresponds to
due North (like on a compass),
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of the
first tick is shown. If "last", only the exponent of
the last tick is shown. If "none", no exponents appear.
showgrid
Determines whether or not grid lines are drawn. If
True, the grid lines are drawn at every tick mark.
showline
Determines whether or not a line bounding this axis is
drawn.
showticklabels
Determines whether or not the tick labels are drawn.
showtickprefix
If "all", all tick labels are displayed with a prefix.
If "first", only the first tick is displayed with a
prefix. If "last", only the last tick is displayed with
a suffix. If "none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thetaunit
Sets the format unit of the formatted "theta" values.
Has an effect only when `angularaxis.type` is "linear".
tick0
Sets the placement of the first tick on this axis. Use
with `dtick`. If the axis `type` is "log", then you
must take the log of your starting tick (e.g. to set
the starting tick to 100, set the `tick0` to 2) except
when `dtick`=*L<f>* (see `dtick` for more info). If the
axis `type` is "date", it should be a date string, like
date data. If the axis `type` is "category", it should
be a number, using the scale where each category is
assigned a serial number from zero in the order it
appears.
tickangle
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the
tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the tick font.
tickformat
Sets the tick label formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for
dates see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add
one item to d3's date formatter: "%{n}f" for fractional
seconds with n digits. For example, *2016-10-13
09:15:23.456* with tickformat "%H~%M~%S.%2f" would
display "09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.layout.polar.an
gularaxis.Tickformatstop` instances or dicts with
compatible properties
tickformatstopdefaults
When used in a template (as layout.template.layout.pola
r.angularaxis.tickformatstopdefaults), sets the default
property values to use for elements of
layout.polar.angularaxis.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto", the number
of ticks is set via `nticks`. If "linear", the
placement of the ticks is determined by a starting
position `tick0` and a tick step `dtick` ("linear" is
the default value if `tick0` and `dtick` are provided).
If "array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`. ("array" is
the default value if `tickvals` is provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If "", this
axis' ticks are not drawn. If "outside" ("inside"),
this axis' are drawn outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position via
`tickvals`. Only has an effect if `tickmode` is set to
"array". Used with `tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud for
ticktext .
tickvals
Sets the values at which ticks on this axis appear.
Only has an effect if `tickmode` is set to "array".
Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud for
tickvals .
tickwidth
Sets the tick width (in px).
type
Sets the angular axis type. If "linear", set
`thetaunit` to determine the unit in which axis value
are shown. If *category, use `period` to set the number
of integer coordinates around polar axis.
uirevision
Controls persistence of user-driven changes in axis
`rotation`. Defaults to `polar<N>.uirevision`.
visible
A single toggle to hide the axis while preserving
interaction like dragging. Default is true when a
cheater plot is present on the axis, otherwise false
Returns
-------
AngularAxis
"""
super(AngularAxis, self).__init__("angularaxis")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.layout.polar.AngularAxis
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.polar.AngularAxis`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("categoryarray", None)
_v = categoryarray if categoryarray is not None else _v
if _v is not None:
self["categoryarray"] = _v
_v = arg.pop("categoryarraysrc", None)
_v = categoryarraysrc if categoryarraysrc is not None else _v
if _v is not None:
self["categoryarraysrc"] = _v
_v = arg.pop("categoryorder", None)
_v = categoryorder if categoryorder is not None else _v
if _v is not None:
self["categoryorder"] = _v
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("direction", None)
_v = direction if direction is not None else _v
if _v is not None:
self["direction"] = _v
_v = arg.pop("dtick", None)
_v = dtick if dtick is not None else _v
if _v is not None:
self["dtick"] = _v
_v = arg.pop("exponentformat", None)
_v = exponentformat if exponentformat is not None else _v
if _v is not None:
self["exponentformat"] = _v
_v = arg.pop("gridcolor", None)
_v = gridcolor if gridcolor is not None else _v
if _v is not None:
self["gridcolor"] = _v
_v = arg.pop("gridwidth", None)
_v = gridwidth if gridwidth is not None else _v
if _v is not None:
self["gridwidth"] = _v
_v = arg.pop("hoverformat", None)
_v = hoverformat if hoverformat is not None else _v
if _v is not None:
self["hoverformat"] = _v
_v = arg.pop("layer", None)
_v = layer if layer is not None else _v
if _v is not None:
self["layer"] = _v
_v = arg.pop("linecolor", None)
_v = linecolor if linecolor is not None else _v
if _v is not None:
self["linecolor"] = _v
_v = arg.pop("linewidth", None)
_v = linewidth if linewidth is not None else _v
if _v is not None:
self["linewidth"] = _v
_v = arg.pop("nticks", None)
_v = nticks if nticks is not None else _v
if _v is not None:
self["nticks"] = _v
_v = arg.pop("period", None)
_v = period if period is not None else _v
if _v is not None:
self["period"] = _v
_v = arg.pop("rotation", None)
_v = rotation if rotation is not None else _v
if _v is not None:
self["rotation"] = _v
_v = arg.pop("separatethousands", None)
_v = separatethousands if separatethousands is not None else _v
if _v is not None:
self["separatethousands"] = _v
_v = arg.pop("showexponent", None)
_v = showexponent if showexponent is not None else _v
if _v is not None:
self["showexponent"] = _v
_v = arg.pop("showgrid", None)
_v = showgrid if showgrid is not None else _v
if _v is not None:
self["showgrid"] = _v
_v = arg.pop("showline", None)
_v = showline if showline is not None else _v
if _v is not None:
self["showline"] = _v
_v = arg.pop("showticklabels", None)
_v = showticklabels if showticklabels is not None else _v
if _v is not None:
self["showticklabels"] = _v
_v = arg.pop("showtickprefix", None)
_v = showtickprefix if showtickprefix is not None else _v
if _v is not None:
self["showtickprefix"] = _v
_v = arg.pop("showticksuffix", None)
_v = showticksuffix if showticksuffix is not None else _v
if _v is not None:
self["showticksuffix"] = _v
_v = arg.pop("thetaunit", None)
_v = thetaunit if thetaunit is not None else _v
if _v is not None:
self["thetaunit"] = _v
_v = arg.pop("tick0", None)
_v = tick0 if tick0 is not None else _v
if _v is not None:
self["tick0"] = _v
_v = arg.pop("tickangle", None)
_v = tickangle if tickangle is not None else _v
if _v is not None:
self["tickangle"] = _v
_v = arg.pop("tickcolor", None)
_v = tickcolor if tickcolor is not None else _v
if _v is not None:
self["tickcolor"] = _v
_v = arg.pop("tickfont", None)
_v = tickfont if tickfont is not None else _v
if _v is not None:
self["tickfont"] = _v
_v = arg.pop("tickformat", None)
_v = tickformat if tickformat is not None else _v
if _v is not None:
self["tickformat"] = _v
_v = arg.pop("tickformatstops", None)
_v = tickformatstops if tickformatstops is not None else _v
if _v is not None:
self["tickformatstops"] = _v
_v = arg.pop("tickformatstopdefaults", None)
_v = tickformatstopdefaults if tickformatstopdefaults is not None else _v
if _v is not None:
self["tickformatstopdefaults"] = _v
_v = arg.pop("ticklen", None)
_v = ticklen if ticklen is not None else _v
if _v is not None:
self["ticklen"] = _v
_v = arg.pop("tickmode", None)
_v = tickmode if tickmode is not None else _v
if _v is not None:
self["tickmode"] = _v
_v = arg.pop("tickprefix", None)
_v = tickprefix if tickprefix is not None else _v
if _v is not None:
self["tickprefix"] = _v
_v = arg.pop("ticks", None)
_v = ticks if ticks is not None else _v
if _v is not None:
self["ticks"] = _v
_v = arg.pop("ticksuffix", None)
_v = ticksuffix if ticksuffix is not None else _v
if _v is not None:
self["ticksuffix"] = _v
_v = arg.pop("ticktext", None)
_v = ticktext if ticktext is not None else _v
if _v is not None:
self["ticktext"] = _v
_v = arg.pop("ticktextsrc", None)
_v = ticktextsrc if ticktextsrc is not None else _v
if _v is not None:
self["ticktextsrc"] = _v
_v = arg.pop("tickvals", None)
_v = tickvals if tickvals is not None else _v
if _v is not None:
self["tickvals"] = _v
_v = arg.pop("tickvalssrc", None)
_v = tickvalssrc if tickvalssrc is not None else _v
if _v is not None:
self["tickvalssrc"] = _v
_v = arg.pop("tickwidth", None)
_v = tickwidth if tickwidth is not None else _v
if _v is not None:
self["tickwidth"] = _v
_v = arg.pop("type", None)
_v = type if type is not None else _v
if _v is not None:
self["type"] = _v
_v = arg.pop("uirevision", None)
_v = uirevision if uirevision is not None else _v
if _v is not None:
self["uirevision"] = _v
_v = arg.pop("visible", None)
_v = visible if visible is not None else _v
if _v is not None:
self["visible"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"categoryarray",
"=",
"None",
",",
"categoryarraysrc",
"=",
"None",
",",
"categoryorder",
"=",
"None",
",",
"color",
"=",
"None",
",",
"direction",
"=",
"None",
",",
"dtick",
"=",
"None",
",",
"exponentformat",
"=",
"None",
",",
"gridcolor",
"=",
"None",
",",
"gridwidth",
"=",
"None",
",",
"hoverformat",
"=",
"None",
",",
"layer",
"=",
"None",
",",
"linecolor",
"=",
"None",
",",
"linewidth",
"=",
"None",
",",
"nticks",
"=",
"None",
",",
"period",
"=",
"None",
",",
"rotation",
"=",
"None",
",",
"separatethousands",
"=",
"None",
",",
"showexponent",
"=",
"None",
",",
"showgrid",
"=",
"None",
",",
"showline",
"=",
"None",
",",
"showticklabels",
"=",
"None",
",",
"showtickprefix",
"=",
"None",
",",
"showticksuffix",
"=",
"None",
",",
"thetaunit",
"=",
"None",
",",
"tick0",
"=",
"None",
",",
"tickangle",
"=",
"None",
",",
"tickcolor",
"=",
"None",
",",
"tickfont",
"=",
"None",
",",
"tickformat",
"=",
"None",
",",
"tickformatstops",
"=",
"None",
",",
"tickformatstopdefaults",
"=",
"None",
",",
"ticklen",
"=",
"None",
",",
"tickmode",
"=",
"None",
",",
"tickprefix",
"=",
"None",
",",
"ticks",
"=",
"None",
",",
"ticksuffix",
"=",
"None",
",",
"ticktext",
"=",
"None",
",",
"ticktextsrc",
"=",
"None",
",",
"tickvals",
"=",
"None",
",",
"tickvalssrc",
"=",
"None",
",",
"tickwidth",
"=",
"None",
",",
"type",
"=",
"None",
",",
"uirevision",
"=",
"None",
",",
"visible",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"AngularAxis",
",",
"self",
")",
".",
"__init__",
"(",
"\"angularaxis\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.layout.polar.AngularAxis \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.polar.AngularAxis`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"categoryarray\"",
",",
"None",
")",
"_v",
"=",
"categoryarray",
"if",
"categoryarray",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"categoryarray\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"categoryarraysrc\"",
",",
"None",
")",
"_v",
"=",
"categoryarraysrc",
"if",
"categoryarraysrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"categoryarraysrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"categoryorder\"",
",",
"None",
")",
"_v",
"=",
"categoryorder",
"if",
"categoryorder",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"categoryorder\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"direction\"",
",",
"None",
")",
"_v",
"=",
"direction",
"if",
"direction",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"direction\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"dtick\"",
",",
"None",
")",
"_v",
"=",
"dtick",
"if",
"dtick",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtick\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"exponentformat\"",
",",
"None",
")",
"_v",
"=",
"exponentformat",
"if",
"exponentformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"exponentformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"gridcolor\"",
",",
"None",
")",
"_v",
"=",
"gridcolor",
"if",
"gridcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"gridcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"gridwidth\"",
",",
"None",
")",
"_v",
"=",
"gridwidth",
"if",
"gridwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"gridwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverformat\"",
",",
"None",
")",
"_v",
"=",
"hoverformat",
"if",
"hoverformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"layer\"",
",",
"None",
")",
"_v",
"=",
"layer",
"if",
"layer",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"layer\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"linecolor\"",
",",
"None",
")",
"_v",
"=",
"linecolor",
"if",
"linecolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"linecolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"linewidth\"",
",",
"None",
")",
"_v",
"=",
"linewidth",
"if",
"linewidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"linewidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"nticks\"",
",",
"None",
")",
"_v",
"=",
"nticks",
"if",
"nticks",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"nticks\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"period\"",
",",
"None",
")",
"_v",
"=",
"period",
"if",
"period",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"period\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"rotation\"",
",",
"None",
")",
"_v",
"=",
"rotation",
"if",
"rotation",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"rotation\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"separatethousands\"",
",",
"None",
")",
"_v",
"=",
"separatethousands",
"if",
"separatethousands",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"separatethousands\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showexponent\"",
",",
"None",
")",
"_v",
"=",
"showexponent",
"if",
"showexponent",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showexponent\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showgrid\"",
",",
"None",
")",
"_v",
"=",
"showgrid",
"if",
"showgrid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showgrid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showline\"",
",",
"None",
")",
"_v",
"=",
"showline",
"if",
"showline",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showline\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showticklabels\"",
",",
"None",
")",
"_v",
"=",
"showticklabels",
"if",
"showticklabels",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showticklabels\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showtickprefix\"",
",",
"None",
")",
"_v",
"=",
"showtickprefix",
"if",
"showtickprefix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showtickprefix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showticksuffix\"",
",",
"None",
")",
"_v",
"=",
"showticksuffix",
"if",
"showticksuffix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showticksuffix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"thetaunit\"",
",",
"None",
")",
"_v",
"=",
"thetaunit",
"if",
"thetaunit",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"thetaunit\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tick0\"",
",",
"None",
")",
"_v",
"=",
"tick0",
"if",
"tick0",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tick0\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickangle\"",
",",
"None",
")",
"_v",
"=",
"tickangle",
"if",
"tickangle",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickangle\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickcolor\"",
",",
"None",
")",
"_v",
"=",
"tickcolor",
"if",
"tickcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickfont\"",
",",
"None",
")",
"_v",
"=",
"tickfont",
"if",
"tickfont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickfont\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformat\"",
",",
"None",
")",
"_v",
"=",
"tickformat",
"if",
"tickformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformatstops\"",
",",
"None",
")",
"_v",
"=",
"tickformatstops",
"if",
"tickformatstops",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformatstops\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickformatstopdefaults\"",
",",
"None",
")",
"_v",
"=",
"tickformatstopdefaults",
"if",
"tickformatstopdefaults",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickformatstopdefaults\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticklen\"",
",",
"None",
")",
"_v",
"=",
"ticklen",
"if",
"ticklen",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticklen\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickmode\"",
",",
"None",
")",
"_v",
"=",
"tickmode",
"if",
"tickmode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickmode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickprefix\"",
",",
"None",
")",
"_v",
"=",
"tickprefix",
"if",
"tickprefix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickprefix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticks\"",
",",
"None",
")",
"_v",
"=",
"ticks",
"if",
"ticks",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticks\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticksuffix\"",
",",
"None",
")",
"_v",
"=",
"ticksuffix",
"if",
"ticksuffix",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticksuffix\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticktext\"",
",",
"None",
")",
"_v",
"=",
"ticktext",
"if",
"ticktext",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticktext\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ticktextsrc\"",
",",
"None",
")",
"_v",
"=",
"ticktextsrc",
"if",
"ticktextsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ticktextsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickvals\"",
",",
"None",
")",
"_v",
"=",
"tickvals",
"if",
"tickvals",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickvals\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickvalssrc\"",
",",
"None",
")",
"_v",
"=",
"tickvalssrc",
"if",
"tickvalssrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickvalssrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"tickwidth\"",
",",
"None",
")",
"_v",
"=",
"tickwidth",
"if",
"tickwidth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"tickwidth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"type\"",
",",
"None",
")",
"_v",
"=",
"type",
"if",
"type",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"type\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"uirevision\"",
",",
"None",
")",
"_v",
"=",
"uirevision",
"if",
"uirevision",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"uirevision\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"visible\"",
",",
"None",
")",
"_v",
"=",
"visible",
"if",
"visible",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"visible\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1518,
4
] | [
2011,
34
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter3d.line
.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
|
Construct a new Tickfont object
Sets the color bar's tick label font | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter3d.line
.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
"""
super(Tickfont, self).__init__("tickfont")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scatter3d.line.colorbar.Tickfont
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickfont`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("family", None)
_v = family if family is not None else _v
if _v is not None:
self["family"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scatter3d.line.colorbar.Tickfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickfont`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"family\"",
",",
"None",
")",
"_v",
"=",
"family",
"if",
"family",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"family\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
GetRevocRegDeltaHandler.get_result | (self, request: Request) |
For getting reply we need:
1. Get REVOC_REG_ENTRY by "TO" timestamp from state
2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state
3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued strategy)
4. Compute issued and revoked indices by corresponding strategy
5. Make result
5.1 Now, if "FROM" is presented in request, then STATE_PROOF_FROM and ACCUM (revocation entry for "FROM" timestamp)
will added into data section
5.2 If not, then only STATE_PROOF for "TO" revocation entry will added
:param request:
:return: Reply
|
For getting reply we need:
1. Get REVOC_REG_ENTRY by "TO" timestamp from state
2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state
3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued strategy)
4. Compute issued and revoked indices by corresponding strategy
5. Make result
5.1 Now, if "FROM" is presented in request, then STATE_PROOF_FROM and ACCUM (revocation entry for "FROM" timestamp)
will added into data section
5.2 If not, then only STATE_PROOF for "TO" revocation entry will added
:param request:
:return: Reply
| def get_result(self, request: Request):
"""
For getting reply we need:
1. Get REVOC_REG_ENTRY by "TO" timestamp from state
2. If FROM is given in request, then Get REVOC_REG_ENTRY by "FROM" timestamp from state
3. Get ISSUANCE_TYPE for REVOC_REG_DEF (revoked/issued strategy)
4. Compute issued and revoked indices by corresponding strategy
5. Make result
5.1 Now, if "FROM" is presented in request, then STATE_PROOF_FROM and ACCUM (revocation entry for "FROM" timestamp)
will added into data section
5.2 If not, then only STATE_PROOF for "TO" revocation entry will added
:param request:
:return: Reply
"""
self._validate_request_type(request)
req_ts_from = request.operation.get(FROM, None)
req_ts_to = request.operation.get(TO)
revoc_reg_def_id = request.operation.get(REVOC_REG_DEF_ID)
reply = None
"""
Get root hash for "to" timestamp
Get REVOC_REG_ENTRY and ACCUM record for timestamp "to"
"""
path_to_reg_entry = RevocRegEntryHandler.make_state_path_for_revoc_reg_entry(revoc_reg_def_id=revoc_reg_def_id)
path_to_reg_entry_accum = RevocRegEntryHandler.make_state_path_for_revoc_reg_entry_accum(revoc_reg_def_id=revoc_reg_def_id)
entry_to = self._get_reg_entry_by_timestamp(req_ts_to, path_to_reg_entry)
accum_to = self._get_reg_entry_accum_by_timestamp(req_ts_to, path_to_reg_entry_accum)
entry_from = StateValue()
accum_from = StateValue()
if accum_to.value and entry_to.value:
"""Get issuance type from REVOC_REG_DEF"""
encoded_revoc_reg_def = self.state.get_for_root_hash(entry_to.root_hash,
revoc_reg_def_id)
if encoded_revoc_reg_def:
revoc_reg_def, _, _ = decode_state_value(encoded_revoc_reg_def)
strategy_cls = self.get_revocation_strategy(revoc_reg_def[VALUE][ISSUANCE_TYPE])
issued_to = entry_to.value[VALUE].get(ISSUED, [])
revoked_to = entry_to.value[VALUE].get(REVOKED, [])
if req_ts_from:
"""Get REVOC_REG_ENTRY and ACCUM records for timestamp from if exist"""
entry_from = self._get_reg_entry_by_timestamp(req_ts_from, path_to_reg_entry)
accum_from = self._get_reg_entry_accum_by_timestamp(req_ts_from, path_to_reg_entry_accum)
if req_ts_from and entry_from.value and accum_from.value:
"""Compute issued/revoked lists corresponding with ISSUANCE_TYPE strategy"""
issued_from = entry_from.value[VALUE].get(ISSUED, [])
revoked_from = entry_from.value[VALUE].get(REVOKED, [])
result_issued, result_revoked = strategy_cls.get_delta({ISSUED: issued_to,
REVOKED: revoked_to},
{ISSUED: issued_from,
REVOKED: revoked_from})
else:
result_issued, result_revoked = strategy_cls.get_delta({ISSUED: issued_to,
REVOKED: revoked_to},
None)
reply = {
REVOC_REG_DEF_ID: revoc_reg_def_id,
REVOC_TYPE: revoc_reg_def.get(REVOC_TYPE),
VALUE: {
ACCUM_TO: accum_to.value if entry_from.value else entry_to.value,
ISSUED: result_issued,
REVOKED: result_revoked
}
}
"""If we got "from" timestamp, then add state proof into "data" section of reply"""
if req_ts_from:
reply[STATE_PROOF_FROM] = accum_from.proof
reply[VALUE][ACCUM_FROM] = accum_from.value
if accum_to and entry_to:
seq_no = accum_to.seq_no if entry_from.value else entry_to.seq_no
update_time = accum_to.update_time if entry_from.value else entry_to.update_time
proof = accum_to.proof if entry_from.value else entry_to.proof
if reply is None and req_ts_from is not None:
# TODO: change this according to INDY-2115
reply = {}
accum_from = self._get_reg_entry_accum_by_timestamp(req_ts_from, path_to_reg_entry_accum)
reply[STATE_PROOF_FROM] = accum_from.proof
reply[VALUE] = {}
reply[VALUE][ACCUM_TO] = None
reply[VALUE][ACCUM_FROM] = accum_from.value
else:
seq_no = None
update_time = None
proof = None
return self.make_result(request=request,
data=reply,
last_seq_no=seq_no,
update_time=update_time,
proof=proof) | [
"def",
"get_result",
"(",
"self",
",",
"request",
":",
"Request",
")",
":",
"self",
".",
"_validate_request_type",
"(",
"request",
")",
"req_ts_from",
"=",
"request",
".",
"operation",
".",
"get",
"(",
"FROM",
",",
"None",
")",
"req_ts_to",
"=",
"request",
".",
"operation",
".",
"get",
"(",
"TO",
")",
"revoc_reg_def_id",
"=",
"request",
".",
"operation",
".",
"get",
"(",
"REVOC_REG_DEF_ID",
")",
"reply",
"=",
"None",
"\"\"\"\n Get root hash for \"to\" timestamp\n Get REVOC_REG_ENTRY and ACCUM record for timestamp \"to\"\n \"\"\"",
"path_to_reg_entry",
"=",
"RevocRegEntryHandler",
".",
"make_state_path_for_revoc_reg_entry",
"(",
"revoc_reg_def_id",
"=",
"revoc_reg_def_id",
")",
"path_to_reg_entry_accum",
"=",
"RevocRegEntryHandler",
".",
"make_state_path_for_revoc_reg_entry_accum",
"(",
"revoc_reg_def_id",
"=",
"revoc_reg_def_id",
")",
"entry_to",
"=",
"self",
".",
"_get_reg_entry_by_timestamp",
"(",
"req_ts_to",
",",
"path_to_reg_entry",
")",
"accum_to",
"=",
"self",
".",
"_get_reg_entry_accum_by_timestamp",
"(",
"req_ts_to",
",",
"path_to_reg_entry_accum",
")",
"entry_from",
"=",
"StateValue",
"(",
")",
"accum_from",
"=",
"StateValue",
"(",
")",
"if",
"accum_to",
".",
"value",
"and",
"entry_to",
".",
"value",
":",
"\"\"\"Get issuance type from REVOC_REG_DEF\"\"\"",
"encoded_revoc_reg_def",
"=",
"self",
".",
"state",
".",
"get_for_root_hash",
"(",
"entry_to",
".",
"root_hash",
",",
"revoc_reg_def_id",
")",
"if",
"encoded_revoc_reg_def",
":",
"revoc_reg_def",
",",
"_",
",",
"_",
"=",
"decode_state_value",
"(",
"encoded_revoc_reg_def",
")",
"strategy_cls",
"=",
"self",
".",
"get_revocation_strategy",
"(",
"revoc_reg_def",
"[",
"VALUE",
"]",
"[",
"ISSUANCE_TYPE",
"]",
")",
"issued_to",
"=",
"entry_to",
".",
"value",
"[",
"VALUE",
"]",
".",
"get",
"(",
"ISSUED",
",",
"[",
"]",
")",
"revoked_to",
"=",
"entry_to",
".",
"value",
"[",
"VALUE",
"]",
".",
"get",
"(",
"REVOKED",
",",
"[",
"]",
")",
"if",
"req_ts_from",
":",
"\"\"\"Get REVOC_REG_ENTRY and ACCUM records for timestamp from if exist\"\"\"",
"entry_from",
"=",
"self",
".",
"_get_reg_entry_by_timestamp",
"(",
"req_ts_from",
",",
"path_to_reg_entry",
")",
"accum_from",
"=",
"self",
".",
"_get_reg_entry_accum_by_timestamp",
"(",
"req_ts_from",
",",
"path_to_reg_entry_accum",
")",
"if",
"req_ts_from",
"and",
"entry_from",
".",
"value",
"and",
"accum_from",
".",
"value",
":",
"\"\"\"Compute issued/revoked lists corresponding with ISSUANCE_TYPE strategy\"\"\"",
"issued_from",
"=",
"entry_from",
".",
"value",
"[",
"VALUE",
"]",
".",
"get",
"(",
"ISSUED",
",",
"[",
"]",
")",
"revoked_from",
"=",
"entry_from",
".",
"value",
"[",
"VALUE",
"]",
".",
"get",
"(",
"REVOKED",
",",
"[",
"]",
")",
"result_issued",
",",
"result_revoked",
"=",
"strategy_cls",
".",
"get_delta",
"(",
"{",
"ISSUED",
":",
"issued_to",
",",
"REVOKED",
":",
"revoked_to",
"}",
",",
"{",
"ISSUED",
":",
"issued_from",
",",
"REVOKED",
":",
"revoked_from",
"}",
")",
"else",
":",
"result_issued",
",",
"result_revoked",
"=",
"strategy_cls",
".",
"get_delta",
"(",
"{",
"ISSUED",
":",
"issued_to",
",",
"REVOKED",
":",
"revoked_to",
"}",
",",
"None",
")",
"reply",
"=",
"{",
"REVOC_REG_DEF_ID",
":",
"revoc_reg_def_id",
",",
"REVOC_TYPE",
":",
"revoc_reg_def",
".",
"get",
"(",
"REVOC_TYPE",
")",
",",
"VALUE",
":",
"{",
"ACCUM_TO",
":",
"accum_to",
".",
"value",
"if",
"entry_from",
".",
"value",
"else",
"entry_to",
".",
"value",
",",
"ISSUED",
":",
"result_issued",
",",
"REVOKED",
":",
"result_revoked",
"}",
"}",
"\"\"\"If we got \"from\" timestamp, then add state proof into \"data\" section of reply\"\"\"",
"if",
"req_ts_from",
":",
"reply",
"[",
"STATE_PROOF_FROM",
"]",
"=",
"accum_from",
".",
"proof",
"reply",
"[",
"VALUE",
"]",
"[",
"ACCUM_FROM",
"]",
"=",
"accum_from",
".",
"value",
"if",
"accum_to",
"and",
"entry_to",
":",
"seq_no",
"=",
"accum_to",
".",
"seq_no",
"if",
"entry_from",
".",
"value",
"else",
"entry_to",
".",
"seq_no",
"update_time",
"=",
"accum_to",
".",
"update_time",
"if",
"entry_from",
".",
"value",
"else",
"entry_to",
".",
"update_time",
"proof",
"=",
"accum_to",
".",
"proof",
"if",
"entry_from",
".",
"value",
"else",
"entry_to",
".",
"proof",
"if",
"reply",
"is",
"None",
"and",
"req_ts_from",
"is",
"not",
"None",
":",
"# TODO: change this according to INDY-2115",
"reply",
"=",
"{",
"}",
"accum_from",
"=",
"self",
".",
"_get_reg_entry_accum_by_timestamp",
"(",
"req_ts_from",
",",
"path_to_reg_entry_accum",
")",
"reply",
"[",
"STATE_PROOF_FROM",
"]",
"=",
"accum_from",
".",
"proof",
"reply",
"[",
"VALUE",
"]",
"=",
"{",
"}",
"reply",
"[",
"VALUE",
"]",
"[",
"ACCUM_TO",
"]",
"=",
"None",
"reply",
"[",
"VALUE",
"]",
"[",
"ACCUM_FROM",
"]",
"=",
"accum_from",
".",
"value",
"else",
":",
"seq_no",
"=",
"None",
"update_time",
"=",
"None",
"proof",
"=",
"None",
"return",
"self",
".",
"make_result",
"(",
"request",
"=",
"request",
",",
"data",
"=",
"reply",
",",
"last_seq_no",
"=",
"seq_no",
",",
"update_time",
"=",
"update_time",
",",
"proof",
"=",
"proof",
")"
] | [
33,
4
] | [
125,
44
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["align"] | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
26,
4
] | [
41,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
50,
4
] | [
61,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bgcolor"] | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
70,
4
] | [
121,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
130,
4
] | [
141,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bordercolor"] | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
150,
4
] | [
201,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bordercolorsrc"] | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
210,
4
] | [
222,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.ohlc.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.ohlc.hoverlabel.Font
|
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.ohlc.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.ohlc.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.ohlc.hoverlabel.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
231,
4
] | [
278,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
|
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
"""
return self["namelength"] | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
287,
4
] | [
305,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["namelengthsrc"] | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
314,
4
] | [
326,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.split | (self) |
Show hover information (open, close, high, low) in separate
labels.
The 'split' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Show hover information (open, close, high, low) in separate
labels.
The 'split' property must be specified as a bool
(either True, or False) | def split(self):
"""
Show hover information (open, close, high, low) in separate
labels.
The 'split' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["split"] | [
"def",
"split",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"split\"",
"]"
] | [
335,
4
] | [
347,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
split=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.ohlc.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
split
Show hover information (open, close, high, low) in
separate labels.
Returns
-------
Hoverlabel
|
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.ohlc.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
split
Show hover information (open, close, high, low) in
separate labels. | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
split=None,
**kwargs
):
"""
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.ohlc.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
split
Show hover information (open, close, high, low) in
separate labels.
Returns
-------
Hoverlabel
"""
super(Hoverlabel, self).__init__("hoverlabel")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.ohlc.Hoverlabel
constructor must be a dict or
an instance of :class:`plotly.graph_objs.ohlc.Hoverlabel`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("align", None)
_v = align if align is not None else _v
if _v is not None:
self["align"] = _v
_v = arg.pop("alignsrc", None)
_v = alignsrc if alignsrc is not None else _v
if _v is not None:
self["alignsrc"] = _v
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("bgcolorsrc", None)
_v = bgcolorsrc if bgcolorsrc is not None else _v
if _v is not None:
self["bgcolorsrc"] = _v
_v = arg.pop("bordercolor", None)
_v = bordercolor if bordercolor is not None else _v
if _v is not None:
self["bordercolor"] = _v
_v = arg.pop("bordercolorsrc", None)
_v = bordercolorsrc if bordercolorsrc is not None else _v
if _v is not None:
self["bordercolorsrc"] = _v
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("namelength", None)
_v = namelength if namelength is not None else _v
if _v is not None:
self["namelength"] = _v
_v = arg.pop("namelengthsrc", None)
_v = namelengthsrc if namelengthsrc is not None else _v
if _v is not None:
self["namelengthsrc"] = _v
_v = arg.pop("split", None)
_v = split if split is not None else _v
if _v is not None:
self["split"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"font",
"=",
"None",
",",
"namelength",
"=",
"None",
",",
"namelengthsrc",
"=",
"None",
",",
"split",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Hoverlabel",
",",
"self",
")",
".",
"__init__",
"(",
"\"hoverlabel\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.ohlc.Hoverlabel \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.ohlc.Hoverlabel`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"align\"",
",",
"None",
")",
"_v",
"=",
"align",
"if",
"align",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"align\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"alignsrc\"",
",",
"None",
")",
"_v",
"=",
"alignsrc",
"if",
"alignsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"alignsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolor\"",
",",
"None",
")",
"_v",
"=",
"bgcolor",
"if",
"bgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bgcolorsrc",
"if",
"bgcolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolor\"",
",",
"None",
")",
"_v",
"=",
"bordercolor",
"if",
"bordercolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bordercolorsrc",
"if",
"bordercolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelength\"",
",",
"None",
")",
"_v",
"=",
"namelength",
"if",
"namelength",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelength\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelengthsrc\"",
",",
"None",
")",
"_v",
"=",
"namelengthsrc",
"if",
"namelengthsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelengthsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"split\"",
",",
"None",
")",
"_v",
"=",
"split",
"if",
"split",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"split\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
395,
4
] | [
535,
34
] | python | en | ['en', 'error', 'th'] | False |
Title.font | (self) |
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.barpolar.marker.colorbar.title.Font
|
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | def font(self):
"""
Sets this color bar's title font. Note that the title's font
used to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.barpolar.marker.colorbar.title.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
53,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.side | (self) |
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom']
Returns
-------
Any
|
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom'] | def side(self):
"""
Determines the location of color bar's title with respect to
the color bar. Note that the title's location used to be set by
the now deprecated `titleside` attribute.
The 'side' property is an enumeration that may be specified as:
- One of the following enumeration values:
['right', 'top', 'bottom']
Returns
-------
Any
"""
return self["side"] | [
"def",
"side",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"side\"",
"]"
] | [
62,
4
] | [
76,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def text(self):
"""
Sets the title of the color bar. Note that before the existence
of `title.text`, the title's contents used to be defined as the
`title` attribute itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["text"] | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
85,
4
] | [
99,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, side=None, text=None, **kwargs) |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.barpolar.marke
r.colorbar.Title`
font
Sets this color bar's title font. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
side
Determines the location of color bar's title with
respect to the color bar. Note that the title's
location used to be set by the now deprecated
`titleside` attribute.
text
Sets the title of the color bar. Note that before the
existence of `title.text`, the title's contents used to
be defined as the `title` attribute itself. This
behavior has been deprecated.
Returns
-------
Title
|
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.barpolar.marke
r.colorbar.Title`
font
Sets this color bar's title font. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
side
Determines the location of color bar's title with
respect to the color bar. Note that the title's
location used to be set by the now deprecated
`titleside` attribute.
text
Sets the title of the color bar. Note that before the
existence of `title.text`, the title's contents used to
be defined as the `title` attribute itself. This
behavior has been deprecated. | def __init__(self, arg=None, font=None, side=None, text=None, **kwargs):
"""
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.barpolar.marke
r.colorbar.Title`
font
Sets this color bar's title font. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
side
Determines the location of color bar's title with
respect to the color bar. Note that the title's
location used to be set by the now deprecated
`titleside` attribute.
text
Sets the title of the color bar. Note that before the
existence of `title.text`, the title's contents used to
be defined as the `title` attribute itself. This
behavior has been deprecated.
Returns
-------
Title
"""
super(Title, self).__init__("title")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.barpolar.marker.colorbar.Title
constructor must be a dict or
an instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Title`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("side", None)
_v = side if side is not None else _v
if _v is not None:
self["side"] = _v
_v = arg.pop("text", None)
_v = text if text is not None else _v
if _v is not None:
self["text"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"side",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.barpolar.marker.colorbar.Title \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.barpolar.marker.colorbar.Title`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"side\"",
",",
"None",
")",
"_v",
"=",
"side",
"if",
"side",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"side\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"text\"",
",",
"None",
")",
"_v",
"=",
"text",
"if",
"text",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"text\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
126,
4
] | [
203,
34
] | python | en | ['en', 'error', 'th'] | False |
MuxAccountLookCommand.parse | (self) | Custom parsing | Custom parsing | def parse(self):
"""Custom parsing"""
super(MuxAccountLookCommand, self).parse()
if _MULTISESSION_MODE < 2:
# only one character allowed - not used in this mode
self.playable = None
return
playable = self.account.db._playable_characters
if playable is not None:
# clean up list if character object was deleted in between
if None in playable:
playable = [character for character in playable if character]
self.account.db._playable_characters = playable
# store playable property
if self.args:
self.playable = dict((utils.to_str(char.key.lower()), char)
for char in playable).get(self.args.lower(), None)
else:
self.playable = playable | [
"def",
"parse",
"(",
"self",
")",
":",
"super",
"(",
"MuxAccountLookCommand",
",",
"self",
")",
".",
"parse",
"(",
")",
"if",
"_MULTISESSION_MODE",
"<",
"2",
":",
"# only one character allowed - not used in this mode",
"self",
".",
"playable",
"=",
"None",
"return",
"playable",
"=",
"self",
".",
"account",
".",
"db",
".",
"_playable_characters",
"if",
"playable",
"is",
"not",
"None",
":",
"# clean up list if character object was deleted in between",
"if",
"None",
"in",
"playable",
":",
"playable",
"=",
"[",
"character",
"for",
"character",
"in",
"playable",
"if",
"character",
"]",
"self",
".",
"account",
".",
"db",
".",
"_playable_characters",
"=",
"playable",
"# store playable property",
"if",
"self",
".",
"args",
":",
"self",
".",
"playable",
"=",
"dict",
"(",
"(",
"utils",
".",
"to_str",
"(",
"char",
".",
"key",
".",
"lower",
"(",
")",
")",
",",
"char",
")",
"for",
"char",
"in",
"playable",
")",
".",
"get",
"(",
"self",
".",
"args",
".",
"lower",
"(",
")",
",",
"None",
")",
"else",
":",
"self",
".",
"playable",
"=",
"playable"
] | [
45,
4
] | [
66,
36
] | python | en | ['en', 'hi-Latn', 'en'] | False |
CmdOOCLook.func | (self) | implement the ooc look command | implement the ooc look command | def func(self):
"""implement the ooc look command"""
if _MULTISESSION_MODE < 2:
# only one character allowed
self.msg("You are out-of-character (OOC).\nUse |w@ic|n to get back into the game.")
return
# call on-account look helper method
self.msg(self.account.at_look(target=self.playable, session=self.session)) | [
"def",
"func",
"(",
"self",
")",
":",
"if",
"_MULTISESSION_MODE",
"<",
"2",
":",
"# only one character allowed",
"self",
".",
"msg",
"(",
"\"You are out-of-character (OOC).\\nUse |w@ic|n to get back into the game.\"",
")",
"return",
"# call on-account look helper method",
"self",
".",
"msg",
"(",
"self",
".",
"account",
".",
"at_look",
"(",
"target",
"=",
"self",
".",
"playable",
",",
"session",
"=",
"self",
".",
"session",
")",
")"
] | [
98,
4
] | [
107,
82
] | python | en | ['en', 'en', 'en'] | True |
CmdCharCreate.func | (self) | create the new character | create the new character | def func(self):
"""create the new character"""
account = self.account
if not self.args:
self.msg("Usage: @charcreate <charname> [= description]")
return
key = self.lhs
desc = self.rhs
charmax = _MAX_NR_CHARACTERS
if not account.is_superuser and \
(account.db._playable_characters and
len(account.db._playable_characters) >= charmax):
self.msg("You may only create a maximum of %i characters." % charmax)
return
from evennia.objects.models import ObjectDB
typeclass = settings.BASE_CHARACTER_TYPECLASS
if ObjectDB.objects.filter(db_typeclass_path=typeclass, db_key__iexact=key):
# check if this Character already exists. Note that we are only
# searching the base character typeclass here, not any child
# classes.
self.msg("|rA character named '|w%s|r' already exists.|n" % key)
return
# create the character
start_location = ObjectDB.objects.get_id(settings.START_LOCATION)
default_home = ObjectDB.objects.get_id(settings.DEFAULT_HOME)
permissions = settings.PERMISSION_ACCOUNT_DEFAULT
new_character = create.create_object(typeclass, key=key,
location=start_location,
home=default_home,
permissions=permissions)
# only allow creator (and developers) to puppet this char
new_character.locks.add("puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)" %
(new_character.id, account.id))
account.db._playable_characters.append(new_character)
if desc:
new_character.db.desc = desc
elif not new_character.db.desc:
new_character.db.desc = "This is a character."
self.msg("Created new character %s. Use |w@ic %s|n to enter the game as this character."
% (new_character.key, new_character.key)) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"if",
"not",
"self",
".",
"args",
":",
"self",
".",
"msg",
"(",
"\"Usage: @charcreate <charname> [= description]\"",
")",
"return",
"key",
"=",
"self",
".",
"lhs",
"desc",
"=",
"self",
".",
"rhs",
"charmax",
"=",
"_MAX_NR_CHARACTERS",
"if",
"not",
"account",
".",
"is_superuser",
"and",
"(",
"account",
".",
"db",
".",
"_playable_characters",
"and",
"len",
"(",
"account",
".",
"db",
".",
"_playable_characters",
")",
">=",
"charmax",
")",
":",
"self",
".",
"msg",
"(",
"\"You may only create a maximum of %i characters.\"",
"%",
"charmax",
")",
"return",
"from",
"evennia",
".",
"objects",
".",
"models",
"import",
"ObjectDB",
"typeclass",
"=",
"settings",
".",
"BASE_CHARACTER_TYPECLASS",
"if",
"ObjectDB",
".",
"objects",
".",
"filter",
"(",
"db_typeclass_path",
"=",
"typeclass",
",",
"db_key__iexact",
"=",
"key",
")",
":",
"# check if this Character already exists. Note that we are only",
"# searching the base character typeclass here, not any child",
"# classes.",
"self",
".",
"msg",
"(",
"\"|rA character named '|w%s|r' already exists.|n\"",
"%",
"key",
")",
"return",
"# create the character",
"start_location",
"=",
"ObjectDB",
".",
"objects",
".",
"get_id",
"(",
"settings",
".",
"START_LOCATION",
")",
"default_home",
"=",
"ObjectDB",
".",
"objects",
".",
"get_id",
"(",
"settings",
".",
"DEFAULT_HOME",
")",
"permissions",
"=",
"settings",
".",
"PERMISSION_ACCOUNT_DEFAULT",
"new_character",
"=",
"create",
".",
"create_object",
"(",
"typeclass",
",",
"key",
"=",
"key",
",",
"location",
"=",
"start_location",
",",
"home",
"=",
"default_home",
",",
"permissions",
"=",
"permissions",
")",
"# only allow creator (and developers) to puppet this char",
"new_character",
".",
"locks",
".",
"add",
"(",
"\"puppet:id(%i) or pid(%i) or perm(Developer) or pperm(Developer)\"",
"%",
"(",
"new_character",
".",
"id",
",",
"account",
".",
"id",
")",
")",
"account",
".",
"db",
".",
"_playable_characters",
".",
"append",
"(",
"new_character",
")",
"if",
"desc",
":",
"new_character",
".",
"db",
".",
"desc",
"=",
"desc",
"elif",
"not",
"new_character",
".",
"db",
".",
"desc",
":",
"new_character",
".",
"db",
".",
"desc",
"=",
"\"This is a character.\"",
"self",
".",
"msg",
"(",
"\"Created new character %s. Use |w@ic %s|n to enter the game as this character.\"",
"%",
"(",
"new_character",
".",
"key",
",",
"new_character",
".",
"key",
")",
")"
] | [
129,
4
] | [
172,
58
] | python | en | ['en', 'en', 'en'] | True |
CmdCharDelete.func | (self) | delete the character | delete the character | def func(self):
"""delete the character"""
account = self.account
if not self.args:
self.msg("Usage: @chardelete <charactername>")
return
# use the playable_characters list to search
match = [char for char in utils.make_iter(account.db._playable_characters)
if char.key.lower() == self.args.lower()]
if not match:
self.msg("You have no such character to delete.")
return
elif len(match) > 1:
self.msg("Aborting - there are two characters with the same name. Ask an admin to delete the right one.")
return
else: # one match
from evennia.utils.evmenu import get_input
def _callback(caller, callback_prompt, result):
if result.lower() == "yes":
# only take action
delobj = caller.ndb._char_to_delete
key = delobj.key
caller.db._playable_characters = [pc for pc in caller.db._playable_characters if pc != delobj]
delobj.delete()
self.msg("Character '%s' was permanently deleted." % key)
else:
self.msg("Deletion was aborted.")
del caller.ndb._char_to_delete
match = match[0]
account.ndb._char_to_delete = match
prompt = "|rThis will permanently destroy '%s'. This cannot be undone.|n Continue yes/[no]?"
get_input(account, prompt % match.key, _callback) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"if",
"not",
"self",
".",
"args",
":",
"self",
".",
"msg",
"(",
"\"Usage: @chardelete <charactername>\"",
")",
"return",
"# use the playable_characters list to search",
"match",
"=",
"[",
"char",
"for",
"char",
"in",
"utils",
".",
"make_iter",
"(",
"account",
".",
"db",
".",
"_playable_characters",
")",
"if",
"char",
".",
"key",
".",
"lower",
"(",
")",
"==",
"self",
".",
"args",
".",
"lower",
"(",
")",
"]",
"if",
"not",
"match",
":",
"self",
".",
"msg",
"(",
"\"You have no such character to delete.\"",
")",
"return",
"elif",
"len",
"(",
"match",
")",
">",
"1",
":",
"self",
".",
"msg",
"(",
"\"Aborting - there are two characters with the same name. Ask an admin to delete the right one.\"",
")",
"return",
"else",
":",
"# one match",
"from",
"evennia",
".",
"utils",
".",
"evmenu",
"import",
"get_input",
"def",
"_callback",
"(",
"caller",
",",
"callback_prompt",
",",
"result",
")",
":",
"if",
"result",
".",
"lower",
"(",
")",
"==",
"\"yes\"",
":",
"# only take action",
"delobj",
"=",
"caller",
".",
"ndb",
".",
"_char_to_delete",
"key",
"=",
"delobj",
".",
"key",
"caller",
".",
"db",
".",
"_playable_characters",
"=",
"[",
"pc",
"for",
"pc",
"in",
"caller",
".",
"db",
".",
"_playable_characters",
"if",
"pc",
"!=",
"delobj",
"]",
"delobj",
".",
"delete",
"(",
")",
"self",
".",
"msg",
"(",
"\"Character '%s' was permanently deleted.\"",
"%",
"key",
")",
"else",
":",
"self",
".",
"msg",
"(",
"\"Deletion was aborted.\"",
")",
"del",
"caller",
".",
"ndb",
".",
"_char_to_delete",
"match",
"=",
"match",
"[",
"0",
"]",
"account",
".",
"ndb",
".",
"_char_to_delete",
"=",
"match",
"prompt",
"=",
"\"|rThis will permanently destroy '%s'. This cannot be undone.|n Continue yes/[no]?\"",
"get_input",
"(",
"account",
",",
"prompt",
"%",
"match",
".",
"key",
",",
"_callback",
")"
] | [
188,
4
] | [
223,
61
] | python | en | ['en', 'en', 'en'] | True |
CmdIC.func | (self) |
Main puppet method
|
Main puppet method
| def func(self):
"""
Main puppet method
"""
account = self.account
session = self.session
new_character = None
if not self.args:
new_character = account.db._last_puppet
if not new_character:
self.msg("Usage: @ic <character>")
return
if not new_character:
# search for a matching character
new_character = [char for char in search.object_search(self.args) if char.access(account, "puppet")]
if not new_character:
self.msg("That is not a valid character choice.")
return
if len(new_character) > 1:
self.msg("Multiple targets with the same name:\n %s"
% ", ".join("%s(#%s)" % (obj.key, obj.id) for obj in new_character))
return
else:
new_character = new_character[0]
try:
account.puppet_object(session, new_character)
account.db._last_puppet = new_character
except RuntimeError as exc:
self.msg("|rYou cannot become |C%s|n: %s" % (new_character.name, exc)) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"session",
"=",
"self",
".",
"session",
"new_character",
"=",
"None",
"if",
"not",
"self",
".",
"args",
":",
"new_character",
"=",
"account",
".",
"db",
".",
"_last_puppet",
"if",
"not",
"new_character",
":",
"self",
".",
"msg",
"(",
"\"Usage: @ic <character>\"",
")",
"return",
"if",
"not",
"new_character",
":",
"# search for a matching character",
"new_character",
"=",
"[",
"char",
"for",
"char",
"in",
"search",
".",
"object_search",
"(",
"self",
".",
"args",
")",
"if",
"char",
".",
"access",
"(",
"account",
",",
"\"puppet\"",
")",
"]",
"if",
"not",
"new_character",
":",
"self",
".",
"msg",
"(",
"\"That is not a valid character choice.\"",
")",
"return",
"if",
"len",
"(",
"new_character",
")",
">",
"1",
":",
"self",
".",
"msg",
"(",
"\"Multiple targets with the same name:\\n %s\"",
"%",
"\", \"",
".",
"join",
"(",
"\"%s(#%s)\"",
"%",
"(",
"obj",
".",
"key",
",",
"obj",
".",
"id",
")",
"for",
"obj",
"in",
"new_character",
")",
")",
"return",
"else",
":",
"new_character",
"=",
"new_character",
"[",
"0",
"]",
"try",
":",
"account",
".",
"puppet_object",
"(",
"session",
",",
"new_character",
")",
"account",
".",
"db",
".",
"_last_puppet",
"=",
"new_character",
"except",
"RuntimeError",
"as",
"exc",
":",
"self",
".",
"msg",
"(",
"\"|rYou cannot become |C%s|n: %s\"",
"%",
"(",
"new_character",
".",
"name",
",",
"exc",
")",
")"
] | [
253,
4
] | [
282,
82
] | python | en | ['en', 'error', 'th'] | False |
CmdOOC.func | (self) | Implement function | Implement function | def func(self):
"""Implement function"""
account = self.account
session = self.session
old_char = account.get_puppet(session)
if not old_char:
string = "You are already OOC."
self.msg(string)
return
account.db._last_puppet = old_char
# disconnect
try:
account.unpuppet_object(session)
self.msg("\n|GYou go OOC.|n\n")
if _MULTISESSION_MODE < 2:
# only one character allowed
self.msg("You are out-of-character (OOC).\nUse |w@ic|n to get back into the game.")
return
self.msg(account.at_look(target=self.playable, session=session))
except RuntimeError as exc:
self.msg("|rCould not unpuppet from |c%s|n: %s" % (old_char, exc)) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"session",
"=",
"self",
".",
"session",
"old_char",
"=",
"account",
".",
"get_puppet",
"(",
"session",
")",
"if",
"not",
"old_char",
":",
"string",
"=",
"\"You are already OOC.\"",
"self",
".",
"msg",
"(",
"string",
")",
"return",
"account",
".",
"db",
".",
"_last_puppet",
"=",
"old_char",
"# disconnect",
"try",
":",
"account",
".",
"unpuppet_object",
"(",
"session",
")",
"self",
".",
"msg",
"(",
"\"\\n|GYou go OOC.|n\\n\"",
")",
"if",
"_MULTISESSION_MODE",
"<",
"2",
":",
"# only one character allowed",
"self",
".",
"msg",
"(",
"\"You are out-of-character (OOC).\\nUse |w@ic|n to get back into the game.\"",
")",
"return",
"self",
".",
"msg",
"(",
"account",
".",
"at_look",
"(",
"target",
"=",
"self",
".",
"playable",
",",
"session",
"=",
"session",
")",
")",
"except",
"RuntimeError",
"as",
"exc",
":",
"self",
".",
"msg",
"(",
"\"|rCould not unpuppet from |c%s|n: %s\"",
"%",
"(",
"old_char",
",",
"exc",
")",
")"
] | [
307,
4
] | [
334,
78
] | python | en | ['en', 'en', 'en'] | False |
CmdSessions.func | (self) | Implement function | Implement function | def func(self):
"""Implement function"""
account = self.account
sessions = account.sessions.all()
table = evtable.EvTable("|wsessid",
"|wprotocol",
"|whost",
"|wpuppet/character",
"|wlocation")
for sess in sorted(sessions, key=lambda x: x.sessid):
char = account.get_puppet(sess)
table.add_row(str(sess.sessid), str(sess.protocol_key),
isinstance(sess.address, tuple) and sess.address[0] or sess.address,
char and str(char) or "None",
char and str(char.location) or "N/A")
self.msg("|wYour current session(s):|n\n%s" % table) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"sessions",
"=",
"account",
".",
"sessions",
".",
"all",
"(",
")",
"table",
"=",
"evtable",
".",
"EvTable",
"(",
"\"|wsessid\"",
",",
"\"|wprotocol\"",
",",
"\"|whost\"",
",",
"\"|wpuppet/character\"",
",",
"\"|wlocation\"",
")",
"for",
"sess",
"in",
"sorted",
"(",
"sessions",
",",
"key",
"=",
"lambda",
"x",
":",
"x",
".",
"sessid",
")",
":",
"char",
"=",
"account",
".",
"get_puppet",
"(",
"sess",
")",
"table",
".",
"add_row",
"(",
"str",
"(",
"sess",
".",
"sessid",
")",
",",
"str",
"(",
"sess",
".",
"protocol_key",
")",
",",
"isinstance",
"(",
"sess",
".",
"address",
",",
"tuple",
")",
"and",
"sess",
".",
"address",
"[",
"0",
"]",
"or",
"sess",
".",
"address",
",",
"char",
"and",
"str",
"(",
"char",
")",
"or",
"\"None\"",
",",
"char",
"and",
"str",
"(",
"char",
".",
"location",
")",
"or",
"\"N/A\"",
")",
"self",
".",
"msg",
"(",
"\"|wYour current session(s):|n\\n%s\"",
"%",
"table",
")"
] | [
354,
4
] | [
369,
64
] | python | en | ['en', 'en', 'en'] | False |
CmdWho.func | (self) |
Get all connected accounts by polling session.
|
Get all connected accounts by polling session.
| def func(self):
"""
Get all connected accounts by polling session.
"""
account = self.account
session_list = SESSIONS.get_sessions()
session_list = sorted(session_list, key=lambda o: o.account.key)
if self.cmdstring == "doing":
show_session_data = False
else:
show_session_data = account.check_permstring("Developer") or account.check_permstring("Admins")
naccounts = (SESSIONS.account_count())
if show_session_data:
# privileged info
table = evtable.EvTable("|wAccount Name",
"|wOn for",
"|wIdle",
"|wPuppeting",
"|wRoom",
"|wCmds",
"|wProtocol",
"|wHost")
for session in session_list:
if not session.logged_in:
continue
delta_cmd = time.time() - session.cmd_last_visible
delta_conn = time.time() - session.conn_time
account = session.get_account()
puppet = session.get_puppet()
location = puppet.location.key if puppet and puppet.location else "None"
table.add_row(utils.crop(account.name, width=25),
utils.time_format(delta_conn, 0),
utils.time_format(delta_cmd, 1),
utils.crop(puppet.key if puppet else "None", width=25),
utils.crop(location, width=25),
session.cmd_total,
session.protocol_key,
isinstance(session.address, tuple) and session.address[0] or session.address)
else:
# unprivileged
table = evtable.EvTable("|wAccount name", "|wOn for", "|wIdle")
for session in session_list:
if not session.logged_in:
continue
delta_cmd = time.time() - session.cmd_last_visible
delta_conn = time.time() - session.conn_time
account = session.get_account()
table.add_row(utils.crop(account.key, width=25),
utils.time_format(delta_conn, 0),
utils.time_format(delta_cmd, 1))
is_one = naccounts == 1
self.msg("|wAccounts:|n\n%s\n%s unique account%s logged in."
% (table, "One" if is_one else naccounts, "" if is_one else "s")) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"session_list",
"=",
"SESSIONS",
".",
"get_sessions",
"(",
")",
"session_list",
"=",
"sorted",
"(",
"session_list",
",",
"key",
"=",
"lambda",
"o",
":",
"o",
".",
"account",
".",
"key",
")",
"if",
"self",
".",
"cmdstring",
"==",
"\"doing\"",
":",
"show_session_data",
"=",
"False",
"else",
":",
"show_session_data",
"=",
"account",
".",
"check_permstring",
"(",
"\"Developer\"",
")",
"or",
"account",
".",
"check_permstring",
"(",
"\"Admins\"",
")",
"naccounts",
"=",
"(",
"SESSIONS",
".",
"account_count",
"(",
")",
")",
"if",
"show_session_data",
":",
"# privileged info",
"table",
"=",
"evtable",
".",
"EvTable",
"(",
"\"|wAccount Name\"",
",",
"\"|wOn for\"",
",",
"\"|wIdle\"",
",",
"\"|wPuppeting\"",
",",
"\"|wRoom\"",
",",
"\"|wCmds\"",
",",
"\"|wProtocol\"",
",",
"\"|wHost\"",
")",
"for",
"session",
"in",
"session_list",
":",
"if",
"not",
"session",
".",
"logged_in",
":",
"continue",
"delta_cmd",
"=",
"time",
".",
"time",
"(",
")",
"-",
"session",
".",
"cmd_last_visible",
"delta_conn",
"=",
"time",
".",
"time",
"(",
")",
"-",
"session",
".",
"conn_time",
"account",
"=",
"session",
".",
"get_account",
"(",
")",
"puppet",
"=",
"session",
".",
"get_puppet",
"(",
")",
"location",
"=",
"puppet",
".",
"location",
".",
"key",
"if",
"puppet",
"and",
"puppet",
".",
"location",
"else",
"\"None\"",
"table",
".",
"add_row",
"(",
"utils",
".",
"crop",
"(",
"account",
".",
"name",
",",
"width",
"=",
"25",
")",
",",
"utils",
".",
"time_format",
"(",
"delta_conn",
",",
"0",
")",
",",
"utils",
".",
"time_format",
"(",
"delta_cmd",
",",
"1",
")",
",",
"utils",
".",
"crop",
"(",
"puppet",
".",
"key",
"if",
"puppet",
"else",
"\"None\"",
",",
"width",
"=",
"25",
")",
",",
"utils",
".",
"crop",
"(",
"location",
",",
"width",
"=",
"25",
")",
",",
"session",
".",
"cmd_total",
",",
"session",
".",
"protocol_key",
",",
"isinstance",
"(",
"session",
".",
"address",
",",
"tuple",
")",
"and",
"session",
".",
"address",
"[",
"0",
"]",
"or",
"session",
".",
"address",
")",
"else",
":",
"# unprivileged",
"table",
"=",
"evtable",
".",
"EvTable",
"(",
"\"|wAccount name\"",
",",
"\"|wOn for\"",
",",
"\"|wIdle\"",
")",
"for",
"session",
"in",
"session_list",
":",
"if",
"not",
"session",
".",
"logged_in",
":",
"continue",
"delta_cmd",
"=",
"time",
".",
"time",
"(",
")",
"-",
"session",
".",
"cmd_last_visible",
"delta_conn",
"=",
"time",
".",
"time",
"(",
")",
"-",
"session",
".",
"conn_time",
"account",
"=",
"session",
".",
"get_account",
"(",
")",
"table",
".",
"add_row",
"(",
"utils",
".",
"crop",
"(",
"account",
".",
"key",
",",
"width",
"=",
"25",
")",
",",
"utils",
".",
"time_format",
"(",
"delta_conn",
",",
"0",
")",
",",
"utils",
".",
"time_format",
"(",
"delta_cmd",
",",
"1",
")",
")",
"is_one",
"=",
"naccounts",
"==",
"1",
"self",
".",
"msg",
"(",
"\"|wAccounts:|n\\n%s\\n%s unique account%s logged in.\"",
"%",
"(",
"table",
",",
"\"One\"",
"if",
"is_one",
"else",
"naccounts",
",",
"\"\"",
"if",
"is_one",
"else",
"\"s\"",
")",
")"
] | [
391,
4
] | [
447,
82
] | python | en | ['en', 'error', 'th'] | False |
CmdOption.func | (self) |
Implements the command
|
Implements the command
| def func(self):
"""
Implements the command
"""
if self.session is None:
return
flags = self.session.protocol_flags
# Display current options
if not self.args:
# list the option settings
if "save" in self.switches:
# save all options
self.caller.db._saved_protocol_flags = flags
self.msg("|gSaved all options. Use @option/clear to remove.|n")
if "clear" in self.switches:
# clear all saves
self.caller.db._saved_protocol_flags = {}
self.msg("|gCleared all saved options.")
options = dict(flags) # make a copy of the flag dict
saved_options = dict(self.caller.attributes.get("_saved_protocol_flags", default={}))
if "SCREENWIDTH" in options:
if len(options["SCREENWIDTH"]) == 1:
options["SCREENWIDTH"] = options["SCREENWIDTH"][0]
else:
options["SCREENWIDTH"] = " \n".join("%s : %s" % (screenid, size)
for screenid, size in options["SCREENWIDTH"].iteritems())
if "SCREENHEIGHT" in options:
if len(options["SCREENHEIGHT"]) == 1:
options["SCREENHEIGHT"] = options["SCREENHEIGHT"][0]
else:
options["SCREENHEIGHT"] = " \n".join("%s : %s" % (screenid, size)
for screenid, size in options["SCREENHEIGHT"].iteritems())
options.pop("TTYPE", None)
header = ("Name", "Value", "Saved") if saved_options else ("Name", "Value")
table = evtable.EvTable(*header)
for key in sorted(options):
row = [key, options[key]]
if saved_options:
saved = " |YYes|n" if key in saved_options else ""
changed = "|y*|n" if key in saved_options and flags[key] != saved_options[key] else ""
row.append("%s%s" % (saved, changed))
table.add_row(*row)
self.msg("|wClient settings (%s):|n\n%s|n" % (self.session.protocol_key, table))
return
if not self.rhs:
self.msg("Usage: @option [name = [value]]")
return
# Try to assign new values
def validate_encoding(new_encoding):
# helper: change encoding
try:
utils.to_str(utils.to_unicode("test-string"), encoding=new_encoding)
except LookupError:
raise RuntimeError("The encoding '|w%s|n' is invalid. " % new_encoding)
return val
def validate_size(new_size):
return {0: int(new_size)}
def validate_bool(new_bool):
return True if new_bool.lower() in ("true", "on", "1") else False
def update(new_name, new_val, validator):
# helper: update property and report errors
try:
old_val = flags.get(new_name, False)
new_val = validator(new_val)
if old_val == new_val:
self.msg("Option |w%s|n was kept as '|w%s|n'." % (new_name, old_val))
else:
flags[new_name] = new_val
self.msg("Option |w%s|n was changed from '|w%s|n' to '|w%s|n'." % (new_name, old_val, new_val))
return {new_name: new_val}
except Exception as err:
self.msg("|rCould not set option |w%s|r:|n %s" % (new_name, err))
return False
validators = {"ANSI": validate_bool,
"CLIENTNAME": utils.to_str,
"ENCODING": validate_encoding,
"MCCP": validate_bool,
"NOGOAHEAD": validate_bool,
"MXP": validate_bool,
"NOCOLOR": validate_bool,
"NOPKEEPALIVE": validate_bool,
"OOB": validate_bool,
"RAW": validate_bool,
"SCREENHEIGHT": validate_size,
"SCREENWIDTH": validate_size,
"SCREENREADER": validate_bool,
"TERM": utils.to_str,
"UTF-8": validate_bool,
"XTERM256": validate_bool,
"INPUTDEBUG": validate_bool,
"FORCEDENDLINE": validate_bool}
name = self.lhs.upper()
val = self.rhs.strip()
optiondict = False
if val and name in validators:
optiondict = update(name, val, validators[name])
else:
self.msg("|rNo option named '|w%s|r'." % name)
if optiondict:
# a valid setting
if "save" in self.switches:
# save this option only
saved_options = self.account.attributes.get("_saved_protocol_flags", default={})
saved_options.update(optiondict)
self.account.attributes.add("_saved_protocol_flags", saved_options)
for key in optiondict:
self.msg("|gSaved option %s.|n" % key)
if "clear" in self.switches:
# clear this save
for key in optiondict:
self.account.attributes.get("_saved_protocol_flags", {}).pop(key, None)
self.msg("|gCleared saved %s." % key)
self.session.update_flags(**optiondict) | [
"def",
"func",
"(",
"self",
")",
":",
"if",
"self",
".",
"session",
"is",
"None",
":",
"return",
"flags",
"=",
"self",
".",
"session",
".",
"protocol_flags",
"# Display current options",
"if",
"not",
"self",
".",
"args",
":",
"# list the option settings",
"if",
"\"save\"",
"in",
"self",
".",
"switches",
":",
"# save all options",
"self",
".",
"caller",
".",
"db",
".",
"_saved_protocol_flags",
"=",
"flags",
"self",
".",
"msg",
"(",
"\"|gSaved all options. Use @option/clear to remove.|n\"",
")",
"if",
"\"clear\"",
"in",
"self",
".",
"switches",
":",
"# clear all saves",
"self",
".",
"caller",
".",
"db",
".",
"_saved_protocol_flags",
"=",
"{",
"}",
"self",
".",
"msg",
"(",
"\"|gCleared all saved options.\"",
")",
"options",
"=",
"dict",
"(",
"flags",
")",
"# make a copy of the flag dict",
"saved_options",
"=",
"dict",
"(",
"self",
".",
"caller",
".",
"attributes",
".",
"get",
"(",
"\"_saved_protocol_flags\"",
",",
"default",
"=",
"{",
"}",
")",
")",
"if",
"\"SCREENWIDTH\"",
"in",
"options",
":",
"if",
"len",
"(",
"options",
"[",
"\"SCREENWIDTH\"",
"]",
")",
"==",
"1",
":",
"options",
"[",
"\"SCREENWIDTH\"",
"]",
"=",
"options",
"[",
"\"SCREENWIDTH\"",
"]",
"[",
"0",
"]",
"else",
":",
"options",
"[",
"\"SCREENWIDTH\"",
"]",
"=",
"\" \\n\"",
".",
"join",
"(",
"\"%s : %s\"",
"%",
"(",
"screenid",
",",
"size",
")",
"for",
"screenid",
",",
"size",
"in",
"options",
"[",
"\"SCREENWIDTH\"",
"]",
".",
"iteritems",
"(",
")",
")",
"if",
"\"SCREENHEIGHT\"",
"in",
"options",
":",
"if",
"len",
"(",
"options",
"[",
"\"SCREENHEIGHT\"",
"]",
")",
"==",
"1",
":",
"options",
"[",
"\"SCREENHEIGHT\"",
"]",
"=",
"options",
"[",
"\"SCREENHEIGHT\"",
"]",
"[",
"0",
"]",
"else",
":",
"options",
"[",
"\"SCREENHEIGHT\"",
"]",
"=",
"\" \\n\"",
".",
"join",
"(",
"\"%s : %s\"",
"%",
"(",
"screenid",
",",
"size",
")",
"for",
"screenid",
",",
"size",
"in",
"options",
"[",
"\"SCREENHEIGHT\"",
"]",
".",
"iteritems",
"(",
")",
")",
"options",
".",
"pop",
"(",
"\"TTYPE\"",
",",
"None",
")",
"header",
"=",
"(",
"\"Name\"",
",",
"\"Value\"",
",",
"\"Saved\"",
")",
"if",
"saved_options",
"else",
"(",
"\"Name\"",
",",
"\"Value\"",
")",
"table",
"=",
"evtable",
".",
"EvTable",
"(",
"*",
"header",
")",
"for",
"key",
"in",
"sorted",
"(",
"options",
")",
":",
"row",
"=",
"[",
"key",
",",
"options",
"[",
"key",
"]",
"]",
"if",
"saved_options",
":",
"saved",
"=",
"\" |YYes|n\"",
"if",
"key",
"in",
"saved_options",
"else",
"\"\"",
"changed",
"=",
"\"|y*|n\"",
"if",
"key",
"in",
"saved_options",
"and",
"flags",
"[",
"key",
"]",
"!=",
"saved_options",
"[",
"key",
"]",
"else",
"\"\"",
"row",
".",
"append",
"(",
"\"%s%s\"",
"%",
"(",
"saved",
",",
"changed",
")",
")",
"table",
".",
"add_row",
"(",
"*",
"row",
")",
"self",
".",
"msg",
"(",
"\"|wClient settings (%s):|n\\n%s|n\"",
"%",
"(",
"self",
".",
"session",
".",
"protocol_key",
",",
"table",
")",
")",
"return",
"if",
"not",
"self",
".",
"rhs",
":",
"self",
".",
"msg",
"(",
"\"Usage: @option [name = [value]]\"",
")",
"return",
"# Try to assign new values",
"def",
"validate_encoding",
"(",
"new_encoding",
")",
":",
"# helper: change encoding",
"try",
":",
"utils",
".",
"to_str",
"(",
"utils",
".",
"to_unicode",
"(",
"\"test-string\"",
")",
",",
"encoding",
"=",
"new_encoding",
")",
"except",
"LookupError",
":",
"raise",
"RuntimeError",
"(",
"\"The encoding '|w%s|n' is invalid. \"",
"%",
"new_encoding",
")",
"return",
"val",
"def",
"validate_size",
"(",
"new_size",
")",
":",
"return",
"{",
"0",
":",
"int",
"(",
"new_size",
")",
"}",
"def",
"validate_bool",
"(",
"new_bool",
")",
":",
"return",
"True",
"if",
"new_bool",
".",
"lower",
"(",
")",
"in",
"(",
"\"true\"",
",",
"\"on\"",
",",
"\"1\"",
")",
"else",
"False",
"def",
"update",
"(",
"new_name",
",",
"new_val",
",",
"validator",
")",
":",
"# helper: update property and report errors",
"try",
":",
"old_val",
"=",
"flags",
".",
"get",
"(",
"new_name",
",",
"False",
")",
"new_val",
"=",
"validator",
"(",
"new_val",
")",
"if",
"old_val",
"==",
"new_val",
":",
"self",
".",
"msg",
"(",
"\"Option |w%s|n was kept as '|w%s|n'.\"",
"%",
"(",
"new_name",
",",
"old_val",
")",
")",
"else",
":",
"flags",
"[",
"new_name",
"]",
"=",
"new_val",
"self",
".",
"msg",
"(",
"\"Option |w%s|n was changed from '|w%s|n' to '|w%s|n'.\"",
"%",
"(",
"new_name",
",",
"old_val",
",",
"new_val",
")",
")",
"return",
"{",
"new_name",
":",
"new_val",
"}",
"except",
"Exception",
"as",
"err",
":",
"self",
".",
"msg",
"(",
"\"|rCould not set option |w%s|r:|n %s\"",
"%",
"(",
"new_name",
",",
"err",
")",
")",
"return",
"False",
"validators",
"=",
"{",
"\"ANSI\"",
":",
"validate_bool",
",",
"\"CLIENTNAME\"",
":",
"utils",
".",
"to_str",
",",
"\"ENCODING\"",
":",
"validate_encoding",
",",
"\"MCCP\"",
":",
"validate_bool",
",",
"\"NOGOAHEAD\"",
":",
"validate_bool",
",",
"\"MXP\"",
":",
"validate_bool",
",",
"\"NOCOLOR\"",
":",
"validate_bool",
",",
"\"NOPKEEPALIVE\"",
":",
"validate_bool",
",",
"\"OOB\"",
":",
"validate_bool",
",",
"\"RAW\"",
":",
"validate_bool",
",",
"\"SCREENHEIGHT\"",
":",
"validate_size",
",",
"\"SCREENWIDTH\"",
":",
"validate_size",
",",
"\"SCREENREADER\"",
":",
"validate_bool",
",",
"\"TERM\"",
":",
"utils",
".",
"to_str",
",",
"\"UTF-8\"",
":",
"validate_bool",
",",
"\"XTERM256\"",
":",
"validate_bool",
",",
"\"INPUTDEBUG\"",
":",
"validate_bool",
",",
"\"FORCEDENDLINE\"",
":",
"validate_bool",
"}",
"name",
"=",
"self",
".",
"lhs",
".",
"upper",
"(",
")",
"val",
"=",
"self",
".",
"rhs",
".",
"strip",
"(",
")",
"optiondict",
"=",
"False",
"if",
"val",
"and",
"name",
"in",
"validators",
":",
"optiondict",
"=",
"update",
"(",
"name",
",",
"val",
",",
"validators",
"[",
"name",
"]",
")",
"else",
":",
"self",
".",
"msg",
"(",
"\"|rNo option named '|w%s|r'.\"",
"%",
"name",
")",
"if",
"optiondict",
":",
"# a valid setting",
"if",
"\"save\"",
"in",
"self",
".",
"switches",
":",
"# save this option only",
"saved_options",
"=",
"self",
".",
"account",
".",
"attributes",
".",
"get",
"(",
"\"_saved_protocol_flags\"",
",",
"default",
"=",
"{",
"}",
")",
"saved_options",
".",
"update",
"(",
"optiondict",
")",
"self",
".",
"account",
".",
"attributes",
".",
"add",
"(",
"\"_saved_protocol_flags\"",
",",
"saved_options",
")",
"for",
"key",
"in",
"optiondict",
":",
"self",
".",
"msg",
"(",
"\"|gSaved option %s.|n\"",
"%",
"key",
")",
"if",
"\"clear\"",
"in",
"self",
".",
"switches",
":",
"# clear this save",
"for",
"key",
"in",
"optiondict",
":",
"self",
".",
"account",
".",
"attributes",
".",
"get",
"(",
"\"_saved_protocol_flags\"",
",",
"{",
"}",
")",
".",
"pop",
"(",
"key",
",",
"None",
")",
"self",
".",
"msg",
"(",
"\"|gCleared saved %s.\"",
"%",
"key",
")",
"self",
".",
"session",
".",
"update_flags",
"(",
"*",
"*",
"optiondict",
")"
] | [
475,
4
] | [
602,
51
] | python | en | ['en', 'error', 'th'] | False |
CmdPassword.func | (self) | hook function. | hook function. | def func(self):
"""hook function."""
account = self.account
if not self.rhs:
self.msg("Usage: @password <oldpass> = <newpass>")
return
oldpass = self.lhslist[0] # Both of these are
newpass = self.rhslist[0] # already stripped by parse()
# Validate password
validated, error = account.validate_password(newpass)
if not account.check_password(oldpass):
self.msg("The specified old password isn't correct.")
elif not validated:
errors = [e for suberror in error.messages for e in error.messages]
string = "\n".join(errors)
self.msg(string)
else:
account.set_password(newpass)
account.save()
self.msg("Password changed.") | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"if",
"not",
"self",
".",
"rhs",
":",
"self",
".",
"msg",
"(",
"\"Usage: @password <oldpass> = <newpass>\"",
")",
"return",
"oldpass",
"=",
"self",
".",
"lhslist",
"[",
"0",
"]",
"# Both of these are",
"newpass",
"=",
"self",
".",
"rhslist",
"[",
"0",
"]",
"# already stripped by parse()",
"# Validate password",
"validated",
",",
"error",
"=",
"account",
".",
"validate_password",
"(",
"newpass",
")",
"if",
"not",
"account",
".",
"check_password",
"(",
"oldpass",
")",
":",
"self",
".",
"msg",
"(",
"\"The specified old password isn't correct.\"",
")",
"elif",
"not",
"validated",
":",
"errors",
"=",
"[",
"e",
"for",
"suberror",
"in",
"error",
".",
"messages",
"for",
"e",
"in",
"error",
".",
"messages",
"]",
"string",
"=",
"\"\\n\"",
".",
"join",
"(",
"errors",
")",
"self",
".",
"msg",
"(",
"string",
")",
"else",
":",
"account",
".",
"set_password",
"(",
"newpass",
")",
"account",
".",
"save",
"(",
")",
"self",
".",
"msg",
"(",
"\"Password changed.\"",
")"
] | [
620,
4
] | [
642,
41
] | python | en | ['en', 'af', 'en'] | False |
CmdQuit.func | (self) | hook function | hook function | def func(self):
"""hook function"""
account = self.account
if 'all' in self.switches:
account.msg("|RQuitting|n all sessions. Hope to see you soon again.", session=self.session)
reason = "quit/all"
for session in account.sessions.all():
account.disconnect_session_from_account(session, reason)
else:
nsess = len(account.sessions.all())
reason = "quit"
if nsess == 2:
account.msg("|RQuitting|n. One session is still connected.", session=self.session)
elif nsess > 2:
account.msg("|RQuitting|n. %i sessions are still connected." % (nsess - 1), session=self.session)
else:
# we are quitting the last available session
account.msg("|RQuitting|n. Hope to see you again, soon.", session=self.session)
account.disconnect_session_from_account(self.session, reason) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"if",
"'all'",
"in",
"self",
".",
"switches",
":",
"account",
".",
"msg",
"(",
"\"|RQuitting|n all sessions. Hope to see you soon again.\"",
",",
"session",
"=",
"self",
".",
"session",
")",
"reason",
"=",
"\"quit/all\"",
"for",
"session",
"in",
"account",
".",
"sessions",
".",
"all",
"(",
")",
":",
"account",
".",
"disconnect_session_from_account",
"(",
"session",
",",
"reason",
")",
"else",
":",
"nsess",
"=",
"len",
"(",
"account",
".",
"sessions",
".",
"all",
"(",
")",
")",
"reason",
"=",
"\"quit\"",
"if",
"nsess",
"==",
"2",
":",
"account",
".",
"msg",
"(",
"\"|RQuitting|n. One session is still connected.\"",
",",
"session",
"=",
"self",
".",
"session",
")",
"elif",
"nsess",
">",
"2",
":",
"account",
".",
"msg",
"(",
"\"|RQuitting|n. %i sessions are still connected.\"",
"%",
"(",
"nsess",
"-",
"1",
")",
",",
"session",
"=",
"self",
".",
"session",
")",
"else",
":",
"# we are quitting the last available session",
"account",
".",
"msg",
"(",
"\"|RQuitting|n. Hope to see you again, soon.\"",
",",
"session",
"=",
"self",
".",
"session",
")",
"account",
".",
"disconnect_session_from_account",
"(",
"self",
".",
"session",
",",
"reason",
")"
] | [
665,
4
] | [
684,
73
] | python | en | ['en', 'af', 'en'] | False |
CmdColorTest.table_format | (self, table) |
Helper method to format the ansi/xterm256 tables.
Takes a table of columns [[val,val,...],[val,val,...],...]
|
Helper method to format the ansi/xterm256 tables.
Takes a table of columns [[val,val,...],[val,val,...],...]
| def table_format(self, table):
"""
Helper method to format the ansi/xterm256 tables.
Takes a table of columns [[val,val,...],[val,val,...],...]
"""
if not table:
return [[]]
extra_space = 1
max_widths = [max([len(str(val)) for val in col]) for col in table]
ftable = []
for irow in range(len(table[0])):
ftable.append([str(col[irow]).ljust(max_widths[icol]) + " " *
extra_space for icol, col in enumerate(table)])
return ftable | [
"def",
"table_format",
"(",
"self",
",",
"table",
")",
":",
"if",
"not",
"table",
":",
"return",
"[",
"[",
"]",
"]",
"extra_space",
"=",
"1",
"max_widths",
"=",
"[",
"max",
"(",
"[",
"len",
"(",
"str",
"(",
"val",
")",
")",
"for",
"val",
"in",
"col",
"]",
")",
"for",
"col",
"in",
"table",
"]",
"ftable",
"=",
"[",
"]",
"for",
"irow",
"in",
"range",
"(",
"len",
"(",
"table",
"[",
"0",
"]",
")",
")",
":",
"ftable",
".",
"append",
"(",
"[",
"str",
"(",
"col",
"[",
"irow",
"]",
")",
".",
"ljust",
"(",
"max_widths",
"[",
"icol",
"]",
")",
"+",
"\" \"",
"*",
"extra_space",
"for",
"icol",
",",
"col",
"in",
"enumerate",
"(",
"table",
")",
"]",
")",
"return",
"ftable"
] | [
715,
4
] | [
729,
21
] | python | en | ['en', 'error', 'th'] | False |
CmdColorTest.func | (self) | Show color tables | Show color tables | def func(self):
"""Show color tables"""
if self.args.startswith("a"):
# show ansi 16-color table
from evennia.utils import ansi
ap = ansi.ANSI_PARSER
# ansi colors
# show all ansi color-related codes
bright_fg = ["%s%s|n" % (code, code.replace("|", "||"))
for code, _ in ap.ansi_map[self.slice_bright_fg]]
dark_fg = ["%s%s|n" % (code, code.replace("|", "||"))
for code, _ in ap.ansi_map[self.slice_dark_fg]]
dark_bg = ["%s%s|n" % (code.replace("\\", ""), code.replace("|", "||").replace("\\", ""))
for code, _ in ap.ansi_map[self.slice_dark_bg]]
bright_bg = ["%s%s|n" % (code.replace("\\", ""), code.replace("|", "||").replace("\\", ""))
for code, _ in ap.ansi_xterm256_bright_bg_map[self.slice_bright_bg]]
dark_fg.extend(["" for _ in range(len(bright_fg) - len(dark_fg))])
table = utils.format_table([bright_fg, dark_fg, bright_bg, dark_bg])
string = "ANSI colors:"
for row in table:
string += "\n " + " ".join(row)
self.msg(string)
self.msg("||X : black. ||/ : return, ||- : tab, ||_ : space, ||* : invert, ||u : underline\n"
"To combine background and foreground, add background marker last, e.g. ||r||[B.\n"
"Note: bright backgrounds like ||[r requires your client handling Xterm256 colors.")
elif self.args.startswith("x"):
# show xterm256 table
table = [[], [], [], [], [], [], [], [], [], [], [], []]
for ir in range(6):
for ig in range(6):
for ib in range(6):
# foreground table
table[ir].append("|%i%i%i%s|n" % (ir, ig, ib, "||%i%i%i" % (ir, ig, ib)))
# background table
table[6 + ir].append("|%i%i%i|[%i%i%i%s|n"
% (5 - ir, 5 - ig, 5 - ib, ir, ig, ib, "||[%i%i%i" % (ir, ig, ib)))
table = self.table_format(table)
string = "Xterm256 colors (if not all hues show, your client might not report that it can handle xterm256):"
string += "\n" + "\n".join("".join(row) for row in table)
table = [[], [], [], [], [], [], [], [], [], [], [], []]
for ibatch in range(4):
for igray in range(6):
letter = chr(97 + (ibatch * 6 + igray))
inverse = chr(122 - (ibatch * 6 + igray))
table[0 + igray].append("|=%s%s |n" % (letter, "||=%s" % letter))
table[6 + igray].append("|=%s|[=%s%s |n" % (inverse, letter, "||[=%s" % letter))
for igray in range(6):
# the last row (y, z) has empty columns
if igray < 2:
letter = chr(121 + igray)
inverse = chr(98 - igray)
fg = "|=%s%s |n" % (letter, "||=%s" % letter)
bg = "|=%s|[=%s%s |n" % (inverse, letter, "||[=%s" % letter)
else:
fg, bg = " ", " "
table[0 + igray].append(fg)
table[6 + igray].append(bg)
table = self.table_format(table)
string += "\n" + "\n".join("".join(row) for row in table)
self.msg(string)
else:
# malformed input
self.msg("Usage: @color ansi||xterm256") | [
"def",
"func",
"(",
"self",
")",
":",
"if",
"self",
".",
"args",
".",
"startswith",
"(",
"\"a\"",
")",
":",
"# show ansi 16-color table",
"from",
"evennia",
".",
"utils",
"import",
"ansi",
"ap",
"=",
"ansi",
".",
"ANSI_PARSER",
"# ansi colors",
"# show all ansi color-related codes",
"bright_fg",
"=",
"[",
"\"%s%s|n\"",
"%",
"(",
"code",
",",
"code",
".",
"replace",
"(",
"\"|\"",
",",
"\"||\"",
")",
")",
"for",
"code",
",",
"_",
"in",
"ap",
".",
"ansi_map",
"[",
"self",
".",
"slice_bright_fg",
"]",
"]",
"dark_fg",
"=",
"[",
"\"%s%s|n\"",
"%",
"(",
"code",
",",
"code",
".",
"replace",
"(",
"\"|\"",
",",
"\"||\"",
")",
")",
"for",
"code",
",",
"_",
"in",
"ap",
".",
"ansi_map",
"[",
"self",
".",
"slice_dark_fg",
"]",
"]",
"dark_bg",
"=",
"[",
"\"%s%s|n\"",
"%",
"(",
"code",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\"",
")",
",",
"code",
".",
"replace",
"(",
"\"|\"",
",",
"\"||\"",
")",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\"",
")",
")",
"for",
"code",
",",
"_",
"in",
"ap",
".",
"ansi_map",
"[",
"self",
".",
"slice_dark_bg",
"]",
"]",
"bright_bg",
"=",
"[",
"\"%s%s|n\"",
"%",
"(",
"code",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\"",
")",
",",
"code",
".",
"replace",
"(",
"\"|\"",
",",
"\"||\"",
")",
".",
"replace",
"(",
"\"\\\\\"",
",",
"\"\"",
")",
")",
"for",
"code",
",",
"_",
"in",
"ap",
".",
"ansi_xterm256_bright_bg_map",
"[",
"self",
".",
"slice_bright_bg",
"]",
"]",
"dark_fg",
".",
"extend",
"(",
"[",
"\"\"",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"bright_fg",
")",
"-",
"len",
"(",
"dark_fg",
")",
")",
"]",
")",
"table",
"=",
"utils",
".",
"format_table",
"(",
"[",
"bright_fg",
",",
"dark_fg",
",",
"bright_bg",
",",
"dark_bg",
"]",
")",
"string",
"=",
"\"ANSI colors:\"",
"for",
"row",
"in",
"table",
":",
"string",
"+=",
"\"\\n \"",
"+",
"\" \"",
".",
"join",
"(",
"row",
")",
"self",
".",
"msg",
"(",
"string",
")",
"self",
".",
"msg",
"(",
"\"||X : black. ||/ : return, ||- : tab, ||_ : space, ||* : invert, ||u : underline\\n\"",
"\"To combine background and foreground, add background marker last, e.g. ||r||[B.\\n\"",
"\"Note: bright backgrounds like ||[r requires your client handling Xterm256 colors.\"",
")",
"elif",
"self",
".",
"args",
".",
"startswith",
"(",
"\"x\"",
")",
":",
"# show xterm256 table",
"table",
"=",
"[",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
"]",
"for",
"ir",
"in",
"range",
"(",
"6",
")",
":",
"for",
"ig",
"in",
"range",
"(",
"6",
")",
":",
"for",
"ib",
"in",
"range",
"(",
"6",
")",
":",
"# foreground table",
"table",
"[",
"ir",
"]",
".",
"append",
"(",
"\"|%i%i%i%s|n\"",
"%",
"(",
"ir",
",",
"ig",
",",
"ib",
",",
"\"||%i%i%i\"",
"%",
"(",
"ir",
",",
"ig",
",",
"ib",
")",
")",
")",
"# background table",
"table",
"[",
"6",
"+",
"ir",
"]",
".",
"append",
"(",
"\"|%i%i%i|[%i%i%i%s|n\"",
"%",
"(",
"5",
"-",
"ir",
",",
"5",
"-",
"ig",
",",
"5",
"-",
"ib",
",",
"ir",
",",
"ig",
",",
"ib",
",",
"\"||[%i%i%i\"",
"%",
"(",
"ir",
",",
"ig",
",",
"ib",
")",
")",
")",
"table",
"=",
"self",
".",
"table_format",
"(",
"table",
")",
"string",
"=",
"\"Xterm256 colors (if not all hues show, your client might not report that it can handle xterm256):\"",
"string",
"+=",
"\"\\n\"",
"+",
"\"\\n\"",
".",
"join",
"(",
"\"\"",
".",
"join",
"(",
"row",
")",
"for",
"row",
"in",
"table",
")",
"table",
"=",
"[",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
",",
"[",
"]",
"]",
"for",
"ibatch",
"in",
"range",
"(",
"4",
")",
":",
"for",
"igray",
"in",
"range",
"(",
"6",
")",
":",
"letter",
"=",
"chr",
"(",
"97",
"+",
"(",
"ibatch",
"*",
"6",
"+",
"igray",
")",
")",
"inverse",
"=",
"chr",
"(",
"122",
"-",
"(",
"ibatch",
"*",
"6",
"+",
"igray",
")",
")",
"table",
"[",
"0",
"+",
"igray",
"]",
".",
"append",
"(",
"\"|=%s%s |n\"",
"%",
"(",
"letter",
",",
"\"||=%s\"",
"%",
"letter",
")",
")",
"table",
"[",
"6",
"+",
"igray",
"]",
".",
"append",
"(",
"\"|=%s|[=%s%s |n\"",
"%",
"(",
"inverse",
",",
"letter",
",",
"\"||[=%s\"",
"%",
"letter",
")",
")",
"for",
"igray",
"in",
"range",
"(",
"6",
")",
":",
"# the last row (y, z) has empty columns",
"if",
"igray",
"<",
"2",
":",
"letter",
"=",
"chr",
"(",
"121",
"+",
"igray",
")",
"inverse",
"=",
"chr",
"(",
"98",
"-",
"igray",
")",
"fg",
"=",
"\"|=%s%s |n\"",
"%",
"(",
"letter",
",",
"\"||=%s\"",
"%",
"letter",
")",
"bg",
"=",
"\"|=%s|[=%s%s |n\"",
"%",
"(",
"inverse",
",",
"letter",
",",
"\"||[=%s\"",
"%",
"letter",
")",
"else",
":",
"fg",
",",
"bg",
"=",
"\" \"",
",",
"\" \"",
"table",
"[",
"0",
"+",
"igray",
"]",
".",
"append",
"(",
"fg",
")",
"table",
"[",
"6",
"+",
"igray",
"]",
".",
"append",
"(",
"bg",
")",
"table",
"=",
"self",
".",
"table_format",
"(",
"table",
")",
"string",
"+=",
"\"\\n\"",
"+",
"\"\\n\"",
".",
"join",
"(",
"\"\"",
".",
"join",
"(",
"row",
")",
"for",
"row",
"in",
"table",
")",
"self",
".",
"msg",
"(",
"string",
")",
"else",
":",
"# malformed input",
"self",
".",
"msg",
"(",
"\"Usage: @color ansi||xterm256\"",
")"
] | [
731,
4
] | [
795,
52
] | python | en | ['en', 'fr', 'en'] | True |
CmdQuell._recache_locks | (self, account) | Helper method to reset the lockhandler on an already puppeted object | Helper method to reset the lockhandler on an already puppeted object | def _recache_locks(self, account):
"""Helper method to reset the lockhandler on an already puppeted object"""
if self.session:
char = self.session.puppet
if char:
# we are already puppeting an object. We need to reset
# the lock caches (otherwise the superuser status change
# won't be visible until repuppet)
char.locks.reset()
account.locks.reset() | [
"def",
"_recache_locks",
"(",
"self",
",",
"account",
")",
":",
"if",
"self",
".",
"session",
":",
"char",
"=",
"self",
".",
"session",
".",
"puppet",
"if",
"char",
":",
"# we are already puppeting an object. We need to reset",
"# the lock caches (otherwise the superuser status change",
"# won't be visible until repuppet)",
"char",
".",
"locks",
".",
"reset",
"(",
")",
"account",
".",
"locks",
".",
"reset",
"(",
")"
] | [
823,
4
] | [
832,
29
] | python | en | ['en', 'en', 'en'] | True |
CmdQuell.func | (self) | Perform the command | Perform the command | def func(self):
"""Perform the command"""
account = self.account
permstr = account.is_superuser and " (superuser)" or "(%s)" % (", ".join(account.permissions.all()))
if self.cmdstring in ('unquell', '@unquell'):
if not account.attributes.get('_quell'):
self.msg("Already using normal Account permissions %s." % permstr)
else:
account.attributes.remove('_quell')
self.msg("Account permissions %s restored." % permstr)
else:
if account.attributes.get('_quell'):
self.msg("Already quelling Account %s permissions." % permstr)
return
account.attributes.add('_quell', True)
puppet = self.session.puppet
if puppet:
cpermstr = "(%s)" % ", ".join(puppet.permissions.all())
cpermstr = "Quelling to current puppet's permissions %s." % cpermstr
cpermstr += "\n(Note: If this is higher than Account permissions %s," \
" the lowest of the two will be used.)" % permstr
cpermstr += "\nUse @unquell to return to normal permission usage."
self.msg(cpermstr)
else:
self.msg("Quelling Account permissions%s. Use @unquell to get them back." % permstr)
self._recache_locks(account) | [
"def",
"func",
"(",
"self",
")",
":",
"account",
"=",
"self",
".",
"account",
"permstr",
"=",
"account",
".",
"is_superuser",
"and",
"\" (superuser)\"",
"or",
"\"(%s)\"",
"%",
"(",
"\", \"",
".",
"join",
"(",
"account",
".",
"permissions",
".",
"all",
"(",
")",
")",
")",
"if",
"self",
".",
"cmdstring",
"in",
"(",
"'unquell'",
",",
"'@unquell'",
")",
":",
"if",
"not",
"account",
".",
"attributes",
".",
"get",
"(",
"'_quell'",
")",
":",
"self",
".",
"msg",
"(",
"\"Already using normal Account permissions %s.\"",
"%",
"permstr",
")",
"else",
":",
"account",
".",
"attributes",
".",
"remove",
"(",
"'_quell'",
")",
"self",
".",
"msg",
"(",
"\"Account permissions %s restored.\"",
"%",
"permstr",
")",
"else",
":",
"if",
"account",
".",
"attributes",
".",
"get",
"(",
"'_quell'",
")",
":",
"self",
".",
"msg",
"(",
"\"Already quelling Account %s permissions.\"",
"%",
"permstr",
")",
"return",
"account",
".",
"attributes",
".",
"add",
"(",
"'_quell'",
",",
"True",
")",
"puppet",
"=",
"self",
".",
"session",
".",
"puppet",
"if",
"puppet",
":",
"cpermstr",
"=",
"\"(%s)\"",
"%",
"\", \"",
".",
"join",
"(",
"puppet",
".",
"permissions",
".",
"all",
"(",
")",
")",
"cpermstr",
"=",
"\"Quelling to current puppet's permissions %s.\"",
"%",
"cpermstr",
"cpermstr",
"+=",
"\"\\n(Note: If this is higher than Account permissions %s,\"",
"\" the lowest of the two will be used.)\"",
"%",
"permstr",
"cpermstr",
"+=",
"\"\\nUse @unquell to return to normal permission usage.\"",
"self",
".",
"msg",
"(",
"cpermstr",
")",
"else",
":",
"self",
".",
"msg",
"(",
"\"Quelling Account permissions%s. Use @unquell to get them back.\"",
"%",
"permstr",
")",
"self",
".",
"_recache_locks",
"(",
"account",
")"
] | [
834,
4
] | [
859,
36
] | python | en | ['en', 'en', 'en'] | True |
start_plugin_services | (portal) |
This hook is called by Evennia, last in the Portal startup process.
portal - a reference to the main portal application.
|
This hook is called by Evennia, last in the Portal startup process. | def start_plugin_services(portal):
"""
This hook is called by Evennia, last in the Portal startup process.
portal - a reference to the main portal application.
"""
pass | [
"def",
"start_plugin_services",
"(",
"portal",
")",
":",
"pass"
] | [
17,
0
] | [
23,
8
] | python | en | ['en', 'error', 'th'] | False |
test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync | (
looper,
tdirWithPoolTxns,
tdirWithDomainTxns,
nodeSet,
sdk_pool_handle,
sdk_wallet_endorser,
allPluginsPath,
tconf,
disable_transport_batching) |
Verifies that a batch rejected due to catch-up start can be successfully
ordered later before ledgers synchronization without any
warnings.
In the test we perform stashing / unstashing messages and patching /
unpatching methods to ensure the desired order of events for the following
scenario:
1. Start a pool of 4 nodes. One node with a master replica not being
a primary suffers from a slow network connection. We name this node slow.
2. Start a client.
3. Send a write request from the client to the pool.
4. All the 3PC messages for this request are sent, received and handled by
all the nodes except that COMMIT messages are not received by the slow node.
5. The other nodes reach a consensus and order the batch.
6. Initiate a catch-up of the slow node by calling its start_catchup method.
7. The slow node rejects the unordered batch.
8. The slow node sends MESSAGE_REQUEST for LEDGER_STATUS to the other nodes.
9. The slow node receives the COMMIT messages from the other nodes.
10. The slow node gets ORDER messages from its replicas and stashes them
since it is not in participating mode.
11. The slow node receives LEDGER_STATUS messages from the other nodes.
12. Prior to ledgers synchronization the slow node processes the stashed
Commits messages and orders batch.
13. The slow node synchronizes its ledgers and completes the catch-up.
|
Verifies that a batch rejected due to catch-up start can be successfully
ordered later before ledgers synchronization without any
warnings. | def test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync(
looper,
tdirWithPoolTxns,
tdirWithDomainTxns,
nodeSet,
sdk_pool_handle,
sdk_wallet_endorser,
allPluginsPath,
tconf,
disable_transport_batching):
"""
Verifies that a batch rejected due to catch-up start can be successfully
ordered later before ledgers synchronization without any
warnings.
In the test we perform stashing / unstashing messages and patching /
unpatching methods to ensure the desired order of events for the following
scenario:
1. Start a pool of 4 nodes. One node with a master replica not being
a primary suffers from a slow network connection. We name this node slow.
2. Start a client.
3. Send a write request from the client to the pool.
4. All the 3PC messages for this request are sent, received and handled by
all the nodes except that COMMIT messages are not received by the slow node.
5. The other nodes reach a consensus and order the batch.
6. Initiate a catch-up of the slow node by calling its start_catchup method.
7. The slow node rejects the unordered batch.
8. The slow node sends MESSAGE_REQUEST for LEDGER_STATUS to the other nodes.
9. The slow node receives the COMMIT messages from the other nodes.
10. The slow node gets ORDER messages from its replicas and stashes them
since it is not in participating mode.
11. The slow node receives LEDGER_STATUS messages from the other nodes.
12. Prior to ledgers synchronization the slow node processes the stashed
Commits messages and orders batch.
13. The slow node synchronizes its ledgers and completes the catch-up.
"""
non_primary_replicas_of_master = getNonPrimaryReplicas(nodeSet, 0)
slow_node = non_primary_replicas_of_master[0].node
slow_os = slow_node.master_replica._ordering_service
slow_node.nodeIbStasher.delay(cDelay(300))
slow_node.start_catchup = MethodType(patched_start_catchup, slow_node)
no_more_catchups_needed_call_times_before = \
slow_node.spylog.count(Node.no_more_catchups_needed.__name__)
on_batch_rejected_call_times_before = \
slow_os.spylog.count(OrderingService.post_batch_rejection.__name__)
on_batch_created_call_times_before = \
slow_os.spylog.count(OrderingService.post_batch_creation.__name__)
process_ordered_call_times_before = \
slow_node.spylog.count(Node.processOrdered.__name__)
send_random_requests(looper, sdk_pool_handle, sdk_wallet_endorser, 1)
slow_node.start_catchup()
def check_catchup_done():
assert slow_node.spylog.count(Node.no_more_catchups_needed.__name__) > \
no_more_catchups_needed_call_times_before
looper.run(eventually(check_catchup_done, retryWait=1, timeout=10))
on_batch_rejected_call_times_after = \
slow_os.spylog.count(OrderingService.post_batch_rejection.__name__)
on_batch_created_call_times_after = \
slow_os.spylog.count(OrderingService.post_batch_creation.__name__)
process_ordered_call_times_after = \
slow_node.spylog.count(Node.processOrdered.__name__)
assert on_batch_rejected_call_times_after \
- on_batch_rejected_call_times_before == 1
assert on_batch_created_call_times_after \
- on_batch_created_call_times_before == 1
assert process_ordered_call_times_after \
- process_ordered_call_times_before == 0 # one per replica
last_2_process_ordered_results = \
[call.result for call
in slow_node.spylog.getAll(Node.processOrdered.__name__)[-2:]]
assert True in last_2_process_ordered_results | [
"def",
"test_batch_rejected_on_catchup_start_can_be_ordered_before_ledgers_sync",
"(",
"looper",
",",
"tdirWithPoolTxns",
",",
"tdirWithDomainTxns",
",",
"nodeSet",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"allPluginsPath",
",",
"tconf",
",",
"disable_transport_batching",
")",
":",
"non_primary_replicas_of_master",
"=",
"getNonPrimaryReplicas",
"(",
"nodeSet",
",",
"0",
")",
"slow_node",
"=",
"non_primary_replicas_of_master",
"[",
"0",
"]",
".",
"node",
"slow_os",
"=",
"slow_node",
".",
"master_replica",
".",
"_ordering_service",
"slow_node",
".",
"nodeIbStasher",
".",
"delay",
"(",
"cDelay",
"(",
"300",
")",
")",
"slow_node",
".",
"start_catchup",
"=",
"MethodType",
"(",
"patched_start_catchup",
",",
"slow_node",
")",
"no_more_catchups_needed_call_times_before",
"=",
"slow_node",
".",
"spylog",
".",
"count",
"(",
"Node",
".",
"no_more_catchups_needed",
".",
"__name__",
")",
"on_batch_rejected_call_times_before",
"=",
"slow_os",
".",
"spylog",
".",
"count",
"(",
"OrderingService",
".",
"post_batch_rejection",
".",
"__name__",
")",
"on_batch_created_call_times_before",
"=",
"slow_os",
".",
"spylog",
".",
"count",
"(",
"OrderingService",
".",
"post_batch_creation",
".",
"__name__",
")",
"process_ordered_call_times_before",
"=",
"slow_node",
".",
"spylog",
".",
"count",
"(",
"Node",
".",
"processOrdered",
".",
"__name__",
")",
"send_random_requests",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"1",
")",
"slow_node",
".",
"start_catchup",
"(",
")",
"def",
"check_catchup_done",
"(",
")",
":",
"assert",
"slow_node",
".",
"spylog",
".",
"count",
"(",
"Node",
".",
"no_more_catchups_needed",
".",
"__name__",
")",
">",
"no_more_catchups_needed_call_times_before",
"looper",
".",
"run",
"(",
"eventually",
"(",
"check_catchup_done",
",",
"retryWait",
"=",
"1",
",",
"timeout",
"=",
"10",
")",
")",
"on_batch_rejected_call_times_after",
"=",
"slow_os",
".",
"spylog",
".",
"count",
"(",
"OrderingService",
".",
"post_batch_rejection",
".",
"__name__",
")",
"on_batch_created_call_times_after",
"=",
"slow_os",
".",
"spylog",
".",
"count",
"(",
"OrderingService",
".",
"post_batch_creation",
".",
"__name__",
")",
"process_ordered_call_times_after",
"=",
"slow_node",
".",
"spylog",
".",
"count",
"(",
"Node",
".",
"processOrdered",
".",
"__name__",
")",
"assert",
"on_batch_rejected_call_times_after",
"-",
"on_batch_rejected_call_times_before",
"==",
"1",
"assert",
"on_batch_created_call_times_after",
"-",
"on_batch_created_call_times_before",
"==",
"1",
"assert",
"process_ordered_call_times_after",
"-",
"process_ordered_call_times_before",
"==",
"0",
"# one per replica",
"last_2_process_ordered_results",
"=",
"[",
"call",
".",
"result",
"for",
"call",
"in",
"slow_node",
".",
"spylog",
".",
"getAll",
"(",
"Node",
".",
"processOrdered",
".",
"__name__",
")",
"[",
"-",
"2",
":",
"]",
"]",
"assert",
"True",
"in",
"last_2_process_ordered_results"
] | [
44,
0
] | [
126,
49
] | python | en | ['en', 'error', 'th'] | False |
Title.font | (self) |
Sets the font used for `title`. Note that the title's font used
to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.pie.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.pie.title.Font
|
Sets the font used for `title`. Note that the title's font used
to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.pie.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def font(self):
"""
Sets the font used for `title`. Note that the title's font used
to be set by the now deprecated `titlefont` attribute.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.pie.title.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.pie.title.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
15,
4
] | [
63,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.position | (self) |
Specifies the location of the `title`. Note that the title's
position used to be set by the now deprecated `titleposition`
attribute.
The 'position' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top right', 'middle center',
'bottom left', 'bottom center', 'bottom right']
Returns
-------
Any
|
Specifies the location of the `title`. Note that the title's
position used to be set by the now deprecated `titleposition`
attribute.
The 'position' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top right', 'middle center',
'bottom left', 'bottom center', 'bottom right'] | def position(self):
"""
Specifies the location of the `title`. Note that the title's
position used to be set by the now deprecated `titleposition`
attribute.
The 'position' property is an enumeration that may be specified as:
- One of the following enumeration values:
['top left', 'top center', 'top right', 'middle center',
'bottom left', 'bottom center', 'bottom right']
Returns
-------
Any
"""
return self["position"] | [
"def",
"position",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"position\"",
"]"
] | [
72,
4
] | [
87,
31
] | python | en | ['en', 'error', 'th'] | False |
Title.text | (self) |
Sets the title of the chart. If it is empty, no title is
displayed. Note that before the existence of `title.text`, the
title's contents used to be defined as the `title` attribute
itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the title of the chart. If it is empty, no title is
displayed. Note that before the existence of `title.text`, the
title's contents used to be defined as the `title` attribute
itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def text(self):
"""
Sets the title of the chart. If it is empty, no title is
displayed. Note that before the existence of `title.text`, the
title's contents used to be defined as the `title` attribute
itself. This behavior has been deprecated.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["text"] | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
96,
4
] | [
111,
27
] | python | en | ['en', 'error', 'th'] | False |
Title.__init__ | (self, arg=None, font=None, position=None, text=None, **kwargs) |
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.pie.Title`
font
Sets the font used for `title`. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
position
Specifies the location of the `title`. Note that the
title's position used to be set by the now deprecated
`titleposition` attribute.
text
Sets the title of the chart. If it is empty, no title
is displayed. Note that before the existence of
`title.text`, the title's contents used to be defined
as the `title` attribute itself. This behavior has been
deprecated.
Returns
-------
Title
|
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.pie.Title`
font
Sets the font used for `title`. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
position
Specifies the location of the `title`. Note that the
title's position used to be set by the now deprecated
`titleposition` attribute.
text
Sets the title of the chart. If it is empty, no title
is displayed. Note that before the existence of
`title.text`, the title's contents used to be defined
as the `title` attribute itself. This behavior has been
deprecated. | def __init__(self, arg=None, font=None, position=None, text=None, **kwargs):
"""
Construct a new Title object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.pie.Title`
font
Sets the font used for `title`. Note that the title's
font used to be set by the now deprecated `titlefont`
attribute.
position
Specifies the location of the `title`. Note that the
title's position used to be set by the now deprecated
`titleposition` attribute.
text
Sets the title of the chart. If it is empty, no title
is displayed. Note that before the existence of
`title.text`, the title's contents used to be defined
as the `title` attribute itself. This behavior has been
deprecated.
Returns
-------
Title
"""
super(Title, self).__init__("title")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.pie.Title
constructor must be a dict or
an instance of :class:`plotly.graph_objs.pie.Title`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("position", None)
_v = position if position is not None else _v
if _v is not None:
self["position"] = _v
_v = arg.pop("text", None)
_v = text if text is not None else _v
if _v is not None:
self["text"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"font",
"=",
"None",
",",
"position",
"=",
"None",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Title",
",",
"self",
")",
".",
"__init__",
"(",
"\"title\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.pie.Title \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.pie.Title`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"position\"",
",",
"None",
")",
"_v",
"=",
"position",
"if",
"position",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"position\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"text\"",
",",
"None",
")",
"_v",
"=",
"text",
"if",
"text",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"text\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
138,
4
] | [
214,
34
] | python | en | ['en', 'error', 'th'] | False |
multiclass_nms | (multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None) | NMS for multi-class bboxes.
Args:
multi_bboxes (Tensor): shape (n, #class*4) or (n, 4)
multi_scores (Tensor): shape (n, #class), where the last column
contains scores of the background class, but this will be ignored.
score_thr (float): bbox threshold, bboxes with scores lower than it
will not be considered.
nms_thr (float): NMS IoU threshold
max_num (int): if there are more than max_num bboxes after NMS,
only top max_num will be kept.
score_factors (Tensor): The factors multiplied to scores before
applying NMS
Returns:
tuple: (bboxes, labels), tensors of shape (k, 5) and (k, 1). Labels
are 0-based.
| NMS for multi-class bboxes. | def multiclass_nms(multi_bboxes,
multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None):
"""NMS for multi-class bboxes.
Args:
multi_bboxes (Tensor): shape (n, #class*4) or (n, 4)
multi_scores (Tensor): shape (n, #class), where the last column
contains scores of the background class, but this will be ignored.
score_thr (float): bbox threshold, bboxes with scores lower than it
will not be considered.
nms_thr (float): NMS IoU threshold
max_num (int): if there are more than max_num bboxes after NMS,
only top max_num will be kept.
score_factors (Tensor): The factors multiplied to scores before
applying NMS
Returns:
tuple: (bboxes, labels), tensors of shape (k, 5) and (k, 1). Labels
are 0-based.
"""
num_classes = multi_scores.size(1) - 1
# exclude background category
if multi_bboxes.shape[1] > 4:
bboxes = multi_bboxes.view(multi_scores.size(0), -1, 4)
else:
bboxes = multi_bboxes[:, None].expand(-1, num_classes, 4)
scores = multi_scores[:, :-1]
# filter out boxes with low scores
valid_mask = scores > score_thr
bboxes = bboxes[valid_mask]
if score_factors is not None:
scores = scores * score_factors[:, None]
scores = scores[valid_mask]
labels = valid_mask.nonzero()[:, 1]
if bboxes.numel() == 0:
bboxes = multi_bboxes.new_zeros((0, 5))
labels = multi_bboxes.new_zeros((0, ), dtype=torch.long)
return bboxes, labels
dets, keep = batched_nms(bboxes, scores, labels, nms_cfg)
if max_num > 0:
dets = dets[:max_num]
keep = keep[:max_num]
return dets, labels[keep] | [
"def",
"multiclass_nms",
"(",
"multi_bboxes",
",",
"multi_scores",
",",
"score_thr",
",",
"nms_cfg",
",",
"max_num",
"=",
"-",
"1",
",",
"score_factors",
"=",
"None",
")",
":",
"num_classes",
"=",
"multi_scores",
".",
"size",
"(",
"1",
")",
"-",
"1",
"# exclude background category",
"if",
"multi_bboxes",
".",
"shape",
"[",
"1",
"]",
">",
"4",
":",
"bboxes",
"=",
"multi_bboxes",
".",
"view",
"(",
"multi_scores",
".",
"size",
"(",
"0",
")",
",",
"-",
"1",
",",
"4",
")",
"else",
":",
"bboxes",
"=",
"multi_bboxes",
"[",
":",
",",
"None",
"]",
".",
"expand",
"(",
"-",
"1",
",",
"num_classes",
",",
"4",
")",
"scores",
"=",
"multi_scores",
"[",
":",
",",
":",
"-",
"1",
"]",
"# filter out boxes with low scores",
"valid_mask",
"=",
"scores",
">",
"score_thr",
"bboxes",
"=",
"bboxes",
"[",
"valid_mask",
"]",
"if",
"score_factors",
"is",
"not",
"None",
":",
"scores",
"=",
"scores",
"*",
"score_factors",
"[",
":",
",",
"None",
"]",
"scores",
"=",
"scores",
"[",
"valid_mask",
"]",
"labels",
"=",
"valid_mask",
".",
"nonzero",
"(",
")",
"[",
":",
",",
"1",
"]",
"if",
"bboxes",
".",
"numel",
"(",
")",
"==",
"0",
":",
"bboxes",
"=",
"multi_bboxes",
".",
"new_zeros",
"(",
"(",
"0",
",",
"5",
")",
")",
"labels",
"=",
"multi_bboxes",
".",
"new_zeros",
"(",
"(",
"0",
",",
")",
",",
"dtype",
"=",
"torch",
".",
"long",
")",
"return",
"bboxes",
",",
"labels",
"dets",
",",
"keep",
"=",
"batched_nms",
"(",
"bboxes",
",",
"scores",
",",
"labels",
",",
"nms_cfg",
")",
"if",
"max_num",
">",
"0",
":",
"dets",
"=",
"dets",
"[",
":",
"max_num",
"]",
"keep",
"=",
"keep",
"[",
":",
"max_num",
"]",
"return",
"dets",
",",
"labels",
"[",
"keep",
"]"
] | [
4,
0
] | [
55,
29
] | python | en | ['en', 'en', 'en'] | True |
BatchSampler._sample | (self, num) | Sample specific number of ground truths and return indices.
Args:
num (int): Sampled number.
Returns:
list[int]: Indices of sampled ground truths.
| Sample specific number of ground truths and return indices. | def _sample(self, num):
"""Sample specific number of ground truths and return indices.
Args:
num (int): Sampled number.
Returns:
list[int]: Indices of sampled ground truths.
"""
if self._idx + num >= self._example_num:
ret = self._indices[self._idx:].copy()
self._reset()
else:
ret = self._indices[self._idx:self._idx + num]
self._idx += num
return ret | [
"def",
"_sample",
"(",
"self",
",",
"num",
")",
":",
"if",
"self",
".",
"_idx",
"+",
"num",
">=",
"self",
".",
"_example_num",
":",
"ret",
"=",
"self",
".",
"_indices",
"[",
"self",
".",
"_idx",
":",
"]",
".",
"copy",
"(",
")",
"self",
".",
"_reset",
"(",
")",
"else",
":",
"ret",
"=",
"self",
".",
"_indices",
"[",
"self",
".",
"_idx",
":",
"self",
".",
"_idx",
"+",
"num",
"]",
"self",
".",
"_idx",
"+=",
"num",
"return",
"ret"
] | [
40,
4
] | [
55,
18
] | python | en | ['en', 'en', 'en'] | True |
BatchSampler._reset | (self) | Reset the index of batchsampler to zero. | Reset the index of batchsampler to zero. | def _reset(self):
"""Reset the index of batchsampler to zero."""
assert self._name is not None
# print("reset", self._name)
if self._shuffle:
np.random.shuffle(self._indices)
self._idx = 0 | [
"def",
"_reset",
"(",
"self",
")",
":",
"assert",
"self",
".",
"_name",
"is",
"not",
"None",
"# print(\"reset\", self._name)",
"if",
"self",
".",
"_shuffle",
":",
"np",
".",
"random",
".",
"shuffle",
"(",
"self",
".",
"_indices",
")",
"self",
".",
"_idx",
"=",
"0"
] | [
57,
4
] | [
63,
21
] | python | en | ['en', 'nl', 'en'] | True |
BatchSampler.sample | (self, num) | Sample specific number of ground truths.
Args:
num (int): Sampled number.
Returns:
list[dict]: Sampled ground truths.
| Sample specific number of ground truths. | def sample(self, num):
"""Sample specific number of ground truths.
Args:
num (int): Sampled number.
Returns:
list[dict]: Sampled ground truths.
"""
indices = self._sample(num)
return [self._sampled_list[i] for i in indices] | [
"def",
"sample",
"(",
"self",
",",
"num",
")",
":",
"indices",
"=",
"self",
".",
"_sample",
"(",
"num",
")",
"return",
"[",
"self",
".",
"_sampled_list",
"[",
"i",
"]",
"for",
"i",
"in",
"indices",
"]"
] | [
65,
4
] | [
75,
55
] | python | en | ['en', 'en', 'en'] | True |
gen_convo_ul | (conversations) |
Generate the ul section of the HTML for the conversations.
:param conversation: The conversation to be rendered (after pre-processing)
:return: The string generating the list in HTML
|
Generate the ul section of the HTML for the conversations. | def gen_convo_ul(conversations):
"""
Generate the ul section of the HTML for the conversations.
:param conversation: The conversation to be rendered (after pre-processing)
:return: The string generating the list in HTML
"""
ul_str = f"\t<ul>\n"
for speaker, speech in conversations:
if speaker == END_OF_CONVO:
ul_str += f"\n\t <li class=\"breaker\"><hr/></li>\n"
else:
ul_str += f"""
<li>
<div class="{speaker}_img_div">
<img class="{speaker}_img">
</div>
<div class="{speaker}_p_div">
<p class="{speaker}">{speech}</p>
</div>
<div class="clear"></div>
</li>
"""
ul_str += "\t</ul>"
return ul_str | [
"def",
"gen_convo_ul",
"(",
"conversations",
")",
":",
"ul_str",
"=",
"f\"\\t<ul>\\n\"",
"for",
"speaker",
",",
"speech",
"in",
"conversations",
":",
"if",
"speaker",
"==",
"END_OF_CONVO",
":",
"ul_str",
"+=",
"f\"\\n\\t <li class=\\\"breaker\\\"><hr/></li>\\n\"",
"else",
":",
"ul_str",
"+=",
"f\"\"\"\n <li>\n <div class=\"{speaker}_img_div\">\n <img class=\"{speaker}_img\">\n </div>\n <div class=\"{speaker}_p_div\">\n <p class=\"{speaker}\">{speech}</p>\n </div>\n <div class=\"clear\"></div>\n </li>\n \"\"\"",
"ul_str",
"+=",
"\"\\t</ul>\"",
"return",
"ul_str"
] | [
23,
0
] | [
49,
17
] | python | en | ['en', 'error', 'th'] | False |
gen_html | (
conversations,
height,
width,
title,
other_speaker,
human_speaker,
user_icon,
alt_icon,
) |
Generate HTML string for the given conversation.
:param conversation:
The conversation to be rendered (after pre-processing)
:param height:
Height of the HTML page
:param width:
Width of the HTML page
:param title:
Title of the HTML page
:param other_speaker:
The title of the model (grey boxes)
:param human_speaker:
Human speaker in the dialogs (blue boxes)
:return: HTML string for the desired conversation
|
Generate HTML string for the given conversation. | def gen_html(
conversations,
height,
width,
title,
other_speaker,
human_speaker,
user_icon,
alt_icon,
):
"""
Generate HTML string for the given conversation.
:param conversation:
The conversation to be rendered (after pre-processing)
:param height:
Height of the HTML page
:param width:
Width of the HTML page
:param title:
Title of the HTML page
:param other_speaker:
The title of the model (grey boxes)
:param human_speaker:
Human speaker in the dialogs (blue boxes)
:return: HTML string for the desired conversation
"""
html_str = f"""<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title> {title} </title>
<style type="text/css">
@media print{{
@page{{ margin: 0; size: {str(width)}in {str(height)}in; }}
}}
ul{{
list-style: none;
}}
.{other_speaker}_img_div{{
display: inline-block;
float: left;
margin: 18px 5px 0px -25px;
}}
.{human_speaker}_img_div{{
display: inline-block;
float: right;
margin: 18px 15px 5px 5px;
}}
.{other_speaker}_img{{
content:url({alt_icon});
}}
.{human_speaker}_img{{
content:url({user_icon});
}}
.{other_speaker}_p_div{{
float: left;
}}
.{human_speaker}_p_div{{
float:right;
}}
p{{
display:inline-block;
overflow-wrap: break-word;
border-radius: 30px;
padding: 10px 10px 10px 10px;
font-family: Helvetica, Arial, sans-serif;
}}
.clear{{
float: none;
clear: both;
}}
.{other_speaker}{{
background: #eee;
float: left;
}}
.{human_speaker}{{
background: #0084ff;
color: #fff;
float: right;
}}
.breaker{{
color: #bec3c9;
display: block;
height: 20px;
margin: 20px 20px 20px 20px;
text-align: center;
text-transform: uppercase;
}}
img{{
border-radius: 50px;
width: 50px;
height: 50px;
}}
</style>
</head>
<body>
{gen_convo_ul(conversations)}
</body>
</html>
"""
return html_str | [
"def",
"gen_html",
"(",
"conversations",
",",
"height",
",",
"width",
",",
"title",
",",
"other_speaker",
",",
"human_speaker",
",",
"user_icon",
",",
"alt_icon",
",",
")",
":",
"html_str",
"=",
"f\"\"\"<html>\n<head>\n <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n <title> {title} </title>\n <style type=\"text/css\">\n @media print{{\n @page{{ margin: 0; size: {str(width)}in {str(height)}in; }}\n }}\n ul{{\n list-style: none;\n }}\n .{other_speaker}_img_div{{\n display: inline-block;\n float: left;\n margin: 18px 5px 0px -25px;\n }}\n .{human_speaker}_img_div{{\n display: inline-block;\n float: right;\n margin: 18px 15px 5px 5px;\n }}\n .{other_speaker}_img{{\n content:url({alt_icon});\n }}\n .{human_speaker}_img{{\n content:url({user_icon});\n }}\n .{other_speaker}_p_div{{\n float: left;\n }}\n .{human_speaker}_p_div{{\n float:right;\n }}\n p{{\n display:inline-block;\n overflow-wrap: break-word;\n border-radius: 30px;\n padding: 10px 10px 10px 10px;\n font-family: Helvetica, Arial, sans-serif;\n }}\n .clear{{\n float: none;\n clear: both;\n }}\n .{other_speaker}{{\n background: #eee;\n float: left;\n }}\n .{human_speaker}{{\n background: #0084ff;\n color: #fff;\n float: right;\n }}\n .breaker{{\n color: #bec3c9;\n display: block;\n height: 20px;\n margin: 20px 20px 20px 20px;\n text-align: center;\n text-transform: uppercase;\n }}\n img{{\n border-radius: 50px;\n width: 50px;\n height: 50px;\n }}\n </style>\n</head>\n<body>\n{gen_convo_ul(conversations)}\n</body>\n</html>\n \"\"\"",
"return",
"html_str"
] | [
52,
0
] | [
153,
19
] | python | en | ['en', 'error', 'th'] | False |
pre_process | (fname, num_ex, alt_speaker) |
Pre-process the given file to bring the conversation in a certain format.
:param fname: File name to be processed
:param num_ex: Number of conversations to be used
:param alt_speaker: Name of other speaker to be used
:return: List of tuples of the form: (speaker, speech)
|
Pre-process the given file to bring the conversation in a certain format. | def pre_process(fname, num_ex, alt_speaker):
"""
Pre-process the given file to bring the conversation in a certain format.
:param fname: File name to be processed
:param num_ex: Number of conversations to be used
:param alt_speaker: Name of other speaker to be used
:return: List of tuples of the form: (speaker, speech)
"""
conversation = []
with PathManager.open(fname) as f:
lines = f.readlines()
random.shuffle(lines)
lines = lines[:num_ex]
for line in lines:
data = json.loads(line)
dialogue = data["dialog"]
for item in dialogue:
speaker = item[0]['id']
text = item[0]['text']
conversation += [(speaker, text)]
conversation += [(END_OF_CONVO, END_OF_CONVO)]
return conversation | [
"def",
"pre_process",
"(",
"fname",
",",
"num_ex",
",",
"alt_speaker",
")",
":",
"conversation",
"=",
"[",
"]",
"with",
"PathManager",
".",
"open",
"(",
"fname",
")",
"as",
"f",
":",
"lines",
"=",
"f",
".",
"readlines",
"(",
")",
"random",
".",
"shuffle",
"(",
"lines",
")",
"lines",
"=",
"lines",
"[",
":",
"num_ex",
"]",
"for",
"line",
"in",
"lines",
":",
"data",
"=",
"json",
".",
"loads",
"(",
"line",
")",
"dialogue",
"=",
"data",
"[",
"\"dialog\"",
"]",
"for",
"item",
"in",
"dialogue",
":",
"speaker",
"=",
"item",
"[",
"0",
"]",
"[",
"'id'",
"]",
"text",
"=",
"item",
"[",
"0",
"]",
"[",
"'text'",
"]",
"conversation",
"+=",
"[",
"(",
"speaker",
",",
"text",
")",
"]",
"conversation",
"+=",
"[",
"(",
"END_OF_CONVO",
",",
"END_OF_CONVO",
")",
"]",
"return",
"conversation"
] | [
156,
0
] | [
180,
23
] | python | en | ['en', 'error', 'th'] | False |
prBlueBG | (text) |
Print given in text with a blue background.
:param text: The text to be printed
|
Print given in text with a blue background. | def prBlueBG(text):
"""
Print given in text with a blue background.
:param text: The text to be printed
"""
print("\033[44m{}\033[0m".format(text), sep="") | [
"def",
"prBlueBG",
"(",
"text",
")",
":",
"print",
"(",
"\"\\033[44m{}\\033[0m\"",
".",
"format",
"(",
"text",
")",
",",
"sep",
"=",
"\"\"",
")"
] | [
183,
0
] | [
189,
51
] | python | en | ['en', 'error', 'th'] | False |
display_cli | (conversations, alt_speaker, human_speaker) |
Display the conversations on the Command Line.
:param conversations: The dialogs to be displayed
:param alt_speaker: Name of other speaker to be used
:param human_speaker: Name of human speaker to be used
|
Display the conversations on the Command Line. | def display_cli(conversations, alt_speaker, human_speaker):
"""
Display the conversations on the Command Line.
:param conversations: The dialogs to be displayed
:param alt_speaker: Name of other speaker to be used
:param human_speaker: Name of human speaker to be used
"""
for speaker, speech in conversations:
if speaker == END_OF_CONVO:
print("-" * 20 + "END OF CONVERSATION" + "-" * 20)
elif speaker == alt_speaker:
print("%-15s: %s" % (speaker[:15], speech))
else:
prBlueBG("%-15s: %s" % (speaker[:15], speech)) | [
"def",
"display_cli",
"(",
"conversations",
",",
"alt_speaker",
",",
"human_speaker",
")",
":",
"for",
"speaker",
",",
"speech",
"in",
"conversations",
":",
"if",
"speaker",
"==",
"END_OF_CONVO",
":",
"print",
"(",
"\"-\"",
"*",
"20",
"+",
"\"END OF CONVERSATION\"",
"+",
"\"-\"",
"*",
"20",
")",
"elif",
"speaker",
"==",
"alt_speaker",
":",
"print",
"(",
"\"%-15s: %s\"",
"%",
"(",
"speaker",
"[",
":",
"15",
"]",
",",
"speech",
")",
")",
"else",
":",
"prBlueBG",
"(",
"\"%-15s: %s\"",
"%",
"(",
"speaker",
"[",
":",
"15",
"]",
",",
"speech",
")",
")"
] | [
192,
0
] | [
206,
58
] | python | en | ['en', 'error', 'th'] | False |
setup_args | () |
Creates a parser object with some pre-determined arguments.
|
Creates a parser object with some pre-determined arguments.
| def setup_args():
"""
Creates a parser object with some pre-determined arguments.
"""
parser = ParlaiParser(add_parlai_args=True, description="Render data as HTML")
conv_render = parser.add_argument_group('Conversation Rendering Arguments')
conv_render.add_argument(
"--input", "-i", help="Input file to read conversations from"
)
conv_render.add_argument(
"--output",
"-o",
help="Output file to write conversations to. One of [.pdf, .png, .html] only",
)
conv_render.add_argument(
"--width", "-wd", help="Width of output file", type=int, default=8
)
conv_render.add_argument(
"--height", "-ht", help="Height of output file", type=int, default=10
)
conv_render.add_argument(
"--user-icon",
"-uic",
help="Absolute Path/URL to user image icon",
default=HUMAN_EMOJI_IMG,
)
conv_render.add_argument(
"--alt-icon",
"-aic",
help="Absolute Path/URL to alternate image icon",
default=ALT_EMOJI_IMG,
)
conv_render.add_argument(
"--num-examples",
"-ne",
help="Number of conversations to render",
type=int,
default=10,
)
return parser | [
"def",
"setup_args",
"(",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"add_parlai_args",
"=",
"True",
",",
"description",
"=",
"\"Render data as HTML\"",
")",
"conv_render",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Conversation Rendering Arguments'",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--input\"",
",",
"\"-i\"",
",",
"help",
"=",
"\"Input file to read conversations from\"",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--output\"",
",",
"\"-o\"",
",",
"help",
"=",
"\"Output file to write conversations to. One of [.pdf, .png, .html] only\"",
",",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--width\"",
",",
"\"-wd\"",
",",
"help",
"=",
"\"Width of output file\"",
",",
"type",
"=",
"int",
",",
"default",
"=",
"8",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--height\"",
",",
"\"-ht\"",
",",
"help",
"=",
"\"Height of output file\"",
",",
"type",
"=",
"int",
",",
"default",
"=",
"10",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--user-icon\"",
",",
"\"-uic\"",
",",
"help",
"=",
"\"Absolute Path/URL to user image icon\"",
",",
"default",
"=",
"HUMAN_EMOJI_IMG",
",",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--alt-icon\"",
",",
"\"-aic\"",
",",
"help",
"=",
"\"Absolute Path/URL to alternate image icon\"",
",",
"default",
"=",
"ALT_EMOJI_IMG",
",",
")",
"conv_render",
".",
"add_argument",
"(",
"\"--num-examples\"",
",",
"\"-ne\"",
",",
"help",
"=",
"\"Number of conversations to render\"",
",",
"type",
"=",
"int",
",",
"default",
"=",
"10",
",",
")",
"return",
"parser"
] | [
209,
0
] | [
249,
17
] | python | en | ['en', 'error', 'th'] | False |
check_icon_arg | (src, default) |
Checks if icon arguments are valid: either a URL or an absolute path.
:param src: Source of the icon
:param default: default value of the icon
:return: src (possibly pre-pended with "file://")
|
Checks if icon arguments are valid: either a URL or an absolute path. | def check_icon_arg(src, default):
"""
Checks if icon arguments are valid: either a URL or an absolute path.
:param src: Source of the icon
:param default: default value of the icon
:return: src (possibly pre-pended with "file://")
"""
if src != default:
# check if URl
if not src.startswith('https://') and not src.startswith('http://'):
# Either a file or incorrect input
if os.path.isabs(src):
src = "file://" + src
else:
raise IOError(
f"Please provide a valid URL or valid *absolute* path to icon: {src}"
)
return src | [
"def",
"check_icon_arg",
"(",
"src",
",",
"default",
")",
":",
"if",
"src",
"!=",
"default",
":",
"# check if URl",
"if",
"not",
"src",
".",
"startswith",
"(",
"'https://'",
")",
"and",
"not",
"src",
".",
"startswith",
"(",
"'http://'",
")",
":",
"# Either a file or incorrect input",
"if",
"os",
".",
"path",
".",
"isabs",
"(",
"src",
")",
":",
"src",
"=",
"\"file://\"",
"+",
"src",
"else",
":",
"raise",
"IOError",
"(",
"f\"Please provide a valid URL or valid *absolute* path to icon: {src}\"",
")",
"return",
"src"
] | [
252,
0
] | [
271,
14
] | python | en | ['en', 'error', 'th'] | False |
validate_args | (opt) |
Validate the cmdline args passed into the script.
:param opt: The arguments of te parser
:return: Returns extension of output file. None if no output file
|
Validate the cmdline args passed into the script. | def validate_args(opt):
"""
Validate the cmdline args passed into the script.
:param opt: The arguments of te parser
:return: Returns extension of output file. None if no output file
"""
if not PathManager.exists(opt['input']):
raise IOError("Input File does not exist")
if opt['output'] is None:
return None
extension = opt['output'].split(".")[-1]
if extension not in ["html", "pdf", "png"]:
raise Exception(
"Extension not specified/supported. Specify one of '.html', '.pdf' or '.png' output files"
)
opt['user_icon'] = check_icon_arg(opt['user_icon'], HUMAN_EMOJI_IMG)
opt['alt_icon'] = check_icon_arg(opt['alt_icon'], ALT_EMOJI_IMG)
return extension | [
"def",
"validate_args",
"(",
"opt",
")",
":",
"if",
"not",
"PathManager",
".",
"exists",
"(",
"opt",
"[",
"'input'",
"]",
")",
":",
"raise",
"IOError",
"(",
"\"Input File does not exist\"",
")",
"if",
"opt",
"[",
"'output'",
"]",
"is",
"None",
":",
"return",
"None",
"extension",
"=",
"opt",
"[",
"'output'",
"]",
".",
"split",
"(",
"\".\"",
")",
"[",
"-",
"1",
"]",
"if",
"extension",
"not",
"in",
"[",
"\"html\"",
",",
"\"pdf\"",
",",
"\"png\"",
"]",
":",
"raise",
"Exception",
"(",
"\"Extension not specified/supported. Specify one of '.html', '.pdf' or '.png' output files\"",
")",
"opt",
"[",
"'user_icon'",
"]",
"=",
"check_icon_arg",
"(",
"opt",
"[",
"'user_icon'",
"]",
",",
"HUMAN_EMOJI_IMG",
")",
"opt",
"[",
"'alt_icon'",
"]",
"=",
"check_icon_arg",
"(",
"opt",
"[",
"'alt_icon'",
"]",
",",
"ALT_EMOJI_IMG",
")",
"return",
"extension"
] | [
274,
0
] | [
293,
20
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter.marker
.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
|
Construct a new Tickfont object
Sets the color bar's tick label font | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scatter.marker
.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
"""
super(Tickfont, self).__init__("tickfont")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scatter.marker.colorbar.Tickfont
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatter.marker.colorbar.Tickfont`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("family", None)
_v = family if family is not None else _v
if _v is not None:
self["family"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scatter.marker.colorbar.Tickfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatter.marker.colorbar.Tickfont`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"family\"",
",",
"None",
")",
"_v",
"=",
"family",
"if",
"family",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"family\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
Stream.maxpoints | (self) |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]
Returns
-------
int|float
|
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000] | def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]
Returns
-------
int|float
"""
return self["maxpoints"] | [
"def",
"maxpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"maxpoints\"",
"]"
] | [
15,
4
] | [
28,
32
] | python | en | ['en', 'error', 'th'] | False |
Stream.token | (self) |
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string | def token(self):
"""
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["token"] | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"token\"",
"]"
] | [
37,
4
] | [
50,
28
] | python | en | ['en', 'error', 'th'] | False |
Stream.__init__ | (self, arg=None, maxpoints=None, token=None, **kwargs) |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcoords.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details.
Returns
-------
Stream
|
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcoords.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details. | def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):
"""
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.parcoords.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details.
Returns
-------
Stream
"""
super(Stream, self).__init__("stream")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.parcoords.Stream
constructor must be a dict or
an instance of :class:`plotly.graph_objs.parcoords.Stream`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("maxpoints", None)
_v = maxpoints if maxpoints is not None else _v
if _v is not None:
self["maxpoints"] = _v
_v = arg.pop("token", None)
_v = token if token is not None else _v
if _v is not None:
self["token"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.parcoords.Stream \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.parcoords.Stream`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"maxpoints\"",
",",
"None",
")",
"_v",
"=",
"maxpoints",
"if",
"maxpoints",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"maxpoints\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"token\"",
",",
"None",
")",
"_v",
"=",
"token",
"if",
"token",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"token\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
72,
4
] | [
140,
34
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.dtickrange | (self) |
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
|
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type | def dtickrange(self):
"""
range [*min*, *max*], where "min", "max" - dtick values which
describe some zoom level, it is possible to omit "min" or "max"
value by passing "null"
The 'dtickrange' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'dtickrange[0]' property accepts values of any type
(1) The 'dtickrange[1]' property accepts values of any type
Returns
-------
list
"""
return self["dtickrange"] | [
"def",
"dtickrange",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtickrange\"",
"]"
] | [
15,
4
] | [
31,
33
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.enabled | (self) |
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False) | def enabled(self):
"""
Determines whether or not this stop is used. If `false`, this
stop is ignored even within its `dtickrange`.
The 'enabled' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["enabled"] | [
"def",
"enabled",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"enabled\"",
"]"
] | [
40,
4
] | [
52,
30
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.name | (self) |
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def name(self):
"""
When used in a template, named items are created in the output
figure in addition to any items the figure already has in this
array. You can modify these items in the output figure by
making your own item with `templateitemname` matching this
`name` alongside your modifications (including `visible: false`
or `enabled: false` to hide it). Has no effect outside of a
template.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
61,
4
] | [
79,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.templateitemname | (self) |
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def templateitemname(self):
"""
Used to refer to a named item in this array in the template.
Named items from the template will be created even without a
matching item in the input figure, but you can modify one by
making an item with `templateitemname` matching its `name`,
alongside your modifications (including `visible: false` or
`enabled: false` to hide it). If there is no template or no
matching item, this item will be hidden unless you explicitly
show it with `visible: true`.
The 'templateitemname' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["templateitemname"] | [
"def",
"templateitemname",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"templateitemname\"",
"]"
] | [
88,
4
] | [
107,
39
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.value | (self) |
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def value(self):
"""
string - dtickformat for described zoom level, the same as
"tickformat"
The 'value' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["value"] | [
"def",
"value",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"value\"",
"]"
] | [
116,
4
] | [
129,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickformatstop.__init__ | (
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
) |
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.streamtube.col
orbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
|
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.streamtube.col
orbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat" | def __init__(
self,
arg=None,
dtickrange=None,
enabled=None,
name=None,
templateitemname=None,
value=None,
**kwargs
):
"""
Construct a new Tickformatstop object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.streamtube.col
orbar.Tickformatstop`
dtickrange
range [*min*, *max*], where "min", "max" - dtick values
which describe some zoom level, it is possible to omit
"min" or "max" value by passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are created in the
output figure in addition to any items the figure
already has in this array. You can modify these items
in the output figure by making your own item with
`templateitemname` matching this `name` alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). Has no effect outside of a
template.
templateitemname
Used to refer to a named item in this array in the
template. Named items from the template will be created
even without a matching item in the input figure, but
you can modify one by making an item with
`templateitemname` matching its `name`, alongside your
modifications (including `visible: false` or `enabled:
false` to hide it). If there is no template or no
matching item, this item will be hidden unless you
explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level, the same
as "tickformat"
Returns
-------
Tickformatstop
"""
super(Tickformatstop, self).__init__("tickformatstops")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.streamtube.colorbar.Tickformatstop
constructor must be a dict or
an instance of :class:`plotly.graph_objs.streamtube.colorbar.Tickformatstop`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("dtickrange", None)
_v = dtickrange if dtickrange is not None else _v
if _v is not None:
self["dtickrange"] = _v
_v = arg.pop("enabled", None)
_v = enabled if enabled is not None else _v
if _v is not None:
self["enabled"] = _v
_v = arg.pop("name", None)
_v = name if name is not None else _v
if _v is not None:
self["name"] = _v
_v = arg.pop("templateitemname", None)
_v = templateitemname if templateitemname is not None else _v
if _v is not None:
self["templateitemname"] = _v
_v = arg.pop("value", None)
_v = value if value is not None else _v
if _v is not None:
self["value"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"dtickrange",
"=",
"None",
",",
"enabled",
"=",
"None",
",",
"name",
"=",
"None",
",",
"templateitemname",
"=",
"None",
",",
"value",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickformatstop",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickformatstops\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.streamtube.colorbar.Tickformatstop \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.streamtube.colorbar.Tickformatstop`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"dtickrange\"",
",",
"None",
")",
"_v",
"=",
"dtickrange",
"if",
"dtickrange",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dtickrange\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"enabled\"",
",",
"None",
")",
"_v",
"=",
"enabled",
"if",
"enabled",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"enabled\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"name\"",
",",
"None",
")",
"_v",
"=",
"name",
"if",
"name",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"name\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"templateitemname\"",
",",
"None",
")",
"_v",
"=",
"templateitemname",
"if",
"templateitemname",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"templateitemname\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"value\"",
",",
"None",
")",
"_v",
"=",
"value",
"if",
"value",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"value\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
172,
4
] | [
282,
34
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.array | (self) |
Sets the data corresponding the length of each error bar.
Values are plotted relative to the underlying data.
The 'array' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the data corresponding the length of each error bar.
Values are plotted relative to the underlying data.
The 'array' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def array(self):
"""
Sets the data corresponding the length of each error bar.
Values are plotted relative to the underlying data.
The 'array' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["array"] | [
"def",
"array",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"array\"",
"]"
] | [
31,
4
] | [
43,
28
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.arrayminus | (self) |
Sets the data corresponding the length of each error bar in the
bottom (left) direction for vertical (horizontal) bars Values
are plotted relative to the underlying data.
The 'arrayminus' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the data corresponding the length of each error bar in the
bottom (left) direction for vertical (horizontal) bars Values
are plotted relative to the underlying data.
The 'arrayminus' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def arrayminus(self):
"""
Sets the data corresponding the length of each error bar in the
bottom (left) direction for vertical (horizontal) bars Values
are plotted relative to the underlying data.
The 'arrayminus' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["arrayminus"] | [
"def",
"arrayminus",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"arrayminus\"",
"]"
] | [
52,
4
] | [
65,
33
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.arrayminussrc | (self) |
Sets the source reference on Chart Studio Cloud for arrayminus
.
The 'arrayminussrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for arrayminus
.
The 'arrayminussrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def arrayminussrc(self):
"""
Sets the source reference on Chart Studio Cloud for arrayminus
.
The 'arrayminussrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["arrayminussrc"] | [
"def",
"arrayminussrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"arrayminussrc\"",
"]"
] | [
74,
4
] | [
86,
36
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.arraysrc | (self) |
Sets the source reference on Chart Studio Cloud for array .
The 'arraysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for array .
The 'arraysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def arraysrc(self):
"""
Sets the source reference on Chart Studio Cloud for array .
The 'arraysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["arraysrc"] | [
"def",
"arraysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"arraysrc\"",
"]"
] | [
95,
4
] | [
106,
31
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.color | (self) |
Sets the stoke color of the error bars.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the stoke color of the error bars.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
Sets the stoke color of the error bars.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
115,
4
] | [
165,
28
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.copy_zstyle | (self) |
The 'copy_zstyle' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
The 'copy_zstyle' property must be specified as a bool
(either True, or False) | def copy_zstyle(self):
"""
The 'copy_zstyle' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["copy_zstyle"] | [
"def",
"copy_zstyle",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"copy_zstyle\"",
"]"
] | [
174,
4
] | [
183,
34
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.symmetric | (self) |
Determines whether or not the error bars have the same length
in both direction (top/bottom for vertical bars, left/right for
horizontal bars.
The 'symmetric' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the error bars have the same length
in both direction (top/bottom for vertical bars, left/right for
horizontal bars.
The 'symmetric' property must be specified as a bool
(either True, or False) | def symmetric(self):
"""
Determines whether or not the error bars have the same length
in both direction (top/bottom for vertical bars, left/right for
horizontal bars.
The 'symmetric' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["symmetric"] | [
"def",
"symmetric",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"symmetric\"",
"]"
] | [
192,
4
] | [
205,
32
] | python | en | ['en', 'error', 'th'] | False |
ErrorX.thickness | (self) |
Sets the thickness (in px) of the error bars.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the thickness (in px) of the error bars.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def thickness(self):
"""
Sets the thickness (in px) of the error bars.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["thickness"] | [
"def",
"thickness",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thickness\"",
"]"
] | [
214,
4
] | [
225,
32
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.