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
sequence
start_point
sequence
end_point
sequence
language
stringclasses
1 value
docstring_language
stringlengths
2
7
docstring_language_predictions
stringlengths
18
23
is_langid_reliable
stringclasses
2 values
Updatemenu.bordercolor
(self)
Sets the color of the border enclosing the update menu. 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 Returns ------- str
Sets the color of the border enclosing the update menu. 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
def bordercolor(self): """ Sets the color of the border enclosing the update menu. 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 Returns ------- str """ return self["bordercolor"]
[ "def", "bordercolor", "(", "self", ")", ":", "return", "self", "[", "\"bordercolor\"", "]" ]
[ 115, 4 ]
[ 165, 34 ]
python
en
['en', 'error', 'th']
False
Updatemenu.borderwidth
(self)
Sets the width (in px) of the border enclosing the update menu. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float
Sets the width (in px) of the border enclosing the update menu. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf]
def borderwidth(self): """ Sets the width (in px) of the border enclosing the update menu. The 'borderwidth' property is a number and may be specified as: - An int or float in the interval [0, inf] Returns ------- int|float """ return self["borderwidth"]
[ "def", "borderwidth", "(", "self", ")", ":", "return", "self", "[", "\"borderwidth\"", "]" ]
[ 174, 4 ]
[ 185, 34 ]
python
en
['en', 'error', 'th']
False
Updatemenu.buttons
(self)
The 'buttons' property is a tuple of instances of Button that may be specified as: - A list or tuple of instances of plotly.graph_objs.layout.updatemenu.Button - A list or tuple of dicts of string/value properties that will be passed to the Button constructor Supported dict properties: args Sets the arguments values to be passed to the Plotly method set in `method` on click. args2 Sets a 2nd set of `args`, these arguments values are passed to the Plotly method set in `method` when clicking this button while in the active state. Use this to create toggle buttons. execute When true, the API method is executed. When false, all other behaviors are the same and command execution is skipped. This may be useful when hooking into, for example, the `plotly_buttonclicked` method and executing the API command manually without losing the benefit of the updatemenu automatically binding to the state of the plot through the specification of `method` and `args`. label Sets the text label to appear on the button. method Sets the Plotly method to be called on click. If the `skip` method is used, the API updatemenu will function as normal but will perform no API calls and will not bind automatically to state updates. This may be used to create a component interface and attach to updatemenu events manually via JavaScript. 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`. visible Determines whether or not this button is visible. Returns ------- tuple[plotly.graph_objs.layout.updatemenu.Button]
The 'buttons' property is a tuple of instances of Button that may be specified as: - A list or tuple of instances of plotly.graph_objs.layout.updatemenu.Button - A list or tuple of dicts of string/value properties that will be passed to the Button constructor Supported dict properties: args Sets the arguments values to be passed to the Plotly method set in `method` on click. args2 Sets a 2nd set of `args`, these arguments values are passed to the Plotly method set in `method` when clicking this button while in the active state. Use this to create toggle buttons. execute When true, the API method is executed. When false, all other behaviors are the same and command execution is skipped. This may be useful when hooking into, for example, the `plotly_buttonclicked` method and executing the API command manually without losing the benefit of the updatemenu automatically binding to the state of the plot through the specification of `method` and `args`. label Sets the text label to appear on the button. method Sets the Plotly method to be called on click. If the `skip` method is used, the API updatemenu will function as normal but will perform no API calls and will not bind automatically to state updates. This may be used to create a component interface and attach to updatemenu events manually via JavaScript. 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`. visible Determines whether or not this button is visible.
def buttons(self): """ The 'buttons' property is a tuple of instances of Button that may be specified as: - A list or tuple of instances of plotly.graph_objs.layout.updatemenu.Button - A list or tuple of dicts of string/value properties that will be passed to the Button constructor Supported dict properties: args Sets the arguments values to be passed to the Plotly method set in `method` on click. args2 Sets a 2nd set of `args`, these arguments values are passed to the Plotly method set in `method` when clicking this button while in the active state. Use this to create toggle buttons. execute When true, the API method is executed. When false, all other behaviors are the same and command execution is skipped. This may be useful when hooking into, for example, the `plotly_buttonclicked` method and executing the API command manually without losing the benefit of the updatemenu automatically binding to the state of the plot through the specification of `method` and `args`. label Sets the text label to appear on the button. method Sets the Plotly method to be called on click. If the `skip` method is used, the API updatemenu will function as normal but will perform no API calls and will not bind automatically to state updates. This may be used to create a component interface and attach to updatemenu events manually via JavaScript. 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`. visible Determines whether or not this button is visible. Returns ------- tuple[plotly.graph_objs.layout.updatemenu.Button] """ return self["buttons"]
[ "def", "buttons", "(", "self", ")", ":", "return", "self", "[", "\"buttons\"", "]" ]
[ 194, 4 ]
[ 262, 30 ]
python
en
['en', 'error', 'th']
False
Updatemenu.buttondefaults
(self)
When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons The 'buttondefaults' property is an instance of Button that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Button` - A dict of string/value properties that will be passed to the Button constructor Supported dict properties: Returns ------- plotly.graph_objs.layout.updatemenu.Button
When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons The 'buttondefaults' property is an instance of Button that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Button` - A dict of string/value properties that will be passed to the Button constructor Supported dict properties:
def buttondefaults(self): """ When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons The 'buttondefaults' property is an instance of Button that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Button` - A dict of string/value properties that will be passed to the Button constructor Supported dict properties: Returns ------- plotly.graph_objs.layout.updatemenu.Button """ return self["buttondefaults"]
[ "def", "buttondefaults", "(", "self", ")", ":", "return", "self", "[", "\"buttondefaults\"", "]" ]
[ 271, 4 ]
[ 290, 37 ]
python
en
['en', 'error', 'th']
False
Updatemenu.direction
(self)
Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. The 'direction' property is an enumeration that may be specified as: - One of the following enumeration values: ['left', 'right', 'up', 'down'] Returns ------- Any
Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. The 'direction' property is an enumeration that may be specified as: - One of the following enumeration values: ['left', 'right', 'up', 'down']
def direction(self): """ Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. The 'direction' property is an enumeration that may be specified as: - One of the following enumeration values: ['left', 'right', 'up', 'down'] Returns ------- Any """ return self["direction"]
[ "def", "direction", "(", "self", ")", ":", "return", "self", "[", "\"direction\"", "]" ]
[ 299, 4 ]
[ 314, 32 ]
python
en
['en', 'error', 'th']
False
Updatemenu.font
(self)
Sets the font of the update menu button text. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.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.layout.updatemenu.Font
Sets the font of the update menu button text. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.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 the font of the update menu button text. The 'font' property is an instance of Font that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.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.layout.updatemenu.Font """ return self["font"]
[ "def", "font", "(", "self", ")", ":", "return", "self", "[", "\"font\"", "]" ]
[ 323, 4 ]
[ 360, 27 ]
python
en
['en', 'error', 'th']
False
Updatemenu.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\"", "]" ]
[ 369, 4 ]
[ 387, 27 ]
python
en
['en', 'error', 'th']
False
Updatemenu.pad
(self)
Sets the padding around the buttons or dropdown menu. The 'pad' property is an instance of Pad that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Pad` - A dict of string/value properties that will be passed to the Pad constructor Supported dict properties: b The amount of padding (in px) along the bottom of the component. l The amount of padding (in px) on the left side of the component. r The amount of padding (in px) on the right side of the component. t The amount of padding (in px) along the top of the component. Returns ------- plotly.graph_objs.layout.updatemenu.Pad
Sets the padding around the buttons or dropdown menu. The 'pad' property is an instance of Pad that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Pad` - A dict of string/value properties that will be passed to the Pad constructor Supported dict properties: b The amount of padding (in px) along the bottom of the component. l The amount of padding (in px) on the left side of the component. r The amount of padding (in px) on the right side of the component. t The amount of padding (in px) along the top of the component.
def pad(self): """ Sets the padding around the buttons or dropdown menu. The 'pad' property is an instance of Pad that may be specified as: - An instance of :class:`plotly.graph_objs.layout.updatemenu.Pad` - A dict of string/value properties that will be passed to the Pad constructor Supported dict properties: b The amount of padding (in px) along the bottom of the component. l The amount of padding (in px) on the left side of the component. r The amount of padding (in px) on the right side of the component. t The amount of padding (in px) along the top of the component. Returns ------- plotly.graph_objs.layout.updatemenu.Pad """ return self["pad"]
[ "def", "pad", "(", "self", ")", ":", "return", "self", "[", "\"pad\"", "]" ]
[ 396, 4 ]
[ 425, 26 ]
python
en
['en', 'error', 'th']
False
Updatemenu.showactive
(self)
Highlights active dropdown item or active button if true. The 'showactive' property must be specified as a bool (either True, or False) Returns ------- bool
Highlights active dropdown item or active button if true. The 'showactive' property must be specified as a bool (either True, or False)
def showactive(self): """ Highlights active dropdown item or active button if true. The 'showactive' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["showactive"]
[ "def", "showactive", "(", "self", ")", ":", "return", "self", "[", "\"showactive\"", "]" ]
[ 434, 4 ]
[ 445, 33 ]
python
en
['en', 'error', 'th']
False
Updatemenu.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\"", "]" ]
[ 454, 4 ]
[ 473, 39 ]
python
en
['en', 'error', 'th']
False
Updatemenu.type
(self)
Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically The 'type' property is an enumeration that may be specified as: - One of the following enumeration values: ['dropdown', 'buttons'] Returns ------- Any
Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically The 'type' property is an enumeration that may be specified as: - One of the following enumeration values: ['dropdown', 'buttons']
def type(self): """ Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically The 'type' property is an enumeration that may be specified as: - One of the following enumeration values: ['dropdown', 'buttons'] Returns ------- Any """ return self["type"]
[ "def", "type", "(", "self", ")", ":", "return", "self", "[", "\"type\"", "]" ]
[ 482, 4 ]
[ 496, 27 ]
python
en
['en', 'error', 'th']
False
Updatemenu.visible
(self)
Determines whether or not the update menu is visible. The 'visible' property must be specified as a bool (either True, or False) Returns ------- bool
Determines whether or not the update menu is visible. The 'visible' property must be specified as a bool (either True, or False)
def visible(self): """ Determines whether or not the update menu is visible. The 'visible' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["visible"]
[ "def", "visible", "(", "self", ")", ":", "return", "self", "[", "\"visible\"", "]" ]
[ 505, 4 ]
[ 516, 30 ]
python
en
['en', 'error', 'th']
False
Updatemenu.x
(self)
Sets the x position (in normalized coordinates) of the update menu. The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float
Sets the x position (in normalized coordinates) of the update menu. The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3]
def x(self): """ Sets the x position (in normalized coordinates) of the update menu. The 'x' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float """ return self["x"]
[ "def", "x", "(", "self", ")", ":", "return", "self", "[", "\"x\"", "]" ]
[ 525, 4 ]
[ 537, 24 ]
python
en
['en', 'error', 'th']
False
Updatemenu.xanchor
(self)
Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'left', 'center', 'right'] Returns ------- Any
Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'left', 'center', 'right']
def xanchor(self): """ Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. The 'xanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'left', 'center', 'right'] Returns ------- Any """ return self["xanchor"]
[ "def", "xanchor", "(", "self", ")", ":", "return", "self", "[", "\"xanchor\"", "]" ]
[ 546, 4 ]
[ 560, 30 ]
python
en
['en', 'error', 'th']
False
Updatemenu.y
(self)
Sets the y position (in normalized coordinates) of the update menu. The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float
Sets the y position (in normalized coordinates) of the update menu. The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3]
def y(self): """ Sets the y position (in normalized coordinates) of the update menu. The 'y' property is a number and may be specified as: - An int or float in the interval [-2, 3] Returns ------- int|float """ return self["y"]
[ "def", "y", "(", "self", ")", ":", "return", "self", "[", "\"y\"", "]" ]
[ 569, 4 ]
[ 581, 24 ]
python
en
['en', 'error', 'th']
False
Updatemenu.yanchor
(self)
Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'top', 'middle', 'bottom'] Returns ------- Any
Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'top', 'middle', 'bottom']
def yanchor(self): """ Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector. The 'yanchor' property is an enumeration that may be specified as: - One of the following enumeration values: ['auto', 'top', 'middle', 'bottom'] Returns ------- Any """ return self["yanchor"]
[ "def", "yanchor", "(", "self", ")", ":", "return", "self", "[", "\"yanchor\"", "]" ]
[ 590, 4 ]
[ 604, 30 ]
python
en
['en', 'error', 'th']
False
Updatemenu.__init__
( self, arg=None, active=None, bgcolor=None, bordercolor=None, borderwidth=None, buttons=None, buttondefaults=None, direction=None, font=None, name=None, pad=None, showactive=None, templateitemname=None, type=None, visible=None, x=None, xanchor=None, y=None, yanchor=None, **kwargs )
Construct a new Updatemenu object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.layout.Updatemenu` active Determines which button (by index starting from 0) is considered active. bgcolor Sets the background color of the update menu buttons. bordercolor Sets the color of the border enclosing the update menu. borderwidth Sets the width (in px) of the border enclosing the update menu. buttons A tuple of :class:`plotly.graph_objects.layout.updatemenu.Button` instances or dicts with compatible properties buttondefaults When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons direction Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. font Sets the font of the update menu button text. 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. pad Sets the padding around the buttons or dropdown menu. showactive Highlights active dropdown item or active button if true. 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`. type Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically visible Determines whether or not the update menu is visible. x Sets the x position (in normalized coordinates) of the update menu. xanchor Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. y Sets the y position (in normalized coordinates) of the update menu. yanchor Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector. Returns ------- Updatemenu
Construct a new Updatemenu object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.layout.Updatemenu` active Determines which button (by index starting from 0) is considered active. bgcolor Sets the background color of the update menu buttons. bordercolor Sets the color of the border enclosing the update menu. borderwidth Sets the width (in px) of the border enclosing the update menu. buttons A tuple of :class:`plotly.graph_objects.layout.updatemenu.Button` instances or dicts with compatible properties buttondefaults When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons direction Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. font Sets the font of the update menu button text. 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. pad Sets the padding around the buttons or dropdown menu. showactive Highlights active dropdown item or active button if true. 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`. type Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically visible Determines whether or not the update menu is visible. x Sets the x position (in normalized coordinates) of the update menu. xanchor Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. y Sets the y position (in normalized coordinates) of the update menu. yanchor Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector.
def __init__( self, arg=None, active=None, bgcolor=None, bordercolor=None, borderwidth=None, buttons=None, buttondefaults=None, direction=None, font=None, name=None, pad=None, showactive=None, templateitemname=None, type=None, visible=None, x=None, xanchor=None, y=None, yanchor=None, **kwargs ): """ Construct a new Updatemenu object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.layout.Updatemenu` active Determines which button (by index starting from 0) is considered active. bgcolor Sets the background color of the update menu buttons. bordercolor Sets the color of the border enclosing the update menu. borderwidth Sets the width (in px) of the border enclosing the update menu. buttons A tuple of :class:`plotly.graph_objects.layout.updatemenu.Button` instances or dicts with compatible properties buttondefaults When used in a template (as layout.template.layout.updatemenu.buttondefaults), sets the default property values to use for elements of layout.updatemenu.buttons direction Determines the direction in which the buttons are laid out, whether in a dropdown menu or a row/column of buttons. For `left` and `up`, the buttons will still appear in left-to-right or top-to-bottom order respectively. font Sets the font of the update menu button text. 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. pad Sets the padding around the buttons or dropdown menu. showactive Highlights active dropdown item or active button if true. 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`. type Determines whether the buttons are accessible via a dropdown menu or whether the buttons are stacked horizontally or vertically visible Determines whether or not the update menu is visible. x Sets the x position (in normalized coordinates) of the update menu. xanchor Sets the update menu's horizontal position anchor. This anchor binds the `x` position to the "left", "center" or "right" of the range selector. y Sets the y position (in normalized coordinates) of the update menu. yanchor Sets the update menu's vertical position anchor This anchor binds the `y` position to the "top", "middle" or "bottom" of the range selector. Returns ------- Updatemenu """ super(Updatemenu, self).__init__("updatemenus") 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.Updatemenu constructor must be a dict or an instance of :class:`plotly.graph_objs.layout.Updatemenu`""" ) # 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("active", None) _v = active if active is not None else _v if _v is not None: self["active"] = _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("bordercolor", None) _v = bordercolor if bordercolor is not None else _v if _v is not None: self["bordercolor"] = _v _v = arg.pop("borderwidth", None) _v = borderwidth if borderwidth is not None else _v if _v is not None: self["borderwidth"] = _v _v = arg.pop("buttons", None) _v = buttons if buttons is not None else _v if _v is not None: self["buttons"] = _v _v = arg.pop("buttondefaults", None) _v = buttondefaults if buttondefaults is not None else _v if _v is not None: self["buttondefaults"] = _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("font", None) _v = font if font is not None else _v if _v is not None: self["font"] = _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("pad", None) _v = pad if pad is not None else _v if _v is not None: self["pad"] = _v _v = arg.pop("showactive", None) _v = showactive if showactive is not None else _v if _v is not None: self["showactive"] = _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("type", None) _v = type if type is not None else _v if _v is not None: self["type"] = _v _v = arg.pop("visible", None) _v = visible if visible is not None else _v if _v is not None: self["visible"] = _v _v = arg.pop("x", None) _v = x if x is not None else _v if _v is not None: self["x"] = _v _v = arg.pop("xanchor", None) _v = xanchor if xanchor is not None else _v if _v is not None: self["xanchor"] = _v _v = arg.pop("y", None) _v = y if y is not None else _v if _v is not None: self["y"] = _v _v = arg.pop("yanchor", None) _v = yanchor if yanchor is not None else _v if _v is not None: self["yanchor"] = _v # Process unknown kwargs # ---------------------- self._process_kwargs(**dict(arg, **kwargs)) # Reset skip_invalid # ------------------ self._skip_invalid = False
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "active", "=", "None", ",", "bgcolor", "=", "None", ",", "bordercolor", "=", "None", ",", "borderwidth", "=", "None", ",", "buttons", "=", "None", ",", "buttondefaults", "=", "None", ",", "direction", "=", "None", ",", "font", "=", "None", ",", "name", "=", "None", ",", "pad", "=", "None", ",", "showactive", "=", "None", ",", "templateitemname", "=", "None", ",", "type", "=", "None", ",", "visible", "=", "None", ",", "x", "=", "None", ",", "xanchor", "=", "None", ",", "y", "=", "None", ",", "yanchor", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Updatemenu", ",", "self", ")", ".", "__init__", "(", "\"updatemenus\"", ")", "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.Updatemenu \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.Updatemenu`\"\"\"", ")", "# 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", "(", "\"active\"", ",", "None", ")", "_v", "=", "active", "if", "active", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"active\"", "]", "=", "_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", "(", "\"bordercolor\"", ",", "None", ")", "_v", "=", "bordercolor", "if", "bordercolor", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"bordercolor\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"borderwidth\"", ",", "None", ")", "_v", "=", "borderwidth", "if", "borderwidth", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"borderwidth\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"buttons\"", ",", "None", ")", "_v", "=", "buttons", "if", "buttons", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"buttons\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"buttondefaults\"", ",", "None", ")", "_v", "=", "buttondefaults", "if", "buttondefaults", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"buttondefaults\"", "]", "=", "_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", "(", "\"font\"", ",", "None", ")", "_v", "=", "font", "if", "font", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"font\"", "]", "=", "_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", "(", "\"pad\"", ",", "None", ")", "_v", "=", "pad", "if", "pad", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"pad\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"showactive\"", ",", "None", ")", "_v", "=", "showactive", "if", "showactive", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"showactive\"", "]", "=", "_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", "(", "\"type\"", ",", "None", ")", "_v", "=", "type", "if", "type", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"type\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"visible\"", ",", "None", ")", "_v", "=", "visible", "if", "visible", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"visible\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"x\"", ",", "None", ")", "_v", "=", "x", "if", "x", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"x\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"xanchor\"", ",", "None", ")", "_v", "=", "xanchor", "if", "xanchor", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"xanchor\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"y\"", ",", "None", ")", "_v", "=", "y", "if", "y", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"y\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"yanchor\"", ",", "None", ")", "_v", "=", "yanchor", "if", "yanchor", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"yanchor\"", "]", "=", "_v", "# Process unknown kwargs", "# ----------------------", "self", ".", "_process_kwargs", "(", "*", "*", "dict", "(", "arg", ",", "*", "*", "kwargs", ")", ")", "# Reset skip_invalid", "# ------------------", "self", ".", "_skip_invalid", "=", "False" ]
[ 688, 4 ]
[ 904, 34 ]
python
en
['en', 'error', 'th']
False
LocalHumanAgent.add_cmdline_args
( cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None )
Add command-line arguments specifically for this agent.
Add command-line arguments specifically for this agent.
def add_cmdline_args( cls, parser: ParlaiParser, partial_opt: Optional[Opt] = None ) -> ParlaiParser: """ Add command-line arguments specifically for this agent. """ agent = parser.add_argument_group('Local Human Arguments') agent.add_argument( '-fixedCands', '--local-human-candidates-file', default=None, type=str, help='File of label_candidates to send to other agent', ) agent.add_argument( '--single_turn', type='bool', default=False, help='If on, assumes single turn episodes.', ) return parser
[ "def", "add_cmdline_args", "(", "cls", ",", "parser", ":", "ParlaiParser", ",", "partial_opt", ":", "Optional", "[", "Opt", "]", "=", "None", ")", "->", "ParlaiParser", ":", "agent", "=", "parser", ".", "add_argument_group", "(", "'Local Human Arguments'", ")", "agent", ".", "add_argument", "(", "'-fixedCands'", ",", "'--local-human-candidates-file'", ",", "default", "=", "None", ",", "type", "=", "str", ",", "help", "=", "'File of label_candidates to send to other agent'", ",", ")", "agent", ".", "add_argument", "(", "'--single_turn'", ",", "type", "=", "'bool'", ",", "default", "=", "False", ",", "help", "=", "'If on, assumes single turn episodes.'", ",", ")", "return", "parser" ]
[ 22, 4 ]
[ 42, 21 ]
python
en
['en', 'error', 'th']
False
endpts_to_intervals
(endpts)
Returns a list of intervals for categorical colormaps Accepts a list or tuple of sequentially increasing numbers and returns a list representation of the mathematical intervals with these numbers as endpoints. For example, [1, 6] returns [[-inf, 1], [1, 6], [6, inf]] :raises: (PlotlyError) If input is not a list or tuple :raises: (PlotlyError) If the input contains a string :raises: (PlotlyError) If any number does not increase after the previous one in the sequence
Returns a list of intervals for categorical colormaps
def endpts_to_intervals(endpts): """ Returns a list of intervals for categorical colormaps Accepts a list or tuple of sequentially increasing numbers and returns a list representation of the mathematical intervals with these numbers as endpoints. For example, [1, 6] returns [[-inf, 1], [1, 6], [6, inf]] :raises: (PlotlyError) If input is not a list or tuple :raises: (PlotlyError) If the input contains a string :raises: (PlotlyError) If any number does not increase after the previous one in the sequence """ length = len(endpts) # Check if endpts is a list or tuple if not (isinstance(endpts, (tuple)) or isinstance(endpts, (list))): raise exceptions.PlotlyError( "The intervals_endpts argument must " "be a list or tuple of a sequence " "of increasing numbers." ) # Check if endpts contains only numbers for item in endpts: if isinstance(item, str): raise exceptions.PlotlyError( "The intervals_endpts argument " "must be a list or tuple of a " "sequence of increasing " "numbers." ) # Check if numbers in endpts are increasing for k in range(length - 1): if endpts[k] >= endpts[k + 1]: raise exceptions.PlotlyError( "The intervals_endpts argument " "must be a list or tuple of a " "sequence of increasing " "numbers." ) else: intervals = [] # add -inf to intervals intervals.append([float("-inf"), endpts[0]]) for k in range(length - 1): interval = [] interval.append(endpts[k]) interval.append(endpts[k + 1]) intervals.append(interval) # add +inf to intervals intervals.append([endpts[length - 1], float("inf")]) return intervals
[ "def", "endpts_to_intervals", "(", "endpts", ")", ":", "length", "=", "len", "(", "endpts", ")", "# Check if endpts is a list or tuple", "if", "not", "(", "isinstance", "(", "endpts", ",", "(", "tuple", ")", ")", "or", "isinstance", "(", "endpts", ",", "(", "list", ")", ")", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"The intervals_endpts argument must \"", "\"be a list or tuple of a sequence \"", "\"of increasing numbers.\"", ")", "# Check if endpts contains only numbers", "for", "item", "in", "endpts", ":", "if", "isinstance", "(", "item", ",", "str", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"The intervals_endpts argument \"", "\"must be a list or tuple of a \"", "\"sequence of increasing \"", "\"numbers.\"", ")", "# Check if numbers in endpts are increasing", "for", "k", "in", "range", "(", "length", "-", "1", ")", ":", "if", "endpts", "[", "k", "]", ">=", "endpts", "[", "k", "+", "1", "]", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"The intervals_endpts argument \"", "\"must be a list or tuple of a \"", "\"sequence of increasing \"", "\"numbers.\"", ")", "else", ":", "intervals", "=", "[", "]", "# add -inf to intervals", "intervals", ".", "append", "(", "[", "float", "(", "\"-inf\"", ")", ",", "endpts", "[", "0", "]", "]", ")", "for", "k", "in", "range", "(", "length", "-", "1", ")", ":", "interval", "=", "[", "]", "interval", ".", "append", "(", "endpts", "[", "k", "]", ")", "interval", ".", "append", "(", "endpts", "[", "k", "+", "1", "]", ")", "intervals", ".", "append", "(", "interval", ")", "# add +inf to intervals", "intervals", ".", "append", "(", "[", "endpts", "[", "length", "-", "1", "]", ",", "float", "(", "\"inf\"", ")", "]", ")", "return", "intervals" ]
[ 16, 0 ]
[ 66, 24 ]
python
en
['en', 'error', 'th']
False
hide_tick_labels_from_box_subplots
(fig)
Hides tick labels for box plots in scatterplotmatrix subplots.
Hides tick labels for box plots in scatterplotmatrix subplots.
def hide_tick_labels_from_box_subplots(fig): """ Hides tick labels for box plots in scatterplotmatrix subplots. """ boxplot_xaxes = [] for trace in fig["data"]: if trace["type"] == "box": # stores the xaxes which correspond to boxplot subplots # since we use xaxis1, xaxis2, etc, in plotly.py boxplot_xaxes.append("xaxis{}".format(trace["xaxis"][1:])) for xaxis in boxplot_xaxes: fig["layout"][xaxis]["showticklabels"] = False
[ "def", "hide_tick_labels_from_box_subplots", "(", "fig", ")", ":", "boxplot_xaxes", "=", "[", "]", "for", "trace", "in", "fig", "[", "\"data\"", "]", ":", "if", "trace", "[", "\"type\"", "]", "==", "\"box\"", ":", "# stores the xaxes which correspond to boxplot subplots", "# since we use xaxis1, xaxis2, etc, in plotly.py", "boxplot_xaxes", ".", "append", "(", "\"xaxis{}\"", ".", "format", "(", "trace", "[", "\"xaxis\"", "]", "[", "1", ":", "]", ")", ")", "for", "xaxis", "in", "boxplot_xaxes", ":", "fig", "[", "\"layout\"", "]", "[", "xaxis", "]", "[", "\"showticklabels\"", "]", "=", "False" ]
[ 69, 0 ]
[ 80, 54 ]
python
en
['en', 'error', 'th']
False
validate_scatterplotmatrix
(df, index, diag, colormap_type, **kwargs)
Validates basic inputs for FigureFactory.create_scatterplotmatrix() :raises: (PlotlyError) If pandas is not imported :raises: (PlotlyError) If pandas dataframe is not inputted :raises: (PlotlyError) If pandas dataframe has <= 1 columns :raises: (PlotlyError) If diagonal plot choice (diag) is not one of the viable options :raises: (PlotlyError) If colormap_type is not a valid choice :raises: (PlotlyError) If kwargs contains 'size', 'color' or 'colorscale'
Validates basic inputs for FigureFactory.create_scatterplotmatrix()
def validate_scatterplotmatrix(df, index, diag, colormap_type, **kwargs): """ Validates basic inputs for FigureFactory.create_scatterplotmatrix() :raises: (PlotlyError) If pandas is not imported :raises: (PlotlyError) If pandas dataframe is not inputted :raises: (PlotlyError) If pandas dataframe has <= 1 columns :raises: (PlotlyError) If diagonal plot choice (diag) is not one of the viable options :raises: (PlotlyError) If colormap_type is not a valid choice :raises: (PlotlyError) If kwargs contains 'size', 'color' or 'colorscale' """ if not pd: raise ImportError( "FigureFactory.scatterplotmatrix requires " "a pandas DataFrame." ) # Check if pandas dataframe if not isinstance(df, pd.core.frame.DataFrame): raise exceptions.PlotlyError( "Dataframe not inputed. Please " "use a pandas dataframe to pro" "duce a scatterplot matrix." ) # Check if dataframe is 1 column or less if len(df.columns) <= 1: raise exceptions.PlotlyError( "Dataframe has only one column. To " "use the scatterplot matrix, use at " "least 2 columns." ) # Check that diag parameter is a valid selection if diag not in DIAG_CHOICES: raise exceptions.PlotlyError( "Make sure diag is set to " "one of {}".format(DIAG_CHOICES) ) # Check that colormap_types is a valid selection if colormap_type not in VALID_COLORMAP_TYPES: raise exceptions.PlotlyError( "Must choose a valid colormap type. " "Either 'cat' or 'seq' for a cate" "gorical and sequential colormap " "respectively." ) # Check for not 'size' or 'color' in 'marker' of **kwargs if "marker" in kwargs: FORBIDDEN_PARAMS = ["size", "color", "colorscale"] if any(param in kwargs["marker"] for param in FORBIDDEN_PARAMS): raise exceptions.PlotlyError( "Your kwargs dictionary cannot " "include the 'size', 'color' or " "'colorscale' key words inside " "the marker dict since 'size' is " "already an argument of the " "scatterplot matrix function and " "both 'color' and 'colorscale " "are set internally." )
[ "def", "validate_scatterplotmatrix", "(", "df", ",", "index", ",", "diag", ",", "colormap_type", ",", "*", "*", "kwargs", ")", ":", "if", "not", "pd", ":", "raise", "ImportError", "(", "\"FigureFactory.scatterplotmatrix requires \"", "\"a pandas DataFrame.\"", ")", "# Check if pandas dataframe", "if", "not", "isinstance", "(", "df", ",", "pd", ".", "core", ".", "frame", ".", "DataFrame", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Dataframe not inputed. Please \"", "\"use a pandas dataframe to pro\"", "\"duce a scatterplot matrix.\"", ")", "# Check if dataframe is 1 column or less", "if", "len", "(", "df", ".", "columns", ")", "<=", "1", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Dataframe has only one column. To \"", "\"use the scatterplot matrix, use at \"", "\"least 2 columns.\"", ")", "# Check that diag parameter is a valid selection", "if", "diag", "not", "in", "DIAG_CHOICES", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Make sure diag is set to \"", "\"one of {}\"", ".", "format", "(", "DIAG_CHOICES", ")", ")", "# Check that colormap_types is a valid selection", "if", "colormap_type", "not", "in", "VALID_COLORMAP_TYPES", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Must choose a valid colormap type. \"", "\"Either 'cat' or 'seq' for a cate\"", "\"gorical and sequential colormap \"", "\"respectively.\"", ")", "# Check for not 'size' or 'color' in 'marker' of **kwargs", "if", "\"marker\"", "in", "kwargs", ":", "FORBIDDEN_PARAMS", "=", "[", "\"size\"", ",", "\"color\"", ",", "\"colorscale\"", "]", "if", "any", "(", "param", "in", "kwargs", "[", "\"marker\"", "]", "for", "param", "in", "FORBIDDEN_PARAMS", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Your kwargs dictionary cannot \"", "\"include the 'size', 'color' or \"", "\"'colorscale' key words inside \"", "\"the marker dict since 'size' is \"", "\"already an argument of the \"", "\"scatterplot matrix function and \"", "\"both 'color' and 'colorscale \"", "\"are set internally.\"", ")" ]
[ 83, 0 ]
[ 145, 13 ]
python
en
['en', 'error', 'th']
False
scatterplot
(dataframe, headers, diag, size, height, width, title, **kwargs)
Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix without index
Refer to FigureFactory.create_scatterplotmatrix() for docstring
def scatterplot(dataframe, headers, diag, size, height, width, title, **kwargs): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix without index """ dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] # Insert traces into trace_list for listy in dataframe: for listx in dataframe: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram(x=listx, showlegend=False) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box(y=listx, name=None, showlegend=False) else: if "marker" in kwargs: kwargs["marker"]["size"] = size trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", showlegend=False, **kwargs ) trace_list.append(trace) else: trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", marker=dict(size=size), showlegend=False, **kwargs ) trace_list.append(trace) trace_index = 0 indices = range(1, dim + 1) for y_index in indices: for x_index in indices: fig.append_trace(trace_list[trace_index], y_index, x_index) trace_index += 1 # Insert headers into the figure for j in range(dim): xaxis_key = "xaxis{}".format((dim * dim) - dim + 1 + j) fig["layout"][xaxis_key].update(title=headers[j]) for j in range(dim): yaxis_key = "yaxis{}".format(1 + (dim * j)) fig["layout"][yaxis_key].update(title=headers[j]) fig["layout"].update(height=height, width=width, title=title, showlegend=True) hide_tick_labels_from_box_subplots(fig) return fig
[ "def", "scatterplot", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "*", "*", "kwargs", ")", ":", "dim", "=", "len", "(", "dataframe", ")", "fig", "=", "make_subplots", "(", "rows", "=", "dim", ",", "cols", "=", "dim", ",", "print_grid", "=", "False", ")", "trace_list", "=", "[", "]", "# Insert traces into trace_list", "for", "listy", "in", "dataframe", ":", "for", "listx", "in", "dataframe", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "listx", ",", "showlegend", "=", "False", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "listx", ",", "name", "=", "None", ",", "showlegend", "=", "False", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "trace_list", ".", "append", "(", "trace", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "marker", "=", "dict", "(", "size", "=", "size", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "trace_list", ".", "append", "(", "trace", ")", "trace_index", "=", "0", "indices", "=", "range", "(", "1", ",", "dim", "+", "1", ")", "for", "y_index", "in", "indices", ":", "for", "x_index", "in", "indices", ":", "fig", ".", "append_trace", "(", "trace_list", "[", "trace_index", "]", ",", "y_index", ",", "x_index", ")", "trace_index", "+=", "1", "# Insert headers into the figure", "for", "j", "in", "range", "(", "dim", ")", ":", "xaxis_key", "=", "\"xaxis{}\"", ".", "format", "(", "(", "dim", "*", "dim", ")", "-", "dim", "+", "1", "+", "j", ")", "fig", "[", "\"layout\"", "]", "[", "xaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "for", "j", "in", "range", "(", "dim", ")", ":", "yaxis_key", "=", "\"yaxis{}\"", ".", "format", "(", "1", "+", "(", "dim", "*", "j", ")", ")", "fig", "[", "\"layout\"", "]", "[", "yaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "hide_tick_labels_from_box_subplots", "(", "fig", ")", "return", "fig" ]
[ 148, 0 ]
[ 202, 14 ]
python
en
['en', 'error', 'th']
False
scatterplot_dict
( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs )
Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked. Used if colormap is a dictionary with index values as keys pointing to colors. Forces colormap_type to behave categorically because it would not make sense colors are assigned to each index value and thus implies that a categorical approach should be taken
Refer to FigureFactory.create_scatterplotmatrix() for docstring
def scatterplot_dict( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked. Used if colormap is a dictionary with index values as keys pointing to colors. Forces colormap_type to behave categorically because it would not make sense colors are assigned to each index value and thus implies that a categorical approach should be taken """ theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] legend_param = 0 # Work over all permutations of list pairs for listy in dataframe: for listx in dataframe: # create a dictionary for index_vals unique_index_vals = {} for name in index_vals: if name not in unique_index_vals: unique_index_vals[name] = [] # Fill all the rest of the names into the dictionary for name in sorted(unique_index_vals.keys()): new_listx = [] new_listy = [] for j in range(len(index_vals)): if index_vals[j] == name: new_listx.append(listx[j]) new_listy.append(listy[j]) # Generate trace with VISIBLE icon if legend_param == 1: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[name]), showlegend=True ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[name]), showlegend=True, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = theme[name] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, showlegend=True, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, marker=dict(size=size, color=theme[name]), showlegend=True, **kwargs ) # Generate trace with INVISIBLE icon else: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[name]), showlegend=False, ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[name]), showlegend=False, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = theme[name] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, showlegend=False, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, marker=dict(size=size, color=theme[name]), showlegend=False, **kwargs ) # Push the trace into dictionary unique_index_vals[name] = trace trace_list.append(unique_index_vals) legend_param += 1 trace_index = 0 indices = range(1, dim + 1) for y_index in indices: for x_index in indices: for name in sorted(trace_list[trace_index].keys()): fig.append_trace(trace_list[trace_index][name], y_index, x_index) trace_index += 1 # Insert headers into the figure for j in range(dim): xaxis_key = "xaxis{}".format((dim * dim) - dim + 1 + j) fig["layout"][xaxis_key].update(title=headers[j]) for j in range(dim): yaxis_key = "yaxis{}".format(1 + (dim * j)) fig["layout"][yaxis_key].update(title=headers[j]) hide_tick_labels_from_box_subplots(fig) if diag == "histogram": fig["layout"].update( height=height, width=width, title=title, showlegend=True, barmode="stack" ) return fig else: fig["layout"].update(height=height, width=width, title=title, showlegend=True) return fig
[ "def", "scatterplot_dict", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "index", ",", "index_vals", ",", "endpts", ",", "colormap", ",", "colormap_type", ",", "*", "*", "kwargs", ")", ":", "theme", "=", "colormap", "dim", "=", "len", "(", "dataframe", ")", "fig", "=", "make_subplots", "(", "rows", "=", "dim", ",", "cols", "=", "dim", ",", "print_grid", "=", "False", ")", "trace_list", "=", "[", "]", "legend_param", "=", "0", "# Work over all permutations of list pairs", "for", "listy", "in", "dataframe", ":", "for", "listx", "in", "dataframe", ":", "# create a dictionary for index_vals", "unique_index_vals", "=", "{", "}", "for", "name", "in", "index_vals", ":", "if", "name", "not", "in", "unique_index_vals", ":", "unique_index_vals", "[", "name", "]", "=", "[", "]", "# Fill all the rest of the names into the dictionary", "for", "name", "in", "sorted", "(", "unique_index_vals", ".", "keys", "(", ")", ")", ":", "new_listx", "=", "[", "]", "new_listy", "=", "[", "]", "for", "j", "in", "range", "(", "len", "(", "index_vals", ")", ")", ":", "if", "index_vals", "[", "j", "]", "==", "name", ":", "new_listx", ".", "append", "(", "listx", "[", "j", "]", ")", "new_listy", ".", "append", "(", "listy", "[", "j", "]", ")", "# Generate trace with VISIBLE icon", "if", "legend_param", "==", "1", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "True", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "True", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "theme", "[", "name", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "# Generate trace with INVISIBLE icon", "else", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "False", ",", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "False", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "theme", "[", "name", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "name", "]", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "# Push the trace into dictionary", "unique_index_vals", "[", "name", "]", "=", "trace", "trace_list", ".", "append", "(", "unique_index_vals", ")", "legend_param", "+=", "1", "trace_index", "=", "0", "indices", "=", "range", "(", "1", ",", "dim", "+", "1", ")", "for", "y_index", "in", "indices", ":", "for", "x_index", "in", "indices", ":", "for", "name", "in", "sorted", "(", "trace_list", "[", "trace_index", "]", ".", "keys", "(", ")", ")", ":", "fig", ".", "append_trace", "(", "trace_list", "[", "trace_index", "]", "[", "name", "]", ",", "y_index", ",", "x_index", ")", "trace_index", "+=", "1", "# Insert headers into the figure", "for", "j", "in", "range", "(", "dim", ")", ":", "xaxis_key", "=", "\"xaxis{}\"", ".", "format", "(", "(", "dim", "*", "dim", ")", "-", "dim", "+", "1", "+", "j", ")", "fig", "[", "\"layout\"", "]", "[", "xaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "for", "j", "in", "range", "(", "dim", ")", ":", "yaxis_key", "=", "\"yaxis{}\"", ".", "format", "(", "1", "+", "(", "dim", "*", "j", ")", ")", "fig", "[", "\"layout\"", "]", "[", "yaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "hide_tick_labels_from_box_subplots", "(", "fig", ")", "if", "diag", "==", "\"histogram\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ",", "barmode", "=", "\"stack\"", ")", "return", "fig", "else", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig" ]
[ 205, 0 ]
[ 357, 18 ]
python
en
['en', 'error', 'th']
False
scatterplot_theme
( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs )
Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked
Refer to FigureFactory.create_scatterplotmatrix() for docstring
def scatterplot_theme( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ): """ Refer to FigureFactory.create_scatterplotmatrix() for docstring Returns fig for scatterplotmatrix with both index and colormap picked """ # Check if index is made of string values if isinstance(index_vals[0], str): unique_index_vals = [] for name in index_vals: if name not in unique_index_vals: unique_index_vals.append(name) n_colors_len = len(unique_index_vals) # Convert colormap to list of n RGB tuples if colormap_type == "seq": foo = clrs.color_parser(colormap, clrs.unlabel_rgb) foo = clrs.n_colors(foo[0], foo[1], n_colors_len) theme = clrs.color_parser(foo, clrs.label_rgb) if colormap_type == "cat": # leave list of colors the same way theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] legend_param = 0 # Work over all permutations of list pairs for listy in dataframe: for listx in dataframe: # create a dictionary for index_vals unique_index_vals = {} for name in index_vals: if name not in unique_index_vals: unique_index_vals[name] = [] c_indx = 0 # color index # Fill all the rest of the names into the dictionary for name in sorted(unique_index_vals.keys()): new_listx = [] new_listy = [] for j in range(len(index_vals)): if index_vals[j] == name: new_listx.append(listx[j]) new_listy.append(listy[j]) # Generate trace with VISIBLE icon if legend_param == 1: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[c_indx]), showlegend=True, ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[c_indx]), showlegend=True, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, showlegend=True, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, marker=dict(size=size, color=theme[c_indx]), showlegend=True, **kwargs ) # Generate trace with INVISIBLE icon else: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[c_indx]), showlegend=False, ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[c_indx]), showlegend=False, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, showlegend=False, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=name, marker=dict(size=size, color=theme[c_indx]), showlegend=False, **kwargs ) # Push the trace into dictionary unique_index_vals[name] = trace if c_indx >= (len(theme) - 1): c_indx = -1 c_indx += 1 trace_list.append(unique_index_vals) legend_param += 1 trace_index = 0 indices = range(1, dim + 1) for y_index in indices: for x_index in indices: for name in sorted(trace_list[trace_index].keys()): fig.append_trace(trace_list[trace_index][name], y_index, x_index) trace_index += 1 # Insert headers into the figure for j in range(dim): xaxis_key = "xaxis{}".format((dim * dim) - dim + 1 + j) fig["layout"][xaxis_key].update(title=headers[j]) for j in range(dim): yaxis_key = "yaxis{}".format(1 + (dim * j)) fig["layout"][yaxis_key].update(title=headers[j]) hide_tick_labels_from_box_subplots(fig) if diag == "histogram": fig["layout"].update( height=height, width=width, title=title, showlegend=True, barmode="stack", ) return fig elif diag == "box": fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig else: fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig else: if endpts: intervals = utils.endpts_to_intervals(endpts) # Convert colormap to list of n RGB tuples if colormap_type == "seq": foo = clrs.color_parser(colormap, clrs.unlabel_rgb) foo = clrs.n_colors(foo[0], foo[1], len(intervals)) theme = clrs.color_parser(foo, clrs.label_rgb) if colormap_type == "cat": # leave list of colors the same way theme = colormap dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] legend_param = 0 # Work over all permutations of list pairs for listy in dataframe: for listx in dataframe: interval_labels = {} for interval in intervals: interval_labels[str(interval)] = [] c_indx = 0 # color index # Fill all the rest of the names into the dictionary for interval in intervals: new_listx = [] new_listy = [] for j in range(len(index_vals)): if interval[0] < index_vals[j] <= interval[1]: new_listx.append(listx[j]) new_listy.append(listy[j]) # Generate trace with VISIBLE icon if legend_param == 1: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[c_indx]), showlegend=True, ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[c_indx]), showlegend=True, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size (kwargs["marker"]["color"]) = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=str(interval), showlegend=True, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=str(interval), marker=dict(size=size, color=theme[c_indx]), showlegend=True, **kwargs ) # Generate trace with INVISIBLE icon else: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=new_listx, marker=dict(color=theme[c_indx]), showlegend=False, ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=new_listx, name=None, marker=dict(color=theme[c_indx]), showlegend=False, ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size (kwargs["marker"]["color"]) = theme[c_indx] trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=str(interval), showlegend=False, **kwargs ) else: trace = graph_objs.Scatter( x=new_listx, y=new_listy, mode="markers", name=str(interval), marker=dict(size=size, color=theme[c_indx]), showlegend=False, **kwargs ) # Push the trace into dictionary interval_labels[str(interval)] = trace if c_indx >= (len(theme) - 1): c_indx = -1 c_indx += 1 trace_list.append(interval_labels) legend_param += 1 trace_index = 0 indices = range(1, dim + 1) for y_index in indices: for x_index in indices: for interval in intervals: fig.append_trace( trace_list[trace_index][str(interval)], y_index, x_index ) trace_index += 1 # Insert headers into the figure for j in range(dim): xaxis_key = "xaxis{}".format((dim * dim) - dim + 1 + j) fig["layout"][xaxis_key].update(title=headers[j]) for j in range(dim): yaxis_key = "yaxis{}".format(1 + (dim * j)) fig["layout"][yaxis_key].update(title=headers[j]) hide_tick_labels_from_box_subplots(fig) if diag == "histogram": fig["layout"].update( height=height, width=width, title=title, showlegend=True, barmode="stack", ) return fig elif diag == "box": fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig else: fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig else: theme = colormap # add a copy of rgb color to theme if it contains one color if len(theme) <= 1: theme.append(theme[0]) color = [] for incr in range(len(theme)): color.append([1.0 / (len(theme) - 1) * incr, theme[incr]]) dim = len(dataframe) fig = make_subplots(rows=dim, cols=dim, print_grid=False) trace_list = [] legend_param = 0 # Run through all permutations of list pairs for listy in dataframe: for listx in dataframe: # Generate trace with VISIBLE icon if legend_param == 1: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=listx, marker=dict(color=theme[0]), showlegend=False ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=listx, marker=dict(color=theme[0]), showlegend=False ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = index_vals kwargs["marker"]["colorscale"] = color kwargs["marker"]["showscale"] = True trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", showlegend=False, **kwargs ) else: trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", marker=dict( size=size, color=index_vals, colorscale=color, showscale=True, ), showlegend=False, **kwargs ) # Generate trace with INVISIBLE icon else: if (listx == listy) and (diag == "histogram"): trace = graph_objs.Histogram( x=listx, marker=dict(color=theme[0]), showlegend=False ) elif (listx == listy) and (diag == "box"): trace = graph_objs.Box( y=listx, marker=dict(color=theme[0]), showlegend=False ) else: if "marker" in kwargs: kwargs["marker"]["size"] = size kwargs["marker"]["color"] = index_vals kwargs["marker"]["colorscale"] = color kwargs["marker"]["showscale"] = False trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", showlegend=False, **kwargs ) else: trace = graph_objs.Scatter( x=listx, y=listy, mode="markers", marker=dict( size=size, color=index_vals, colorscale=color, showscale=False, ), showlegend=False, **kwargs ) # Push the trace into list trace_list.append(trace) legend_param += 1 trace_index = 0 indices = range(1, dim + 1) for y_index in indices: for x_index in indices: fig.append_trace(trace_list[trace_index], y_index, x_index) trace_index += 1 # Insert headers into the figure for j in range(dim): xaxis_key = "xaxis{}".format((dim * dim) - dim + 1 + j) fig["layout"][xaxis_key].update(title=headers[j]) for j in range(dim): yaxis_key = "yaxis{}".format(1 + (dim * j)) fig["layout"][yaxis_key].update(title=headers[j]) hide_tick_labels_from_box_subplots(fig) if diag == "histogram": fig["layout"].update( height=height, width=width, title=title, showlegend=True, barmode="stack", ) return fig elif diag == "box": fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig else: fig["layout"].update( height=height, width=width, title=title, showlegend=True ) return fig
[ "def", "scatterplot_theme", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "index", ",", "index_vals", ",", "endpts", ",", "colormap", ",", "colormap_type", ",", "*", "*", "kwargs", ")", ":", "# Check if index is made of string values", "if", "isinstance", "(", "index_vals", "[", "0", "]", ",", "str", ")", ":", "unique_index_vals", "=", "[", "]", "for", "name", "in", "index_vals", ":", "if", "name", "not", "in", "unique_index_vals", ":", "unique_index_vals", ".", "append", "(", "name", ")", "n_colors_len", "=", "len", "(", "unique_index_vals", ")", "# Convert colormap to list of n RGB tuples", "if", "colormap_type", "==", "\"seq\"", ":", "foo", "=", "clrs", ".", "color_parser", "(", "colormap", ",", "clrs", ".", "unlabel_rgb", ")", "foo", "=", "clrs", ".", "n_colors", "(", "foo", "[", "0", "]", ",", "foo", "[", "1", "]", ",", "n_colors_len", ")", "theme", "=", "clrs", ".", "color_parser", "(", "foo", ",", "clrs", ".", "label_rgb", ")", "if", "colormap_type", "==", "\"cat\"", ":", "# leave list of colors the same way", "theme", "=", "colormap", "dim", "=", "len", "(", "dataframe", ")", "fig", "=", "make_subplots", "(", "rows", "=", "dim", ",", "cols", "=", "dim", ",", "print_grid", "=", "False", ")", "trace_list", "=", "[", "]", "legend_param", "=", "0", "# Work over all permutations of list pairs", "for", "listy", "in", "dataframe", ":", "for", "listx", "in", "dataframe", ":", "# create a dictionary for index_vals", "unique_index_vals", "=", "{", "}", "for", "name", "in", "index_vals", ":", "if", "name", "not", "in", "unique_index_vals", ":", "unique_index_vals", "[", "name", "]", "=", "[", "]", "c_indx", "=", "0", "# color index", "# Fill all the rest of the names into the dictionary", "for", "name", "in", "sorted", "(", "unique_index_vals", ".", "keys", "(", ")", ")", ":", "new_listx", "=", "[", "]", "new_listy", "=", "[", "]", "for", "j", "in", "range", "(", "len", "(", "index_vals", ")", ")", ":", "if", "index_vals", "[", "j", "]", "==", "name", ":", "new_listx", ".", "append", "(", "listx", "[", "j", "]", ")", "new_listy", ".", "append", "(", "listy", "[", "j", "]", ")", "# Generate trace with VISIBLE icon", "if", "legend_param", "==", "1", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "theme", "[", "c_indx", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "# Generate trace with INVISIBLE icon", "else", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "theme", "[", "c_indx", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "name", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "# Push the trace into dictionary", "unique_index_vals", "[", "name", "]", "=", "trace", "if", "c_indx", ">=", "(", "len", "(", "theme", ")", "-", "1", ")", ":", "c_indx", "=", "-", "1", "c_indx", "+=", "1", "trace_list", ".", "append", "(", "unique_index_vals", ")", "legend_param", "+=", "1", "trace_index", "=", "0", "indices", "=", "range", "(", "1", ",", "dim", "+", "1", ")", "for", "y_index", "in", "indices", ":", "for", "x_index", "in", "indices", ":", "for", "name", "in", "sorted", "(", "trace_list", "[", "trace_index", "]", ".", "keys", "(", ")", ")", ":", "fig", ".", "append_trace", "(", "trace_list", "[", "trace_index", "]", "[", "name", "]", ",", "y_index", ",", "x_index", ")", "trace_index", "+=", "1", "# Insert headers into the figure", "for", "j", "in", "range", "(", "dim", ")", ":", "xaxis_key", "=", "\"xaxis{}\"", ".", "format", "(", "(", "dim", "*", "dim", ")", "-", "dim", "+", "1", "+", "j", ")", "fig", "[", "\"layout\"", "]", "[", "xaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "for", "j", "in", "range", "(", "dim", ")", ":", "yaxis_key", "=", "\"yaxis{}\"", ".", "format", "(", "1", "+", "(", "dim", "*", "j", ")", ")", "fig", "[", "\"layout\"", "]", "[", "yaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "hide_tick_labels_from_box_subplots", "(", "fig", ")", "if", "diag", "==", "\"histogram\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ",", "barmode", "=", "\"stack\"", ",", ")", "return", "fig", "elif", "diag", "==", "\"box\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig", "else", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig", "else", ":", "if", "endpts", ":", "intervals", "=", "utils", ".", "endpts_to_intervals", "(", "endpts", ")", "# Convert colormap to list of n RGB tuples", "if", "colormap_type", "==", "\"seq\"", ":", "foo", "=", "clrs", ".", "color_parser", "(", "colormap", ",", "clrs", ".", "unlabel_rgb", ")", "foo", "=", "clrs", ".", "n_colors", "(", "foo", "[", "0", "]", ",", "foo", "[", "1", "]", ",", "len", "(", "intervals", ")", ")", "theme", "=", "clrs", ".", "color_parser", "(", "foo", ",", "clrs", ".", "label_rgb", ")", "if", "colormap_type", "==", "\"cat\"", ":", "# leave list of colors the same way", "theme", "=", "colormap", "dim", "=", "len", "(", "dataframe", ")", "fig", "=", "make_subplots", "(", "rows", "=", "dim", ",", "cols", "=", "dim", ",", "print_grid", "=", "False", ")", "trace_list", "=", "[", "]", "legend_param", "=", "0", "# Work over all permutations of list pairs", "for", "listy", "in", "dataframe", ":", "for", "listx", "in", "dataframe", ":", "interval_labels", "=", "{", "}", "for", "interval", "in", "intervals", ":", "interval_labels", "[", "str", "(", "interval", ")", "]", "=", "[", "]", "c_indx", "=", "0", "# color index", "# Fill all the rest of the names into the dictionary", "for", "interval", "in", "intervals", ":", "new_listx", "=", "[", "]", "new_listy", "=", "[", "]", "for", "j", "in", "range", "(", "len", "(", "index_vals", ")", ")", ":", "if", "interval", "[", "0", "]", "<", "index_vals", "[", "j", "]", "<=", "interval", "[", "1", "]", ":", "new_listx", ".", "append", "(", "listx", "[", "j", "]", ")", "new_listy", ".", "append", "(", "listy", "[", "j", "]", ")", "# Generate trace with VISIBLE icon", "if", "legend_param", "==", "1", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "(", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", ")", "=", "theme", "[", "c_indx", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "str", "(", "interval", ")", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "str", "(", "interval", ")", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "True", ",", "*", "*", "kwargs", ")", "# Generate trace with INVISIBLE icon", "else", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "new_listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "new_listx", ",", "name", "=", "None", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "(", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", ")", "=", "theme", "[", "c_indx", "]", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "str", "(", "interval", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "new_listx", ",", "y", "=", "new_listy", ",", "mode", "=", "\"markers\"", ",", "name", "=", "str", "(", "interval", ")", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "theme", "[", "c_indx", "]", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "# Push the trace into dictionary", "interval_labels", "[", "str", "(", "interval", ")", "]", "=", "trace", "if", "c_indx", ">=", "(", "len", "(", "theme", ")", "-", "1", ")", ":", "c_indx", "=", "-", "1", "c_indx", "+=", "1", "trace_list", ".", "append", "(", "interval_labels", ")", "legend_param", "+=", "1", "trace_index", "=", "0", "indices", "=", "range", "(", "1", ",", "dim", "+", "1", ")", "for", "y_index", "in", "indices", ":", "for", "x_index", "in", "indices", ":", "for", "interval", "in", "intervals", ":", "fig", ".", "append_trace", "(", "trace_list", "[", "trace_index", "]", "[", "str", "(", "interval", ")", "]", ",", "y_index", ",", "x_index", ")", "trace_index", "+=", "1", "# Insert headers into the figure", "for", "j", "in", "range", "(", "dim", ")", ":", "xaxis_key", "=", "\"xaxis{}\"", ".", "format", "(", "(", "dim", "*", "dim", ")", "-", "dim", "+", "1", "+", "j", ")", "fig", "[", "\"layout\"", "]", "[", "xaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "for", "j", "in", "range", "(", "dim", ")", ":", "yaxis_key", "=", "\"yaxis{}\"", ".", "format", "(", "1", "+", "(", "dim", "*", "j", ")", ")", "fig", "[", "\"layout\"", "]", "[", "yaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "hide_tick_labels_from_box_subplots", "(", "fig", ")", "if", "diag", "==", "\"histogram\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ",", "barmode", "=", "\"stack\"", ",", ")", "return", "fig", "elif", "diag", "==", "\"box\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig", "else", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig", "else", ":", "theme", "=", "colormap", "# add a copy of rgb color to theme if it contains one color", "if", "len", "(", "theme", ")", "<=", "1", ":", "theme", ".", "append", "(", "theme", "[", "0", "]", ")", "color", "=", "[", "]", "for", "incr", "in", "range", "(", "len", "(", "theme", ")", ")", ":", "color", ".", "append", "(", "[", "1.0", "/", "(", "len", "(", "theme", ")", "-", "1", ")", "*", "incr", ",", "theme", "[", "incr", "]", "]", ")", "dim", "=", "len", "(", "dataframe", ")", "fig", "=", "make_subplots", "(", "rows", "=", "dim", ",", "cols", "=", "dim", ",", "print_grid", "=", "False", ")", "trace_list", "=", "[", "]", "legend_param", "=", "0", "# Run through all permutations of list pairs", "for", "listy", "in", "dataframe", ":", "for", "listx", "in", "dataframe", ":", "# Generate trace with VISIBLE icon", "if", "legend_param", "==", "1", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "0", "]", ")", ",", "showlegend", "=", "False", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "0", "]", ")", ",", "showlegend", "=", "False", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "index_vals", "kwargs", "[", "\"marker\"", "]", "[", "\"colorscale\"", "]", "=", "color", "kwargs", "[", "\"marker\"", "]", "[", "\"showscale\"", "]", "=", "True", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "index_vals", ",", "colorscale", "=", "color", ",", "showscale", "=", "True", ",", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "# Generate trace with INVISIBLE icon", "else", ":", "if", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"histogram\"", ")", ":", "trace", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "0", "]", ")", ",", "showlegend", "=", "False", ")", "elif", "(", "listx", "==", "listy", ")", "and", "(", "diag", "==", "\"box\"", ")", ":", "trace", "=", "graph_objs", ".", "Box", "(", "y", "=", "listx", ",", "marker", "=", "dict", "(", "color", "=", "theme", "[", "0", "]", ")", ",", "showlegend", "=", "False", ")", "else", ":", "if", "\"marker\"", "in", "kwargs", ":", "kwargs", "[", "\"marker\"", "]", "[", "\"size\"", "]", "=", "size", "kwargs", "[", "\"marker\"", "]", "[", "\"color\"", "]", "=", "index_vals", "kwargs", "[", "\"marker\"", "]", "[", "\"colorscale\"", "]", "=", "color", "kwargs", "[", "\"marker\"", "]", "[", "\"showscale\"", "]", "=", "False", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "else", ":", "trace", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "listx", ",", "y", "=", "listy", ",", "mode", "=", "\"markers\"", ",", "marker", "=", "dict", "(", "size", "=", "size", ",", "color", "=", "index_vals", ",", "colorscale", "=", "color", ",", "showscale", "=", "False", ",", ")", ",", "showlegend", "=", "False", ",", "*", "*", "kwargs", ")", "# Push the trace into list", "trace_list", ".", "append", "(", "trace", ")", "legend_param", "+=", "1", "trace_index", "=", "0", "indices", "=", "range", "(", "1", ",", "dim", "+", "1", ")", "for", "y_index", "in", "indices", ":", "for", "x_index", "in", "indices", ":", "fig", ".", "append_trace", "(", "trace_list", "[", "trace_index", "]", ",", "y_index", ",", "x_index", ")", "trace_index", "+=", "1", "# Insert headers into the figure", "for", "j", "in", "range", "(", "dim", ")", ":", "xaxis_key", "=", "\"xaxis{}\"", ".", "format", "(", "(", "dim", "*", "dim", ")", "-", "dim", "+", "1", "+", "j", ")", "fig", "[", "\"layout\"", "]", "[", "xaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "for", "j", "in", "range", "(", "dim", ")", ":", "yaxis_key", "=", "\"yaxis{}\"", ".", "format", "(", "1", "+", "(", "dim", "*", "j", ")", ")", "fig", "[", "\"layout\"", "]", "[", "yaxis_key", "]", ".", "update", "(", "title", "=", "headers", "[", "j", "]", ")", "hide_tick_labels_from_box_subplots", "(", "fig", ")", "if", "diag", "==", "\"histogram\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ",", "barmode", "=", "\"stack\"", ",", ")", "return", "fig", "elif", "diag", "==", "\"box\"", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig", "else", ":", "fig", "[", "\"layout\"", "]", ".", "update", "(", "height", "=", "height", ",", "width", "=", "width", ",", "title", "=", "title", ",", "showlegend", "=", "True", ")", "return", "fig" ]
[ 360, 0 ]
[ 836, 26 ]
python
en
['en', 'error', 'th']
False
create_scatterplotmatrix
( df, index=None, endpts=None, diag="scatter", height=500, width=500, size=6, title="Scatterplot Matrix", colormap=None, colormap_type="cat", dataframe=None, headers=None, index_vals=None, **kwargs )
Returns data for a scatterplot matrix; **deprecated**, use instead the plotly.graph_objects trace :class:`plotly.graph_objects.Splom`. :param (array) df: array of the data with column headers :param (str) index: name of the index column in data array :param (list|tuple) endpts: takes an increasing sequece of numbers that defines intervals on the real line. They are used to group the entries in an index of numbers into their corresponding interval and therefore can be treated as categorical data :param (str) diag: sets the chart type for the main diagonal plots. The options are 'scatter', 'histogram' and 'box'. :param (int|float) height: sets the height of the chart :param (int|float) width: sets the width of the chart :param (float) size: sets the marker size (in px) :param (str) title: the title label of the scatterplot matrix :param (str|tuple|list|dict) colormap: either a plotly scale name, an rgb or hex color, a color tuple, a list of colors or a dictionary. An rgb color is of the form 'rgb(x, y, z)' where x, y and z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain valid color types as its members. If colormap is a dictionary, all the string entries in the index column must be a key in colormap. In this case, the colormap_type is forced to 'cat' or categorical :param (str) colormap_type: determines how colormap is interpreted. Valid choices are 'seq' (sequential) and 'cat' (categorical). If 'seq' is selected, only the first two colors in colormap will be considered (when colormap is a list) and the index values will be linearly interpolated between those two colors. This option is forced if all index values are numeric. If 'cat' is selected, a color from colormap will be assigned to each category from index, including the intervals if endpts is being used :param (dict) **kwargs: a dictionary of scatterplot arguments The only forbidden parameters are 'size', 'color' and 'colorscale' in 'marker' Example 1: Vanilla Scatterplot Matrix >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe >>> df = pd.DataFrame(np.random.randn(10, 2), ... columns=['Column 1', 'Column 2']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df) >>> fig.show() Example 2: Indexing a Column >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with index >>> df = pd.DataFrame(np.random.randn(10, 2), ... columns=['A', 'B']) >>> # Add another column of strings to the dataframe >>> df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', ... 'grape', 'pear', 'pear', 'apple', 'pear']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df, index='Fruit', size=10) >>> fig.show() Example 3: Styling the Diagonal Subplots >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with index >>> df = pd.DataFrame(np.random.randn(10, 4), ... columns=['A', 'B', 'C', 'D']) >>> # Add another column of strings to the dataframe >>> df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', ... 'grape', 'pear', 'pear', 'apple', 'pear']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df, diag='box', index='Fruit', height=1000, ... width=1000) >>> fig.show() Example 4: Use a Theme to Style the Subplots >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['A', 'B', 'C']) >>> # Create scatterplot matrix using a built-in >>> # Plotly palette scale and indexing column 'A' >>> fig = create_scatterplotmatrix(df, diag='histogram', index='A', ... colormap='Blues', height=800, width=800) >>> fig.show() Example 5: Example 4 with Interval Factoring >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['A', 'B', 'C']) >>> # Create scatterplot matrix using a list of 2 rgb tuples >>> # and endpoints at -1, 0 and 1 >>> fig = create_scatterplotmatrix(df, diag='histogram', index='A', ... colormap=['rgb(140, 255, 50)', ... 'rgb(170, 60, 115)', '#6c4774', ... (0.5, 0.1, 0.8)], ... endpts=[-1, 0, 1], height=800, width=800) >>> fig.show() Example 6: Using the colormap as a Dictionary >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> import random >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['Column A', ... 'Column B', ... 'Column C']) >>> # Add new color column to dataframe >>> new_column = [] >>> strange_colors = ['turquoise', 'limegreen', 'goldenrod'] >>> for j in range(100): ... new_column.append(random.choice(strange_colors)) >>> df['Colors'] = pd.Series(new_column, index=df.index) >>> # Create scatterplot matrix using a dictionary of hex color values >>> # which correspond to actual color names in 'Colors' column >>> fig = create_scatterplotmatrix( ... df, diag='box', index='Colors', ... colormap= dict( ... turquoise = '#00F5FF', ... limegreen = '#32CD32', ... goldenrod = '#DAA520' ... ), ... colormap_type='cat', ... height=800, width=800 ... ) >>> fig.show()
Returns data for a scatterplot matrix; **deprecated**, use instead the plotly.graph_objects trace :class:`plotly.graph_objects.Splom`.
def create_scatterplotmatrix( df, index=None, endpts=None, diag="scatter", height=500, width=500, size=6, title="Scatterplot Matrix", colormap=None, colormap_type="cat", dataframe=None, headers=None, index_vals=None, **kwargs ): """ Returns data for a scatterplot matrix; **deprecated**, use instead the plotly.graph_objects trace :class:`plotly.graph_objects.Splom`. :param (array) df: array of the data with column headers :param (str) index: name of the index column in data array :param (list|tuple) endpts: takes an increasing sequece of numbers that defines intervals on the real line. They are used to group the entries in an index of numbers into their corresponding interval and therefore can be treated as categorical data :param (str) diag: sets the chart type for the main diagonal plots. The options are 'scatter', 'histogram' and 'box'. :param (int|float) height: sets the height of the chart :param (int|float) width: sets the width of the chart :param (float) size: sets the marker size (in px) :param (str) title: the title label of the scatterplot matrix :param (str|tuple|list|dict) colormap: either a plotly scale name, an rgb or hex color, a color tuple, a list of colors or a dictionary. An rgb color is of the form 'rgb(x, y, z)' where x, y and z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain valid color types as its members. If colormap is a dictionary, all the string entries in the index column must be a key in colormap. In this case, the colormap_type is forced to 'cat' or categorical :param (str) colormap_type: determines how colormap is interpreted. Valid choices are 'seq' (sequential) and 'cat' (categorical). If 'seq' is selected, only the first two colors in colormap will be considered (when colormap is a list) and the index values will be linearly interpolated between those two colors. This option is forced if all index values are numeric. If 'cat' is selected, a color from colormap will be assigned to each category from index, including the intervals if endpts is being used :param (dict) **kwargs: a dictionary of scatterplot arguments The only forbidden parameters are 'size', 'color' and 'colorscale' in 'marker' Example 1: Vanilla Scatterplot Matrix >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe >>> df = pd.DataFrame(np.random.randn(10, 2), ... columns=['Column 1', 'Column 2']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df) >>> fig.show() Example 2: Indexing a Column >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with index >>> df = pd.DataFrame(np.random.randn(10, 2), ... columns=['A', 'B']) >>> # Add another column of strings to the dataframe >>> df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', ... 'grape', 'pear', 'pear', 'apple', 'pear']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df, index='Fruit', size=10) >>> fig.show() Example 3: Styling the Diagonal Subplots >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with index >>> df = pd.DataFrame(np.random.randn(10, 4), ... columns=['A', 'B', 'C', 'D']) >>> # Add another column of strings to the dataframe >>> df['Fruit'] = pd.Series(['apple', 'apple', 'grape', 'apple', 'apple', ... 'grape', 'pear', 'pear', 'apple', 'pear']) >>> # Create scatterplot matrix >>> fig = create_scatterplotmatrix(df, diag='box', index='Fruit', height=1000, ... width=1000) >>> fig.show() Example 4: Use a Theme to Style the Subplots >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['A', 'B', 'C']) >>> # Create scatterplot matrix using a built-in >>> # Plotly palette scale and indexing column 'A' >>> fig = create_scatterplotmatrix(df, diag='histogram', index='A', ... colormap='Blues', height=800, width=800) >>> fig.show() Example 5: Example 4 with Interval Factoring >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['A', 'B', 'C']) >>> # Create scatterplot matrix using a list of 2 rgb tuples >>> # and endpoints at -1, 0 and 1 >>> fig = create_scatterplotmatrix(df, diag='histogram', index='A', ... colormap=['rgb(140, 255, 50)', ... 'rgb(170, 60, 115)', '#6c4774', ... (0.5, 0.1, 0.8)], ... endpts=[-1, 0, 1], height=800, width=800) >>> fig.show() Example 6: Using the colormap as a Dictionary >>> from plotly.graph_objs import graph_objs >>> from plotly.figure_factory import create_scatterplotmatrix >>> import numpy as np >>> import pandas as pd >>> import random >>> # Create dataframe with random data >>> df = pd.DataFrame(np.random.randn(100, 3), ... columns=['Column A', ... 'Column B', ... 'Column C']) >>> # Add new color column to dataframe >>> new_column = [] >>> strange_colors = ['turquoise', 'limegreen', 'goldenrod'] >>> for j in range(100): ... new_column.append(random.choice(strange_colors)) >>> df['Colors'] = pd.Series(new_column, index=df.index) >>> # Create scatterplot matrix using a dictionary of hex color values >>> # which correspond to actual color names in 'Colors' column >>> fig = create_scatterplotmatrix( ... df, diag='box', index='Colors', ... colormap= dict( ... turquoise = '#00F5FF', ... limegreen = '#32CD32', ... goldenrod = '#DAA520' ... ), ... colormap_type='cat', ... height=800, width=800 ... ) >>> fig.show() """ # TODO: protected until #282 if dataframe is None: dataframe = [] if headers is None: headers = [] if index_vals is None: index_vals = [] validate_scatterplotmatrix(df, index, diag, colormap_type, **kwargs) # Validate colormap if isinstance(colormap, dict): colormap = clrs.validate_colors_dict(colormap, "rgb") elif ( isinstance(colormap, six.string_types) and "rgb" not in colormap and "#" not in colormap ): if colormap not in clrs.PLOTLY_SCALES.keys(): raise exceptions.PlotlyError( "If 'colormap' is a string, it must be the name " "of a Plotly Colorscale. The available colorscale " "names are {}".format(clrs.PLOTLY_SCALES.keys()) ) else: # TODO change below to allow the correct Plotly colorscale colormap = clrs.colorscale_to_colors(clrs.PLOTLY_SCALES[colormap]) # keep only first and last item - fix later colormap = [colormap[0]] + [colormap[-1]] colormap = clrs.validate_colors(colormap, "rgb") else: colormap = clrs.validate_colors(colormap, "rgb") if not index: for name in df: headers.append(name) for name in headers: dataframe.append(df[name].values.tolist()) # Check for same data-type in df columns utils.validate_dataframe(dataframe) figure = scatterplot( dataframe, headers, diag, size, height, width, title, **kwargs ) return figure else: # Validate index selection if index not in df: raise exceptions.PlotlyError( "Make sure you set the index " "input variable to one of the " "column names of your " "dataframe." ) index_vals = df[index].values.tolist() for name in df: if name != index: headers.append(name) for name in headers: dataframe.append(df[name].values.tolist()) # check for same data-type in each df column utils.validate_dataframe(dataframe) utils.validate_index(index_vals) # check if all colormap keys are in the index # if colormap is a dictionary if isinstance(colormap, dict): for key in colormap: if not all(index in colormap for index in index_vals): raise exceptions.PlotlyError( "If colormap is a " "dictionary, all the " "names in the index " "must be keys." ) figure = scatterplot_dict( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ) return figure else: figure = scatterplot_theme( dataframe, headers, diag, size, height, width, title, index, index_vals, endpts, colormap, colormap_type, **kwargs ) return figure
[ "def", "create_scatterplotmatrix", "(", "df", ",", "index", "=", "None", ",", "endpts", "=", "None", ",", "diag", "=", "\"scatter\"", ",", "height", "=", "500", ",", "width", "=", "500", ",", "size", "=", "6", ",", "title", "=", "\"Scatterplot Matrix\"", ",", "colormap", "=", "None", ",", "colormap_type", "=", "\"cat\"", ",", "dataframe", "=", "None", ",", "headers", "=", "None", ",", "index_vals", "=", "None", ",", "*", "*", "kwargs", ")", ":", "# TODO: protected until #282", "if", "dataframe", "is", "None", ":", "dataframe", "=", "[", "]", "if", "headers", "is", "None", ":", "headers", "=", "[", "]", "if", "index_vals", "is", "None", ":", "index_vals", "=", "[", "]", "validate_scatterplotmatrix", "(", "df", ",", "index", ",", "diag", ",", "colormap_type", ",", "*", "*", "kwargs", ")", "# Validate colormap", "if", "isinstance", "(", "colormap", ",", "dict", ")", ":", "colormap", "=", "clrs", ".", "validate_colors_dict", "(", "colormap", ",", "\"rgb\"", ")", "elif", "(", "isinstance", "(", "colormap", ",", "six", ".", "string_types", ")", "and", "\"rgb\"", "not", "in", "colormap", "and", "\"#\"", "not", "in", "colormap", ")", ":", "if", "colormap", "not", "in", "clrs", ".", "PLOTLY_SCALES", ".", "keys", "(", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"If 'colormap' is a string, it must be the name \"", "\"of a Plotly Colorscale. The available colorscale \"", "\"names are {}\"", ".", "format", "(", "clrs", ".", "PLOTLY_SCALES", ".", "keys", "(", ")", ")", ")", "else", ":", "# TODO change below to allow the correct Plotly colorscale", "colormap", "=", "clrs", ".", "colorscale_to_colors", "(", "clrs", ".", "PLOTLY_SCALES", "[", "colormap", "]", ")", "# keep only first and last item - fix later", "colormap", "=", "[", "colormap", "[", "0", "]", "]", "+", "[", "colormap", "[", "-", "1", "]", "]", "colormap", "=", "clrs", ".", "validate_colors", "(", "colormap", ",", "\"rgb\"", ")", "else", ":", "colormap", "=", "clrs", ".", "validate_colors", "(", "colormap", ",", "\"rgb\"", ")", "if", "not", "index", ":", "for", "name", "in", "df", ":", "headers", ".", "append", "(", "name", ")", "for", "name", "in", "headers", ":", "dataframe", ".", "append", "(", "df", "[", "name", "]", ".", "values", ".", "tolist", "(", ")", ")", "# Check for same data-type in df columns", "utils", ".", "validate_dataframe", "(", "dataframe", ")", "figure", "=", "scatterplot", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "*", "*", "kwargs", ")", "return", "figure", "else", ":", "# Validate index selection", "if", "index", "not", "in", "df", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"Make sure you set the index \"", "\"input variable to one of the \"", "\"column names of your \"", "\"dataframe.\"", ")", "index_vals", "=", "df", "[", "index", "]", ".", "values", ".", "tolist", "(", ")", "for", "name", "in", "df", ":", "if", "name", "!=", "index", ":", "headers", ".", "append", "(", "name", ")", "for", "name", "in", "headers", ":", "dataframe", ".", "append", "(", "df", "[", "name", "]", ".", "values", ".", "tolist", "(", ")", ")", "# check for same data-type in each df column", "utils", ".", "validate_dataframe", "(", "dataframe", ")", "utils", ".", "validate_index", "(", "index_vals", ")", "# check if all colormap keys are in the index", "# if colormap is a dictionary", "if", "isinstance", "(", "colormap", ",", "dict", ")", ":", "for", "key", "in", "colormap", ":", "if", "not", "all", "(", "index", "in", "colormap", "for", "index", "in", "index_vals", ")", ":", "raise", "exceptions", ".", "PlotlyError", "(", "\"If colormap is a \"", "\"dictionary, all the \"", "\"names in the index \"", "\"must be keys.\"", ")", "figure", "=", "scatterplot_dict", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "index", ",", "index_vals", ",", "endpts", ",", "colormap", ",", "colormap_type", ",", "*", "*", "kwargs", ")", "return", "figure", "else", ":", "figure", "=", "scatterplot_theme", "(", "dataframe", ",", "headers", ",", "diag", ",", "size", ",", "height", ",", "width", ",", "title", ",", "index", ",", "index_vals", ",", "endpts", ",", "colormap", ",", "colormap_type", ",", "*", "*", "kwargs", ")", "return", "figure" ]
[ 839, 0 ]
[ 1142, 25 ]
python
en
['en', 'error', 'th']
False
Marker.colors
(self)
Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. The 'colors' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray
Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. The 'colors' property is an array that may be specified as a tuple, list, numpy array, or pandas Series
def colors(self): """ Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. The 'colors' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray """ return self["colors"]
[ "def", "colors", "(", "self", ")", ":", "return", "self", "[", "\"colors\"", "]" ]
[ 15, 4 ]
[ 27, 29 ]
python
en
['en', 'error', 'th']
False
Marker.colorssrc
(self)
Sets the source reference on Chart Studio Cloud for colors . The 'colorssrc' 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 colors . The 'colorssrc' property must be specified as a string or as a plotly.grid_objs.Column object
def colorssrc(self): """ Sets the source reference on Chart Studio Cloud for colors . The 'colorssrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["colorssrc"]
[ "def", "colorssrc", "(", "self", ")", ":", "return", "self", "[", "\"colorssrc\"", "]" ]
[ 36, 4 ]
[ 47, 32 ]
python
en
['en', 'error', 'th']
False
Marker.line
(self)
The 'line' property is an instance of Line that may be specified as: - An instance of :class:`plotly.graph_objs.pie.marker.Line` - A dict of string/value properties that will be passed to the Line constructor Supported dict properties: color Sets the color of the line enclosing each sector. colorsrc Sets the source reference on Chart Studio Cloud for color . width Sets the width (in px) of the line enclosing each sector. widthsrc Sets the source reference on Chart Studio Cloud for width . Returns ------- plotly.graph_objs.pie.marker.Line
The 'line' property is an instance of Line that may be specified as: - An instance of :class:`plotly.graph_objs.pie.marker.Line` - A dict of string/value properties that will be passed to the Line constructor Supported dict properties: color Sets the color of the line enclosing each sector. colorsrc Sets the source reference on Chart Studio Cloud for color . width Sets the width (in px) of the line enclosing each sector. widthsrc Sets the source reference on Chart Studio Cloud for width .
def line(self): """ The 'line' property is an instance of Line that may be specified as: - An instance of :class:`plotly.graph_objs.pie.marker.Line` - A dict of string/value properties that will be passed to the Line constructor Supported dict properties: color Sets the color of the line enclosing each sector. colorsrc Sets the source reference on Chart Studio Cloud for color . width Sets the width (in px) of the line enclosing each sector. widthsrc Sets the source reference on Chart Studio Cloud for width . Returns ------- plotly.graph_objs.pie.marker.Line """ return self["line"]
[ "def", "line", "(", "self", ")", ":", "return", "self", "[", "\"line\"", "]" ]
[ 56, 4 ]
[ 83, 27 ]
python
en
['en', 'error', 'th']
False
Marker.__init__
(self, arg=None, colors=None, colorssrc=None, line=None, **kwargs)
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.pie.Marker` colors Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. colorssrc Sets the source reference on Chart Studio Cloud for colors . line :class:`plotly.graph_objects.pie.marker.Line` instance or dict with compatible properties Returns ------- Marker
Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.pie.Marker` colors Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. colorssrc Sets the source reference on Chart Studio Cloud for colors . line :class:`plotly.graph_objects.pie.marker.Line` instance or dict with compatible properties
def __init__(self, arg=None, colors=None, colorssrc=None, line=None, **kwargs): """ Construct a new Marker object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.pie.Marker` colors Sets the color of each sector. If not specified, the default trace color set is used to pick the sector colors. colorssrc Sets the source reference on Chart Studio Cloud for colors . line :class:`plotly.graph_objects.pie.marker.Line` instance or dict with compatible properties Returns ------- Marker """ super(Marker, self).__init__("marker") 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.Marker constructor must be a dict or an instance of :class:`plotly.graph_objs.pie.Marker`""" ) # 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("colors", None) _v = colors if colors is not None else _v if _v is not None: self["colors"] = _v _v = arg.pop("colorssrc", None) _v = colorssrc if colorssrc is not None else _v if _v is not None: self["colorssrc"] = _v _v = arg.pop("line", None) _v = line if line is not None else _v if _v is not None: self["line"] = _v # Process unknown kwargs # ---------------------- self._process_kwargs(**dict(arg, **kwargs)) # Reset skip_invalid # ------------------ self._skip_invalid = False
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "colors", "=", "None", ",", "colorssrc", "=", "None", ",", "line", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Marker", ",", "self", ")", ".", "__init__", "(", "\"marker\"", ")", "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.Marker \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.pie.Marker`\"\"\"", ")", "# 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", "(", "\"colors\"", ",", "None", ")", "_v", "=", "colors", "if", "colors", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"colors\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"colorssrc\"", ",", "None", ")", "_v", "=", "colorssrc", "if", "colorssrc", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"colorssrc\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"line\"", ",", "None", ")", "_v", "=", "line", "if", "line", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"line\"", "]", "=", "_v", "# Process unknown kwargs", "# ----------------------", "self", ".", "_process_kwargs", "(", "*", "*", "dict", "(", "arg", ",", "*", "*", "kwargs", ")", ")", "# Reset skip_invalid", "# ------------------", "self", ".", "_skip_invalid", "=", "False" ]
[ 106, 4 ]
[ 178, 34 ]
python
en
['en', 'error', 'th']
False
make_linear_colorscale
(colors)
Makes a list of colors into a colorscale-acceptable form For documentation regarding to the form of the output, see https://plot.ly/python/reference/#mesh3d-colorscale
Makes a list of colors into a colorscale-acceptable form
def make_linear_colorscale(colors): """ Makes a list of colors into a colorscale-acceptable form For documentation regarding to the form of the output, see https://plot.ly/python/reference/#mesh3d-colorscale """ scale = 1.0 / (len(colors) - 1) return [[i * scale, color] for i, color in enumerate(colors)]
[ "def", "make_linear_colorscale", "(", "colors", ")", ":", "scale", "=", "1.0", "/", "(", "len", "(", "colors", ")", "-", "1", ")", "return", "[", "[", "i", "*", "scale", ",", "color", "]", "for", "i", ",", "color", "in", "enumerate", "(", "colors", ")", "]" ]
[ 10, 0 ]
[ 18, 65 ]
python
en
['en', 'error', 'th']
False
create_2d_density
( x, y, colorscale="Earth", ncontours=20, hist_color=(0, 0, 0.5), point_color=(0, 0, 0.5), point_size=2, title="2D Density Plot", height=600, width=600, )
**deprecated**, use instead :func:`plotly.express.density_heatmap`. :param (list|array) x: x-axis data for plot generation :param (list|array) y: y-axis data for plot generation :param (str|tuple|list) colorscale: either a plotly scale name, an rgb or hex color, a color tuple or a list or tuple of colors. An rgb color is of the form 'rgb(x, y, z)' where x, y, z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain the valid color types aforementioned as its members. :param (int) ncontours: the number of 2D contours to draw on the plot :param (str) hist_color: the color of the plotted histograms :param (str) point_color: the color of the scatter points :param (str) point_size: the color of the scatter points :param (str) title: set the title for the plot :param (float) height: the height of the chart :param (float) width: the width of the chart Examples -------- Example 1: Simple 2D Density Plot >>> from plotly.figure_factory import create_2d_density >>> import numpy as np >>> # Make data points >>> t = np.linspace(-1,1.2,2000) >>> x = (t**3)+(0.3*np.random.randn(2000)) >>> y = (t**6)+(0.3*np.random.randn(2000)) >>> # Create a figure >>> fig = create_2d_density(x, y) >>> # Plot the data >>> fig.show() Example 2: Using Parameters >>> from plotly.figure_factory import create_2d_density >>> import numpy as np >>> # Make data points >>> t = np.linspace(-1,1.2,2000) >>> x = (t**3)+(0.3*np.random.randn(2000)) >>> y = (t**6)+(0.3*np.random.randn(2000)) >>> # Create custom colorscale >>> colorscale = ['#7A4579', '#D56073', 'rgb(236,158,105)', ... (1, 1, 0.2), (0.98,0.98,0.98)] >>> # Create a figure >>> fig = create_2d_density(x, y, colorscale=colorscale, ... hist_color='rgb(255, 237, 222)', point_size=3) >>> # Plot the data >>> fig.show()
**deprecated**, use instead :func:`plotly.express.density_heatmap`.
def create_2d_density( x, y, colorscale="Earth", ncontours=20, hist_color=(0, 0, 0.5), point_color=(0, 0, 0.5), point_size=2, title="2D Density Plot", height=600, width=600, ): """ **deprecated**, use instead :func:`plotly.express.density_heatmap`. :param (list|array) x: x-axis data for plot generation :param (list|array) y: y-axis data for plot generation :param (str|tuple|list) colorscale: either a plotly scale name, an rgb or hex color, a color tuple or a list or tuple of colors. An rgb color is of the form 'rgb(x, y, z)' where x, y, z belong to the interval [0, 255] and a color tuple is a tuple of the form (a, b, c) where a, b and c belong to [0, 1]. If colormap is a list, it must contain the valid color types aforementioned as its members. :param (int) ncontours: the number of 2D contours to draw on the plot :param (str) hist_color: the color of the plotted histograms :param (str) point_color: the color of the scatter points :param (str) point_size: the color of the scatter points :param (str) title: set the title for the plot :param (float) height: the height of the chart :param (float) width: the width of the chart Examples -------- Example 1: Simple 2D Density Plot >>> from plotly.figure_factory import create_2d_density >>> import numpy as np >>> # Make data points >>> t = np.linspace(-1,1.2,2000) >>> x = (t**3)+(0.3*np.random.randn(2000)) >>> y = (t**6)+(0.3*np.random.randn(2000)) >>> # Create a figure >>> fig = create_2d_density(x, y) >>> # Plot the data >>> fig.show() Example 2: Using Parameters >>> from plotly.figure_factory import create_2d_density >>> import numpy as np >>> # Make data points >>> t = np.linspace(-1,1.2,2000) >>> x = (t**3)+(0.3*np.random.randn(2000)) >>> y = (t**6)+(0.3*np.random.randn(2000)) >>> # Create custom colorscale >>> colorscale = ['#7A4579', '#D56073', 'rgb(236,158,105)', ... (1, 1, 0.2), (0.98,0.98,0.98)] >>> # Create a figure >>> fig = create_2d_density(x, y, colorscale=colorscale, ... hist_color='rgb(255, 237, 222)', point_size=3) >>> # Plot the data >>> fig.show() """ # validate x and y are filled with numbers only for array in [x, y]: if not all(isinstance(element, Number) for element in array): raise plotly.exceptions.PlotlyError( "All elements of your 'x' and 'y' lists must be numbers." ) # validate x and y are the same length if len(x) != len(y): raise plotly.exceptions.PlotlyError( "Both lists 'x' and 'y' must be the same length." ) colorscale = clrs.validate_colors(colorscale, "rgb") colorscale = make_linear_colorscale(colorscale) # validate hist_color and point_color hist_color = clrs.validate_colors(hist_color, "rgb") point_color = clrs.validate_colors(point_color, "rgb") trace1 = graph_objs.Scatter( x=x, y=y, mode="markers", name="points", marker=dict(color=point_color[0], size=point_size, opacity=0.4), ) trace2 = graph_objs.Histogram2dContour( x=x, y=y, name="density", ncontours=ncontours, colorscale=colorscale, reversescale=True, showscale=False, ) trace3 = graph_objs.Histogram( x=x, name="x density", marker=dict(color=hist_color[0]), yaxis="y2" ) trace4 = graph_objs.Histogram( y=y, name="y density", marker=dict(color=hist_color[0]), xaxis="x2" ) data = [trace1, trace2, trace3, trace4] layout = graph_objs.Layout( showlegend=False, autosize=False, title=title, height=height, width=width, xaxis=dict(domain=[0, 0.85], showgrid=False, zeroline=False), yaxis=dict(domain=[0, 0.85], showgrid=False, zeroline=False), margin=dict(t=50), hovermode="closest", bargap=0, xaxis2=dict(domain=[0.85, 1], showgrid=False, zeroline=False), yaxis2=dict(domain=[0.85, 1], showgrid=False, zeroline=False), ) fig = graph_objs.Figure(data=data, layout=layout) return fig
[ "def", "create_2d_density", "(", "x", ",", "y", ",", "colorscale", "=", "\"Earth\"", ",", "ncontours", "=", "20", ",", "hist_color", "=", "(", "0", ",", "0", ",", "0.5", ")", ",", "point_color", "=", "(", "0", ",", "0", ",", "0.5", ")", ",", "point_size", "=", "2", ",", "title", "=", "\"2D Density Plot\"", ",", "height", "=", "600", ",", "width", "=", "600", ",", ")", ":", "# validate x and y are filled with numbers only", "for", "array", "in", "[", "x", ",", "y", "]", ":", "if", "not", "all", "(", "isinstance", "(", "element", ",", "Number", ")", "for", "element", "in", "array", ")", ":", "raise", "plotly", ".", "exceptions", ".", "PlotlyError", "(", "\"All elements of your 'x' and 'y' lists must be numbers.\"", ")", "# validate x and y are the same length", "if", "len", "(", "x", ")", "!=", "len", "(", "y", ")", ":", "raise", "plotly", ".", "exceptions", ".", "PlotlyError", "(", "\"Both lists 'x' and 'y' must be the same length.\"", ")", "colorscale", "=", "clrs", ".", "validate_colors", "(", "colorscale", ",", "\"rgb\"", ")", "colorscale", "=", "make_linear_colorscale", "(", "colorscale", ")", "# validate hist_color and point_color", "hist_color", "=", "clrs", ".", "validate_colors", "(", "hist_color", ",", "\"rgb\"", ")", "point_color", "=", "clrs", ".", "validate_colors", "(", "point_color", ",", "\"rgb\"", ")", "trace1", "=", "graph_objs", ".", "Scatter", "(", "x", "=", "x", ",", "y", "=", "y", ",", "mode", "=", "\"markers\"", ",", "name", "=", "\"points\"", ",", "marker", "=", "dict", "(", "color", "=", "point_color", "[", "0", "]", ",", "size", "=", "point_size", ",", "opacity", "=", "0.4", ")", ",", ")", "trace2", "=", "graph_objs", ".", "Histogram2dContour", "(", "x", "=", "x", ",", "y", "=", "y", ",", "name", "=", "\"density\"", ",", "ncontours", "=", "ncontours", ",", "colorscale", "=", "colorscale", ",", "reversescale", "=", "True", ",", "showscale", "=", "False", ",", ")", "trace3", "=", "graph_objs", ".", "Histogram", "(", "x", "=", "x", ",", "name", "=", "\"x density\"", ",", "marker", "=", "dict", "(", "color", "=", "hist_color", "[", "0", "]", ")", ",", "yaxis", "=", "\"y2\"", ")", "trace4", "=", "graph_objs", ".", "Histogram", "(", "y", "=", "y", ",", "name", "=", "\"y density\"", ",", "marker", "=", "dict", "(", "color", "=", "hist_color", "[", "0", "]", ")", ",", "xaxis", "=", "\"x2\"", ")", "data", "=", "[", "trace1", ",", "trace2", ",", "trace3", ",", "trace4", "]", "layout", "=", "graph_objs", ".", "Layout", "(", "showlegend", "=", "False", ",", "autosize", "=", "False", ",", "title", "=", "title", ",", "height", "=", "height", ",", "width", "=", "width", ",", "xaxis", "=", "dict", "(", "domain", "=", "[", "0", ",", "0.85", "]", ",", "showgrid", "=", "False", ",", "zeroline", "=", "False", ")", ",", "yaxis", "=", "dict", "(", "domain", "=", "[", "0", ",", "0.85", "]", ",", "showgrid", "=", "False", ",", "zeroline", "=", "False", ")", ",", "margin", "=", "dict", "(", "t", "=", "50", ")", ",", "hovermode", "=", "\"closest\"", ",", "bargap", "=", "0", ",", "xaxis2", "=", "dict", "(", "domain", "=", "[", "0.85", ",", "1", "]", ",", "showgrid", "=", "False", ",", "zeroline", "=", "False", ")", ",", "yaxis2", "=", "dict", "(", "domain", "=", "[", "0.85", ",", "1", "]", ",", "showgrid", "=", "False", ",", "zeroline", "=", "False", ")", ",", ")", "fig", "=", "graph_objs", ".", "Figure", "(", "data", "=", "data", ",", "layout", "=", "layout", ")", "return", "fig" ]
[ 21, 0 ]
[ 156, 14 ]
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.mesh3d.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.mesh3d.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.mesh3d.colorbar.Tickfont constructor must be a dict or an instance of :class:`plotly.graph_objs.mesh3d.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.mesh3d.colorbar.Tickfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.mesh3d.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
Axis.dtick
(self)
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" The 'dtick' property accepts values of any type Returns ------- Any
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" The 'dtick' property accepts values of any type
def dtick(self): """ 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" The 'dtick' property accepts values of any type Returns ------- Any """ return self["dtick"]
[ "def", "dtick", "(", "self", ")", ":", "return", "self", "[", "\"dtick\"", "]" ]
[ 43, 4 ]
[ 72, 28 ]
python
en
['en', 'error', 'th']
False
Axis.exponentformat
(self)
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. The 'exponentformat' property is an enumeration that may be specified as: - One of the following enumeration values: ['none', 'e', 'E', 'power', 'SI', 'B'] Returns ------- Any
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. The 'exponentformat' property is an enumeration that may be specified as: - One of the following enumeration values: ['none', 'e', 'E', 'power', 'SI', 'B']
def exponentformat(self): """ 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. The 'exponentformat' property is an enumeration that may be specified as: - One of the following enumeration values: ['none', 'e', 'E', 'power', 'SI', 'B'] Returns ------- Any """ return self["exponentformat"]
[ "def", "exponentformat", "(", "self", ")", ":", "return", "self", "[", "\"exponentformat\"", "]" ]
[ 81, 4 ]
[ 97, 37 ]
python
en
['en', 'error', 'th']
False
Axis.nticks
(self)
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". The 'nticks' property is a integer and may be specified as: - An int (or float that will be cast to an int) in the interval [0, 9223372036854775807] Returns ------- int
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". The 'nticks' property is a integer and may be specified as: - An int (or float that will be cast to an int) in the interval [0, 9223372036854775807]
def nticks(self): """ 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". The 'nticks' property is a integer and may be specified as: - An int (or float that will be cast to an int) in the interval [0, 9223372036854775807] Returns ------- int """ return self["nticks"]
[ "def", "nticks", "(", "self", ")", ":", "return", "self", "[", "\"nticks\"", "]" ]
[ 106, 4 ]
[ 121, 29 ]
python
en
['en', 'error', 'th']
False
Axis.range
(self)
Sets the range of this axis. The 'range' property is an info array that may be specified as: * a list or tuple of 2 elements where: (0) The 'range[0]' property is a number and may be specified as: - An int or float (1) The 'range[1]' property is a number and may be specified as: - An int or float Returns ------- list
Sets the range of this axis. The 'range' property is an info array that may be specified as: * a list or tuple of 2 elements where: (0) The 'range[0]' property is a number and may be specified as: - An int or float (1) The 'range[1]' property is a number and may be specified as: - An int or float
def range(self): """ Sets the range of this axis. The 'range' property is an info array that may be specified as: * a list or tuple of 2 elements where: (0) The 'range[0]' property is a number and may be specified as: - An int or float (1) The 'range[1]' property is a number and may be specified as: - An int or float Returns ------- list """ return self["range"]
[ "def", "range", "(", "self", ")", ":", "return", "self", "[", "\"range\"", "]" ]
[ 130, 4 ]
[ 146, 28 ]
python
en
['en', 'error', 'th']
False
Axis.separatethousands
(self)
If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False) Returns ------- bool
If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False)
def separatethousands(self): """ If "true", even 4-digit integers are separated The 'separatethousands' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["separatethousands"]
[ "def", "separatethousands", "(", "self", ")", ":", "return", "self", "[", "\"separatethousands\"", "]" ]
[ 155, 4 ]
[ 166, 40 ]
python
en
['en', 'error', 'th']
False
Axis.showexponent
(self)
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. The 'showexponent' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none'] Returns ------- Any
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. The 'showexponent' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none']
def showexponent(self): """ 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. The 'showexponent' property is an enumeration that may be specified as: - One of the following enumeration values: ['all', 'first', 'last', 'none'] Returns ------- Any """ return self["showexponent"]
[ "def", "showexponent", "(", "self", ")", ":", "return", "self", "[", "\"showexponent\"", "]" ]
[ 175, 4 ]
[ 190, 35 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 199, 4 ]
[ 210, 37 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 219, 4 ]
[ 234, 37 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 243, 4 ]
[ 255, 37 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 264, 4 ]
[ 282, 28 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 291, 4 ]
[ 306, 32 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 315, 4 ]
[ 365, 32 ]
python
en
['en', 'error', 'th']
False
Axis.tickfont
(self)
Sets the color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.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.indicator.gauge.axis.Tickfont
Sets the color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.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 color bar's tick label font The 'tickfont' property is an instance of Tickfont that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.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.indicator.gauge.axis.Tickfont """ return self["tickfont"]
[ "def", "tickfont", "(", "self", ")", ":", "return", "self", "[", "\"tickfont\"", "]" ]
[ 374, 4 ]
[ 411, 31 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 420, 4 ]
[ 440, 33 ]
python
en
['en', 'error', 'th']
False
Axis.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.indicator.gauge.axis.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.indicator.gauge.axis.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.indicator.gauge.axis.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.indicator.gauge.axis.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.indicator.gauge.axis.Tickformatstop] """ return self["tickformatstops"]
[ "def", "tickformatstops", "(", "self", ")", ":", "return", "self", "[", "\"tickformatstops\"", "]" ]
[ 449, 4 ]
[ 497, 38 ]
python
en
['en', 'error', 'th']
False
Axis.tickformatstopdefaults
(self)
When used in a template (as layout.template.data.indicator.gaug e.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.tickformatstops The 'tickformatstopdefaults' property is an instance of Tickformatstop that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.Tickformatstop` - A dict of string/value properties that will be passed to the Tickformatstop constructor Supported dict properties: Returns ------- plotly.graph_objs.indicator.gauge.axis.Tickformatstop
When used in a template (as layout.template.data.indicator.gaug e.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.tickformatstops The 'tickformatstopdefaults' property is an instance of Tickformatstop that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.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.data.indicator.gaug e.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.tickformatstops The 'tickformatstopdefaults' property is an instance of Tickformatstop that may be specified as: - An instance of :class:`plotly.graph_objs.indicator.gauge.axis.Tickformatstop` - A dict of string/value properties that will be passed to the Tickformatstop constructor Supported dict properties: Returns ------- plotly.graph_objs.indicator.gauge.axis.Tickformatstop """ return self["tickformatstopdefaults"]
[ "def", "tickformatstopdefaults", "(", "self", ")", ":", "return", "self", "[", "\"tickformatstopdefaults\"", "]" ]
[ 506, 4 ]
[ 525, 45 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 534, 4 ]
[ 545, 30 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 554, 4 ]
[ 572, 31 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 581, 4 ]
[ 593, 33 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 602, 4 ]
[ 616, 28 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 625, 4 ]
[ 637, 33 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 646, 4 ]
[ 659, 31 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 668, 4 ]
[ 679, 34 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 688, 4 ]
[ 700, 31 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 709, 4 ]
[ 720, 34 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 729, 4 ]
[ 740, 32 ]
python
en
['en', 'error', 'th']
False
Axis.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\"", "]" ]
[ 749, 4 ]
[ 762, 30 ]
python
en
['en', 'error', 'th']
False
Axis.__init__
( self, arg=None, dtick=None, exponentformat=None, nticks=None, range=None, separatethousands=None, showexponent=None, showticklabels=None, showtickprefix=None, showticksuffix=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, visible=None, **kwargs )
Construct a new Axis object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.indicator.gauge.Axis` 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. 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". range Sets the range of this axis. 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. 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. 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 color bar's tick label 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.indicator.gauge .axis.Tickformatstop` instances or dicts with compatible properties tickformatstopdefaults When used in a template (as layout.template.data.indica tor.gauge.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.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). 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 ------- Axis
Construct a new Axis object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.indicator.gauge.Axis` 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. 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". range Sets the range of this axis. 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. 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. 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 color bar's tick label 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.indicator.gauge .axis.Tickformatstop` instances or dicts with compatible properties tickformatstopdefaults When used in a template (as layout.template.data.indica tor.gauge.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.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). 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, dtick=None, exponentformat=None, nticks=None, range=None, separatethousands=None, showexponent=None, showticklabels=None, showtickprefix=None, showticksuffix=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, visible=None, **kwargs ): """ Construct a new Axis object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.indicator.gauge.Axis` 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. 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". range Sets the range of this axis. 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. 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. 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 color bar's tick label 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.indicator.gauge .axis.Tickformatstop` instances or dicts with compatible properties tickformatstopdefaults When used in a template (as layout.template.data.indica tor.gauge.axis.tickformatstopdefaults), sets the default property values to use for elements of indicator.gauge.axis.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). 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 ------- Axis """ super(Axis, self).__init__("axis") 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.indicator.gauge.Axis constructor must be a dict or an instance of :class:`plotly.graph_objs.indicator.gauge.Axis`""" ) # 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("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("nticks", None) _v = nticks if nticks is not None else _v if _v is not None: self["nticks"] = _v _v = arg.pop("range", None) _v = range if range is not None else _v if _v is not None: self["range"] = _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("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("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("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", ",", "dtick", "=", "None", ",", "exponentformat", "=", "None", ",", "nticks", "=", "None", ",", "range", "=", "None", ",", "separatethousands", "=", "None", ",", "showexponent", "=", "None", ",", "showticklabels", "=", "None", ",", "showtickprefix", "=", "None", ",", "showticksuffix", "=", "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", ",", "visible", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Axis", ",", "self", ")", ".", "__init__", "(", "\"axis\"", ")", "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.indicator.gauge.Axis \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.indicator.gauge.Axis`\"\"\"", ")", "# 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", "(", "\"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", "(", "\"nticks\"", ",", "None", ")", "_v", "=", "nticks", "if", "nticks", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"nticks\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"range\"", ",", "None", ")", "_v", "=", "range", "if", "range", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"range\"", "]", "=", "_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", "(", "\"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", "(", "\"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", "(", "\"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" ]
[ 908, 4 ]
[ 1231, 34 ]
python
en
['en', 'error', 'th']
False
_conv_linear
(args, filter_size, num_features, bias, bias_start=0.0, scope=None)
convolution: Args: args: a 4D Tensor or a list of 4D, batch x n, Tensors. filter_size: int tuple of filter height and width. num_features: int, number of features. bias_start: starting value to initialize the bias; 0 by default. scope: VariableScope for the created subgraph; defaults to "Linear". Returns: A 4D Tensor with shape [batch h w num_features] Raises: ValueError: if some of the arguments has unspecified or wrong shape.
convolution: Args: args: a 4D Tensor or a list of 4D, batch x n, Tensors. filter_size: int tuple of filter height and width. num_features: int, number of features. bias_start: starting value to initialize the bias; 0 by default. scope: VariableScope for the created subgraph; defaults to "Linear". Returns: A 4D Tensor with shape [batch h w num_features] Raises: ValueError: if some of the arguments has unspecified or wrong shape.
def _conv_linear(args, filter_size, num_features, bias, bias_start=0.0, scope=None): """convolution: Args: args: a 4D Tensor or a list of 4D, batch x n, Tensors. filter_size: int tuple of filter height and width. num_features: int, number of features. bias_start: starting value to initialize the bias; 0 by default. scope: VariableScope for the created subgraph; defaults to "Linear". Returns: A 4D Tensor with shape [batch h w num_features] Raises: ValueError: if some of the arguments has unspecified or wrong shape. """ # Calculate the total size of arguments on dimension 1. total_arg_size_depth = 0 shapes = [a.get_shape().as_list() for a in args] for shape in shapes: if len(shape) != 4: raise ValueError("Linear is expecting 4D arguments: %s" % str(shapes)) if not shape[3]: raise ValueError("Linear expects shape[4] of arguments: %s" % str(shapes)) else: total_arg_size_depth += shape[3] dtype = [a.dtype for a in args][0] # Now the computation. with tf.variable_scope(scope or "Conv"): matrix = tf.get_variable( "Matrix", [filter_size[0], filter_size[1], total_arg_size_depth, num_features], dtype=dtype) if len(args) == 1: res = tf.nn.conv2d(args[0], matrix, strides=[1, 1, 1, 1], padding='SAME') else: res = tf.nn.conv2d(tf.concat(axis=3, values=args), matrix, strides=[1, 1, 1, 1], padding='SAME') if not bias: return res bias_term = tf.get_variable( "Bias", [num_features], dtype=dtype, initializer=tf.constant_initializer( bias_start, dtype=dtype)) return res + bias_term
[ "def", "_conv_linear", "(", "args", ",", "filter_size", ",", "num_features", ",", "bias", ",", "bias_start", "=", "0.0", ",", "scope", "=", "None", ")", ":", "# Calculate the total size of arguments on dimension 1.", "total_arg_size_depth", "=", "0", "shapes", "=", "[", "a", ".", "get_shape", "(", ")", ".", "as_list", "(", ")", "for", "a", "in", "args", "]", "for", "shape", "in", "shapes", ":", "if", "len", "(", "shape", ")", "!=", "4", ":", "raise", "ValueError", "(", "\"Linear is expecting 4D arguments: %s\"", "%", "str", "(", "shapes", ")", ")", "if", "not", "shape", "[", "3", "]", ":", "raise", "ValueError", "(", "\"Linear expects shape[4] of arguments: %s\"", "%", "str", "(", "shapes", ")", ")", "else", ":", "total_arg_size_depth", "+=", "shape", "[", "3", "]", "dtype", "=", "[", "a", ".", "dtype", "for", "a", "in", "args", "]", "[", "0", "]", "# Now the computation.", "with", "tf", ".", "variable_scope", "(", "scope", "or", "\"Conv\"", ")", ":", "matrix", "=", "tf", ".", "get_variable", "(", "\"Matrix\"", ",", "[", "filter_size", "[", "0", "]", ",", "filter_size", "[", "1", "]", ",", "total_arg_size_depth", ",", "num_features", "]", ",", "dtype", "=", "dtype", ")", "if", "len", "(", "args", ")", "==", "1", ":", "res", "=", "tf", ".", "nn", ".", "conv2d", "(", "args", "[", "0", "]", ",", "matrix", ",", "strides", "=", "[", "1", ",", "1", ",", "1", ",", "1", "]", ",", "padding", "=", "'SAME'", ")", "else", ":", "res", "=", "tf", ".", "nn", ".", "conv2d", "(", "tf", ".", "concat", "(", "axis", "=", "3", ",", "values", "=", "args", ")", ",", "matrix", ",", "strides", "=", "[", "1", ",", "1", ",", "1", ",", "1", "]", ",", "padding", "=", "'SAME'", ")", "if", "not", "bias", ":", "return", "res", "bias_term", "=", "tf", ".", "get_variable", "(", "\"Bias\"", ",", "[", "num_features", "]", ",", "dtype", "=", "dtype", ",", "initializer", "=", "tf", ".", "constant_initializer", "(", "bias_start", ",", "dtype", "=", "dtype", ")", ")", "return", "res", "+", "bias_term" ]
[ 83, 0 ]
[ 125, 26 ]
python
it
['en', 'it', 'it']
False
BasicConvLSTMCell.__init__
(self, shape, filter_size, num_features, forget_bias=1.0, state_is_tuple=False, activation=tf.nn.tanh)
shape: int tuple, height and width of the cell filter_size: int tuple, height and width of the filter num_features: int, depth of the cell forget_bias: float, forget gates bias state_is_tuple: If True, accepted and returned states are 2-tuples of the `c_state` and `m_state`. If False, they are concatenated along the column axis. The latter behavior will soon be deprecated. activation: activation function of the inner states
shape: int tuple, height and width of the cell filter_size: int tuple, height and width of the filter num_features: int, depth of the cell forget_bias: float, forget gates bias state_is_tuple: If True, accepted and returned states are 2-tuples of the `c_state` and `m_state`. If False, they are concatenated along the column axis. The latter behavior will soon be deprecated. activation: activation function of the inner states
def __init__(self, shape, filter_size, num_features, forget_bias=1.0, state_is_tuple=False, activation=tf.nn.tanh): """ shape: int tuple, height and width of the cell filter_size: int tuple, height and width of the filter num_features: int, depth of the cell forget_bias: float, forget gates bias state_is_tuple: If True, accepted and returned states are 2-tuples of the `c_state` and `m_state`. If False, they are concatenated along the column axis. The latter behavior will soon be deprecated. activation: activation function of the inner states """ self.shape = shape self.height, self.width = self.shape self.filter_size = filter_size self.num_features = num_features self._num_units = self.num_features * self.height * self.width self._forget_bias = forget_bias self._state_is_tuple = state_is_tuple self._activation = activation
[ "def", "__init__", "(", "self", ",", "shape", ",", "filter_size", ",", "num_features", ",", "forget_bias", "=", "1.0", ",", "state_is_tuple", "=", "False", ",", "activation", "=", "tf", ".", "nn", ".", "tanh", ")", ":", "self", ".", "shape", "=", "shape", "self", ".", "height", ",", "self", ".", "width", "=", "self", ".", "shape", "self", ".", "filter_size", "=", "filter_size", "self", ".", "num_features", "=", "num_features", "self", ".", "_num_units", "=", "self", ".", "num_features", "*", "self", ".", "height", "*", "self", ".", "width", "self", ".", "_forget_bias", "=", "forget_bias", "self", ".", "_state_is_tuple", "=", "state_is_tuple", "self", ".", "_activation", "=", "activation" ]
[ 9, 4 ]
[ 28, 37 ]
python
en
['en', 'error', 'th']
False
BasicConvLSTMCell.__call__
(self, inputs, state, scope=None)
Long short-term memory cell (LSTM).
Long short-term memory cell (LSTM).
def __call__(self, inputs, state, scope=None): """Long short-term memory cell (LSTM).""" with tf.variable_scope(scope or type(self).__name__): # "BasicLSTMCell" # Parameters of gates are concatenated into one multiply for efficiency. if self._state_is_tuple: c, h = state else: c, h = tf.split(axis=1, num_or_size_splits=2, value=state) batch_size = tf.shape(inputs)[0] inputs = tf.reshape(inputs, [batch_size, self.height, self.width, 1]) c = tf.reshape(c, [batch_size, self.height, self.width, self.num_features]) h = tf.reshape(h, [batch_size, self.height, self.width, self.num_features]) concat = _conv_linear([inputs, h], self.filter_size, self.num_features * 4, True) # i = input_gate, j = new_input, f = forget_gate, o = output_gate i, j, f, o = tf.split(axis=3, num_or_size_splits=4, value=concat) new_c = (c * tf.nn.sigmoid(f + self._forget_bias) + tf.nn.sigmoid(i) * self._activation(j)) new_h = self._activation(new_c) * tf.nn.sigmoid(o) new_h = tf.reshape(new_h, [batch_size, self._num_units]) new_c = tf.reshape(new_c, [batch_size, self._num_units]) if self._state_is_tuple: new_state = LSTMStateTuple(new_c, new_h) else: new_state = tf.concat(axis=1, values=[new_c, new_h]) return new_h, new_state
[ "def", "__call__", "(", "self", ",", "inputs", ",", "state", ",", "scope", "=", "None", ")", ":", "with", "tf", ".", "variable_scope", "(", "scope", "or", "type", "(", "self", ")", ".", "__name__", ")", ":", "# \"BasicLSTMCell\"", "# Parameters of gates are concatenated into one multiply for efficiency.", "if", "self", ".", "_state_is_tuple", ":", "c", ",", "h", "=", "state", "else", ":", "c", ",", "h", "=", "tf", ".", "split", "(", "axis", "=", "1", ",", "num_or_size_splits", "=", "2", ",", "value", "=", "state", ")", "batch_size", "=", "tf", ".", "shape", "(", "inputs", ")", "[", "0", "]", "inputs", "=", "tf", ".", "reshape", "(", "inputs", ",", "[", "batch_size", ",", "self", ".", "height", ",", "self", ".", "width", ",", "1", "]", ")", "c", "=", "tf", ".", "reshape", "(", "c", ",", "[", "batch_size", ",", "self", ".", "height", ",", "self", ".", "width", ",", "self", ".", "num_features", "]", ")", "h", "=", "tf", ".", "reshape", "(", "h", ",", "[", "batch_size", ",", "self", ".", "height", ",", "self", ".", "width", ",", "self", ".", "num_features", "]", ")", "concat", "=", "_conv_linear", "(", "[", "inputs", ",", "h", "]", ",", "self", ".", "filter_size", ",", "self", ".", "num_features", "*", "4", ",", "True", ")", "# i = input_gate, j = new_input, f = forget_gate, o = output_gate", "i", ",", "j", ",", "f", ",", "o", "=", "tf", ".", "split", "(", "axis", "=", "3", ",", "num_or_size_splits", "=", "4", ",", "value", "=", "concat", ")", "new_c", "=", "(", "c", "*", "tf", ".", "nn", ".", "sigmoid", "(", "f", "+", "self", ".", "_forget_bias", ")", "+", "tf", ".", "nn", ".", "sigmoid", "(", "i", ")", "*", "self", ".", "_activation", "(", "j", ")", ")", "new_h", "=", "self", ".", "_activation", "(", "new_c", ")", "*", "tf", ".", "nn", ".", "sigmoid", "(", "o", ")", "new_h", "=", "tf", ".", "reshape", "(", "new_h", ",", "[", "batch_size", ",", "self", ".", "_num_units", "]", ")", "new_c", "=", "tf", ".", "reshape", "(", "new_c", ",", "[", "batch_size", ",", "self", ".", "_num_units", "]", ")", "if", "self", ".", "_state_is_tuple", ":", "new_state", "=", "LSTMStateTuple", "(", "new_c", ",", "new_h", ")", "else", ":", "new_state", "=", "tf", ".", "concat", "(", "axis", "=", "1", ",", "values", "=", "[", "new_c", ",", "new_h", "]", ")", "return", "new_h", ",", "new_state" ]
[ 39, 4 ]
[ 70, 35 ]
python
en
['en', 'no', 'en']
True
BasicConvLSTMCell.zero_state
(self, batch_size, dtype)
Return zero-filled state tensor(s). Args: batch_size: int, float, or unit Tensor representing the batch size. dtype: the data type to use for the state. Returns: tensor of shape '[batch_size x shape[0] x shape[1] x num_features] filled with zeros
Return zero-filled state tensor(s). Args: batch_size: int, float, or unit Tensor representing the batch size. dtype: the data type to use for the state. Returns: tensor of shape '[batch_size x shape[0] x shape[1] x num_features] filled with zeros
def zero_state(self, batch_size, dtype): """Return zero-filled state tensor(s). Args: batch_size: int, float, or unit Tensor representing the batch size. dtype: the data type to use for the state. Returns: tensor of shape '[batch_size x shape[0] x shape[1] x num_features] filled with zeros """ return tf.zeros([batch_size, self._num_units * 2])
[ "def", "zero_state", "(", "self", ",", "batch_size", ",", "dtype", ")", ":", "return", "tf", ".", "zeros", "(", "[", "batch_size", ",", "self", ".", "_num_units", "*", "2", "]", ")" ]
[ 72, 4 ]
[ 81, 58 ]
python
en
['eu', 'no', 'en']
False
get_module
(name, should_load=True)
Return module or None. Absolute import is required. :param (str) name: Dot-separated module path. E.g., 'scipy.stats'. :raise: (ImportError) Only when exc_msg is defined. :return: (module|None) If import succeeds, the module will be returned.
Return module or None. Absolute import is required.
def get_module(name, should_load=True): """ Return module or None. Absolute import is required. :param (str) name: Dot-separated module path. E.g., 'scipy.stats'. :raise: (ImportError) Only when exc_msg is defined. :return: (module|None) If import succeeds, the module will be returned. """ if name in sys.modules: return sys.modules[name] if not should_load: return None if name not in _not_importable: try: return import_module(name) except ImportError: _not_importable.add(name) except Exception as e: _not_importable.add(name) msg = "Error importing optional module {}".format(name) logger.exception(msg)
[ "def", "get_module", "(", "name", ",", "should_load", "=", "True", ")", ":", "if", "name", "in", "sys", ".", "modules", ":", "return", "sys", ".", "modules", "[", "name", "]", "if", "not", "should_load", ":", "return", "None", "if", "name", "not", "in", "_not_importable", ":", "try", ":", "return", "import_module", "(", "name", ")", "except", "ImportError", ":", "_not_importable", ".", "add", "(", "name", ")", "except", "Exception", "as", "e", ":", "_not_importable", ".", "add", "(", "name", ")", "msg", "=", "\"Error importing optional module {}\"", ".", "format", "(", "name", ")", "logger", ".", "exception", "(", "msg", ")" ]
[ 14, 0 ]
[ 35, 33 ]
python
en
['en', 'error', 'th']
False
X.fill
(self)
Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. The 'fill' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. The 'fill' property is a number and may be specified as: - An int or float in the interval [0, 1]
def fill(self): """ Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. The 'fill' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["fill"]
[ "def", "fill", "(", "self", ")", ":", "return", "self", "[", "\"fill\"", "]" ]
[ 15, 4 ]
[ 29, 27 ]
python
en
['en', 'error', 'th']
False
X.locations
(self)
Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. The 'locations' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray
Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. The 'locations' property is an array that may be specified as a tuple, list, numpy array, or pandas Series
def locations(self): """ Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. The 'locations' property is an array that may be specified as a tuple, list, numpy array, or pandas Series Returns ------- numpy.ndarray """ return self["locations"]
[ "def", "locations", "(", "self", ")", ":", "return", "self", "[", "\"locations\"", "]" ]
[ 38, 4 ]
[ 51, 32 ]
python
en
['en', 'error', 'th']
False
X.locationssrc
(self)
Sets the source reference on Chart Studio Cloud for locations . The 'locationssrc' 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 locations . The 'locationssrc' property must be specified as a string or as a plotly.grid_objs.Column object
def locationssrc(self): """ Sets the source reference on Chart Studio Cloud for locations . The 'locationssrc' property must be specified as a string or as a plotly.grid_objs.Column object Returns ------- str """ return self["locationssrc"]
[ "def", "locationssrc", "(", "self", ")", ":", "return", "self", "[", "\"locationssrc\"", "]" ]
[ 60, 4 ]
[ 72, 35 ]
python
en
['en', 'error', 'th']
False
X.show
(self)
Determines whether or not slice planes about the x dimension are drawn. The 'show' property must be specified as a bool (either True, or False) Returns ------- bool
Determines whether or not slice planes about the x dimension are drawn. The 'show' property must be specified as a bool (either True, or False)
def show(self): """ Determines whether or not slice planes about the x dimension are drawn. The 'show' property must be specified as a bool (either True, or False) Returns ------- bool """ return self["show"]
[ "def", "show", "(", "self", ")", ":", "return", "self", "[", "\"show\"", "]" ]
[ 81, 4 ]
[ 93, 27 ]
python
en
['en', 'error', 'th']
False
X.__init__
( self, arg=None, fill=None, locations=None, locationssrc=None, show=None, **kwargs )
Construct a new X object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.isosurface.slices.X` fill Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. locations Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. locationssrc Sets the source reference on Chart Studio Cloud for locations . show Determines whether or not slice planes about the x dimension are drawn. Returns ------- X
Construct a new X object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.isosurface.slices.X` fill Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. locations Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. locationssrc Sets the source reference on Chart Studio Cloud for locations . show Determines whether or not slice planes about the x dimension are drawn.
def __init__( self, arg=None, fill=None, locations=None, locationssrc=None, show=None, **kwargs ): """ Construct a new X object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.isosurface.slices.X` fill Sets the fill ratio of the `slices`. The default fill value of the `slices` is 1 meaning that they are entirely shaded. On the other hand Applying a `fill` ratio less than one would allow the creation of openings parallel to the edges. locations Specifies the location(s) of slices on the axis. When not specified slices would be created for all points of the axis x except start and end. locationssrc Sets the source reference on Chart Studio Cloud for locations . show Determines whether or not slice planes about the x dimension are drawn. Returns ------- X """ super(X, self).__init__("x") 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.isosurface.slices.X constructor must be a dict or an instance of :class:`plotly.graph_objs.isosurface.slices.X`""" ) # 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("fill", None) _v = fill if fill is not None else _v if _v is not None: self["fill"] = _v _v = arg.pop("locations", None) _v = locations if locations is not None else _v if _v is not None: self["locations"] = _v _v = arg.pop("locationssrc", None) _v = locationssrc if locationssrc is not None else _v if _v is not None: self["locationssrc"] = _v _v = arg.pop("show", None) _v = show if show is not None else _v if _v is not None: self["show"] = _v # Process unknown kwargs # ---------------------- self._process_kwargs(**dict(arg, **kwargs)) # Reset skip_invalid # ------------------ self._skip_invalid = False
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "fill", "=", "None", ",", "locations", "=", "None", ",", "locationssrc", "=", "None", ",", "show", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "X", ",", "self", ")", ".", "__init__", "(", "\"x\"", ")", "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.isosurface.slices.X \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.isosurface.slices.X`\"\"\"", ")", "# 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", "(", "\"fill\"", ",", "None", ")", "_v", "=", "fill", "if", "fill", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"fill\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"locations\"", ",", "None", ")", "_v", "=", "locations", "if", "locations", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"locations\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"locationssrc\"", ",", "None", ")", "_v", "=", "locationssrc", "if", "locationssrc", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"locationssrc\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"show\"", ",", "None", ")", "_v", "=", "show", "if", "show", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"show\"", "]", "=", "_v", "# Process unknown kwargs", "# ----------------------", "self", ".", "_process_kwargs", "(", "*", "*", "dict", "(", "arg", ",", "*", "*", "kwargs", ")", ")", "# Reset skip_invalid", "# ------------------", "self", ".", "_skip_invalid", "=", "False" ]
[ 122, 4 ]
[ 213, 34 ]
python
en
['en', 'error', 'th']
False
InteractiveWorld.init_contexts
(self, shared=None)
Override to load or instantiate contexts to be used to seed the chat.
Override to load or instantiate contexts to be used to seed the chat.
def init_contexts(self, shared=None): """ Override to load or instantiate contexts to be used to seed the chat. """ pass
[ "def", "init_contexts", "(", "self", ",", "shared", "=", "None", ")", ":", "pass" ]
[ 26, 4 ]
[ 30, 12 ]
python
en
['en', 'error', 'th']
False
InteractiveWorld.get_contexts
(self)
Override to return a pair of contexts with which to seed the episode. This function will be called before the first turn of every episode.
Override to return a pair of contexts with which to seed the episode.
def get_contexts(self): """ Override to return a pair of contexts with which to seed the episode. This function will be called before the first turn of every episode. """ return ['', '']
[ "def", "get_contexts", "(", "self", ")", ":", "return", "[", "''", ",", "''", "]" ]
[ 32, 4 ]
[ 38, 23 ]
python
en
['en', 'error', 'th']
False
InteractiveWorld.parley
(self)
Agent 0 goes first. Alternate between the two agents.
Agent 0 goes first.
def parley(self): """ Agent 0 goes first. Alternate between the two agents. """ if self.turn_cnt == 0: self.p1, self.p2 = self.get_contexts() acts = self.acts agents = self.agents if self.turn_cnt == 0 and self.p1 != '': # add the context on to the first message to agent 0 context_act = Message( {'id': 'context', 'text': self.p1, 'episode_done': False} ) agents[0].observe(validate(context_act)) try: act = deepcopy(agents[0].act()) except StopIteration: self.reset() self.finalize_episode() self.turn_cnt = 0 return acts[0] = act if self.turn_cnt == 0 and self.p2 != '': # add the context on to the first message to agent 1 context_act = Message( {'id': 'context', 'text': self.p2, 'episode_done': False} ) agents[1].observe(validate(context_act)) agents[1].observe(validate(act)) acts[1] = agents[1].act() agents[0].observe(validate(acts[1])) self.update_counters() self.turn_cnt += 1 if act['episode_done']: self.finalize_episode() self.turn_cnt = 0
[ "def", "parley", "(", "self", ")", ":", "if", "self", ".", "turn_cnt", "==", "0", ":", "self", ".", "p1", ",", "self", ".", "p2", "=", "self", ".", "get_contexts", "(", ")", "acts", "=", "self", ".", "acts", "agents", "=", "self", ".", "agents", "if", "self", ".", "turn_cnt", "==", "0", "and", "self", ".", "p1", "!=", "''", ":", "# add the context on to the first message to agent 0", "context_act", "=", "Message", "(", "{", "'id'", ":", "'context'", ",", "'text'", ":", "self", ".", "p1", ",", "'episode_done'", ":", "False", "}", ")", "agents", "[", "0", "]", ".", "observe", "(", "validate", "(", "context_act", ")", ")", "try", ":", "act", "=", "deepcopy", "(", "agents", "[", "0", "]", ".", "act", "(", ")", ")", "except", "StopIteration", ":", "self", ".", "reset", "(", ")", "self", ".", "finalize_episode", "(", ")", "self", ".", "turn_cnt", "=", "0", "return", "acts", "[", "0", "]", "=", "act", "if", "self", ".", "turn_cnt", "==", "0", "and", "self", ".", "p2", "!=", "''", ":", "# add the context on to the first message to agent 1", "context_act", "=", "Message", "(", "{", "'id'", ":", "'context'", ",", "'text'", ":", "self", ".", "p2", ",", "'episode_done'", ":", "False", "}", ")", "agents", "[", "1", "]", ".", "observe", "(", "validate", "(", "context_act", ")", ")", "agents", "[", "1", "]", ".", "observe", "(", "validate", "(", "act", ")", ")", "acts", "[", "1", "]", "=", "agents", "[", "1", "]", ".", "act", "(", ")", "agents", "[", "0", "]", ".", "observe", "(", "validate", "(", "acts", "[", "1", "]", ")", ")", "self", ".", "update_counters", "(", ")", "self", ".", "turn_cnt", "+=", "1", "if", "act", "[", "'episode_done'", "]", ":", "self", ".", "finalize_episode", "(", ")", "self", ".", "turn_cnt", "=", "0" ]
[ 45, 4 ]
[ 84, 29 ]
python
en
['en', 'error', 'th']
False
Lighting.ambient
(self)
Ambient light increases overall color visibility but can wash out the image. The 'ambient' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Ambient light increases overall color visibility but can wash out the image. The 'ambient' property is a number and may be specified as: - An int or float in the interval [0, 1]
def ambient(self): """ Ambient light increases overall color visibility but can wash out the image. The 'ambient' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["ambient"]
[ "def", "ambient", "(", "self", ")", ":", "return", "self", "[", "\"ambient\"", "]" ]
[ 23, 4 ]
[ 35, 30 ]
python
en
['en', 'error', 'th']
False
Lighting.diffuse
(self)
Represents the extent that incident rays are reflected in a range of angles. The 'diffuse' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Represents the extent that incident rays are reflected in a range of angles. The 'diffuse' property is a number and may be specified as: - An int or float in the interval [0, 1]
def diffuse(self): """ Represents the extent that incident rays are reflected in a range of angles. The 'diffuse' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["diffuse"]
[ "def", "diffuse", "(", "self", ")", ":", "return", "self", "[", "\"diffuse\"", "]" ]
[ 44, 4 ]
[ 56, 30 ]
python
en
['en', 'error', 'th']
False
Lighting.facenormalsepsilon
(self)
Epsilon for face normals calculation avoids math issues arising from degenerate geometry. The 'facenormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Epsilon for face normals calculation avoids math issues arising from degenerate geometry. The 'facenormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1]
def facenormalsepsilon(self): """ Epsilon for face normals calculation avoids math issues arising from degenerate geometry. The 'facenormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["facenormalsepsilon"]
[ "def", "facenormalsepsilon", "(", "self", ")", ":", "return", "self", "[", "\"facenormalsepsilon\"", "]" ]
[ 65, 4 ]
[ 77, 41 ]
python
en
['en', 'error', 'th']
False
Lighting.fresnel
(self)
Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. The 'fresnel' property is a number and may be specified as: - An int or float in the interval [0, 5] Returns ------- int|float
Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. The 'fresnel' property is a number and may be specified as: - An int or float in the interval [0, 5]
def fresnel(self): """ Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. The 'fresnel' property is a number and may be specified as: - An int or float in the interval [0, 5] Returns ------- int|float """ return self["fresnel"]
[ "def", "fresnel", "(", "self", ")", ":", "return", "self", "[", "\"fresnel\"", "]" ]
[ 86, 4 ]
[ 99, 30 ]
python
en
['en', 'error', 'th']
False
Lighting.roughness
(self)
Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. The 'roughness' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. The 'roughness' property is a number and may be specified as: - An int or float in the interval [0, 1]
def roughness(self): """ Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. The 'roughness' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["roughness"]
[ "def", "roughness", "(", "self", ")", ":", "return", "self", "[", "\"roughness\"", "]" ]
[ 108, 4 ]
[ 120, 32 ]
python
en
['en', 'error', 'th']
False
Lighting.specular
(self)
Represents the level that incident rays are reflected in a single direction, causing shine. The 'specular' property is a number and may be specified as: - An int or float in the interval [0, 2] Returns ------- int|float
Represents the level that incident rays are reflected in a single direction, causing shine. The 'specular' property is a number and may be specified as: - An int or float in the interval [0, 2]
def specular(self): """ Represents the level that incident rays are reflected in a single direction, causing shine. The 'specular' property is a number and may be specified as: - An int or float in the interval [0, 2] Returns ------- int|float """ return self["specular"]
[ "def", "specular", "(", "self", ")", ":", "return", "self", "[", "\"specular\"", "]" ]
[ 129, 4 ]
[ 141, 31 ]
python
en
['en', 'error', 'th']
False
Lighting.vertexnormalsepsilon
(self)
Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry. The 'vertexnormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float
Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry. The 'vertexnormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1]
def vertexnormalsepsilon(self): """ Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry. The 'vertexnormalsepsilon' property is a number and may be specified as: - An int or float in the interval [0, 1] Returns ------- int|float """ return self["vertexnormalsepsilon"]
[ "def", "vertexnormalsepsilon", "(", "self", ")", ":", "return", "self", "[", "\"vertexnormalsepsilon\"", "]" ]
[ 150, 4 ]
[ 162, 43 ]
python
en
['en', 'error', 'th']
False
Lighting.__init__
( self, arg=None, ambient=None, diffuse=None, facenormalsepsilon=None, fresnel=None, roughness=None, specular=None, vertexnormalsepsilon=None, **kwargs )
Construct a new Lighting object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.mesh3d.Lighting` ambient Ambient light increases overall color visibility but can wash out the image. diffuse Represents the extent that incident rays are reflected in a range of angles. facenormalsepsilon Epsilon for face normals calculation avoids math issues arising from degenerate geometry. fresnel Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. roughness Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. specular Represents the level that incident rays are reflected in a single direction, causing shine. vertexnormalsepsilon Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry. Returns ------- Lighting
Construct a new Lighting object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.mesh3d.Lighting` ambient Ambient light increases overall color visibility but can wash out the image. diffuse Represents the extent that incident rays are reflected in a range of angles. facenormalsepsilon Epsilon for face normals calculation avoids math issues arising from degenerate geometry. fresnel Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. roughness Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. specular Represents the level that incident rays are reflected in a single direction, causing shine. vertexnormalsepsilon Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry.
def __init__( self, arg=None, ambient=None, diffuse=None, facenormalsepsilon=None, fresnel=None, roughness=None, specular=None, vertexnormalsepsilon=None, **kwargs ): """ Construct a new Lighting object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.mesh3d.Lighting` ambient Ambient light increases overall color visibility but can wash out the image. diffuse Represents the extent that incident rays are reflected in a range of angles. facenormalsepsilon Epsilon for face normals calculation avoids math issues arising from degenerate geometry. fresnel Represents the reflectance as a dependency of the viewing angle; e.g. paper is reflective when viewing it from the edge of the paper (almost 90 degrees), causing shine. roughness Alters specular reflection; the rougher the surface, the wider and less contrasty the shine. specular Represents the level that incident rays are reflected in a single direction, causing shine. vertexnormalsepsilon Epsilon for vertex normals calculation avoids math issues arising from degenerate geometry. Returns ------- Lighting """ super(Lighting, self).__init__("lighting") 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.mesh3d.Lighting constructor must be a dict or an instance of :class:`plotly.graph_objs.mesh3d.Lighting`""" ) # 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("ambient", None) _v = ambient if ambient is not None else _v if _v is not None: self["ambient"] = _v _v = arg.pop("diffuse", None) _v = diffuse if diffuse is not None else _v if _v is not None: self["diffuse"] = _v _v = arg.pop("facenormalsepsilon", None) _v = facenormalsepsilon if facenormalsepsilon is not None else _v if _v is not None: self["facenormalsepsilon"] = _v _v = arg.pop("fresnel", None) _v = fresnel if fresnel is not None else _v if _v is not None: self["fresnel"] = _v _v = arg.pop("roughness", None) _v = roughness if roughness is not None else _v if _v is not None: self["roughness"] = _v _v = arg.pop("specular", None) _v = specular if specular is not None else _v if _v is not None: self["specular"] = _v _v = arg.pop("vertexnormalsepsilon", None) _v = vertexnormalsepsilon if vertexnormalsepsilon is not None else _v if _v is not None: self["vertexnormalsepsilon"] = _v # Process unknown kwargs # ---------------------- self._process_kwargs(**dict(arg, **kwargs)) # Reset skip_invalid # ------------------ self._skip_invalid = False
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "ambient", "=", "None", ",", "diffuse", "=", "None", ",", "facenormalsepsilon", "=", "None", ",", "fresnel", "=", "None", ",", "roughness", "=", "None", ",", "specular", "=", "None", ",", "vertexnormalsepsilon", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "Lighting", ",", "self", ")", ".", "__init__", "(", "\"lighting\"", ")", "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.mesh3d.Lighting \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.mesh3d.Lighting`\"\"\"", ")", "# 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", "(", "\"ambient\"", ",", "None", ")", "_v", "=", "ambient", "if", "ambient", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"ambient\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"diffuse\"", ",", "None", ")", "_v", "=", "diffuse", "if", "diffuse", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"diffuse\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"facenormalsepsilon\"", ",", "None", ")", "_v", "=", "facenormalsepsilon", "if", "facenormalsepsilon", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"facenormalsepsilon\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"fresnel\"", ",", "None", ")", "_v", "=", "fresnel", "if", "fresnel", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"fresnel\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"roughness\"", ",", "None", ")", "_v", "=", "roughness", "if", "roughness", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"roughness\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"specular\"", ",", "None", ")", "_v", "=", "specular", "if", "specular", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"specular\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"vertexnormalsepsilon\"", ",", "None", ")", "_v", "=", "vertexnormalsepsilon", "if", "vertexnormalsepsilon", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"vertexnormalsepsilon\"", "]", "=", "_v", "# Process unknown kwargs", "# ----------------------", "self", ".", "_process_kwargs", "(", "*", "*", "dict", "(", "arg", ",", "*", "*", "kwargs", ")", ")", "# Reset skip_invalid", "# ------------------", "self", ".", "_skip_invalid", "=", "False" ]
[ 198, 4 ]
[ 311, 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.scatterpolar.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.scatterpolar.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.scatterpolar.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.scatterpolar.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.scatterpolar.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.scatterpolar.m arker.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.scatterpolar.m arker.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.scatterpolar.m arker.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.scatterpolar.marker.colorbar.Title constructor must be a dict or an instance of :class:`plotly.graph_objs.scatterpolar.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.scatterpolar.marker.colorbar.Title \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatterpolar.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
YBins.end
(self)
Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. The 'end' property accepts values of any type Returns ------- Any
Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. The 'end' property accepts values of any type
def end(self): """ Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. The 'end' property accepts values of any type Returns ------- Any """ return self["end"]
[ "def", "end", "(", "self", ")", ":", "return", "self", "[", "\"end\"", "]" ]
[ 15, 4 ]
[ 30, 26 ]
python
en
['en', 'error', 'th']
False
YBins.size
(self)
Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). The 'size' property accepts values of any type Returns ------- Any
Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). The 'size' property accepts values of any type
def size(self): """ Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). The 'size' property accepts values of any type Returns ------- Any """ return self["size"]
[ "def", "size", "(", "self", ")", ":", "return", "self", "[", "\"size\"", "]" ]
[ 39, 4 ]
[ 56, 27 ]
python
en
['en', 'error', 'th']
False
YBins.start
(self)
Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. The 'start' property accepts values of any type Returns ------- Any
Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. The 'start' property accepts values of any type
def start(self): """ Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. The 'start' property accepts values of any type Returns ------- Any """ return self["start"]
[ "def", "start", "(", "self", ")", ":", "return", "self", "[", "\"start\"", "]" ]
[ 65, 4 ]
[ 84, 28 ]
python
en
['en', 'error', 'th']
False
YBins.__init__
(self, arg=None, end=None, size=None, start=None, **kwargs)
Construct a new YBins object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.histogram2dcontour.YBins` end Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. size Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). start Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. Returns ------- YBins
Construct a new YBins object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.histogram2dcontour.YBins` end Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. size Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). start Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5.
def __init__(self, arg=None, end=None, size=None, start=None, **kwargs): """ Construct a new YBins object Parameters ---------- arg dict of properties compatible with this constructor or an instance of :class:`plotly.graph_objs.histogram2dcontour.YBins` end Sets the end value for the y axis bins. The last bin may not end exactly at this value, we increment the bin edge by `size` from `start` until we reach or exceed `end`. Defaults to the maximum data value. Like `start`, for dates use a date string, and for category data `end` is based on the category serial numbers. size Sets the size of each y axis bin. Default behavior: If `nbinsy` is 0 or omitted, we choose a nice round bin size such that the number of bins is about the same as the typical number of samples in each bin. If `nbinsy` is provided, we choose a nice round bin size giving no more than that many bins. For date data, use milliseconds or "M<n>" for months, as in `axis.dtick`. For category data, the number of categories to bin together (always defaults to 1). start Sets the starting value for the y axis bins. Defaults to the minimum data value, shifted down if necessary to make nice round values and to remove ambiguous bin edges. For example, if most of the data is integers we shift the bin edges 0.5 down, so a `size` of 5 would have a default `start` of -0.5, so it is clear that 0-4 are in the first bin, 5-9 in the second, but continuous data gets a start of 0 and bins [0,5), [5,10) etc. Dates behave similarly, and `start` should be a date string. For category data, `start` is based on the category serial numbers, and defaults to -0.5. Returns ------- YBins """ super(YBins, self).__init__("ybins") 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.histogram2dcontour.YBins constructor must be a dict or an instance of :class:`plotly.graph_objs.histogram2dcontour.YBins`""" ) # 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("end", None) _v = end if end is not None else _v if _v is not None: self["end"] = _v _v = arg.pop("size", None) _v = size if size is not None else _v if _v is not None: self["size"] = _v _v = arg.pop("start", None) _v = start if start is not None else _v if _v is not None: self["start"] = _v # Process unknown kwargs # ---------------------- self._process_kwargs(**dict(arg, **kwargs)) # Reset skip_invalid # ------------------ self._skip_invalid = False
[ "def", "__init__", "(", "self", ",", "arg", "=", "None", ",", "end", "=", "None", ",", "size", "=", "None", ",", "start", "=", "None", ",", "*", "*", "kwargs", ")", ":", "super", "(", "YBins", ",", "self", ")", ".", "__init__", "(", "\"ybins\"", ")", "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.histogram2dcontour.YBins \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.histogram2dcontour.YBins`\"\"\"", ")", "# 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", "(", "\"end\"", ",", "None", ")", "_v", "=", "end", "if", "end", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"end\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"size\"", ",", "None", ")", "_v", "=", "size", "if", "size", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"size\"", "]", "=", "_v", "_v", "=", "arg", ".", "pop", "(", "\"start\"", ",", "None", ")", "_v", "=", "start", "if", "start", "is", "not", "None", "else", "_v", "if", "_v", "is", "not", "None", ":", "self", "[", "\"start\"", "]", "=", "_v", "# Process unknown kwargs", "# ----------------------", "self", ".", "_process_kwargs", "(", "*", "*", "dict", "(", "arg", ",", "*", "*", "kwargs", ")", ")", "# Reset skip_invalid", "# ------------------", "self", ".", "_skip_invalid", "=", "False" ]
[ 126, 4 ]
[ 218, 34 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_attr
(looper, nodeSetWithOneNodeResponding, sdk_added_raw_attribute, attributeName, attributeData, sdk_pool_handle, sdk_wallet_client)
Tests that state proof is returned in the reply for GET_ATTR transactions. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_ATTR transactions. Use different submitter and reader!
def test_state_proof_returned_for_get_attr(looper, nodeSetWithOneNodeResponding, sdk_added_raw_attribute, attributeName, attributeData, sdk_pool_handle, sdk_wallet_client): """ Tests that state proof is returned in the reply for GET_ATTR transactions. Use different submitter and reader! """ get_attr_operation = { TARGET_NYM: sdk_added_raw_attribute['result']['txn']['data']['dest'], TXN_TYPE: GET_ATTR, RAW: attributeName } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_attr_operation) expected_data = attrib_raw_data_serializer.deserialize(attributeData) assert DATA in result data = attrib_raw_data_serializer.deserialize(result[DATA]) assert data == expected_data assert result[TXN_TIME] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_attr", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_added_raw_attribute", ",", "attributeName", ",", "attributeData", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ")", ":", "get_attr_operation", "=", "{", "TARGET_NYM", ":", "sdk_added_raw_attribute", "[", "'result'", "]", "[", "'txn'", "]", "[", "'data'", "]", "[", "'dest'", "]", ",", "TXN_TYPE", ":", "GET_ATTR", ",", "RAW", ":", "attributeName", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_attr_operation", ")", "expected_data", "=", "attrib_raw_data_serializer", ".", "deserialize", "(", "attributeData", ")", "assert", "DATA", "in", "result", "data", "=", "attrib_raw_data_serializer", ".", "deserialize", "(", "result", "[", "DATA", "]", ")", "assert", "data", "==", "expected_data", "assert", "result", "[", "TXN_TIME", "]", "check_valid_proof", "(", "result", ")" ]
[ 39, 0 ]
[ 64, 29 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_nym
(looper, nodeSetWithOneNodeResponding, sdk_user_wallet_a, sdk_pool_handle, sdk_wallet_client, sdk_wallet_endorser)
Tests that state proof is returned in the reply for GET_NYM transactions. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_NYM transactions. Use different submitter and reader!
def test_state_proof_returned_for_get_nym(looper, nodeSetWithOneNodeResponding, sdk_user_wallet_a, sdk_pool_handle, sdk_wallet_client, sdk_wallet_endorser): """ Tests that state proof is returned in the reply for GET_NYM transactions. Use different submitter and reader! """ _, dest = sdk_user_wallet_a nym_operation = { TARGET_NYM: dest, TXN_TYPE: NYM } sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_endorser, nym_operation) get_nym_operation = { TARGET_NYM: dest, TXN_TYPE: GET_NYM } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_nym_operation) assert DATA in result assert result[DATA] data = domain_state_serializer.deserialize(result[DATA]) assert ROLE in data assert VERKEY in data assert f.IDENTIFIER.nm in data assert result[TXN_TIME] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_nym", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_user_wallet_a", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "sdk_wallet_endorser", ")", ":", "_", ",", "dest", "=", "sdk_user_wallet_a", "nym_operation", "=", "{", "TARGET_NYM", ":", "dest", ",", "TXN_TYPE", ":", "NYM", "}", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_endorser", ",", "nym_operation", ")", "get_nym_operation", "=", "{", "TARGET_NYM", ":", "dest", ",", "TXN_TYPE", ":", "GET_NYM", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_nym_operation", ")", "assert", "DATA", "in", "result", "assert", "result", "[", "DATA", "]", "data", "=", "domain_state_serializer", ".", "deserialize", "(", "result", "[", "DATA", "]", ")", "assert", "ROLE", "in", "data", "assert", "VERKEY", "in", "data", "assert", "f", ".", "IDENTIFIER", ".", "nm", "in", "data", "assert", "result", "[", "TXN_TIME", "]", "check_valid_proof", "(", "result", ")" ]
[ 67, 0 ]
[ 103, 29 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_schema
(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client)
Tests that state proof is returned in the reply for GET_SCHEMA transactions. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_SCHEMA transactions. Use different submitter and reader!
def test_state_proof_returned_for_get_schema(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client): """ Tests that state proof is returned in the reply for GET_SCHEMA transactions. Use different submitter and reader! """ _, dest = sdk_wallet_endorser schema_name = "test_schema" schema_version = "1.0" schema_attr_names = ["width", "height"] data = { SCHEMA_NAME: schema_name, SCHEMA_VERSION: schema_version, SCHEMA_ATTR_NAMES: schema_attr_names } schema_operation = { TXN_TYPE: SCHEMA, DATA: data } sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_endorser, schema_operation) get_schema_operation = { TARGET_NYM: dest, TXN_TYPE: GET_SCHEMA, DATA: { NAME: schema_name, VERSION: schema_version, } } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_schema_operation) assert DATA in result data = result.get(DATA) assert data assert SCHEMA_ATTR_NAMES in data assert data[SCHEMA_ATTR_NAMES] == schema_attr_names assert NAME in data assert VERSION in data assert result[TXN_TIME] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_schema", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_wallet_endorser", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ")", ":", "_", ",", "dest", "=", "sdk_wallet_endorser", "schema_name", "=", "\"test_schema\"", "schema_version", "=", "\"1.0\"", "schema_attr_names", "=", "[", "\"width\"", ",", "\"height\"", "]", "data", "=", "{", "SCHEMA_NAME", ":", "schema_name", ",", "SCHEMA_VERSION", ":", "schema_version", ",", "SCHEMA_ATTR_NAMES", ":", "schema_attr_names", "}", "schema_operation", "=", "{", "TXN_TYPE", ":", "SCHEMA", ",", "DATA", ":", "data", "}", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_endorser", ",", "schema_operation", ")", "get_schema_operation", "=", "{", "TARGET_NYM", ":", "dest", ",", "TXN_TYPE", ":", "GET_SCHEMA", ",", "DATA", ":", "{", "NAME", ":", "schema_name", ",", "VERSION", ":", "schema_version", ",", "}", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_schema_operation", ")", "assert", "DATA", "in", "result", "data", "=", "result", ".", "get", "(", "DATA", ")", "assert", "data", "assert", "SCHEMA_ATTR_NAMES", "in", "data", "assert", "data", "[", "SCHEMA_ATTR_NAMES", "]", "==", "schema_attr_names", "assert", "NAME", "in", "data", "assert", "VERSION", "in", "data", "assert", "result", "[", "TXN_TIME", "]", "check_valid_proof", "(", "result", ")" ]
[ 106, 0 ]
[ 152, 29 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_rich_schema
(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, write_rich_schema, txn_type, rs_type, content, rs_id, rs_name, rs_version)
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID. Use different submitter and reader!
def test_state_proof_returned_for_get_rich_schema(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, write_rich_schema, txn_type, rs_type, content, rs_id, rs_name, rs_version): """ Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID. Use different submitter and reader! """ get_rich_schema_by_id_operation = { TXN_TYPE: GET_RICH_SCHEMA_OBJECT_BY_ID, RS_ID: rs_id, } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_rich_schema_by_id_operation) expected_data = SortedDict({ 'id': rs_id, 'rsType': rs_type, 'rsName': rs_name, 'rsVersion': rs_version, 'content': content, 'from': sdk_wallet_endorser[1] }) assert SortedDict(result['data']) == expected_data assert result['seqNo'] assert result['txnTime'] assert result['state_proof'] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_rich_schema", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_wallet_endorser", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "write_rich_schema", ",", "txn_type", ",", "rs_type", ",", "content", ",", "rs_id", ",", "rs_name", ",", "rs_version", ")", ":", "get_rich_schema_by_id_operation", "=", "{", "TXN_TYPE", ":", "GET_RICH_SCHEMA_OBJECT_BY_ID", ",", "RS_ID", ":", "rs_id", ",", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_rich_schema_by_id_operation", ")", "expected_data", "=", "SortedDict", "(", "{", "'id'", ":", "rs_id", ",", "'rsType'", ":", "rs_type", ",", "'rsName'", ":", "rs_name", ",", "'rsVersion'", ":", "rs_version", ",", "'content'", ":", "content", ",", "'from'", ":", "sdk_wallet_endorser", "[", "1", "]", "}", ")", "assert", "SortedDict", "(", "result", "[", "'data'", "]", ")", "==", "expected_data", "assert", "result", "[", "'seqNo'", "]", "assert", "result", "[", "'txnTime'", "]", "assert", "result", "[", "'state_proof'", "]", "check_valid_proof", "(", "result", ")" ]
[ 198, 0 ]
[ 228, 29 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_rich_schema_obj_by_metadata
(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, write_rich_schema, txn_type, rs_type, content, rs_id, rs_name, rs_version)
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_METADATA. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_METADATA. Use different submitter and reader!
def test_state_proof_returned_for_get_rich_schema_obj_by_metadata(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, write_rich_schema, txn_type, rs_type, content, rs_id, rs_name, rs_version): """ Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_METADATA. Use different submitter and reader! """ get_rich_schema_by_metadata_operation = { TXN_TYPE: GET_RICH_SCHEMA_OBJECT_BY_METADATA, RS_NAME: rs_name, RS_VERSION: rs_version, RS_TYPE: rs_type } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_rich_schema_by_metadata_operation) expected_data = SortedDict({ 'id': rs_id, 'rsType': rs_type, 'rsName': rs_name, 'rsVersion': rs_version, 'content': content, 'from': sdk_wallet_endorser[1] }) assert SortedDict(result['data']) == expected_data assert result['seqNo'] assert result['txnTime'] assert result['state_proof'] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_rich_schema_obj_by_metadata", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_wallet_endorser", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "write_rich_schema", ",", "txn_type", ",", "rs_type", ",", "content", ",", "rs_id", ",", "rs_name", ",", "rs_version", ")", ":", "get_rich_schema_by_metadata_operation", "=", "{", "TXN_TYPE", ":", "GET_RICH_SCHEMA_OBJECT_BY_METADATA", ",", "RS_NAME", ":", "rs_name", ",", "RS_VERSION", ":", "rs_version", ",", "RS_TYPE", ":", "rs_type", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_rich_schema_by_metadata_operation", ")", "expected_data", "=", "SortedDict", "(", "{", "'id'", ":", "rs_id", ",", "'rsType'", ":", "rs_type", ",", "'rsName'", ":", "rs_name", ",", "'rsVersion'", ":", "rs_version", ",", "'content'", ":", "content", ",", "'from'", ":", "sdk_wallet_endorser", "[", "1", "]", "}", ")", "assert", "SortedDict", "(", "result", "[", "'data'", "]", ")", "==", "expected_data", "assert", "result", "[", "'seqNo'", "]", "assert", "result", "[", "'txnTime'", "]", "assert", "result", "[", "'state_proof'", "]", "check_valid_proof", "(", "result", ")" ]
[ 235, 0 ]
[ 270, 29 ]
python
en
['en', 'error', 'th']
False
test_state_proof_returned_for_get_claim_def
(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, send_schema_seq_no)
Tests that state proof is returned in the reply for GET_CLAIM_DEF transactions. Use different submitter and reader!
Tests that state proof is returned in the reply for GET_CLAIM_DEF transactions. Use different submitter and reader!
def test_state_proof_returned_for_get_claim_def(looper, nodeSetWithOneNodeResponding, sdk_wallet_endorser, sdk_pool_handle, sdk_wallet_client, send_schema_seq_no): """ Tests that state proof is returned in the reply for GET_CLAIM_DEF transactions. Use different submitter and reader! """ _, dest = sdk_wallet_endorser data = {"primary": {'N': '123'}, REVOCATION: {'h0': '456'}} claim_def_operation = { TXN_TYPE: CLAIM_DEF, CLAIM_DEF_SCHEMA_REF: send_schema_seq_no, DATA: data, CLAIM_DEF_SIGNATURE_TYPE: 'CL', CLAIM_DEF_TAG: "tag1" } sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_endorser, claim_def_operation) get_claim_def_operation = { CLAIM_DEF_FROM: dest, TXN_TYPE: GET_CLAIM_DEF, CLAIM_DEF_SCHEMA_REF: send_schema_seq_no, CLAIM_DEF_SIGNATURE_TYPE: 'CL', CLAIM_DEF_TAG: "tag1" } result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle, sdk_wallet_client, get_claim_def_operation) expected_data = data assert DATA in result data = result.get(DATA) assert data assert data == expected_data assert result[TXN_TIME] check_valid_proof(result)
[ "def", "test_state_proof_returned_for_get_claim_def", "(", "looper", ",", "nodeSetWithOneNodeResponding", ",", "sdk_wallet_endorser", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "send_schema_seq_no", ")", ":", "_", ",", "dest", "=", "sdk_wallet_endorser", "data", "=", "{", "\"primary\"", ":", "{", "'N'", ":", "'123'", "}", ",", "REVOCATION", ":", "{", "'h0'", ":", "'456'", "}", "}", "claim_def_operation", "=", "{", "TXN_TYPE", ":", "CLAIM_DEF", ",", "CLAIM_DEF_SCHEMA_REF", ":", "send_schema_seq_no", ",", "DATA", ":", "data", ",", "CLAIM_DEF_SIGNATURE_TYPE", ":", "'CL'", ",", "CLAIM_DEF_TAG", ":", "\"tag1\"", "}", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_endorser", ",", "claim_def_operation", ")", "get_claim_def_operation", "=", "{", "CLAIM_DEF_FROM", ":", "dest", ",", "TXN_TYPE", ":", "GET_CLAIM_DEF", ",", "CLAIM_DEF_SCHEMA_REF", ":", "send_schema_seq_no", ",", "CLAIM_DEF_SIGNATURE_TYPE", ":", "'CL'", ",", "CLAIM_DEF_TAG", ":", "\"tag1\"", "}", "result", "=", "sdk_submit_operation_and_get_result", "(", "looper", ",", "sdk_pool_handle", ",", "sdk_wallet_client", ",", "get_claim_def_operation", ")", "expected_data", "=", "data", "assert", "DATA", "in", "result", "data", "=", "result", ".", "get", "(", "DATA", ")", "assert", "data", "assert", "data", "==", "expected_data", "assert", "result", "[", "TXN_TIME", "]", "check_valid_proof", "(", "result", ")" ]
[ 273, 0 ]
[ 314, 29 ]
python
en
['en', 'error', 'th']
False
TestAgentMessage.test_init
(self)
Tests init class
Tests init class
def test_init(self): """Tests init class""" SignedAgentMessage() with self.assertRaises(TypeError) as context: self.BadImplementationClass() # pylint: disable=E0110 assert "Can't instantiate abstract" in str(context.exception)
[ "def", "test_init", "(", "self", ")", ":", "SignedAgentMessage", "(", ")", "with", "self", ".", "assertRaises", "(", "TypeError", ")", "as", "context", ":", "self", ".", "BadImplementationClass", "(", ")", "# pylint: disable=E0110", "assert", "\"Can't instantiate abstract\"", "in", "str", "(", "context", ".", "exception", ")" ]
[ 51, 4 ]
[ 58, 69 ]
python
en
['en', 'en', 'en']
True
TestCredentialIssue.test_init
(self)
Test initializer
Test initializer
def test_init(self): """Test initializer""" credential_issue = CredentialIssue( comment="Test", credentials_attach=[ AttachDecorator.from_indy_dict( indy_dict=self.indy_cred, ident=ATTACH_DECO_IDS[CREDENTIAL_ISSUE], ) ], ) assert credential_issue.credentials_attach[0].indy_dict == self.indy_cred assert credential_issue.credentials_attach[0].ident # auto-generates UUID4 assert credential_issue.indy_credential(0) == self.indy_cred
[ "def", "test_init", "(", "self", ")", ":", "credential_issue", "=", "CredentialIssue", "(", "comment", "=", "\"Test\"", ",", "credentials_attach", "=", "[", "AttachDecorator", ".", "from_indy_dict", "(", "indy_dict", "=", "self", ".", "indy_cred", ",", "ident", "=", "ATTACH_DECO_IDS", "[", "CREDENTIAL_ISSUE", "]", ",", ")", "]", ",", ")", "assert", "credential_issue", ".", "credentials_attach", "[", "0", "]", ".", "indy_dict", "==", "self", ".", "indy_cred", "assert", "credential_issue", ".", "credentials_attach", "[", "0", "]", ".", "ident", "# auto-generates UUID4", "assert", "credential_issue", ".", "indy_credential", "(", "0", ")", "==", "self", ".", "indy_cred" ]
[ 76, 4 ]
[ 88, 68 ]
python
de
['de', 'pl', 'en']
False