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 |
---|---|---|---|---|---|---|---|---|---|---|---|
Data.scattercarpet | (self) |
The 'scattercarpet' property is a tuple of instances of
Scattercarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattercarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Scattercarpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattercarpet]
|
The 'scattercarpet' property is a tuple of instances of
Scattercarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattercarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Scattercarpet constructor
Supported dict properties: | def scattercarpet(self):
"""
The 'scattercarpet' property is a tuple of instances of
Scattercarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattercarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Scattercarpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattercarpet]
"""
return self["scattercarpet"] | [
"def",
"scattercarpet",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scattercarpet\"",
"]"
] | [
753,
4
] | [
767,
36
] | python | en | ['en', 'error', 'th'] | False |
Data.scattergeo | (self) |
The 'scattergeo' property is a tuple of instances of
Scattergeo that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergeo
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergeo constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattergeo]
|
The 'scattergeo' property is a tuple of instances of
Scattergeo that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergeo
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergeo constructor
Supported dict properties: | def scattergeo(self):
"""
The 'scattergeo' property is a tuple of instances of
Scattergeo that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergeo
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergeo constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattergeo]
"""
return self["scattergeo"] | [
"def",
"scattergeo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scattergeo\"",
"]"
] | [
776,
4
] | [
790,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.scattergl | (self) |
The 'scattergl' property is a tuple of instances of
Scattergl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergl
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattergl]
|
The 'scattergl' property is a tuple of instances of
Scattergl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergl
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergl constructor
Supported dict properties: | def scattergl(self):
"""
The 'scattergl' property is a tuple of instances of
Scattergl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattergl
- A list or tuple of dicts of string/value properties that
will be passed to the Scattergl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattergl]
"""
return self["scattergl"] | [
"def",
"scattergl",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scattergl\"",
"]"
] | [
799,
4
] | [
813,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.scattermapbox | (self) |
The 'scattermapbox' property is a tuple of instances of
Scattermapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattermapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Scattermapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattermapbox]
|
The 'scattermapbox' property is a tuple of instances of
Scattermapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattermapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Scattermapbox constructor
Supported dict properties: | def scattermapbox(self):
"""
The 'scattermapbox' property is a tuple of instances of
Scattermapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scattermapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Scattermapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scattermapbox]
"""
return self["scattermapbox"] | [
"def",
"scattermapbox",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scattermapbox\"",
"]"
] | [
822,
4
] | [
836,
36
] | python | en | ['en', 'error', 'th'] | False |
Data.scatterpolargl | (self) |
The 'scatterpolargl' property is a tuple of instances of
Scatterpolargl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolargl
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolargl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterpolargl]
|
The 'scatterpolargl' property is a tuple of instances of
Scatterpolargl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolargl
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolargl constructor
Supported dict properties: | def scatterpolargl(self):
"""
The 'scatterpolargl' property is a tuple of instances of
Scatterpolargl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolargl
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolargl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterpolargl]
"""
return self["scatterpolargl"] | [
"def",
"scatterpolargl",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scatterpolargl\"",
"]"
] | [
845,
4
] | [
859,
37
] | python | en | ['en', 'error', 'th'] | False |
Data.scatterpolar | (self) |
The 'scatterpolar' property is a tuple of instances of
Scatterpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterpolar]
|
The 'scatterpolar' property is a tuple of instances of
Scatterpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolar constructor
Supported dict properties: | def scatterpolar(self):
"""
The 'scatterpolar' property is a tuple of instances of
Scatterpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterpolar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterpolar]
"""
return self["scatterpolar"] | [
"def",
"scatterpolar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scatterpolar\"",
"]"
] | [
868,
4
] | [
882,
35
] | python | en | ['en', 'error', 'th'] | False |
Data.scatter | (self) |
The 'scatter' property is a tuple of instances of
Scatter that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatter]
|
The 'scatter' property is a tuple of instances of
Scatter that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter constructor
Supported dict properties: | def scatter(self):
"""
The 'scatter' property is a tuple of instances of
Scatter that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatter]
"""
return self["scatter"] | [
"def",
"scatter",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scatter\"",
"]"
] | [
891,
4
] | [
905,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.scatterternary | (self) |
The 'scatterternary' property is a tuple of instances of
Scatterternary that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterternary
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterternary constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterternary]
|
The 'scatterternary' property is a tuple of instances of
Scatterternary that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterternary
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterternary constructor
Supported dict properties: | def scatterternary(self):
"""
The 'scatterternary' property is a tuple of instances of
Scatterternary that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatterternary
- A list or tuple of dicts of string/value properties that
will be passed to the Scatterternary constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatterternary]
"""
return self["scatterternary"] | [
"def",
"scatterternary",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scatterternary\"",
"]"
] | [
914,
4
] | [
928,
37
] | python | en | ['en', 'error', 'th'] | False |
Data.splom | (self) |
The 'splom' property is a tuple of instances of
Splom that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Splom
- A list or tuple of dicts of string/value properties that
will be passed to the Splom constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Splom]
|
The 'splom' property is a tuple of instances of
Splom that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Splom
- A list or tuple of dicts of string/value properties that
will be passed to the Splom constructor
Supported dict properties: | def splom(self):
"""
The 'splom' property is a tuple of instances of
Splom that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Splom
- A list or tuple of dicts of string/value properties that
will be passed to the Splom constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Splom]
"""
return self["splom"] | [
"def",
"splom",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"splom\"",
"]"
] | [
937,
4
] | [
951,
28
] | python | en | ['en', 'error', 'th'] | False |
Data.streamtube | (self) |
The 'streamtube' property is a tuple of instances of
Streamtube that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Streamtube
- A list or tuple of dicts of string/value properties that
will be passed to the Streamtube constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Streamtube]
|
The 'streamtube' property is a tuple of instances of
Streamtube that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Streamtube
- A list or tuple of dicts of string/value properties that
will be passed to the Streamtube constructor
Supported dict properties: | def streamtube(self):
"""
The 'streamtube' property is a tuple of instances of
Streamtube that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Streamtube
- A list or tuple of dicts of string/value properties that
will be passed to the Streamtube constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Streamtube]
"""
return self["streamtube"] | [
"def",
"streamtube",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"streamtube\"",
"]"
] | [
960,
4
] | [
974,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.sunburst | (self) |
The 'sunburst' property is a tuple of instances of
Sunburst that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sunburst
- A list or tuple of dicts of string/value properties that
will be passed to the Sunburst constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Sunburst]
|
The 'sunburst' property is a tuple of instances of
Sunburst that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sunburst
- A list or tuple of dicts of string/value properties that
will be passed to the Sunburst constructor
Supported dict properties: | def sunburst(self):
"""
The 'sunburst' property is a tuple of instances of
Sunburst that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sunburst
- A list or tuple of dicts of string/value properties that
will be passed to the Sunburst constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Sunburst]
"""
return self["sunburst"] | [
"def",
"sunburst",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sunburst\"",
"]"
] | [
983,
4
] | [
997,
31
] | python | en | ['en', 'error', 'th'] | False |
Data.surface | (self) |
The 'surface' property is a tuple of instances of
Surface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Surface
- A list or tuple of dicts of string/value properties that
will be passed to the Surface constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Surface]
|
The 'surface' property is a tuple of instances of
Surface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Surface
- A list or tuple of dicts of string/value properties that
will be passed to the Surface constructor
Supported dict properties: | def surface(self):
"""
The 'surface' property is a tuple of instances of
Surface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Surface
- A list or tuple of dicts of string/value properties that
will be passed to the Surface constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Surface]
"""
return self["surface"] | [
"def",
"surface",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"surface\"",
"]"
] | [
1006,
4
] | [
1020,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.table | (self) |
The 'table' property is a tuple of instances of
Table that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Table
- A list or tuple of dicts of string/value properties that
will be passed to the Table constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Table]
|
The 'table' property is a tuple of instances of
Table that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Table
- A list or tuple of dicts of string/value properties that
will be passed to the Table constructor
Supported dict properties: | def table(self):
"""
The 'table' property is a tuple of instances of
Table that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Table
- A list or tuple of dicts of string/value properties that
will be passed to the Table constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Table]
"""
return self["table"] | [
"def",
"table",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"table\"",
"]"
] | [
1029,
4
] | [
1043,
28
] | python | en | ['en', 'error', 'th'] | False |
Data.treemap | (self) |
The 'treemap' property is a tuple of instances of
Treemap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Treemap
- A list or tuple of dicts of string/value properties that
will be passed to the Treemap constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Treemap]
|
The 'treemap' property is a tuple of instances of
Treemap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Treemap
- A list or tuple of dicts of string/value properties that
will be passed to the Treemap constructor
Supported dict properties: | def treemap(self):
"""
The 'treemap' property is a tuple of instances of
Treemap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Treemap
- A list or tuple of dicts of string/value properties that
will be passed to the Treemap constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Treemap]
"""
return self["treemap"] | [
"def",
"treemap",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"treemap\"",
"]"
] | [
1052,
4
] | [
1066,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.violin | (self) |
The 'violin' property is a tuple of instances of
Violin that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Violin
- A list or tuple of dicts of string/value properties that
will be passed to the Violin constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Violin]
|
The 'violin' property is a tuple of instances of
Violin that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Violin
- A list or tuple of dicts of string/value properties that
will be passed to the Violin constructor
Supported dict properties: | def violin(self):
"""
The 'violin' property is a tuple of instances of
Violin that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Violin
- A list or tuple of dicts of string/value properties that
will be passed to the Violin constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Violin]
"""
return self["violin"] | [
"def",
"violin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"violin\"",
"]"
] | [
1075,
4
] | [
1089,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.volume | (self) |
The 'volume' property is a tuple of instances of
Volume that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Volume
- A list or tuple of dicts of string/value properties that
will be passed to the Volume constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Volume]
|
The 'volume' property is a tuple of instances of
Volume that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Volume
- A list or tuple of dicts of string/value properties that
will be passed to the Volume constructor
Supported dict properties: | def volume(self):
"""
The 'volume' property is a tuple of instances of
Volume that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Volume
- A list or tuple of dicts of string/value properties that
will be passed to the Volume constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Volume]
"""
return self["volume"] | [
"def",
"volume",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"volume\"",
"]"
] | [
1098,
4
] | [
1112,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.waterfall | (self) |
The 'waterfall' property is a tuple of instances of
Waterfall that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Waterfall
- A list or tuple of dicts of string/value properties that
will be passed to the Waterfall constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Waterfall]
|
The 'waterfall' property is a tuple of instances of
Waterfall that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Waterfall
- A list or tuple of dicts of string/value properties that
will be passed to the Waterfall constructor
Supported dict properties: | def waterfall(self):
"""
The 'waterfall' property is a tuple of instances of
Waterfall that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Waterfall
- A list or tuple of dicts of string/value properties that
will be passed to the Waterfall constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Waterfall]
"""
return self["waterfall"] | [
"def",
"waterfall",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"waterfall\"",
"]"
] | [
1121,
4
] | [
1135,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.__init__ | (
self,
arg=None,
area=None,
barpolar=None,
bar=None,
box=None,
candlestick=None,
carpet=None,
choroplethmapbox=None,
choropleth=None,
cone=None,
contourcarpet=None,
contour=None,
densitymapbox=None,
funnelarea=None,
funnel=None,
heatmapgl=None,
heatmap=None,
histogram2dcontour=None,
histogram2d=None,
histogram=None,
image=None,
indicator=None,
isosurface=None,
mesh3d=None,
ohlc=None,
parcats=None,
parcoords=None,
pie=None,
pointcloud=None,
sankey=None,
scatter3d=None,
scattercarpet=None,
scattergeo=None,
scattergl=None,
scattermapbox=None,
scatterpolargl=None,
scatterpolar=None,
scatter=None,
scatterternary=None,
splom=None,
streamtube=None,
sunburst=None,
surface=None,
table=None,
treemap=None,
violin=None,
volume=None,
waterfall=None,
**kwargs
) |
Construct a new Data object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.template.Data`
area
A tuple of :class:`plotly.graph_objects.Area` instances
or dicts with compatible properties
barpolar
A tuple of :class:`plotly.graph_objects.Barpolar`
instances or dicts with compatible properties
bar
A tuple of :class:`plotly.graph_objects.Bar` instances
or dicts with compatible properties
box
A tuple of :class:`plotly.graph_objects.Box` instances
or dicts with compatible properties
candlestick
A tuple of :class:`plotly.graph_objects.Candlestick`
instances or dicts with compatible properties
carpet
A tuple of :class:`plotly.graph_objects.Carpet`
instances or dicts with compatible properties
choroplethmapbox
A tuple of
:class:`plotly.graph_objects.Choroplethmapbox`
instances or dicts with compatible properties
choropleth
A tuple of :class:`plotly.graph_objects.Choropleth`
instances or dicts with compatible properties
cone
A tuple of :class:`plotly.graph_objects.Cone` instances
or dicts with compatible properties
contourcarpet
A tuple of :class:`plotly.graph_objects.Contourcarpet`
instances or dicts with compatible properties
contour
A tuple of :class:`plotly.graph_objects.Contour`
instances or dicts with compatible properties
densitymapbox
A tuple of :class:`plotly.graph_objects.Densitymapbox`
instances or dicts with compatible properties
funnelarea
A tuple of :class:`plotly.graph_objects.Funnelarea`
instances or dicts with compatible properties
funnel
A tuple of :class:`plotly.graph_objects.Funnel`
instances or dicts with compatible properties
heatmapgl
A tuple of :class:`plotly.graph_objects.Heatmapgl`
instances or dicts with compatible properties
heatmap
A tuple of :class:`plotly.graph_objects.Heatmap`
instances or dicts with compatible properties
histogram2dcontour
A tuple of
:class:`plotly.graph_objects.Histogram2dContour`
instances or dicts with compatible properties
histogram2d
A tuple of :class:`plotly.graph_objects.Histogram2d`
instances or dicts with compatible properties
histogram
A tuple of :class:`plotly.graph_objects.Histogram`
instances or dicts with compatible properties
image
A tuple of :class:`plotly.graph_objects.Image`
instances or dicts with compatible properties
indicator
A tuple of :class:`plotly.graph_objects.Indicator`
instances or dicts with compatible properties
isosurface
A tuple of :class:`plotly.graph_objects.Isosurface`
instances or dicts with compatible properties
mesh3d
A tuple of :class:`plotly.graph_objects.Mesh3d`
instances or dicts with compatible properties
ohlc
A tuple of :class:`plotly.graph_objects.Ohlc` instances
or dicts with compatible properties
parcats
A tuple of :class:`plotly.graph_objects.Parcats`
instances or dicts with compatible properties
parcoords
A tuple of :class:`plotly.graph_objects.Parcoords`
instances or dicts with compatible properties
pie
A tuple of :class:`plotly.graph_objects.Pie` instances
or dicts with compatible properties
pointcloud
A tuple of :class:`plotly.graph_objects.Pointcloud`
instances or dicts with compatible properties
sankey
A tuple of :class:`plotly.graph_objects.Sankey`
instances or dicts with compatible properties
scatter3d
A tuple of :class:`plotly.graph_objects.Scatter3d`
instances or dicts with compatible properties
scattercarpet
A tuple of :class:`plotly.graph_objects.Scattercarpet`
instances or dicts with compatible properties
scattergeo
A tuple of :class:`plotly.graph_objects.Scattergeo`
instances or dicts with compatible properties
scattergl
A tuple of :class:`plotly.graph_objects.Scattergl`
instances or dicts with compatible properties
scattermapbox
A tuple of :class:`plotly.graph_objects.Scattermapbox`
instances or dicts with compatible properties
scatterpolargl
A tuple of :class:`plotly.graph_objects.Scatterpolargl`
instances or dicts with compatible properties
scatterpolar
A tuple of :class:`plotly.graph_objects.Scatterpolar`
instances or dicts with compatible properties
scatter
A tuple of :class:`plotly.graph_objects.Scatter`
instances or dicts with compatible properties
scatterternary
A tuple of :class:`plotly.graph_objects.Scatterternary`
instances or dicts with compatible properties
splom
A tuple of :class:`plotly.graph_objects.Splom`
instances or dicts with compatible properties
streamtube
A tuple of :class:`plotly.graph_objects.Streamtube`
instances or dicts with compatible properties
sunburst
A tuple of :class:`plotly.graph_objects.Sunburst`
instances or dicts with compatible properties
surface
A tuple of :class:`plotly.graph_objects.Surface`
instances or dicts with compatible properties
table
A tuple of :class:`plotly.graph_objects.Table`
instances or dicts with compatible properties
treemap
A tuple of :class:`plotly.graph_objects.Treemap`
instances or dicts with compatible properties
violin
A tuple of :class:`plotly.graph_objects.Violin`
instances or dicts with compatible properties
volume
A tuple of :class:`plotly.graph_objects.Volume`
instances or dicts with compatible properties
waterfall
A tuple of :class:`plotly.graph_objects.Waterfall`
instances or dicts with compatible properties
Returns
-------
Data
|
Construct a new Data object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.template.Data`
area
A tuple of :class:`plotly.graph_objects.Area` instances
or dicts with compatible properties
barpolar
A tuple of :class:`plotly.graph_objects.Barpolar`
instances or dicts with compatible properties
bar
A tuple of :class:`plotly.graph_objects.Bar` instances
or dicts with compatible properties
box
A tuple of :class:`plotly.graph_objects.Box` instances
or dicts with compatible properties
candlestick
A tuple of :class:`plotly.graph_objects.Candlestick`
instances or dicts with compatible properties
carpet
A tuple of :class:`plotly.graph_objects.Carpet`
instances or dicts with compatible properties
choroplethmapbox
A tuple of
:class:`plotly.graph_objects.Choroplethmapbox`
instances or dicts with compatible properties
choropleth
A tuple of :class:`plotly.graph_objects.Choropleth`
instances or dicts with compatible properties
cone
A tuple of :class:`plotly.graph_objects.Cone` instances
or dicts with compatible properties
contourcarpet
A tuple of :class:`plotly.graph_objects.Contourcarpet`
instances or dicts with compatible properties
contour
A tuple of :class:`plotly.graph_objects.Contour`
instances or dicts with compatible properties
densitymapbox
A tuple of :class:`plotly.graph_objects.Densitymapbox`
instances or dicts with compatible properties
funnelarea
A tuple of :class:`plotly.graph_objects.Funnelarea`
instances or dicts with compatible properties
funnel
A tuple of :class:`plotly.graph_objects.Funnel`
instances or dicts with compatible properties
heatmapgl
A tuple of :class:`plotly.graph_objects.Heatmapgl`
instances or dicts with compatible properties
heatmap
A tuple of :class:`plotly.graph_objects.Heatmap`
instances or dicts with compatible properties
histogram2dcontour
A tuple of
:class:`plotly.graph_objects.Histogram2dContour`
instances or dicts with compatible properties
histogram2d
A tuple of :class:`plotly.graph_objects.Histogram2d`
instances or dicts with compatible properties
histogram
A tuple of :class:`plotly.graph_objects.Histogram`
instances or dicts with compatible properties
image
A tuple of :class:`plotly.graph_objects.Image`
instances or dicts with compatible properties
indicator
A tuple of :class:`plotly.graph_objects.Indicator`
instances or dicts with compatible properties
isosurface
A tuple of :class:`plotly.graph_objects.Isosurface`
instances or dicts with compatible properties
mesh3d
A tuple of :class:`plotly.graph_objects.Mesh3d`
instances or dicts with compatible properties
ohlc
A tuple of :class:`plotly.graph_objects.Ohlc` instances
or dicts with compatible properties
parcats
A tuple of :class:`plotly.graph_objects.Parcats`
instances or dicts with compatible properties
parcoords
A tuple of :class:`plotly.graph_objects.Parcoords`
instances or dicts with compatible properties
pie
A tuple of :class:`plotly.graph_objects.Pie` instances
or dicts with compatible properties
pointcloud
A tuple of :class:`plotly.graph_objects.Pointcloud`
instances or dicts with compatible properties
sankey
A tuple of :class:`plotly.graph_objects.Sankey`
instances or dicts with compatible properties
scatter3d
A tuple of :class:`plotly.graph_objects.Scatter3d`
instances or dicts with compatible properties
scattercarpet
A tuple of :class:`plotly.graph_objects.Scattercarpet`
instances or dicts with compatible properties
scattergeo
A tuple of :class:`plotly.graph_objects.Scattergeo`
instances or dicts with compatible properties
scattergl
A tuple of :class:`plotly.graph_objects.Scattergl`
instances or dicts with compatible properties
scattermapbox
A tuple of :class:`plotly.graph_objects.Scattermapbox`
instances or dicts with compatible properties
scatterpolargl
A tuple of :class:`plotly.graph_objects.Scatterpolargl`
instances or dicts with compatible properties
scatterpolar
A tuple of :class:`plotly.graph_objects.Scatterpolar`
instances or dicts with compatible properties
scatter
A tuple of :class:`plotly.graph_objects.Scatter`
instances or dicts with compatible properties
scatterternary
A tuple of :class:`plotly.graph_objects.Scatterternary`
instances or dicts with compatible properties
splom
A tuple of :class:`plotly.graph_objects.Splom`
instances or dicts with compatible properties
streamtube
A tuple of :class:`plotly.graph_objects.Streamtube`
instances or dicts with compatible properties
sunburst
A tuple of :class:`plotly.graph_objects.Sunburst`
instances or dicts with compatible properties
surface
A tuple of :class:`plotly.graph_objects.Surface`
instances or dicts with compatible properties
table
A tuple of :class:`plotly.graph_objects.Table`
instances or dicts with compatible properties
treemap
A tuple of :class:`plotly.graph_objects.Treemap`
instances or dicts with compatible properties
violin
A tuple of :class:`plotly.graph_objects.Violin`
instances or dicts with compatible properties
volume
A tuple of :class:`plotly.graph_objects.Volume`
instances or dicts with compatible properties
waterfall
A tuple of :class:`plotly.graph_objects.Waterfall`
instances or dicts with compatible properties | def __init__(
self,
arg=None,
area=None,
barpolar=None,
bar=None,
box=None,
candlestick=None,
carpet=None,
choroplethmapbox=None,
choropleth=None,
cone=None,
contourcarpet=None,
contour=None,
densitymapbox=None,
funnelarea=None,
funnel=None,
heatmapgl=None,
heatmap=None,
histogram2dcontour=None,
histogram2d=None,
histogram=None,
image=None,
indicator=None,
isosurface=None,
mesh3d=None,
ohlc=None,
parcats=None,
parcoords=None,
pie=None,
pointcloud=None,
sankey=None,
scatter3d=None,
scattercarpet=None,
scattergeo=None,
scattergl=None,
scattermapbox=None,
scatterpolargl=None,
scatterpolar=None,
scatter=None,
scatterternary=None,
splom=None,
streamtube=None,
sunburst=None,
surface=None,
table=None,
treemap=None,
violin=None,
volume=None,
waterfall=None,
**kwargs
):
"""
Construct a new Data object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.layout.template.Data`
area
A tuple of :class:`plotly.graph_objects.Area` instances
or dicts with compatible properties
barpolar
A tuple of :class:`plotly.graph_objects.Barpolar`
instances or dicts with compatible properties
bar
A tuple of :class:`plotly.graph_objects.Bar` instances
or dicts with compatible properties
box
A tuple of :class:`plotly.graph_objects.Box` instances
or dicts with compatible properties
candlestick
A tuple of :class:`plotly.graph_objects.Candlestick`
instances or dicts with compatible properties
carpet
A tuple of :class:`plotly.graph_objects.Carpet`
instances or dicts with compatible properties
choroplethmapbox
A tuple of
:class:`plotly.graph_objects.Choroplethmapbox`
instances or dicts with compatible properties
choropleth
A tuple of :class:`plotly.graph_objects.Choropleth`
instances or dicts with compatible properties
cone
A tuple of :class:`plotly.graph_objects.Cone` instances
or dicts with compatible properties
contourcarpet
A tuple of :class:`plotly.graph_objects.Contourcarpet`
instances or dicts with compatible properties
contour
A tuple of :class:`plotly.graph_objects.Contour`
instances or dicts with compatible properties
densitymapbox
A tuple of :class:`plotly.graph_objects.Densitymapbox`
instances or dicts with compatible properties
funnelarea
A tuple of :class:`plotly.graph_objects.Funnelarea`
instances or dicts with compatible properties
funnel
A tuple of :class:`plotly.graph_objects.Funnel`
instances or dicts with compatible properties
heatmapgl
A tuple of :class:`plotly.graph_objects.Heatmapgl`
instances or dicts with compatible properties
heatmap
A tuple of :class:`plotly.graph_objects.Heatmap`
instances or dicts with compatible properties
histogram2dcontour
A tuple of
:class:`plotly.graph_objects.Histogram2dContour`
instances or dicts with compatible properties
histogram2d
A tuple of :class:`plotly.graph_objects.Histogram2d`
instances or dicts with compatible properties
histogram
A tuple of :class:`plotly.graph_objects.Histogram`
instances or dicts with compatible properties
image
A tuple of :class:`plotly.graph_objects.Image`
instances or dicts with compatible properties
indicator
A tuple of :class:`plotly.graph_objects.Indicator`
instances or dicts with compatible properties
isosurface
A tuple of :class:`plotly.graph_objects.Isosurface`
instances or dicts with compatible properties
mesh3d
A tuple of :class:`plotly.graph_objects.Mesh3d`
instances or dicts with compatible properties
ohlc
A tuple of :class:`plotly.graph_objects.Ohlc` instances
or dicts with compatible properties
parcats
A tuple of :class:`plotly.graph_objects.Parcats`
instances or dicts with compatible properties
parcoords
A tuple of :class:`plotly.graph_objects.Parcoords`
instances or dicts with compatible properties
pie
A tuple of :class:`plotly.graph_objects.Pie` instances
or dicts with compatible properties
pointcloud
A tuple of :class:`plotly.graph_objects.Pointcloud`
instances or dicts with compatible properties
sankey
A tuple of :class:`plotly.graph_objects.Sankey`
instances or dicts with compatible properties
scatter3d
A tuple of :class:`plotly.graph_objects.Scatter3d`
instances or dicts with compatible properties
scattercarpet
A tuple of :class:`plotly.graph_objects.Scattercarpet`
instances or dicts with compatible properties
scattergeo
A tuple of :class:`plotly.graph_objects.Scattergeo`
instances or dicts with compatible properties
scattergl
A tuple of :class:`plotly.graph_objects.Scattergl`
instances or dicts with compatible properties
scattermapbox
A tuple of :class:`plotly.graph_objects.Scattermapbox`
instances or dicts with compatible properties
scatterpolargl
A tuple of :class:`plotly.graph_objects.Scatterpolargl`
instances or dicts with compatible properties
scatterpolar
A tuple of :class:`plotly.graph_objects.Scatterpolar`
instances or dicts with compatible properties
scatter
A tuple of :class:`plotly.graph_objects.Scatter`
instances or dicts with compatible properties
scatterternary
A tuple of :class:`plotly.graph_objects.Scatterternary`
instances or dicts with compatible properties
splom
A tuple of :class:`plotly.graph_objects.Splom`
instances or dicts with compatible properties
streamtube
A tuple of :class:`plotly.graph_objects.Streamtube`
instances or dicts with compatible properties
sunburst
A tuple of :class:`plotly.graph_objects.Sunburst`
instances or dicts with compatible properties
surface
A tuple of :class:`plotly.graph_objects.Surface`
instances or dicts with compatible properties
table
A tuple of :class:`plotly.graph_objects.Table`
instances or dicts with compatible properties
treemap
A tuple of :class:`plotly.graph_objects.Treemap`
instances or dicts with compatible properties
violin
A tuple of :class:`plotly.graph_objects.Violin`
instances or dicts with compatible properties
volume
A tuple of :class:`plotly.graph_objects.Volume`
instances or dicts with compatible properties
waterfall
A tuple of :class:`plotly.graph_objects.Waterfall`
instances or dicts with compatible properties
Returns
-------
Data
"""
super(Data, self).__init__("data")
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.template.Data
constructor must be a dict or
an instance of :class:`plotly.graph_objs.layout.template.Data`"""
)
# 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("area", None)
_v = area if area is not None else _v
if _v is not None:
self["area"] = _v
_v = arg.pop("barpolar", None)
_v = barpolar if barpolar is not None else _v
if _v is not None:
self["barpolar"] = _v
_v = arg.pop("bar", None)
_v = bar if bar is not None else _v
if _v is not None:
self["bar"] = _v
_v = arg.pop("box", None)
_v = box if box is not None else _v
if _v is not None:
self["box"] = _v
_v = arg.pop("candlestick", None)
_v = candlestick if candlestick is not None else _v
if _v is not None:
self["candlestick"] = _v
_v = arg.pop("carpet", None)
_v = carpet if carpet is not None else _v
if _v is not None:
self["carpet"] = _v
_v = arg.pop("choroplethmapbox", None)
_v = choroplethmapbox if choroplethmapbox is not None else _v
if _v is not None:
self["choroplethmapbox"] = _v
_v = arg.pop("choropleth", None)
_v = choropleth if choropleth is not None else _v
if _v is not None:
self["choropleth"] = _v
_v = arg.pop("cone", None)
_v = cone if cone is not None else _v
if _v is not None:
self["cone"] = _v
_v = arg.pop("contourcarpet", None)
_v = contourcarpet if contourcarpet is not None else _v
if _v is not None:
self["contourcarpet"] = _v
_v = arg.pop("contour", None)
_v = contour if contour is not None else _v
if _v is not None:
self["contour"] = _v
_v = arg.pop("densitymapbox", None)
_v = densitymapbox if densitymapbox is not None else _v
if _v is not None:
self["densitymapbox"] = _v
_v = arg.pop("funnelarea", None)
_v = funnelarea if funnelarea is not None else _v
if _v is not None:
self["funnelarea"] = _v
_v = arg.pop("funnel", None)
_v = funnel if funnel is not None else _v
if _v is not None:
self["funnel"] = _v
_v = arg.pop("heatmapgl", None)
_v = heatmapgl if heatmapgl is not None else _v
if _v is not None:
self["heatmapgl"] = _v
_v = arg.pop("heatmap", None)
_v = heatmap if heatmap is not None else _v
if _v is not None:
self["heatmap"] = _v
_v = arg.pop("histogram2dcontour", None)
_v = histogram2dcontour if histogram2dcontour is not None else _v
if _v is not None:
self["histogram2dcontour"] = _v
_v = arg.pop("histogram2d", None)
_v = histogram2d if histogram2d is not None else _v
if _v is not None:
self["histogram2d"] = _v
_v = arg.pop("histogram", None)
_v = histogram if histogram is not None else _v
if _v is not None:
self["histogram"] = _v
_v = arg.pop("image", None)
_v = image if image is not None else _v
if _v is not None:
self["image"] = _v
_v = arg.pop("indicator", None)
_v = indicator if indicator is not None else _v
if _v is not None:
self["indicator"] = _v
_v = arg.pop("isosurface", None)
_v = isosurface if isosurface is not None else _v
if _v is not None:
self["isosurface"] = _v
_v = arg.pop("mesh3d", None)
_v = mesh3d if mesh3d is not None else _v
if _v is not None:
self["mesh3d"] = _v
_v = arg.pop("ohlc", None)
_v = ohlc if ohlc is not None else _v
if _v is not None:
self["ohlc"] = _v
_v = arg.pop("parcats", None)
_v = parcats if parcats is not None else _v
if _v is not None:
self["parcats"] = _v
_v = arg.pop("parcoords", None)
_v = parcoords if parcoords is not None else _v
if _v is not None:
self["parcoords"] = _v
_v = arg.pop("pie", None)
_v = pie if pie is not None else _v
if _v is not None:
self["pie"] = _v
_v = arg.pop("pointcloud", None)
_v = pointcloud if pointcloud is not None else _v
if _v is not None:
self["pointcloud"] = _v
_v = arg.pop("sankey", None)
_v = sankey if sankey is not None else _v
if _v is not None:
self["sankey"] = _v
_v = arg.pop("scatter3d", None)
_v = scatter3d if scatter3d is not None else _v
if _v is not None:
self["scatter3d"] = _v
_v = arg.pop("scattercarpet", None)
_v = scattercarpet if scattercarpet is not None else _v
if _v is not None:
self["scattercarpet"] = _v
_v = arg.pop("scattergeo", None)
_v = scattergeo if scattergeo is not None else _v
if _v is not None:
self["scattergeo"] = _v
_v = arg.pop("scattergl", None)
_v = scattergl if scattergl is not None else _v
if _v is not None:
self["scattergl"] = _v
_v = arg.pop("scattermapbox", None)
_v = scattermapbox if scattermapbox is not None else _v
if _v is not None:
self["scattermapbox"] = _v
_v = arg.pop("scatterpolargl", None)
_v = scatterpolargl if scatterpolargl is not None else _v
if _v is not None:
self["scatterpolargl"] = _v
_v = arg.pop("scatterpolar", None)
_v = scatterpolar if scatterpolar is not None else _v
if _v is not None:
self["scatterpolar"] = _v
_v = arg.pop("scatter", None)
_v = scatter if scatter is not None else _v
if _v is not None:
self["scatter"] = _v
_v = arg.pop("scatterternary", None)
_v = scatterternary if scatterternary is not None else _v
if _v is not None:
self["scatterternary"] = _v
_v = arg.pop("splom", None)
_v = splom if splom is not None else _v
if _v is not None:
self["splom"] = _v
_v = arg.pop("streamtube", None)
_v = streamtube if streamtube is not None else _v
if _v is not None:
self["streamtube"] = _v
_v = arg.pop("sunburst", None)
_v = sunburst if sunburst is not None else _v
if _v is not None:
self["sunburst"] = _v
_v = arg.pop("surface", None)
_v = surface if surface is not None else _v
if _v is not None:
self["surface"] = _v
_v = arg.pop("table", None)
_v = table if table is not None else _v
if _v is not None:
self["table"] = _v
_v = arg.pop("treemap", None)
_v = treemap if treemap is not None else _v
if _v is not None:
self["treemap"] = _v
_v = arg.pop("violin", None)
_v = violin if violin is not None else _v
if _v is not None:
self["violin"] = _v
_v = arg.pop("volume", None)
_v = volume if volume is not None else _v
if _v is not None:
self["volume"] = _v
_v = arg.pop("waterfall", None)
_v = waterfall if waterfall is not None else _v
if _v is not None:
self["waterfall"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"area",
"=",
"None",
",",
"barpolar",
"=",
"None",
",",
"bar",
"=",
"None",
",",
"box",
"=",
"None",
",",
"candlestick",
"=",
"None",
",",
"carpet",
"=",
"None",
",",
"choroplethmapbox",
"=",
"None",
",",
"choropleth",
"=",
"None",
",",
"cone",
"=",
"None",
",",
"contourcarpet",
"=",
"None",
",",
"contour",
"=",
"None",
",",
"densitymapbox",
"=",
"None",
",",
"funnelarea",
"=",
"None",
",",
"funnel",
"=",
"None",
",",
"heatmapgl",
"=",
"None",
",",
"heatmap",
"=",
"None",
",",
"histogram2dcontour",
"=",
"None",
",",
"histogram2d",
"=",
"None",
",",
"histogram",
"=",
"None",
",",
"image",
"=",
"None",
",",
"indicator",
"=",
"None",
",",
"isosurface",
"=",
"None",
",",
"mesh3d",
"=",
"None",
",",
"ohlc",
"=",
"None",
",",
"parcats",
"=",
"None",
",",
"parcoords",
"=",
"None",
",",
"pie",
"=",
"None",
",",
"pointcloud",
"=",
"None",
",",
"sankey",
"=",
"None",
",",
"scatter3d",
"=",
"None",
",",
"scattercarpet",
"=",
"None",
",",
"scattergeo",
"=",
"None",
",",
"scattergl",
"=",
"None",
",",
"scattermapbox",
"=",
"None",
",",
"scatterpolargl",
"=",
"None",
",",
"scatterpolar",
"=",
"None",
",",
"scatter",
"=",
"None",
",",
"scatterternary",
"=",
"None",
",",
"splom",
"=",
"None",
",",
"streamtube",
"=",
"None",
",",
"sunburst",
"=",
"None",
",",
"surface",
"=",
"None",
",",
"table",
"=",
"None",
",",
"treemap",
"=",
"None",
",",
"violin",
"=",
"None",
",",
"volume",
"=",
"None",
",",
"waterfall",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Data",
",",
"self",
")",
".",
"__init__",
"(",
"\"data\"",
")",
"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.template.Data \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.layout.template.Data`\"\"\"",
")",
"# 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",
"(",
"\"area\"",
",",
"None",
")",
"_v",
"=",
"area",
"if",
"area",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"area\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"barpolar\"",
",",
"None",
")",
"_v",
"=",
"barpolar",
"if",
"barpolar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"barpolar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bar\"",
",",
"None",
")",
"_v",
"=",
"bar",
"if",
"bar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"box\"",
",",
"None",
")",
"_v",
"=",
"box",
"if",
"box",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"box\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"candlestick\"",
",",
"None",
")",
"_v",
"=",
"candlestick",
"if",
"candlestick",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"candlestick\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"carpet\"",
",",
"None",
")",
"_v",
"=",
"carpet",
"if",
"carpet",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"carpet\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"choroplethmapbox\"",
",",
"None",
")",
"_v",
"=",
"choroplethmapbox",
"if",
"choroplethmapbox",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"choroplethmapbox\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"choropleth\"",
",",
"None",
")",
"_v",
"=",
"choropleth",
"if",
"choropleth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"choropleth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cone\"",
",",
"None",
")",
"_v",
"=",
"cone",
"if",
"cone",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cone\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"contourcarpet\"",
",",
"None",
")",
"_v",
"=",
"contourcarpet",
"if",
"contourcarpet",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"contourcarpet\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"contour\"",
",",
"None",
")",
"_v",
"=",
"contour",
"if",
"contour",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"contour\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"densitymapbox\"",
",",
"None",
")",
"_v",
"=",
"densitymapbox",
"if",
"densitymapbox",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"densitymapbox\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"funnelarea\"",
",",
"None",
")",
"_v",
"=",
"funnelarea",
"if",
"funnelarea",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"funnelarea\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"funnel\"",
",",
"None",
")",
"_v",
"=",
"funnel",
"if",
"funnel",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"funnel\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"heatmapgl\"",
",",
"None",
")",
"_v",
"=",
"heatmapgl",
"if",
"heatmapgl",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"heatmapgl\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"heatmap\"",
",",
"None",
")",
"_v",
"=",
"heatmap",
"if",
"heatmap",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"heatmap\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"histogram2dcontour\"",
",",
"None",
")",
"_v",
"=",
"histogram2dcontour",
"if",
"histogram2dcontour",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"histogram2dcontour\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"histogram2d\"",
",",
"None",
")",
"_v",
"=",
"histogram2d",
"if",
"histogram2d",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"histogram2d\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"histogram\"",
",",
"None",
")",
"_v",
"=",
"histogram",
"if",
"histogram",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"histogram\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"image\"",
",",
"None",
")",
"_v",
"=",
"image",
"if",
"image",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"image\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"indicator\"",
",",
"None",
")",
"_v",
"=",
"indicator",
"if",
"indicator",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"indicator\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"isosurface\"",
",",
"None",
")",
"_v",
"=",
"isosurface",
"if",
"isosurface",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"isosurface\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"mesh3d\"",
",",
"None",
")",
"_v",
"=",
"mesh3d",
"if",
"mesh3d",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"mesh3d\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ohlc\"",
",",
"None",
")",
"_v",
"=",
"ohlc",
"if",
"ohlc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ohlc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"parcats\"",
",",
"None",
")",
"_v",
"=",
"parcats",
"if",
"parcats",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"parcats\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"parcoords\"",
",",
"None",
")",
"_v",
"=",
"parcoords",
"if",
"parcoords",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"parcoords\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"pie\"",
",",
"None",
")",
"_v",
"=",
"pie",
"if",
"pie",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"pie\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"pointcloud\"",
",",
"None",
")",
"_v",
"=",
"pointcloud",
"if",
"pointcloud",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"pointcloud\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sankey\"",
",",
"None",
")",
"_v",
"=",
"sankey",
"if",
"sankey",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sankey\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scatter3d\"",
",",
"None",
")",
"_v",
"=",
"scatter3d",
"if",
"scatter3d",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scatter3d\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scattercarpet\"",
",",
"None",
")",
"_v",
"=",
"scattercarpet",
"if",
"scattercarpet",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scattercarpet\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scattergeo\"",
",",
"None",
")",
"_v",
"=",
"scattergeo",
"if",
"scattergeo",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scattergeo\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scattergl\"",
",",
"None",
")",
"_v",
"=",
"scattergl",
"if",
"scattergl",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scattergl\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scattermapbox\"",
",",
"None",
")",
"_v",
"=",
"scattermapbox",
"if",
"scattermapbox",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scattermapbox\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scatterpolargl\"",
",",
"None",
")",
"_v",
"=",
"scatterpolargl",
"if",
"scatterpolargl",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scatterpolargl\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scatterpolar\"",
",",
"None",
")",
"_v",
"=",
"scatterpolar",
"if",
"scatterpolar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scatterpolar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scatter\"",
",",
"None",
")",
"_v",
"=",
"scatter",
"if",
"scatter",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scatter\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scatterternary\"",
",",
"None",
")",
"_v",
"=",
"scatterternary",
"if",
"scatterternary",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scatterternary\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"splom\"",
",",
"None",
")",
"_v",
"=",
"splom",
"if",
"splom",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"splom\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"streamtube\"",
",",
"None",
")",
"_v",
"=",
"streamtube",
"if",
"streamtube",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"streamtube\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sunburst\"",
",",
"None",
")",
"_v",
"=",
"sunburst",
"if",
"sunburst",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sunburst\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"surface\"",
",",
"None",
")",
"_v",
"=",
"surface",
"if",
"surface",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"surface\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"table\"",
",",
"None",
")",
"_v",
"=",
"table",
"if",
"table",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"table\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"treemap\"",
",",
"None",
")",
"_v",
"=",
"treemap",
"if",
"treemap",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"treemap\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"violin\"",
",",
"None",
")",
"_v",
"=",
"violin",
"if",
"violin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"violin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"volume\"",
",",
"None",
")",
"_v",
"=",
"volume",
"if",
"volume",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"volume\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"waterfall\"",
",",
"None",
")",
"_v",
"=",
"waterfall",
"if",
"waterfall",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"waterfall\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1291,
4
] | [
1724,
34
] | python | en | ['en', 'error', 'th'] | False |
ChannelAdmin.subscriptions | (self, obj) |
Helper method to get subs from a channel.
Args:
obj (Channel): The channel to get subs from.
|
Helper method to get subs from a channel. | def subscriptions(self, obj):
"""
Helper method to get subs from a channel.
Args:
obj (Channel): The channel to get subs from.
"""
return ", ".join([str(sub) for sub in obj.subscriptions.all()]) | [
"def",
"subscriptions",
"(",
"self",
",",
"obj",
")",
":",
"return",
"\", \"",
".",
"join",
"(",
"[",
"str",
"(",
"sub",
")",
"for",
"sub",
"in",
"obj",
".",
"subscriptions",
".",
"all",
"(",
")",
"]",
")"
] | [
64,
4
] | [
72,
71
] | python | en | ['en', 'error', 'th'] | False |
ChannelAdmin.save_model | (self, request, obj, form, change) |
Model-save hook.
Args:
request (Request): Incoming request.
obj (Object): Database object.
form (Form): Form instance.
change (bool): If this is a change or a new object.
|
Model-save hook. | def save_model(self, request, obj, form, change):
"""
Model-save hook.
Args:
request (Request): Incoming request.
obj (Object): Database object.
form (Form): Form instance.
change (bool): If this is a change or a new object.
"""
obj.save()
if not change:
# adding a new object
# have to call init with typeclass passed to it
obj.set_class_from_typeclass(typeclass_path=settings.BASE_CHANNEL_TYPECLASS)
obj.at_init() | [
"def",
"save_model",
"(",
"self",
",",
"request",
",",
"obj",
",",
"form",
",",
"change",
")",
":",
"obj",
".",
"save",
"(",
")",
"if",
"not",
"change",
":",
"# adding a new object",
"# have to call init with typeclass passed to it",
"obj",
".",
"set_class_from_typeclass",
"(",
"typeclass_path",
"=",
"settings",
".",
"BASE_CHANNEL_TYPECLASS",
")",
"obj",
".",
"at_init",
"(",
")"
] | [
74,
4
] | [
90,
21
] | python | en | ['en', 'error', 'th'] | False |
PingHandler.handle | (self, context: RequestContext, responder: BaseResponder) |
Handle ping message.
Args:
context: Request context
responder: Responder used to reply
|
Handle ping message. | async def handle(self, context: RequestContext, responder: BaseResponder):
"""
Handle ping message.
Args:
context: Request context
responder: Responder used to reply
"""
self._logger.debug(f"PingHandler called with context {context}")
assert isinstance(context.message, Ping)
self._logger.info(
"Received trust ping from: %s", context.message_receipt.sender_did
)
if not context.connection_ready:
self._logger.info(
"Connection not active, skipping ping response: %s",
context.message_receipt.sender_did,
)
return
if context.message.response_requested:
reply = PingResponse()
reply.assign_thread_from(context.message)
await responder.send_reply(reply)
if context.settings.get("debug.monitor_ping"):
await responder.send_webhook(
"ping",
{
"comment": context.message.comment,
"connection_id": context.message_receipt.connection_id,
"responded": context.message.response_requested,
"state": "received",
"thread_id": context.message._thread_id,
},
) | [
"async",
"def",
"handle",
"(",
"self",
",",
"context",
":",
"RequestContext",
",",
"responder",
":",
"BaseResponder",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"f\"PingHandler called with context {context}\"",
")",
"assert",
"isinstance",
"(",
"context",
".",
"message",
",",
"Ping",
")",
"self",
".",
"_logger",
".",
"info",
"(",
"\"Received trust ping from: %s\"",
",",
"context",
".",
"message_receipt",
".",
"sender_did",
")",
"if",
"not",
"context",
".",
"connection_ready",
":",
"self",
".",
"_logger",
".",
"info",
"(",
"\"Connection not active, skipping ping response: %s\"",
",",
"context",
".",
"message_receipt",
".",
"sender_did",
",",
")",
"return",
"if",
"context",
".",
"message",
".",
"response_requested",
":",
"reply",
"=",
"PingResponse",
"(",
")",
"reply",
".",
"assign_thread_from",
"(",
"context",
".",
"message",
")",
"await",
"responder",
".",
"send_reply",
"(",
"reply",
")",
"if",
"context",
".",
"settings",
".",
"get",
"(",
"\"debug.monitor_ping\"",
")",
":",
"await",
"responder",
".",
"send_webhook",
"(",
"\"ping\"",
",",
"{",
"\"comment\"",
":",
"context",
".",
"message",
".",
"comment",
",",
"\"connection_id\"",
":",
"context",
".",
"message_receipt",
".",
"connection_id",
",",
"\"responded\"",
":",
"context",
".",
"message",
".",
"response_requested",
",",
"\"state\"",
":",
"\"received\"",
",",
"\"thread_id\"",
":",
"context",
".",
"message",
".",
"_thread_id",
",",
"}",
",",
")"
] | [
11,
4
] | [
49,
13
] | python | en | ['en', 'error', 'th'] | False |
Beam.__init__ | (self, batch_size, beam_size, EOS_ID=3) | Beam class for beam search | Beam class for beam search | def __init__(self, batch_size, beam_size, EOS_ID=3):
"""Beam class for beam search"""
self.batch_size = batch_size
self.beam_size = beam_size
self.EOS_ID = EOS_ID
self.back_pointers = [] # [(B, K)] * sequence_length
self.token_ids = [] # [(B, K)] * sequence_length
self.scores = [] | [
"def",
"__init__",
"(",
"self",
",",
"batch_size",
",",
"beam_size",
",",
"EOS_ID",
"=",
"3",
")",
":",
"self",
".",
"batch_size",
"=",
"batch_size",
"self",
".",
"beam_size",
"=",
"beam_size",
"self",
".",
"EOS_ID",
"=",
"EOS_ID",
"self",
".",
"back_pointers",
"=",
"[",
"]",
"# [(B, K)] * sequence_length",
"self",
".",
"token_ids",
"=",
"[",
"]",
"# [(B, K)] * sequence_length",
"self",
".",
"scores",
"=",
"[",
"]"
] | [
9,
4
] | [
18,
24
] | python | en | ['en', 'en', 'en'] | True |
Beam.backtrack | (self) | Backtracks over batch to generate optimal k-sequences
back_pointer [B, K]
token_id [B, K]
attention [B, K, source_L]
Returns:
prediction ([B, K, max_unroll])
A list of Tensors containing predicted sequence
| Backtracks over batch to generate optimal k-sequences | def backtrack(self):
"""Backtracks over batch to generate optimal k-sequences
back_pointer [B, K]
token_id [B, K]
attention [B, K, source_L]
Returns:
prediction ([B, K, max_unroll])
A list of Tensors containing predicted sequence
"""
B = self.batch_size
K = self.beam_size
device = self.token_ids[0].device
max_unroll = len(self.back_pointers)
# Sum of score (sorted) [B, K]
score = self.scores[-1].clone()
n_eos_found = [0] * B
# Initialize Back-pointer [B, K]
back_pointer = torch.arange(0, K).unsqueeze(0).repeat(B, 1).to(device)
# max_unroll * [B, K]
prediction = []
for t in reversed(range(max_unroll)):
token_id = self.token_ids[t].gather(1, back_pointer)
back_pointer = self.back_pointers[t].gather(1, back_pointer)
where_EOS = self.token_ids[t] == self.EOS_ID
if where_EOS.any():
for eos_idx in reversed(where_EOS.nonzero().tolist()):
batch_idx, beam_idx = eos_idx
back_pointer[batch_idx, K - 1 - (n_eos_found[batch_idx] %
K)] = self.back_pointers[t][batch_idx, beam_idx]
token_id[batch_idx, K - 1 - (n_eos_found[batch_idx] %
K)] = self.token_ids[t][batch_idx, beam_idx]
score[batch_idx, K - 1 - (n_eos_found[batch_idx] % K)
] = self.scores[t][batch_idx, beam_idx]
n_eos_found[batch_idx] += 1
prediction.append(token_id)
# Reverse the sequences and re-order at the same time
# It is reversed because the backtracking happens in the reverse order
# max_unroll * [B x K]
prediction = list(reversed(prediction))
# [B, K, max_unroll]
prediction = torch.stack(prediction, 2)
# import ipdb
# ipdb.set_trace()
# Re-order (Score orders might have been changed during EOS handling)
# [B, K]
score, score_idx = score.topk(K, dim=1)
batch_starting_indices = torch.arange(0, B * K, step=K, device=device)
batch_indices = (batch_starting_indices.unsqueeze(1) + score_idx).flatten()
prediction = prediction.view(B * K, max_unroll).index_select(0,
batch_indices).view(B, K, max_unroll)
return prediction, score | [
"def",
"backtrack",
"(",
"self",
")",
":",
"B",
"=",
"self",
".",
"batch_size",
"K",
"=",
"self",
".",
"beam_size",
"device",
"=",
"self",
".",
"token_ids",
"[",
"0",
"]",
".",
"device",
"max_unroll",
"=",
"len",
"(",
"self",
".",
"back_pointers",
")",
"# Sum of score (sorted) [B, K]",
"score",
"=",
"self",
".",
"scores",
"[",
"-",
"1",
"]",
".",
"clone",
"(",
")",
"n_eos_found",
"=",
"[",
"0",
"]",
"*",
"B",
"# Initialize Back-pointer [B, K]",
"back_pointer",
"=",
"torch",
".",
"arange",
"(",
"0",
",",
"K",
")",
".",
"unsqueeze",
"(",
"0",
")",
".",
"repeat",
"(",
"B",
",",
"1",
")",
".",
"to",
"(",
"device",
")",
"# max_unroll * [B, K]",
"prediction",
"=",
"[",
"]",
"for",
"t",
"in",
"reversed",
"(",
"range",
"(",
"max_unroll",
")",
")",
":",
"token_id",
"=",
"self",
".",
"token_ids",
"[",
"t",
"]",
".",
"gather",
"(",
"1",
",",
"back_pointer",
")",
"back_pointer",
"=",
"self",
".",
"back_pointers",
"[",
"t",
"]",
".",
"gather",
"(",
"1",
",",
"back_pointer",
")",
"where_EOS",
"=",
"self",
".",
"token_ids",
"[",
"t",
"]",
"==",
"self",
".",
"EOS_ID",
"if",
"where_EOS",
".",
"any",
"(",
")",
":",
"for",
"eos_idx",
"in",
"reversed",
"(",
"where_EOS",
".",
"nonzero",
"(",
")",
".",
"tolist",
"(",
")",
")",
":",
"batch_idx",
",",
"beam_idx",
"=",
"eos_idx",
"back_pointer",
"[",
"batch_idx",
",",
"K",
"-",
"1",
"-",
"(",
"n_eos_found",
"[",
"batch_idx",
"]",
"%",
"K",
")",
"]",
"=",
"self",
".",
"back_pointers",
"[",
"t",
"]",
"[",
"batch_idx",
",",
"beam_idx",
"]",
"token_id",
"[",
"batch_idx",
",",
"K",
"-",
"1",
"-",
"(",
"n_eos_found",
"[",
"batch_idx",
"]",
"%",
"K",
")",
"]",
"=",
"self",
".",
"token_ids",
"[",
"t",
"]",
"[",
"batch_idx",
",",
"beam_idx",
"]",
"score",
"[",
"batch_idx",
",",
"K",
"-",
"1",
"-",
"(",
"n_eos_found",
"[",
"batch_idx",
"]",
"%",
"K",
")",
"]",
"=",
"self",
".",
"scores",
"[",
"t",
"]",
"[",
"batch_idx",
",",
"beam_idx",
"]",
"n_eos_found",
"[",
"batch_idx",
"]",
"+=",
"1",
"prediction",
".",
"append",
"(",
"token_id",
")",
"# Reverse the sequences and re-order at the same time",
"# It is reversed because the backtracking happens in the reverse order",
"# max_unroll * [B x K]",
"prediction",
"=",
"list",
"(",
"reversed",
"(",
"prediction",
")",
")",
"# [B, K, max_unroll]",
"prediction",
"=",
"torch",
".",
"stack",
"(",
"prediction",
",",
"2",
")",
"# import ipdb",
"# ipdb.set_trace()",
"# Re-order (Score orders might have been changed during EOS handling)",
"# [B, K]",
"score",
",",
"score_idx",
"=",
"score",
".",
"topk",
"(",
"K",
",",
"dim",
"=",
"1",
")",
"batch_starting_indices",
"=",
"torch",
".",
"arange",
"(",
"0",
",",
"B",
"*",
"K",
",",
"step",
"=",
"K",
",",
"device",
"=",
"device",
")",
"batch_indices",
"=",
"(",
"batch_starting_indices",
".",
"unsqueeze",
"(",
"1",
")",
"+",
"score_idx",
")",
".",
"flatten",
"(",
")",
"prediction",
"=",
"prediction",
".",
"view",
"(",
"B",
"*",
"K",
",",
"max_unroll",
")",
".",
"index_select",
"(",
"0",
",",
"batch_indices",
")",
".",
"view",
"(",
"B",
",",
"K",
",",
"max_unroll",
")",
"return",
"prediction",
",",
"score"
] | [
20,
4
] | [
86,
32
] | python | en | ['en', 'en', 'en'] | True |
Histogram2d.autobinx | (self) |
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobinx` is not needed. However, we accept
`autobinx: true` or `false` and will update `xbins` accordingly
before deleting `autobinx` from the trace.
The 'autobinx' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobinx` is not needed. However, we accept
`autobinx: true` or `false` and will update `xbins` accordingly
before deleting `autobinx` from the trace.
The 'autobinx' property must be specified as a bool
(either True, or False) | def autobinx(self):
"""
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobinx` is not needed. However, we accept
`autobinx: true` or `false` and will update `xbins` accordingly
before deleting `autobinx` from the trace.
The 'autobinx' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autobinx"] | [
"def",
"autobinx",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autobinx\"",
"]"
] | [
72,
4
] | [
86,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.autobiny | (self) |
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobiny` is not needed. However, we accept
`autobiny: true` or `false` and will update `ybins` accordingly
before deleting `autobiny` from the trace.
The 'autobiny' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobiny` is not needed. However, we accept
`autobiny: true` or `false` and will update `ybins` accordingly
before deleting `autobiny` from the trace.
The 'autobiny' property must be specified as a bool
(either True, or False) | def autobiny(self):
"""
Obsolete: since v1.42 each bin attribute is auto-determined
separately and `autobiny` is not needed. However, we accept
`autobiny: true` or `false` and will update `ybins` accordingly
before deleting `autobiny` from the trace.
The 'autobiny' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autobiny"] | [
"def",
"autobiny",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autobiny\"",
"]"
] | [
95,
4
] | [
109,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False) | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autocolorscale"] | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
118,
4
] | [
134,
37
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.bingroup | (self) |
Set the `xbingroup` and `ybingroup` default prefix For example,
setting a `bingroup` of 1 on two histogram2d traces will make
them their x-bins and y-bins match separately.
The 'bingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Set the `xbingroup` and `ybingroup` default prefix For example,
setting a `bingroup` of 1 on two histogram2d traces will make
them their x-bins and y-bins match separately.
The 'bingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def bingroup(self):
"""
Set the `xbingroup` and `ybingroup` default prefix For example,
setting a `bingroup` of 1 on two histogram2d traces will make
them their x-bins and y-bins match separately.
The 'bingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["bingroup"] | [
"def",
"bingroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bingroup\"",
"]"
] | [
143,
4
] | [
157,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
|
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.) | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
"""
return self["coloraxis"] | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
166,
4
] | [
184,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.colorbar | (self) |
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
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.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
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.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
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.histogr
am2d.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.histogram2d.colorbar.tickformatstopdefaults),
sets the default property values to use for
elements of
histogram2d.colorbar.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).
title
:class:`plotly.graph_objects.histogram2d.colorb
ar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
histogram2d.colorbar.title.font instead. Sets
this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
histogram2d.colorbar.title.side instead.
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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
plotly.graph_objs.histogram2d.ColorBar
|
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
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.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
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.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
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.histogr
am2d.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.histogram2d.colorbar.tickformatstopdefaults),
sets the default property values to use for
elements of
histogram2d.colorbar.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).
title
:class:`plotly.graph_objects.histogram2d.colorb
ar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
histogram2d.colorbar.title.font instead. Sets
this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
histogram2d.colorbar.title.side instead.
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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction. | def colorbar(self):
"""
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
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.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
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".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
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.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
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.histogr
am2d.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.histogram2d.colorbar.tickformatstopdefaults),
sets the default property values to use for
elements of
histogram2d.colorbar.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).
title
:class:`plotly.graph_objects.histogram2d.colorb
ar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
histogram2d.colorbar.title.font instead. Sets
this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
histogram2d.colorbar.title.side instead.
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.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
plotly.graph_objs.histogram2d.ColorBar
"""
return self["colorbar"] | [
"def",
"colorbar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorbar\"",
"]"
] | [
193,
4
] | [
420,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.colorscale | (self) |
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
|
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it. | def colorscale(self):
"""
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
"""
return self["colorscale"] | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
429,
4
] | [
472,
33
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.customdata | (self) |
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def customdata(self):
"""
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["customdata"] | [
"def",
"customdata",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdata\"",
"]"
] | [
481,
4
] | [
495,
33
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.customdatasrc | (self) |
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' 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 customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def customdatasrc(self):
"""
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["customdatasrc"] | [
"def",
"customdatasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdatasrc\"",
"]"
] | [
504,
4
] | [
516,
36
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.histfunc | (self) |
Specifies the binning function used for this histogram trace.
If "count", the histogram values are computed by counting the
number of values lying inside each bin. If "sum", "avg", "min",
"max", the histogram values are computed using the sum, the
average, the minimum or the maximum of the values lying inside
each bin respectively.
The 'histfunc' property is an enumeration that may be specified as:
- One of the following enumeration values:
['count', 'sum', 'avg', 'min', 'max']
Returns
-------
Any
|
Specifies the binning function used for this histogram trace.
If "count", the histogram values are computed by counting the
number of values lying inside each bin. If "sum", "avg", "min",
"max", the histogram values are computed using the sum, the
average, the minimum or the maximum of the values lying inside
each bin respectively.
The 'histfunc' property is an enumeration that may be specified as:
- One of the following enumeration values:
['count', 'sum', 'avg', 'min', 'max'] | def histfunc(self):
"""
Specifies the binning function used for this histogram trace.
If "count", the histogram values are computed by counting the
number of values lying inside each bin. If "sum", "avg", "min",
"max", the histogram values are computed using the sum, the
average, the minimum or the maximum of the values lying inside
each bin respectively.
The 'histfunc' property is an enumeration that may be specified as:
- One of the following enumeration values:
['count', 'sum', 'avg', 'min', 'max']
Returns
-------
Any
"""
return self["histfunc"] | [
"def",
"histfunc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"histfunc\"",
"]"
] | [
525,
4
] | [
542,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.histnorm | (self) |
Specifies the type of normalization used for this histogram
trace. If "", the span of each bar corresponds to the number of
occurrences (i.e. the number of data points lying inside the
bins). If "percent" / "probability", the span of each bar
corresponds to the percentage / fraction of occurrences with
respect to the total number of sample points (here, the sum of
all bin HEIGHTS equals 100% / 1). If "density", the span of
each bar corresponds to the number of occurrences in a bin
divided by the size of the bin interval (here, the sum of all
bin AREAS equals the total number of sample points). If
*probability density*, the area of each bar corresponds to the
probability that an event will fall into the corresponding bin
(here, the sum of all bin AREAS equals 1).
The 'histnorm' property is an enumeration that may be specified as:
- One of the following enumeration values:
['', 'percent', 'probability', 'density', 'probability
density']
Returns
-------
Any
|
Specifies the type of normalization used for this histogram
trace. If "", the span of each bar corresponds to the number of
occurrences (i.e. the number of data points lying inside the
bins). If "percent" / "probability", the span of each bar
corresponds to the percentage / fraction of occurrences with
respect to the total number of sample points (here, the sum of
all bin HEIGHTS equals 100% / 1). If "density", the span of
each bar corresponds to the number of occurrences in a bin
divided by the size of the bin interval (here, the sum of all
bin AREAS equals the total number of sample points). If
*probability density*, the area of each bar corresponds to the
probability that an event will fall into the corresponding bin
(here, the sum of all bin AREAS equals 1).
The 'histnorm' property is an enumeration that may be specified as:
- One of the following enumeration values:
['', 'percent', 'probability', 'density', 'probability
density'] | def histnorm(self):
"""
Specifies the type of normalization used for this histogram
trace. If "", the span of each bar corresponds to the number of
occurrences (i.e. the number of data points lying inside the
bins). If "percent" / "probability", the span of each bar
corresponds to the percentage / fraction of occurrences with
respect to the total number of sample points (here, the sum of
all bin HEIGHTS equals 100% / 1). If "density", the span of
each bar corresponds to the number of occurrences in a bin
divided by the size of the bin interval (here, the sum of all
bin AREAS equals the total number of sample points). If
*probability density*, the area of each bar corresponds to the
probability that an event will fall into the corresponding bin
(here, the sum of all bin AREAS equals 1).
The 'histnorm' property is an enumeration that may be specified as:
- One of the following enumeration values:
['', 'percent', 'probability', 'density', 'probability
density']
Returns
-------
Any
"""
return self["histnorm"] | [
"def",
"histnorm",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"histnorm\"",
"]"
] | [
551,
4
] | [
576,
31
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.hoverinfo | (self) |
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['x', 'y', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'x+y')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
|
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['x', 'y', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'x+y')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above | def hoverinfo(self):
"""
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['x', 'y', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'x+y')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["hoverinfo"] | [
"def",
"hoverinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfo\"",
"]"
] | [
585,
4
] | [
602,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.hoverinfosrc | (self) |
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' 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 hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hoverinfosrc(self):
"""
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hoverinfosrc"] | [
"def",
"hoverinfosrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfosrc\"",
"]"
] | [
611,
4
] | [
623,
35
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength .
Returns
-------
plotly.graph_objs.histogram2d.Hoverlabel
|
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength . | def hoverlabel(self):
"""
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength .
Returns
-------
plotly.graph_objs.histogram2d.Hoverlabel
"""
return self["hoverlabel"] | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
632,
4
] | [
682,
33
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.hovertemplate | (self) |
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
variable `z` Anything contained in tag `<extra>` is displayed
in the secondary box, for example
"<extra>{fullData.name}</extra>". To hide the secondary box
completely, use an empty tag `<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
variable `z` Anything contained in tag `<extra>` is displayed
in the secondary box, for example
"<extra>{fullData.name}</extra>". To hide the secondary box
completely, use an empty tag `<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def hovertemplate(self):
"""
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
variable `z` Anything contained in tag `<extra>` is displayed
in the secondary box, for example
"<extra>{fullData.name}</extra>". To hide the secondary box
completely, use an empty tag `<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["hovertemplate"] | [
"def",
"hovertemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplate\"",
"]"
] | [
691,
4
] | [
723,
36
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.hovertemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' 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
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertemplatesrc"] | [
"def",
"hovertemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplatesrc\"",
"]"
] | [
732,
4
] | [
744,
39
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ids | (self) |
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ids(self):
"""
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["ids"] | [
"def",
"ids",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ids\"",
"]"
] | [
753,
4
] | [
766,
26
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.idssrc | (self) |
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' 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 ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def idssrc(self):
"""
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["idssrc"] | [
"def",
"idssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"idssrc\"",
"]"
] | [
775,
4
] | [
786,
29
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.legendgroup | (self) |
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def legendgroup(self):
"""
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["legendgroup"] | [
"def",
"legendgroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"legendgroup\"",
"]"
] | [
795,
4
] | [
809,
34
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the aggregation data.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
Returns
-------
plotly.graph_objs.histogram2d.Marker
|
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the aggregation data.
colorsrc
Sets the source reference on Chart Studio Cloud
for color . | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
color
Sets the aggregation data.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
Returns
-------
plotly.graph_objs.histogram2d.Marker
"""
return self["marker"] | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
818,
4
] | [
838,
29
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.meta | (self) |
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
|
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type | def meta(self):
"""
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
"""
return self["meta"] | [
"def",
"meta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"meta\"",
"]"
] | [
847,
4
] | [
866,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.metasrc | (self) |
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' 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 meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def metasrc(self):
"""
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["metasrc"] | [
"def",
"metasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"metasrc\"",
"]"
] | [
875,
4
] | [
886,
30
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.name | (self) |
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the trace name. The trace name appear as the legend item
and on hover.
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):
"""
Sets the trace name. The trace name appear as the legend item
and on hover.
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\"",
"]"
] | [
895,
4
] | [
908,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.nbinsx | (self) |
Specifies the maximum number of desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `xbins.size` is provided.
The 'nbinsx' 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 desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `xbins.size` is provided.
The 'nbinsx' 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 nbinsx(self):
"""
Specifies the maximum number of desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `xbins.size` is provided.
The 'nbinsx' 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["nbinsx"] | [
"def",
"nbinsx",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"nbinsx\"",
"]"
] | [
917,
4
] | [
932,
29
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.nbinsy | (self) |
Specifies the maximum number of desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `ybins.size` is provided.
The 'nbinsy' 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 desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `ybins.size` is provided.
The 'nbinsy' 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 nbinsy(self):
"""
Specifies the maximum number of desired bins. This value will
be used in an algorithm that will decide the optimal bin size
such that the histogram best visualizes the distribution of the
data. Ignored if `ybins.size` is provided.
The 'nbinsy' 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["nbinsy"] | [
"def",
"nbinsy",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"nbinsy\"",
"]"
] | [
941,
4
] | [
956,
29
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.opacity | (self) |
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def opacity(self):
"""
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
return self["opacity"] | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
965,
4
] | [
976,
30
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.reversescale | (self) |
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False) | def reversescale(self):
"""
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["reversescale"] | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
985,
4
] | [
998,
35
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.showlegend | (self) |
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False) | def showlegend(self):
"""
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showlegend"] | [
"def",
"showlegend",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showlegend\"",
"]"
] | [
1007,
4
] | [
1019,
33
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.showscale | (self) |
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False) | def showscale(self):
"""
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showscale"] | [
"def",
"showscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showscale\"",
"]"
] | [
1028,
4
] | [
1040,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.stream | (self) |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.histogram2d.Stream
|
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details. | def stream(self):
"""
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.histogram2d.Stream
"""
return self["stream"] | [
"def",
"stream",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stream\"",
"]"
] | [
1049,
4
] | [
1073,
29
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.uid | (self) |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def uid(self):
"""
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["uid"] | [
"def",
"uid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uid\"",
"]"
] | [
1082,
4
] | [
1095,
26
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.uirevision | (self) |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type
Returns
-------
Any
|
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type | def uirevision(self):
"""
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type
Returns
-------
Any
"""
return self["uirevision"] | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
1104,
4
] | [
1128,
33
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.visible | (self) |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly']
Returns
-------
Any
|
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly'] | def visible(self):
"""
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly']
Returns
-------
Any
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
1137,
4
] | [
1151,
30
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.x | (self) |
Sets the sample data to be binned on the x axis.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the sample data to be binned on the x axis.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def x(self):
"""
Sets the sample data to be binned on the x axis.
The 'x' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
1160,
4
] | [
1171,
24
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xaxis | (self) |
Sets a reference between this trace's x coordinates and a 2D
cartesian x axis. If "x" (the default value), the x coordinates
refer to `layout.xaxis`. If "x2", the x coordinates refer to
`layout.xaxis2`, and so on.
The 'xaxis' property is an identifier of a particular
subplot, of type 'x', that may be specified as the string 'x'
optionally followed by an integer >= 1
(e.g. 'x', 'x1', 'x2', 'x3', etc.)
Returns
-------
str
|
Sets a reference between this trace's x coordinates and a 2D
cartesian x axis. If "x" (the default value), the x coordinates
refer to `layout.xaxis`. If "x2", the x coordinates refer to
`layout.xaxis2`, and so on.
The 'xaxis' property is an identifier of a particular
subplot, of type 'x', that may be specified as the string 'x'
optionally followed by an integer >= 1
(e.g. 'x', 'x1', 'x2', 'x3', etc.) | def xaxis(self):
"""
Sets a reference between this trace's x coordinates and a 2D
cartesian x axis. If "x" (the default value), the x coordinates
refer to `layout.xaxis`. If "x2", the x coordinates refer to
`layout.xaxis2`, and so on.
The 'xaxis' property is an identifier of a particular
subplot, of type 'x', that may be specified as the string 'x'
optionally followed by an integer >= 1
(e.g. 'x', 'x1', 'x2', 'x3', etc.)
Returns
-------
str
"""
return self["xaxis"] | [
"def",
"xaxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xaxis\"",
"]"
] | [
1180,
4
] | [
1196,
28
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xbingroup | (self) |
Set a group of histogram traces which will have compatible
x-bin settings. Using `xbingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible x-bin settings. Note that the same `xbingroup`
value can be used to set (1D) histogram `bingroup`
The 'xbingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Set a group of histogram traces which will have compatible
x-bin settings. Using `xbingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible x-bin settings. Note that the same `xbingroup`
value can be used to set (1D) histogram `bingroup`
The 'xbingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def xbingroup(self):
"""
Set a group of histogram traces which will have compatible
x-bin settings. Using `xbingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible x-bin settings. Note that the same `xbingroup`
value can be used to set (1D) histogram `bingroup`
The 'xbingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["xbingroup"] | [
"def",
"xbingroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xbingroup\"",
"]"
] | [
1205,
4
] | [
1221,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xbins | (self) |
The 'xbins' property is an instance of XBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.XBins`
- A dict of string/value properties that will be passed
to the XBins constructor
Supported dict properties:
end
Sets the end value for the x 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 x axis bin. Default
behavior: If `nbinsx` 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 `nbinsx` 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 x 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
-------
plotly.graph_objs.histogram2d.XBins
|
The 'xbins' property is an instance of XBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.XBins`
- A dict of string/value properties that will be passed
to the XBins constructor
Supported dict properties:
end
Sets the end value for the x 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 x axis bin. Default
behavior: If `nbinsx` 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 `nbinsx` 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 x 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 xbins(self):
"""
The 'xbins' property is an instance of XBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.XBins`
- A dict of string/value properties that will be passed
to the XBins constructor
Supported dict properties:
end
Sets the end value for the x 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 x axis bin. Default
behavior: If `nbinsx` 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 `nbinsx` 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 x 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
-------
plotly.graph_objs.histogram2d.XBins
"""
return self["xbins"] | [
"def",
"xbins",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xbins\"",
"]"
] | [
1230,
4
] | [
1279,
28
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xcalendar | (self) |
Sets the calendar system to use with `x` date data.
The 'xcalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura']
Returns
-------
Any
|
Sets the calendar system to use with `x` date data.
The 'xcalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura'] | def xcalendar(self):
"""
Sets the calendar system to use with `x` date data.
The 'xcalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura']
Returns
-------
Any
"""
return self["xcalendar"] | [
"def",
"xcalendar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xcalendar\"",
"]"
] | [
1288,
4
] | [
1303,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xgap | (self) |
Sets the horizontal gap (in pixels) between bricks.
The 'xgap' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the horizontal gap (in pixels) between bricks.
The 'xgap' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def xgap(self):
"""
Sets the horizontal gap (in pixels) between bricks.
The 'xgap' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["xgap"] | [
"def",
"xgap",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xgap\"",
"]"
] | [
1312,
4
] | [
1323,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.xsrc | (self) |
Sets the source reference on Chart Studio Cloud for x .
The 'xsrc' 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 x .
The 'xsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def xsrc(self):
"""
Sets the source reference on Chart Studio Cloud for x .
The 'xsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["xsrc"] | [
"def",
"xsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"xsrc\"",
"]"
] | [
1332,
4
] | [
1343,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.y | (self) |
Sets the sample data to be binned on the y axis.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the sample data to be binned on the y axis.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def y(self):
"""
Sets the sample data to be binned on the y axis.
The 'y' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
1352,
4
] | [
1363,
24
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.yaxis | (self) |
Sets a reference between this trace's y coordinates and a 2D
cartesian y axis. If "y" (the default value), the y coordinates
refer to `layout.yaxis`. If "y2", the y coordinates refer to
`layout.yaxis2`, and so on.
The 'yaxis' property is an identifier of a particular
subplot, of type 'y', that may be specified as the string 'y'
optionally followed by an integer >= 1
(e.g. 'y', 'y1', 'y2', 'y3', etc.)
Returns
-------
str
|
Sets a reference between this trace's y coordinates and a 2D
cartesian y axis. If "y" (the default value), the y coordinates
refer to `layout.yaxis`. If "y2", the y coordinates refer to
`layout.yaxis2`, and so on.
The 'yaxis' property is an identifier of a particular
subplot, of type 'y', that may be specified as the string 'y'
optionally followed by an integer >= 1
(e.g. 'y', 'y1', 'y2', 'y3', etc.) | def yaxis(self):
"""
Sets a reference between this trace's y coordinates and a 2D
cartesian y axis. If "y" (the default value), the y coordinates
refer to `layout.yaxis`. If "y2", the y coordinates refer to
`layout.yaxis2`, and so on.
The 'yaxis' property is an identifier of a particular
subplot, of type 'y', that may be specified as the string 'y'
optionally followed by an integer >= 1
(e.g. 'y', 'y1', 'y2', 'y3', etc.)
Returns
-------
str
"""
return self["yaxis"] | [
"def",
"yaxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"yaxis\"",
"]"
] | [
1372,
4
] | [
1388,
28
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ybingroup | (self) |
Set a group of histogram traces which will have compatible
y-bin settings. Using `ybingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible y-bin settings. Note that the same `ybingroup`
value can be used to set (1D) histogram `bingroup`
The 'ybingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Set a group of histogram traces which will have compatible
y-bin settings. Using `ybingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible y-bin settings. Note that the same `ybingroup`
value can be used to set (1D) histogram `bingroup`
The 'ybingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def ybingroup(self):
"""
Set a group of histogram traces which will have compatible
y-bin settings. Using `ybingroup`, histogram2d and
histogram2dcontour traces (on axes of the same axis type) can
have compatible y-bin settings. Note that the same `ybingroup`
value can be used to set (1D) histogram `bingroup`
The 'ybingroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["ybingroup"] | [
"def",
"ybingroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ybingroup\"",
"]"
] | [
1397,
4
] | [
1413,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ybins | (self) |
The 'ybins' property is an instance of YBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.YBins`
- A dict of string/value properties that will be passed
to the YBins constructor
Supported dict properties:
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
-------
plotly.graph_objs.histogram2d.YBins
|
The 'ybins' property is an instance of YBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.YBins`
- A dict of string/value properties that will be passed
to the YBins constructor
Supported dict properties:
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 ybins(self):
"""
The 'ybins' property is an instance of YBins
that may be specified as:
- An instance of :class:`plotly.graph_objs.histogram2d.YBins`
- A dict of string/value properties that will be passed
to the YBins constructor
Supported dict properties:
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
-------
plotly.graph_objs.histogram2d.YBins
"""
return self["ybins"] | [
"def",
"ybins",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ybins\"",
"]"
] | [
1422,
4
] | [
1471,
28
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ycalendar | (self) |
Sets the calendar system to use with `y` date data.
The 'ycalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura']
Returns
-------
Any
|
Sets the calendar system to use with `y` date data.
The 'ycalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura'] | def ycalendar(self):
"""
Sets the calendar system to use with `y` date data.
The 'ycalendar' property is an enumeration that may be specified as:
- One of the following enumeration values:
['gregorian', 'chinese', 'coptic', 'discworld',
'ethiopian', 'hebrew', 'islamic', 'julian', 'mayan',
'nanakshahi', 'nepali', 'persian', 'jalali', 'taiwan',
'thai', 'ummalqura']
Returns
-------
Any
"""
return self["ycalendar"] | [
"def",
"ycalendar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ycalendar\"",
"]"
] | [
1480,
4
] | [
1495,
32
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ygap | (self) |
Sets the vertical gap (in pixels) between bricks.
The 'ygap' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the vertical gap (in pixels) between bricks.
The 'ygap' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def ygap(self):
"""
Sets the vertical gap (in pixels) between bricks.
The 'ygap' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["ygap"] | [
"def",
"ygap",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ygap\"",
"]"
] | [
1504,
4
] | [
1515,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.ysrc | (self) |
Sets the source reference on Chart Studio Cloud for y .
The 'ysrc' 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 y .
The 'ysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def ysrc(self):
"""
Sets the source reference on Chart Studio Cloud for y .
The 'ysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["ysrc"] | [
"def",
"ysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ysrc\"",
"]"
] | [
1524,
4
] | [
1535,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.z | (self) |
Sets the aggregation data.
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the aggregation data.
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def z(self):
"""
Sets the aggregation data.
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
1544,
4
] | [
1555,
24
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False) | def zauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["zauto"] | [
"def",
"zauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zauto\"",
"]"
] | [
1564,
4
] | [
1578,
28
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zhoverformat | (self) |
Sets the hover text formatting rule using d3 formatting mini-
languages which are very similar to those in Python. See:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'zhoverformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the hover text formatting rule using d3 formatting mini-
languages which are very similar to those in Python. See:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'zhoverformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def zhoverformat(self):
"""
Sets the hover text formatting rule using d3 formatting mini-
languages which are very similar to those in Python. See:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
The 'zhoverformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["zhoverformat"] | [
"def",
"zhoverformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zhoverformat\"",
"]"
] | [
1587,
4
] | [
1602,
35
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zmax | (self) |
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float | def zmax(self):
"""
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmax"] | [
"def",
"zmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmax\"",
"]"
] | [
1611,
4
] | [
1623,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zmid | (self) |
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float | def zmid(self):
"""
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmid"] | [
"def",
"zmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmid\"",
"]"
] | [
1632,
4
] | [
1645,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zmin | (self) |
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float | def zmin(self):
"""
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmin"] | [
"def",
"zmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmin\"",
"]"
] | [
1654,
4
] | [
1666,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zsmooth | (self) |
Picks a smoothing algorithm use to smooth `z` data.
The 'zsmooth' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fast', 'best', False]
Returns
-------
Any
|
Picks a smoothing algorithm use to smooth `z` data.
The 'zsmooth' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fast', 'best', False] | def zsmooth(self):
"""
Picks a smoothing algorithm use to smooth `z` data.
The 'zsmooth' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fast', 'best', False]
Returns
-------
Any
"""
return self["zsmooth"] | [
"def",
"zsmooth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zsmooth\"",
"]"
] | [
1675,
4
] | [
1687,
30
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.zsrc | (self) |
Sets the source reference on Chart Studio Cloud for z .
The 'zsrc' 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 z .
The 'zsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def zsrc(self):
"""
Sets the source reference on Chart Studio Cloud for z .
The 'zsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["zsrc"] | [
"def",
"zsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zsrc\"",
"]"
] | [
1696,
4
] | [
1707,
27
] | python | en | ['en', 'error', 'th'] | False |
Histogram2d.__init__ | (
self,
arg=None,
autobinx=None,
autobiny=None,
autocolorscale=None,
bingroup=None,
coloraxis=None,
colorbar=None,
colorscale=None,
customdata=None,
customdatasrc=None,
histfunc=None,
histnorm=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
ids=None,
idssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,
nbinsx=None,
nbinsy=None,
opacity=None,
reversescale=None,
showlegend=None,
showscale=None,
stream=None,
uid=None,
uirevision=None,
visible=None,
x=None,
xaxis=None,
xbingroup=None,
xbins=None,
xcalendar=None,
xgap=None,
xsrc=None,
y=None,
yaxis=None,
ybingroup=None,
ybins=None,
ycalendar=None,
ygap=None,
ysrc=None,
z=None,
zauto=None,
zhoverformat=None,
zmax=None,
zmid=None,
zmin=None,
zsmooth=None,
zsrc=None,
**kwargs
) |
Construct a new Histogram2d object
The sample data from which statistics are computed is set in
`x` and `y` (where `x` and `y` represent marginal
distributions, binning is set in `xbins` and `ybins` in this
case) or `z` (where `z` represent the 2D distribution and
binning set, binning is set by `x` and `y` in this case). The
resulting distribution is visualized as a heatmap.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Histogram2d`
autobinx
Obsolete: since v1.42 each bin attribute is auto-
determined separately and `autobinx` is not needed.
However, we accept `autobinx: true` or `false` and will
update `xbins` accordingly before deleting `autobinx`
from the trace.
autobiny
Obsolete: since v1.42 each bin attribute is auto-
determined separately and `autobiny` is not needed.
However, we accept `autobiny: true` or `false` and will
update `ybins` accordingly before deleting `autobiny`
from the trace.
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color`
array are all positive, all negative or mixed.
bingroup
Set the `xbingroup` and `ybingroup` default prefix For
example, setting a `bingroup` of 1 on two histogram2d
traces will make them their x-bins and y-bins match
separately.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorbar
:class:`plotly.graph_objects.histogram2d.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. The colorscale must be an array
containing arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At minimum,
a mapping for the lowest (0) and highest (1) values are
required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the
colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
customdata
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note
that, "scatter" traces also appends customdata items in
the markers DOM elements
customdatasrc
Sets the source reference on Chart Studio Cloud for
customdata .
histfunc
Specifies the binning function used for this histogram
trace. If "count", the histogram values are computed by
counting the number of values lying inside each bin. If
"sum", "avg", "min", "max", the histogram values are
computed using the sum, the average, the minimum or the
maximum of the values lying inside each bin
respectively.
histnorm
Specifies the type of normalization used for this
histogram trace. If "", the span of each bar
corresponds to the number of occurrences (i.e. the
number of data points lying inside the bins). If
"percent" / "probability", the span of each bar
corresponds to the percentage / fraction of occurrences
with respect to the total number of sample points
(here, the sum of all bin HEIGHTS equals 100% / 1). If
"density", the span of each bar corresponds to the
number of occurrences in a bin divided by the size of
the bin interval (here, the sum of all bin AREAS equals
the total number of sample points). If *probability
density*, the area of each bar corresponds to the
probability that an event will fall into the
corresponding bin (here, the sum of all bin AREAS
equals 1).
hoverinfo
Determines which trace information appear on hover. If
`none` or `skip` are set, no information is displayed
upon hovering. But, if `none` is set, click and hover
events are still fired.
hoverinfosrc
Sets the source reference on Chart Studio Cloud for
hoverinfo .
hoverlabel
:class:`plotly.graph_objects.histogram2d.Hoverlabel`
instance or dict with compatible properties
hovertemplate
Template string used for rendering the information that
appear on hover box. Note that this will override
`hoverinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
"Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for
details on the formatting syntax. Dates are formatted
using d3-time-format's syntax %{variable|d3-time-
format}, for example "Day: %{2019-01-01|%A}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for
details on the date formatting syntax. The variables
available in `hovertemplate` are the ones emitted as
event data described at this link
https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. variable `z` Anything contained in tag
`<extra>` is displayed in the secondary box, for
example "<extra>{fullData.name}</extra>". To hide the
secondary box completely, use an empty tag
`<extra></extra>`.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
hovertemplate .
ids
Assigns id labels to each datum. These ids for object
constancy of data points during animation. Should be an
array of strings, not numbers or any other type.
idssrc
Sets the source reference on Chart Studio Cloud for
ids .
legendgroup
Sets the legend group for this trace. Traces part of
the same legend group hide/show at the same time when
toggling legend items.
marker
:class:`plotly.graph_objects.histogram2d.Marker`
instance or dict with compatible properties
meta
Assigns extra meta information associated with this
trace that can be used in various text attributes.
Attributes such as trace `name`, graph, axis and
colorbar `title.text`, annotation `text`
`rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta`
values in an attribute in the same trace, simply use
`%{meta[i]}` where `i` is the index or key of the
`meta` item in question. To access trace `meta` in
layout attributes, use `%{data[n[.meta[i]}` where `i`
is the index or key of the `meta` and `n` is the trace
index.
metasrc
Sets the source reference on Chart Studio Cloud for
meta .
name
Sets the trace name. The trace name appear as the
legend item and on hover.
nbinsx
Specifies the maximum number of desired bins. This
value will be used in an algorithm that will decide the
optimal bin size such that the histogram best
visualizes the distribution of the data. Ignored if
`xbins.size` is provided.
nbinsy
Specifies the maximum number of desired bins. This
value will be used in an algorithm that will decide the
optimal bin size such that the histogram best
visualizes the distribution of the data. Ignored if
`ybins.size` is provided.
opacity
Sets the opacity of the trace.
reversescale
Reverses the color mapping if true. If true, `zmin`
will correspond to the last color in the array and
`zmax` will correspond to the first color.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
showscale
Determines whether or not a colorbar is displayed for
this trace.
stream
:class:`plotly.graph_objects.histogram2d.Stream`
instance or dict with compatible properties
uid
Assign an id to this trace, Use this to provide object
constancy between traces during animations and
transitions.
uirevision
Controls persistence of some user-driven changes to the
trace: `constraintrange` in `parcoords` traces, as well
as some `editable: true` modifications such as `name`
and `colorbar.title`. Defaults to `layout.uirevision`.
Note that other user-driven trace attribute changes are
controlled by `layout` attributes: `trace.visible` is
controlled by `layout.legend.uirevision`,
`selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)`
(accessible with `config: {editable: true}`) is
controlled by `layout.editrevision`. Trace changes are
tracked by `uid`, which only falls back on trace index
if no `uid` is provided. So if your app can add/remove
traces before the end of the `data` array, such that
the same trace has a different index, you can still
preserve user-driven changes if you give each trace a
`uid` that stays with it as it moves.
visible
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as
a legend item (provided that the legend itself is
visible).
x
Sets the sample data to be binned on the x axis.
xaxis
Sets a reference between this trace's x coordinates and
a 2D cartesian x axis. If "x" (the default value), the
x coordinates refer to `layout.xaxis`. If "x2", the x
coordinates refer to `layout.xaxis2`, and so on.
xbingroup
Set a group of histogram traces which will have
compatible x-bin settings. Using `xbingroup`,
histogram2d and histogram2dcontour traces (on axes of
the same axis type) can have compatible x-bin settings.
Note that the same `xbingroup` value can be used to set
(1D) histogram `bingroup`
xbins
:class:`plotly.graph_objects.histogram2d.XBins`
instance or dict with compatible properties
xcalendar
Sets the calendar system to use with `x` date data.
xgap
Sets the horizontal gap (in pixels) between bricks.
xsrc
Sets the source reference on Chart Studio Cloud for x
.
y
Sets the sample data to be binned on the y axis.
yaxis
Sets a reference between this trace's y coordinates and
a 2D cartesian y axis. If "y" (the default value), the
y coordinates refer to `layout.yaxis`. If "y2", the y
coordinates refer to `layout.yaxis2`, and so on.
ybingroup
Set a group of histogram traces which will have
compatible y-bin settings. Using `ybingroup`,
histogram2d and histogram2dcontour traces (on axes of
the same axis type) can have compatible y-bin settings.
Note that the same `ybingroup` value can be used to set
(1D) histogram `bingroup`
ybins
:class:`plotly.graph_objects.histogram2d.YBins`
instance or dict with compatible properties
ycalendar
Sets the calendar system to use with `y` date data.
ygap
Sets the vertical gap (in pixels) between bricks.
ysrc
Sets the source reference on Chart Studio Cloud for y
.
z
Sets the aggregation data.
zauto
Determines whether or not the color domain is computed
with respect to the input data (here in `z`) or the
bounds set in `zmin` and `zmax` Defaults to `false`
when `zmin` and `zmax` are set by the user.
zhoverformat
Sets the hover text formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. See: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
zmax
Sets the upper bound of the color domain. Value should
have the same units as in `z` and if set, `zmin` must
be set as well.
zmid
Sets the mid-point of the color domain by scaling
`zmin` and/or `zmax` to be equidistant to this point.
Value should have the same units as in `z`. Has no
effect when `zauto` is `false`.
zmin
Sets the lower bound of the color domain. Value should
have the same units as in `z` and if set, `zmax` must
be set as well.
zsmooth
Picks a smoothing algorithm use to smooth `z` data.
zsrc
Sets the source reference on Chart Studio Cloud for z
.
Returns
-------
Histogram2d
|
Construct a new Histogram2d object
The sample data from which statistics are computed is set in
`x` and `y` (where `x` and `y` represent marginal
distributions, binning is set in `xbins` and `ybins` in this
case) or `z` (where `z` represent the 2D distribution and
binning set, binning is set by `x` and `y` in this case). The
resulting distribution is visualized as a heatmap. | def __init__(
self,
arg=None,
autobinx=None,
autobiny=None,
autocolorscale=None,
bingroup=None,
coloraxis=None,
colorbar=None,
colorscale=None,
customdata=None,
customdatasrc=None,
histfunc=None,
histnorm=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
ids=None,
idssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,
nbinsx=None,
nbinsy=None,
opacity=None,
reversescale=None,
showlegend=None,
showscale=None,
stream=None,
uid=None,
uirevision=None,
visible=None,
x=None,
xaxis=None,
xbingroup=None,
xbins=None,
xcalendar=None,
xgap=None,
xsrc=None,
y=None,
yaxis=None,
ybingroup=None,
ybins=None,
ycalendar=None,
ygap=None,
ysrc=None,
z=None,
zauto=None,
zhoverformat=None,
zmax=None,
zmid=None,
zmin=None,
zsmooth=None,
zsrc=None,
**kwargs
):
"""
Construct a new Histogram2d object
The sample data from which statistics are computed is set in
`x` and `y` (where `x` and `y` represent marginal
distributions, binning is set in `xbins` and `ybins` in this
case) or `z` (where `z` represent the 2D distribution and
binning set, binning is set by `x` and `y` in this case). The
resulting distribution is visualized as a heatmap.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Histogram2d`
autobinx
Obsolete: since v1.42 each bin attribute is auto-
determined separately and `autobinx` is not needed.
However, we accept `autobinx: true` or `false` and will
update `xbins` accordingly before deleting `autobinx`
from the trace.
autobiny
Obsolete: since v1.42 each bin attribute is auto-
determined separately and `autobiny` is not needed.
However, we accept `autobiny: true` or `false` and will
update `ybins` accordingly before deleting `autobiny`
from the trace.
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color`
array are all positive, all negative or mixed.
bingroup
Set the `xbingroup` and `ybingroup` default prefix For
example, setting a `bingroup` of 1 on two histogram2d
traces will make them their x-bins and y-bins match
separately.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorbar
:class:`plotly.graph_objects.histogram2d.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. The colorscale must be an array
containing arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At minimum,
a mapping for the lowest (0) and highest (1) values are
required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the
colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
customdata
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note
that, "scatter" traces also appends customdata items in
the markers DOM elements
customdatasrc
Sets the source reference on Chart Studio Cloud for
customdata .
histfunc
Specifies the binning function used for this histogram
trace. If "count", the histogram values are computed by
counting the number of values lying inside each bin. If
"sum", "avg", "min", "max", the histogram values are
computed using the sum, the average, the minimum or the
maximum of the values lying inside each bin
respectively.
histnorm
Specifies the type of normalization used for this
histogram trace. If "", the span of each bar
corresponds to the number of occurrences (i.e. the
number of data points lying inside the bins). If
"percent" / "probability", the span of each bar
corresponds to the percentage / fraction of occurrences
with respect to the total number of sample points
(here, the sum of all bin HEIGHTS equals 100% / 1). If
"density", the span of each bar corresponds to the
number of occurrences in a bin divided by the size of
the bin interval (here, the sum of all bin AREAS equals
the total number of sample points). If *probability
density*, the area of each bar corresponds to the
probability that an event will fall into the
corresponding bin (here, the sum of all bin AREAS
equals 1).
hoverinfo
Determines which trace information appear on hover. If
`none` or `skip` are set, no information is displayed
upon hovering. But, if `none` is set, click and hover
events are still fired.
hoverinfosrc
Sets the source reference on Chart Studio Cloud for
hoverinfo .
hoverlabel
:class:`plotly.graph_objects.histogram2d.Hoverlabel`
instance or dict with compatible properties
hovertemplate
Template string used for rendering the information that
appear on hover box. Note that this will override
`hoverinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
"Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for
details on the formatting syntax. Dates are formatted
using d3-time-format's syntax %{variable|d3-time-
format}, for example "Day: %{2019-01-01|%A}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for
details on the date formatting syntax. The variables
available in `hovertemplate` are the ones emitted as
event data described at this link
https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. variable `z` Anything contained in tag
`<extra>` is displayed in the secondary box, for
example "<extra>{fullData.name}</extra>". To hide the
secondary box completely, use an empty tag
`<extra></extra>`.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
hovertemplate .
ids
Assigns id labels to each datum. These ids for object
constancy of data points during animation. Should be an
array of strings, not numbers or any other type.
idssrc
Sets the source reference on Chart Studio Cloud for
ids .
legendgroup
Sets the legend group for this trace. Traces part of
the same legend group hide/show at the same time when
toggling legend items.
marker
:class:`plotly.graph_objects.histogram2d.Marker`
instance or dict with compatible properties
meta
Assigns extra meta information associated with this
trace that can be used in various text attributes.
Attributes such as trace `name`, graph, axis and
colorbar `title.text`, annotation `text`
`rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta`
values in an attribute in the same trace, simply use
`%{meta[i]}` where `i` is the index or key of the
`meta` item in question. To access trace `meta` in
layout attributes, use `%{data[n[.meta[i]}` where `i`
is the index or key of the `meta` and `n` is the trace
index.
metasrc
Sets the source reference on Chart Studio Cloud for
meta .
name
Sets the trace name. The trace name appear as the
legend item and on hover.
nbinsx
Specifies the maximum number of desired bins. This
value will be used in an algorithm that will decide the
optimal bin size such that the histogram best
visualizes the distribution of the data. Ignored if
`xbins.size` is provided.
nbinsy
Specifies the maximum number of desired bins. This
value will be used in an algorithm that will decide the
optimal bin size such that the histogram best
visualizes the distribution of the data. Ignored if
`ybins.size` is provided.
opacity
Sets the opacity of the trace.
reversescale
Reverses the color mapping if true. If true, `zmin`
will correspond to the last color in the array and
`zmax` will correspond to the first color.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
showscale
Determines whether or not a colorbar is displayed for
this trace.
stream
:class:`plotly.graph_objects.histogram2d.Stream`
instance or dict with compatible properties
uid
Assign an id to this trace, Use this to provide object
constancy between traces during animations and
transitions.
uirevision
Controls persistence of some user-driven changes to the
trace: `constraintrange` in `parcoords` traces, as well
as some `editable: true` modifications such as `name`
and `colorbar.title`. Defaults to `layout.uirevision`.
Note that other user-driven trace attribute changes are
controlled by `layout` attributes: `trace.visible` is
controlled by `layout.legend.uirevision`,
`selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)`
(accessible with `config: {editable: true}`) is
controlled by `layout.editrevision`. Trace changes are
tracked by `uid`, which only falls back on trace index
if no `uid` is provided. So if your app can add/remove
traces before the end of the `data` array, such that
the same trace has a different index, you can still
preserve user-driven changes if you give each trace a
`uid` that stays with it as it moves.
visible
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as
a legend item (provided that the legend itself is
visible).
x
Sets the sample data to be binned on the x axis.
xaxis
Sets a reference between this trace's x coordinates and
a 2D cartesian x axis. If "x" (the default value), the
x coordinates refer to `layout.xaxis`. If "x2", the x
coordinates refer to `layout.xaxis2`, and so on.
xbingroup
Set a group of histogram traces which will have
compatible x-bin settings. Using `xbingroup`,
histogram2d and histogram2dcontour traces (on axes of
the same axis type) can have compatible x-bin settings.
Note that the same `xbingroup` value can be used to set
(1D) histogram `bingroup`
xbins
:class:`plotly.graph_objects.histogram2d.XBins`
instance or dict with compatible properties
xcalendar
Sets the calendar system to use with `x` date data.
xgap
Sets the horizontal gap (in pixels) between bricks.
xsrc
Sets the source reference on Chart Studio Cloud for x
.
y
Sets the sample data to be binned on the y axis.
yaxis
Sets a reference between this trace's y coordinates and
a 2D cartesian y axis. If "y" (the default value), the
y coordinates refer to `layout.yaxis`. If "y2", the y
coordinates refer to `layout.yaxis2`, and so on.
ybingroup
Set a group of histogram traces which will have
compatible y-bin settings. Using `ybingroup`,
histogram2d and histogram2dcontour traces (on axes of
the same axis type) can have compatible y-bin settings.
Note that the same `ybingroup` value can be used to set
(1D) histogram `bingroup`
ybins
:class:`plotly.graph_objects.histogram2d.YBins`
instance or dict with compatible properties
ycalendar
Sets the calendar system to use with `y` date data.
ygap
Sets the vertical gap (in pixels) between bricks.
ysrc
Sets the source reference on Chart Studio Cloud for y
.
z
Sets the aggregation data.
zauto
Determines whether or not the color domain is computed
with respect to the input data (here in `z`) or the
bounds set in `zmin` and `zmax` Defaults to `false`
when `zmin` and `zmax` are set by the user.
zhoverformat
Sets the hover text formatting rule using d3 formatting
mini-languages which are very similar to those in
Python. See: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
zmax
Sets the upper bound of the color domain. Value should
have the same units as in `z` and if set, `zmin` must
be set as well.
zmid
Sets the mid-point of the color domain by scaling
`zmin` and/or `zmax` to be equidistant to this point.
Value should have the same units as in `z`. Has no
effect when `zauto` is `false`.
zmin
Sets the lower bound of the color domain. Value should
have the same units as in `z` and if set, `zmax` must
be set as well.
zsmooth
Picks a smoothing algorithm use to smooth `z` data.
zsrc
Sets the source reference on Chart Studio Cloud for z
.
Returns
-------
Histogram2d
"""
super(Histogram2d, self).__init__("histogram2d")
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.Histogram2d
constructor must be a dict or
an instance of :class:`plotly.graph_objs.Histogram2d`"""
)
# 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("autobinx", None)
_v = autobinx if autobinx is not None else _v
if _v is not None:
self["autobinx"] = _v
_v = arg.pop("autobiny", None)
_v = autobiny if autobiny is not None else _v
if _v is not None:
self["autobiny"] = _v
_v = arg.pop("autocolorscale", None)
_v = autocolorscale if autocolorscale is not None else _v
if _v is not None:
self["autocolorscale"] = _v
_v = arg.pop("bingroup", None)
_v = bingroup if bingroup is not None else _v
if _v is not None:
self["bingroup"] = _v
_v = arg.pop("coloraxis", None)
_v = coloraxis if coloraxis is not None else _v
if _v is not None:
self["coloraxis"] = _v
_v = arg.pop("colorbar", None)
_v = colorbar if colorbar is not None else _v
if _v is not None:
self["colorbar"] = _v
_v = arg.pop("colorscale", None)
_v = colorscale if colorscale is not None else _v
if _v is not None:
self["colorscale"] = _v
_v = arg.pop("customdata", None)
_v = customdata if customdata is not None else _v
if _v is not None:
self["customdata"] = _v
_v = arg.pop("customdatasrc", None)
_v = customdatasrc if customdatasrc is not None else _v
if _v is not None:
self["customdatasrc"] = _v
_v = arg.pop("histfunc", None)
_v = histfunc if histfunc is not None else _v
if _v is not None:
self["histfunc"] = _v
_v = arg.pop("histnorm", None)
_v = histnorm if histnorm is not None else _v
if _v is not None:
self["histnorm"] = _v
_v = arg.pop("hoverinfo", None)
_v = hoverinfo if hoverinfo is not None else _v
if _v is not None:
self["hoverinfo"] = _v
_v = arg.pop("hoverinfosrc", None)
_v = hoverinfosrc if hoverinfosrc is not None else _v
if _v is not None:
self["hoverinfosrc"] = _v
_v = arg.pop("hoverlabel", None)
_v = hoverlabel if hoverlabel is not None else _v
if _v is not None:
self["hoverlabel"] = _v
_v = arg.pop("hovertemplate", None)
_v = hovertemplate if hovertemplate is not None else _v
if _v is not None:
self["hovertemplate"] = _v
_v = arg.pop("hovertemplatesrc", None)
_v = hovertemplatesrc if hovertemplatesrc is not None else _v
if _v is not None:
self["hovertemplatesrc"] = _v
_v = arg.pop("ids", None)
_v = ids if ids is not None else _v
if _v is not None:
self["ids"] = _v
_v = arg.pop("idssrc", None)
_v = idssrc if idssrc is not None else _v
if _v is not None:
self["idssrc"] = _v
_v = arg.pop("legendgroup", None)
_v = legendgroup if legendgroup is not None else _v
if _v is not None:
self["legendgroup"] = _v
_v = arg.pop("marker", None)
_v = marker if marker is not None else _v
if _v is not None:
self["marker"] = _v
_v = arg.pop("meta", None)
_v = meta if meta is not None else _v
if _v is not None:
self["meta"] = _v
_v = arg.pop("metasrc", None)
_v = metasrc if metasrc is not None else _v
if _v is not None:
self["metasrc"] = _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("nbinsx", None)
_v = nbinsx if nbinsx is not None else _v
if _v is not None:
self["nbinsx"] = _v
_v = arg.pop("nbinsy", None)
_v = nbinsy if nbinsy is not None else _v
if _v is not None:
self["nbinsy"] = _v
_v = arg.pop("opacity", None)
_v = opacity if opacity is not None else _v
if _v is not None:
self["opacity"] = _v
_v = arg.pop("reversescale", None)
_v = reversescale if reversescale is not None else _v
if _v is not None:
self["reversescale"] = _v
_v = arg.pop("showlegend", None)
_v = showlegend if showlegend is not None else _v
if _v is not None:
self["showlegend"] = _v
_v = arg.pop("showscale", None)
_v = showscale if showscale is not None else _v
if _v is not None:
self["showscale"] = _v
_v = arg.pop("stream", None)
_v = stream if stream is not None else _v
if _v is not None:
self["stream"] = _v
_v = arg.pop("uid", None)
_v = uid if uid is not None else _v
if _v is not None:
self["uid"] = _v
_v = arg.pop("uirevision", None)
_v = uirevision if uirevision is not None else _v
if _v is not None:
self["uirevision"] = _v
_v = arg.pop("visible", None)
_v = visible if visible is not None else _v
if _v is not None:
self["visible"] = _v
_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("xaxis", None)
_v = xaxis if xaxis is not None else _v
if _v is not None:
self["xaxis"] = _v
_v = arg.pop("xbingroup", None)
_v = xbingroup if xbingroup is not None else _v
if _v is not None:
self["xbingroup"] = _v
_v = arg.pop("xbins", None)
_v = xbins if xbins is not None else _v
if _v is not None:
self["xbins"] = _v
_v = arg.pop("xcalendar", None)
_v = xcalendar if xcalendar is not None else _v
if _v is not None:
self["xcalendar"] = _v
_v = arg.pop("xgap", None)
_v = xgap if xgap is not None else _v
if _v is not None:
self["xgap"] = _v
_v = arg.pop("xsrc", None)
_v = xsrc if xsrc is not None else _v
if _v is not None:
self["xsrc"] = _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("yaxis", None)
_v = yaxis if yaxis is not None else _v
if _v is not None:
self["yaxis"] = _v
_v = arg.pop("ybingroup", None)
_v = ybingroup if ybingroup is not None else _v
if _v is not None:
self["ybingroup"] = _v
_v = arg.pop("ybins", None)
_v = ybins if ybins is not None else _v
if _v is not None:
self["ybins"] = _v
_v = arg.pop("ycalendar", None)
_v = ycalendar if ycalendar is not None else _v
if _v is not None:
self["ycalendar"] = _v
_v = arg.pop("ygap", None)
_v = ygap if ygap is not None else _v
if _v is not None:
self["ygap"] = _v
_v = arg.pop("ysrc", None)
_v = ysrc if ysrc is not None else _v
if _v is not None:
self["ysrc"] = _v
_v = arg.pop("z", None)
_v = z if z is not None else _v
if _v is not None:
self["z"] = _v
_v = arg.pop("zauto", None)
_v = zauto if zauto is not None else _v
if _v is not None:
self["zauto"] = _v
_v = arg.pop("zhoverformat", None)
_v = zhoverformat if zhoverformat is not None else _v
if _v is not None:
self["zhoverformat"] = _v
_v = arg.pop("zmax", None)
_v = zmax if zmax is not None else _v
if _v is not None:
self["zmax"] = _v
_v = arg.pop("zmid", None)
_v = zmid if zmid is not None else _v
if _v is not None:
self["zmid"] = _v
_v = arg.pop("zmin", None)
_v = zmin if zmin is not None else _v
if _v is not None:
self["zmin"] = _v
_v = arg.pop("zsmooth", None)
_v = zsmooth if zsmooth is not None else _v
if _v is not None:
self["zsmooth"] = _v
_v = arg.pop("zsrc", None)
_v = zsrc if zsrc is not None else _v
if _v is not None:
self["zsrc"] = _v
# Read-only literals
# ------------------
self._props["type"] = "histogram2d"
arg.pop("type", None)
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autobinx",
"=",
"None",
",",
"autobiny",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"bingroup",
"=",
"None",
",",
"coloraxis",
"=",
"None",
",",
"colorbar",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"histfunc",
"=",
"None",
",",
"histnorm",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hoverinfosrc",
"=",
"None",
",",
"hoverlabel",
"=",
"None",
",",
"hovertemplate",
"=",
"None",
",",
"hovertemplatesrc",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"idssrc",
"=",
"None",
",",
"legendgroup",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"meta",
"=",
"None",
",",
"metasrc",
"=",
"None",
",",
"name",
"=",
"None",
",",
"nbinsx",
"=",
"None",
",",
"nbinsy",
"=",
"None",
",",
"opacity",
"=",
"None",
",",
"reversescale",
"=",
"None",
",",
"showlegend",
"=",
"None",
",",
"showscale",
"=",
"None",
",",
"stream",
"=",
"None",
",",
"uid",
"=",
"None",
",",
"uirevision",
"=",
"None",
",",
"visible",
"=",
"None",
",",
"x",
"=",
"None",
",",
"xaxis",
"=",
"None",
",",
"xbingroup",
"=",
"None",
",",
"xbins",
"=",
"None",
",",
"xcalendar",
"=",
"None",
",",
"xgap",
"=",
"None",
",",
"xsrc",
"=",
"None",
",",
"y",
"=",
"None",
",",
"yaxis",
"=",
"None",
",",
"ybingroup",
"=",
"None",
",",
"ybins",
"=",
"None",
",",
"ycalendar",
"=",
"None",
",",
"ygap",
"=",
"None",
",",
"ysrc",
"=",
"None",
",",
"z",
"=",
"None",
",",
"zauto",
"=",
"None",
",",
"zhoverformat",
"=",
"None",
",",
"zmax",
"=",
"None",
",",
"zmid",
"=",
"None",
",",
"zmin",
"=",
"None",
",",
"zsmooth",
"=",
"None",
",",
"zsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Histogram2d",
",",
"self",
")",
".",
"__init__",
"(",
"\"histogram2d\"",
")",
"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.Histogram2d \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.Histogram2d`\"\"\"",
")",
"# 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",
"(",
"\"autobinx\"",
",",
"None",
")",
"_v",
"=",
"autobinx",
"if",
"autobinx",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"autobinx\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"autobiny\"",
",",
"None",
")",
"_v",
"=",
"autobiny",
"if",
"autobiny",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"autobiny\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"autocolorscale\"",
",",
"None",
")",
"_v",
"=",
"autocolorscale",
"if",
"autocolorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"autocolorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bingroup\"",
",",
"None",
")",
"_v",
"=",
"bingroup",
"if",
"bingroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bingroup\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"coloraxis\"",
",",
"None",
")",
"_v",
"=",
"coloraxis",
"if",
"coloraxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"coloraxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorbar\"",
",",
"None",
")",
"_v",
"=",
"colorbar",
"if",
"colorbar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorbar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorscale\"",
",",
"None",
")",
"_v",
"=",
"colorscale",
"if",
"colorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"customdata\"",
",",
"None",
")",
"_v",
"=",
"customdata",
"if",
"customdata",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"customdata\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"customdatasrc\"",
",",
"None",
")",
"_v",
"=",
"customdatasrc",
"if",
"customdatasrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"customdatasrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"histfunc\"",
",",
"None",
")",
"_v",
"=",
"histfunc",
"if",
"histfunc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"histfunc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"histnorm\"",
",",
"None",
")",
"_v",
"=",
"histnorm",
"if",
"histnorm",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"histnorm\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverinfo\"",
",",
"None",
")",
"_v",
"=",
"hoverinfo",
"if",
"hoverinfo",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverinfo\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverinfosrc\"",
",",
"None",
")",
"_v",
"=",
"hoverinfosrc",
"if",
"hoverinfosrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverinfosrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverlabel\"",
",",
"None",
")",
"_v",
"=",
"hoverlabel",
"if",
"hoverlabel",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverlabel\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertemplate\"",
",",
"None",
")",
"_v",
"=",
"hovertemplate",
"if",
"hovertemplate",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertemplate\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertemplatesrc\"",
",",
"None",
")",
"_v",
"=",
"hovertemplatesrc",
"if",
"hovertemplatesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertemplatesrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ids\"",
",",
"None",
")",
"_v",
"=",
"ids",
"if",
"ids",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ids\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"idssrc\"",
",",
"None",
")",
"_v",
"=",
"idssrc",
"if",
"idssrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"idssrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"legendgroup\"",
",",
"None",
")",
"_v",
"=",
"legendgroup",
"if",
"legendgroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"legendgroup\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"marker\"",
",",
"None",
")",
"_v",
"=",
"marker",
"if",
"marker",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"marker\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"meta\"",
",",
"None",
")",
"_v",
"=",
"meta",
"if",
"meta",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"meta\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"metasrc\"",
",",
"None",
")",
"_v",
"=",
"metasrc",
"if",
"metasrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"metasrc\"",
"]",
"=",
"_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",
"(",
"\"nbinsx\"",
",",
"None",
")",
"_v",
"=",
"nbinsx",
"if",
"nbinsx",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"nbinsx\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"nbinsy\"",
",",
"None",
")",
"_v",
"=",
"nbinsy",
"if",
"nbinsy",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"nbinsy\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"opacity\"",
",",
"None",
")",
"_v",
"=",
"opacity",
"if",
"opacity",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"opacity\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"reversescale\"",
",",
"None",
")",
"_v",
"=",
"reversescale",
"if",
"reversescale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"reversescale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showlegend\"",
",",
"None",
")",
"_v",
"=",
"showlegend",
"if",
"showlegend",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showlegend\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showscale\"",
",",
"None",
")",
"_v",
"=",
"showscale",
"if",
"showscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"stream\"",
",",
"None",
")",
"_v",
"=",
"stream",
"if",
"stream",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"stream\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"uid\"",
",",
"None",
")",
"_v",
"=",
"uid",
"if",
"uid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"uid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"uirevision\"",
",",
"None",
")",
"_v",
"=",
"uirevision",
"if",
"uirevision",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"uirevision\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"visible\"",
",",
"None",
")",
"_v",
"=",
"visible",
"if",
"visible",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"visible\"",
"]",
"=",
"_v",
"_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",
"(",
"\"xaxis\"",
",",
"None",
")",
"_v",
"=",
"xaxis",
"if",
"xaxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xaxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xbingroup\"",
",",
"None",
")",
"_v",
"=",
"xbingroup",
"if",
"xbingroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xbingroup\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xbins\"",
",",
"None",
")",
"_v",
"=",
"xbins",
"if",
"xbins",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xbins\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xcalendar\"",
",",
"None",
")",
"_v",
"=",
"xcalendar",
"if",
"xcalendar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xcalendar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xgap\"",
",",
"None",
")",
"_v",
"=",
"xgap",
"if",
"xgap",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xgap\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"xsrc\"",
",",
"None",
")",
"_v",
"=",
"xsrc",
"if",
"xsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"xsrc\"",
"]",
"=",
"_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",
"(",
"\"yaxis\"",
",",
"None",
")",
"_v",
"=",
"yaxis",
"if",
"yaxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"yaxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ybingroup\"",
",",
"None",
")",
"_v",
"=",
"ybingroup",
"if",
"ybingroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ybingroup\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ybins\"",
",",
"None",
")",
"_v",
"=",
"ybins",
"if",
"ybins",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ybins\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ycalendar\"",
",",
"None",
")",
"_v",
"=",
"ycalendar",
"if",
"ycalendar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ycalendar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ygap\"",
",",
"None",
")",
"_v",
"=",
"ygap",
"if",
"ygap",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ygap\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ysrc\"",
",",
"None",
")",
"_v",
"=",
"ysrc",
"if",
"ysrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ysrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"z\"",
",",
"None",
")",
"_v",
"=",
"z",
"if",
"z",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"z\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zauto\"",
",",
"None",
")",
"_v",
"=",
"zauto",
"if",
"zauto",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zauto\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zhoverformat\"",
",",
"None",
")",
"_v",
"=",
"zhoverformat",
"if",
"zhoverformat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zhoverformat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmax\"",
",",
"None",
")",
"_v",
"=",
"zmax",
"if",
"zmax",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmax\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmid\"",
",",
"None",
")",
"_v",
"=",
"zmid",
"if",
"zmid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmin\"",
",",
"None",
")",
"_v",
"=",
"zmin",
"if",
"zmin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zsmooth\"",
",",
"None",
")",
"_v",
"=",
"zsmooth",
"if",
"zsmooth",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zsmooth\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zsrc\"",
",",
"None",
")",
"_v",
"=",
"zsrc",
"if",
"zsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zsrc\"",
"]",
"=",
"_v",
"# Read-only literals",
"# ------------------",
"self",
".",
"_props",
"[",
"\"type\"",
"]",
"=",
"\"histogram2d\"",
"arg",
".",
"pop",
"(",
"\"type\"",
",",
"None",
")",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
2008,
4
] | [
2632,
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.scattercarpet.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.scattercarpet.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.scattercarpet.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.scattercarpet.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.scattercarpet.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.scattercarpet.
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.
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.scattercarpet.
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.
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.scattercarpet.
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.
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.scattercarpet.marker.colorbar.Title
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scattercarpet.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.scattercarpet.marker.colorbar.Title \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scattercarpet.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 |
CredentialExchange.__init__ | (
self,
*,
credential_exchange_id: str = None,
connection_id: str = None,
thread_id: str = None,
parent_thread_id: str = None,
initiator: str = None,
state: str = None,
credential_definition_id: str = None,
schema_id: str = None,
credential_offer: dict = None,
credential_request: dict = None,
credential_request_metadata: dict = None,
credential_id: str = None,
raw_credential: dict = None,
credential: dict = None,
credential_values: dict = None,
auto_issue: bool = False,
error_msg: str = None,
**kwargs,
) | Initialize a new CredentialExchange. | Initialize a new CredentialExchange. | def __init__(
self,
*,
credential_exchange_id: str = None,
connection_id: str = None,
thread_id: str = None,
parent_thread_id: str = None,
initiator: str = None,
state: str = None,
credential_definition_id: str = None,
schema_id: str = None,
credential_offer: dict = None,
credential_request: dict = None,
credential_request_metadata: dict = None,
credential_id: str = None,
raw_credential: dict = None,
credential: dict = None,
credential_values: dict = None,
auto_issue: bool = False,
error_msg: str = None,
**kwargs,
):
"""Initialize a new CredentialExchange."""
super().__init__(credential_exchange_id, state, **kwargs)
self.connection_id = connection_id
self.thread_id = thread_id
self.parent_thread_id = parent_thread_id
self.initiator = initiator
self.state = state
self.credential_definition_id = credential_definition_id
self.schema_id = schema_id
self.credential_offer = credential_offer
self.credential_request = credential_request
self.credential_request_metadata = credential_request_metadata
self.credential_id = credential_id
self.credential = credential
self.raw_credential = raw_credential
self.credential_values = credential_values
self.auto_issue = auto_issue
self.error_msg = error_msg | [
"def",
"__init__",
"(",
"self",
",",
"*",
",",
"credential_exchange_id",
":",
"str",
"=",
"None",
",",
"connection_id",
":",
"str",
"=",
"None",
",",
"thread_id",
":",
"str",
"=",
"None",
",",
"parent_thread_id",
":",
"str",
"=",
"None",
",",
"initiator",
":",
"str",
"=",
"None",
",",
"state",
":",
"str",
"=",
"None",
",",
"credential_definition_id",
":",
"str",
"=",
"None",
",",
"schema_id",
":",
"str",
"=",
"None",
",",
"credential_offer",
":",
"dict",
"=",
"None",
",",
"credential_request",
":",
"dict",
"=",
"None",
",",
"credential_request_metadata",
":",
"dict",
"=",
"None",
",",
"credential_id",
":",
"str",
"=",
"None",
",",
"raw_credential",
":",
"dict",
"=",
"None",
",",
"credential",
":",
"dict",
"=",
"None",
",",
"credential_values",
":",
"dict",
"=",
"None",
",",
"auto_issue",
":",
"bool",
"=",
"False",
",",
"error_msg",
":",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"credential_exchange_id",
",",
"state",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"connection_id",
"=",
"connection_id",
"self",
".",
"thread_id",
"=",
"thread_id",
"self",
".",
"parent_thread_id",
"=",
"parent_thread_id",
"self",
".",
"initiator",
"=",
"initiator",
"self",
".",
"state",
"=",
"state",
"self",
".",
"credential_definition_id",
"=",
"credential_definition_id",
"self",
".",
"schema_id",
"=",
"schema_id",
"self",
".",
"credential_offer",
"=",
"credential_offer",
"self",
".",
"credential_request",
"=",
"credential_request",
"self",
".",
"credential_request_metadata",
"=",
"credential_request_metadata",
"self",
".",
"credential_id",
"=",
"credential_id",
"self",
".",
"credential",
"=",
"credential",
"self",
".",
"raw_credential",
"=",
"raw_credential",
"self",
".",
"credential_values",
"=",
"credential_values",
"self",
".",
"auto_issue",
"=",
"auto_issue",
"self",
".",
"error_msg",
"=",
"error_msg"
] | [
33,
4
] | [
72,
34
] | python | en | ['en', 'en', 'en'] | True |
CredentialExchange.credential_exchange_id | (self) | Accessor for the ID associated with this exchange. | Accessor for the ID associated with this exchange. | def credential_exchange_id(self) -> str:
"""Accessor for the ID associated with this exchange."""
return self._id | [
"def",
"credential_exchange_id",
"(",
"self",
")",
"->",
"str",
":",
"return",
"self",
".",
"_id"
] | [
75,
4
] | [
77,
23
] | python | en | ['en', 'en', 'en'] | True |
CredentialExchange.record_value | (self) | Accessor to for the JSON record value props for this credential exchange. | Accessor to for the JSON record value props for this credential exchange. | def record_value(self) -> dict:
"""Accessor to for the JSON record value props for this credential exchange."""
return {
prop: getattr(self, prop)
for prop in (
"connection_id",
"initiator",
"credential_offer",
"credential_request",
"credential_request_metadata",
"error_msg",
"auto_issue",
"credential_values",
"credential",
"raw_credential",
"parent_thread_id",
"credential_definition_id",
"schema_id",
"credential_id",
"state",
)
} | [
"def",
"record_value",
"(",
"self",
")",
"->",
"dict",
":",
"return",
"{",
"prop",
":",
"getattr",
"(",
"self",
",",
"prop",
")",
"for",
"prop",
"in",
"(",
"\"connection_id\"",
",",
"\"initiator\"",
",",
"\"credential_offer\"",
",",
"\"credential_request\"",
",",
"\"credential_request_metadata\"",
",",
"\"error_msg\"",
",",
"\"auto_issue\"",
",",
"\"credential_values\"",
",",
"\"credential\"",
",",
"\"raw_credential\"",
",",
"\"parent_thread_id\"",
",",
"\"credential_definition_id\"",
",",
"\"schema_id\"",
",",
"\"credential_id\"",
",",
"\"state\"",
",",
")",
"}"
] | [
80,
4
] | [
101,
9
] | python | en | ['en', 'en', 'en'] | True |
CredentialExchange.retrieve_by_thread_and_initiator | (
cls, context: InjectionContext, thread_id: str, initiator: str
) | Retrieve a credential exchange record by thread ID and inititator. | Retrieve a credential exchange record by thread ID and inititator. | async def retrieve_by_thread_and_initiator(
cls, context: InjectionContext, thread_id: str, initiator: str
) -> "CredentialExchange":
"""Retrieve a credential exchange record by thread ID and inititator."""
cache_key = f"credential_exchange_tidx::{thread_id}::{initiator}"
record_id = await cls.get_cached_key(context, cache_key)
if record_id:
record = await cls.retrieve_by_id(context, record_id)
else:
record = await cls.retrieve_by_tag_filter(
context, {"thread_id": thread_id}, {"initiator": initiator}
)
await cls.set_cached_key(context, cache_key, record.credential_exchange_id)
return record | [
"async",
"def",
"retrieve_by_thread_and_initiator",
"(",
"cls",
",",
"context",
":",
"InjectionContext",
",",
"thread_id",
":",
"str",
",",
"initiator",
":",
"str",
")",
"->",
"\"CredentialExchange\"",
":",
"cache_key",
"=",
"f\"credential_exchange_tidx::{thread_id}::{initiator}\"",
"record_id",
"=",
"await",
"cls",
".",
"get_cached_key",
"(",
"context",
",",
"cache_key",
")",
"if",
"record_id",
":",
"record",
"=",
"await",
"cls",
".",
"retrieve_by_id",
"(",
"context",
",",
"record_id",
")",
"else",
":",
"record",
"=",
"await",
"cls",
".",
"retrieve_by_tag_filter",
"(",
"context",
",",
"{",
"\"thread_id\"",
":",
"thread_id",
"}",
",",
"{",
"\"initiator\"",
":",
"initiator",
"}",
")",
"await",
"cls",
".",
"set_cached_key",
"(",
"context",
",",
"cache_key",
",",
"record",
".",
"credential_exchange_id",
")",
"return",
"record"
] | [
104,
4
] | [
117,
21
] | python | en | ['en', 'en', 'en'] | True |
CredentialExchange.post_save | (
self,
context: InjectionContext,
new_record: bool,
last_state: str,
webhook: bool = None,
) | Perform post-save actions.
Args:
context: The injection context to use
new_record: Flag indicating if the record was just created
last_state: The previous state value
webhook: Adjust whether the webhook is called
| Perform post-save actions. | async def post_save(
self,
context: InjectionContext,
new_record: bool,
last_state: str,
webhook: bool = None,
):
"""Perform post-save actions.
Args:
context: The injection context to use
new_record: Flag indicating if the record was just created
last_state: The previous state value
webhook: Adjust whether the webhook is called
"""
await super(CredentialExchange, self).post_save(
context, new_record, last_state, webhook
)
if self.thread_id and self.initiator:
cache_key = f"credential_exchange_tidx::{self.thread_id}::{self.initiator}"
await self.set_cached_key(context, cache_key, self.credential_exchange_id) | [
"async",
"def",
"post_save",
"(",
"self",
",",
"context",
":",
"InjectionContext",
",",
"new_record",
":",
"bool",
",",
"last_state",
":",
"str",
",",
"webhook",
":",
"bool",
"=",
"None",
",",
")",
":",
"await",
"super",
"(",
"CredentialExchange",
",",
"self",
")",
".",
"post_save",
"(",
"context",
",",
"new_record",
",",
"last_state",
",",
"webhook",
")",
"if",
"self",
".",
"thread_id",
"and",
"self",
".",
"initiator",
":",
"cache_key",
"=",
"f\"credential_exchange_tidx::{self.thread_id}::{self.initiator}\"",
"await",
"self",
".",
"set_cached_key",
"(",
"context",
",",
"cache_key",
",",
"self",
".",
"credential_exchange_id",
")"
] | [
119,
4
] | [
139,
86
] | python | en | ['en', 'en', 'en'] | True |
create_keypair | (seed: bytes = None) |
Create a public and private signing keypair from a seed value.
Args:
seed: Seed for keypair
Returns:
A tuple of (public key, secret key)
|
Create a public and private signing keypair from a seed value. | def create_keypair(seed: bytes = None) -> (bytes, bytes):
"""
Create a public and private signing keypair from a seed value.
Args:
seed: Seed for keypair
Returns:
A tuple of (public key, secret key)
"""
if not seed:
seed = random_seed()
pk, sk = nacl.bindings.crypto_sign_seed_keypair(seed)
return pk, sk | [
"def",
"create_keypair",
"(",
"seed",
":",
"bytes",
"=",
"None",
")",
"->",
"(",
"bytes",
",",
"bytes",
")",
":",
"if",
"not",
"seed",
":",
"seed",
"=",
"random_seed",
"(",
")",
"pk",
",",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_seed_keypair",
"(",
"seed",
")",
"return",
"pk",
",",
"sk"
] | [
49,
0
] | [
63,
17
] | python | en | ['en', 'error', 'th'] | False |
random_seed | () |
Generate a random seed value.
Returns:
A new random seed
|
Generate a random seed value. | def random_seed() -> bytes:
"""
Generate a random seed value.
Returns:
A new random seed
"""
return nacl.utils.random(nacl.bindings.crypto_box_SEEDBYTES) | [
"def",
"random_seed",
"(",
")",
"->",
"bytes",
":",
"return",
"nacl",
".",
"utils",
".",
"random",
"(",
"nacl",
".",
"bindings",
".",
"crypto_box_SEEDBYTES",
")"
] | [
66,
0
] | [
74,
64
] | python | en | ['en', 'error', 'th'] | False |
seed_to_did | (seed: str) |
Derive a DID from a seed value.
Args:
seed: The seed to derive
Returns:
The DID derived from the seed
|
Derive a DID from a seed value. | def seed_to_did(seed: str) -> str:
"""
Derive a DID from a seed value.
Args:
seed: The seed to derive
Returns:
The DID derived from the seed
"""
seed = validate_seed(seed)
verkey, _ = create_keypair(seed)
did = bytes_to_b58(verkey[:16])
return did | [
"def",
"seed_to_did",
"(",
"seed",
":",
"str",
")",
"->",
"str",
":",
"seed",
"=",
"validate_seed",
"(",
"seed",
")",
"verkey",
",",
"_",
"=",
"create_keypair",
"(",
"seed",
")",
"did",
"=",
"bytes_to_b58",
"(",
"verkey",
"[",
":",
"16",
"]",
")",
"return",
"did"
] | [
77,
0
] | [
91,
14
] | python | en | ['en', 'error', 'th'] | False |
validate_seed | (seed: (str, bytes)) |
Convert a seed parameter to standard format and check length.
Args:
seed: The seed to validate
Returns:
The validated and encoded seed
|
Convert a seed parameter to standard format and check length. | def validate_seed(seed: (str, bytes)) -> bytes:
"""
Convert a seed parameter to standard format and check length.
Args:
seed: The seed to validate
Returns:
The validated and encoded seed
"""
if not seed:
return None
if isinstance(seed, str):
if "=" in seed:
seed = b64_to_bytes(seed)
else:
seed = seed.encode("ascii")
if not isinstance(seed, bytes):
raise WalletError("Seed value is not a string or bytes")
if len(seed) != 32:
raise WalletError("Seed value must be 32 bytes in length")
return seed | [
"def",
"validate_seed",
"(",
"seed",
":",
"(",
"str",
",",
"bytes",
")",
")",
"->",
"bytes",
":",
"if",
"not",
"seed",
":",
"return",
"None",
"if",
"isinstance",
"(",
"seed",
",",
"str",
")",
":",
"if",
"\"=\"",
"in",
"seed",
":",
"seed",
"=",
"b64_to_bytes",
"(",
"seed",
")",
"else",
":",
"seed",
"=",
"seed",
".",
"encode",
"(",
"\"ascii\"",
")",
"if",
"not",
"isinstance",
"(",
"seed",
",",
"bytes",
")",
":",
"raise",
"WalletError",
"(",
"\"Seed value is not a string or bytes\"",
")",
"if",
"len",
"(",
"seed",
")",
"!=",
"32",
":",
"raise",
"WalletError",
"(",
"\"Seed value must be 32 bytes in length\"",
")",
"return",
"seed"
] | [
94,
0
] | [
116,
15
] | python | en | ['en', 'error', 'th'] | False |
sign_message | (message: bytes, secret: bytes) |
Sign a message using a private signing key.
Args:
message: The message to sign
secret: The private signing key
Returns:
The signature
|
Sign a message using a private signing key. | def sign_message(message: bytes, secret: bytes) -> bytes:
"""
Sign a message using a private signing key.
Args:
message: The message to sign
secret: The private signing key
Returns:
The signature
"""
result = nacl.bindings.crypto_sign(message, secret)
sig = result[: nacl.bindings.crypto_sign_BYTES]
return sig | [
"def",
"sign_message",
"(",
"message",
":",
"bytes",
",",
"secret",
":",
"bytes",
")",
"->",
"bytes",
":",
"result",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign",
"(",
"message",
",",
"secret",
")",
"sig",
"=",
"result",
"[",
":",
"nacl",
".",
"bindings",
".",
"crypto_sign_BYTES",
"]",
"return",
"sig"
] | [
119,
0
] | [
133,
14
] | python | en | ['en', 'error', 'th'] | False |
verify_signed_message | (signed: bytes, verkey: bytes) |
Verify a signed message according to a public verification key.
Args:
signed: The signed message
verkey: The verkey to use in verification
Returns:
True if verified, else False
|
Verify a signed message according to a public verification key. | def verify_signed_message(signed: bytes, verkey: bytes) -> bool:
"""
Verify a signed message according to a public verification key.
Args:
signed: The signed message
verkey: The verkey to use in verification
Returns:
True if verified, else False
"""
try:
nacl.bindings.crypto_sign_open(signed, verkey)
except nacl.exceptions.BadSignatureError:
return False
return True | [
"def",
"verify_signed_message",
"(",
"signed",
":",
"bytes",
",",
"verkey",
":",
"bytes",
")",
"->",
"bool",
":",
"try",
":",
"nacl",
".",
"bindings",
".",
"crypto_sign_open",
"(",
"signed",
",",
"verkey",
")",
"except",
"nacl",
".",
"exceptions",
".",
"BadSignatureError",
":",
"return",
"False",
"return",
"True"
] | [
136,
0
] | [
152,
15
] | python | en | ['en', 'error', 'th'] | False |
anon_crypt_message | (message: bytes, to_verkey: bytes) |
Apply anon_crypt to a binary message.
Args:
message: The message to encrypt
to_verkey: The verkey to encrypt the message for
Returns:
The anon encrypted message
|
Apply anon_crypt to a binary message. | def anon_crypt_message(message: bytes, to_verkey: bytes) -> bytes:
"""
Apply anon_crypt to a binary message.
Args:
message: The message to encrypt
to_verkey: The verkey to encrypt the message for
Returns:
The anon encrypted message
"""
pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(to_verkey)
enc_message = nacl.bindings.crypto_box_seal(message, pk)
return enc_message | [
"def",
"anon_crypt_message",
"(",
"message",
":",
"bytes",
",",
"to_verkey",
":",
"bytes",
")",
"->",
"bytes",
":",
"pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"to_verkey",
")",
"enc_message",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal",
"(",
"message",
",",
"pk",
")",
"return",
"enc_message"
] | [
155,
0
] | [
169,
22
] | python | en | ['en', 'error', 'th'] | False |
anon_decrypt_message | (enc_message: bytes, secret: bytes) |
Apply anon_decrypt to a binary message.
Args:
enc_message: The encrypted message
secret: The seed to use
Returns:
The decrypted message
|
Apply anon_decrypt to a binary message. | def anon_decrypt_message(enc_message: bytes, secret: bytes) -> bytes:
"""
Apply anon_decrypt to a binary message.
Args:
enc_message: The encrypted message
secret: The seed to use
Returns:
The decrypted message
"""
sign_pk, sign_sk = create_keypair(secret)
pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(sign_pk)
sk = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(sign_sk)
message = nacl.bindings.crypto_box_seal_open(enc_message, pk, sk)
return message | [
"def",
"anon_decrypt_message",
"(",
"enc_message",
":",
"bytes",
",",
"secret",
":",
"bytes",
")",
"->",
"bytes",
":",
"sign_pk",
",",
"sign_sk",
"=",
"create_keypair",
"(",
"secret",
")",
"pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"sign_pk",
")",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_sk_to_curve25519",
"(",
"sign_sk",
")",
"message",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal_open",
"(",
"enc_message",
",",
"pk",
",",
"sk",
")",
"return",
"message"
] | [
172,
0
] | [
189,
18
] | python | en | ['en', 'error', 'th'] | False |
auth_crypt_message | (message: bytes, to_verkey: bytes, from_secret: bytes) |
Apply auth_crypt to a binary message.
Args:
message: The message to encrypt
to_verkey: To recipient's verkey
from_secret: The seed to use
Returns:
The encrypted message
|
Apply auth_crypt to a binary message. | def auth_crypt_message(message: bytes, to_verkey: bytes, from_secret: bytes) -> bytes:
"""
Apply auth_crypt to a binary message.
Args:
message: The message to encrypt
to_verkey: To recipient's verkey
from_secret: The seed to use
Returns:
The encrypted message
"""
nonce = nacl.utils.random(nacl.bindings.crypto_box_NONCEBYTES)
target_pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(to_verkey)
sender_pk, sender_sk = create_keypair(from_secret)
sk = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(sender_sk)
enc_body = nacl.bindings.crypto_box(message, nonce, target_pk, sk)
combo_box = OrderedDict(
[
("msg", bytes_to_b64(enc_body)),
("sender", bytes_to_b58(sender_pk)),
("nonce", bytes_to_b64(nonce)),
]
)
combo_box_bin = msgpack.packb(combo_box, use_bin_type=True)
enc_message = nacl.bindings.crypto_box_seal(combo_box_bin, target_pk)
return enc_message | [
"def",
"auth_crypt_message",
"(",
"message",
":",
"bytes",
",",
"to_verkey",
":",
"bytes",
",",
"from_secret",
":",
"bytes",
")",
"->",
"bytes",
":",
"nonce",
"=",
"nacl",
".",
"utils",
".",
"random",
"(",
"nacl",
".",
"bindings",
".",
"crypto_box_NONCEBYTES",
")",
"target_pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"to_verkey",
")",
"sender_pk",
",",
"sender_sk",
"=",
"create_keypair",
"(",
"from_secret",
")",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_sk_to_curve25519",
"(",
"sender_sk",
")",
"enc_body",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box",
"(",
"message",
",",
"nonce",
",",
"target_pk",
",",
"sk",
")",
"combo_box",
"=",
"OrderedDict",
"(",
"[",
"(",
"\"msg\"",
",",
"bytes_to_b64",
"(",
"enc_body",
")",
")",
",",
"(",
"\"sender\"",
",",
"bytes_to_b58",
"(",
"sender_pk",
")",
")",
",",
"(",
"\"nonce\"",
",",
"bytes_to_b64",
"(",
"nonce",
")",
")",
",",
"]",
")",
"combo_box_bin",
"=",
"msgpack",
".",
"packb",
"(",
"combo_box",
",",
"use_bin_type",
"=",
"True",
")",
"enc_message",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal",
"(",
"combo_box_bin",
",",
"target_pk",
")",
"return",
"enc_message"
] | [
192,
0
] | [
219,
22
] | python | en | ['en', 'error', 'th'] | False |
auth_decrypt_message | (enc_message: bytes, secret: bytes) |
Apply auth_decrypt to a binary message.
Args:
enc_message: The encrypted message
secret: Secret for signing keys
Returns:
A tuple of (decrypted message, sender verkey)
|
Apply auth_decrypt to a binary message. | def auth_decrypt_message(enc_message: bytes, secret: bytes) -> (bytes, str):
"""
Apply auth_decrypt to a binary message.
Args:
enc_message: The encrypted message
secret: Secret for signing keys
Returns:
A tuple of (decrypted message, sender verkey)
"""
sign_pk, sign_sk = create_keypair(secret)
pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(sign_pk)
sk = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(sign_sk)
body = nacl.bindings.crypto_box_seal_open(enc_message, pk, sk)
unpacked = msgpack.unpackb(body, raw=False)
sender_vk = unpacked["sender"]
nonce = b64_to_bytes(unpacked["nonce"])
enc_message = b64_to_bytes(unpacked["msg"])
sender_pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(
b58_to_bytes(sender_vk)
)
message = nacl.bindings.crypto_box_open(enc_message, nonce, sender_pk, sk)
return message, sender_vk | [
"def",
"auth_decrypt_message",
"(",
"enc_message",
":",
"bytes",
",",
"secret",
":",
"bytes",
")",
"->",
"(",
"bytes",
",",
"str",
")",
":",
"sign_pk",
",",
"sign_sk",
"=",
"create_keypair",
"(",
"secret",
")",
"pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"sign_pk",
")",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_sk_to_curve25519",
"(",
"sign_sk",
")",
"body",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal_open",
"(",
"enc_message",
",",
"pk",
",",
"sk",
")",
"unpacked",
"=",
"msgpack",
".",
"unpackb",
"(",
"body",
",",
"raw",
"=",
"False",
")",
"sender_vk",
"=",
"unpacked",
"[",
"\"sender\"",
"]",
"nonce",
"=",
"b64_to_bytes",
"(",
"unpacked",
"[",
"\"nonce\"",
"]",
")",
"enc_message",
"=",
"b64_to_bytes",
"(",
"unpacked",
"[",
"\"msg\"",
"]",
")",
"sender_pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"b58_to_bytes",
"(",
"sender_vk",
")",
")",
"message",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_open",
"(",
"enc_message",
",",
"nonce",
",",
"sender_pk",
",",
"sk",
")",
"return",
"message",
",",
"sender_vk"
] | [
222,
0
] | [
247,
29
] | python | en | ['en', 'error', 'th'] | False |
prepare_pack_recipient_keys | (
to_verkeys: Sequence[bytes], from_secret: bytes = None
) |
Assemble the recipients block of a packed message.
Args:
to_verkeys: Verkeys of recipients
from_secret: Secret to use for signing keys
Returns:
A tuple of (json result, key)
|
Assemble the recipients block of a packed message. | def prepare_pack_recipient_keys(
to_verkeys: Sequence[bytes], from_secret: bytes = None
) -> (str, bytes):
"""
Assemble the recipients block of a packed message.
Args:
to_verkeys: Verkeys of recipients
from_secret: Secret to use for signing keys
Returns:
A tuple of (json result, key)
"""
cek = nacl.bindings.crypto_secretstream_xchacha20poly1305_keygen()
recips = []
for target_vk in to_verkeys:
target_pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(target_vk)
if from_secret:
sender_pk, sender_sk = create_keypair(from_secret)
sender_vk = bytes_to_b58(sender_pk).encode("ascii")
enc_sender = nacl.bindings.crypto_box_seal(sender_vk, target_pk)
sk = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(sender_sk)
nonce = nacl.utils.random(nacl.bindings.crypto_box_NONCEBYTES)
enc_cek = nacl.bindings.crypto_box(cek, nonce, target_pk, sk)
else:
enc_sender = None
nonce = None
enc_cek = nacl.bindings.crypto_box_seal(cek, target_pk)
recips.append(
OrderedDict(
[
("encrypted_key", bytes_to_b64(enc_cek, urlsafe=True)),
(
"header",
OrderedDict(
[
("kid", bytes_to_b58(target_vk)),
(
"sender",
bytes_to_b64(enc_sender, urlsafe=True)
if enc_sender
else None,
),
(
"iv",
bytes_to_b64(nonce, urlsafe=True)
if nonce
else None,
),
]
),
),
]
)
)
data = OrderedDict(
[
("enc", "xchacha20poly1305_ietf"),
("typ", "JWM/1.0"),
("alg", "Authcrypt" if from_secret else "Anoncrypt"),
("recipients", recips),
]
)
return json.dumps(data), cek | [
"def",
"prepare_pack_recipient_keys",
"(",
"to_verkeys",
":",
"Sequence",
"[",
"bytes",
"]",
",",
"from_secret",
":",
"bytes",
"=",
"None",
")",
"->",
"(",
"str",
",",
"bytes",
")",
":",
"cek",
"=",
"nacl",
".",
"bindings",
".",
"crypto_secretstream_xchacha20poly1305_keygen",
"(",
")",
"recips",
"=",
"[",
"]",
"for",
"target_vk",
"in",
"to_verkeys",
":",
"target_pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"target_vk",
")",
"if",
"from_secret",
":",
"sender_pk",
",",
"sender_sk",
"=",
"create_keypair",
"(",
"from_secret",
")",
"sender_vk",
"=",
"bytes_to_b58",
"(",
"sender_pk",
")",
".",
"encode",
"(",
"\"ascii\"",
")",
"enc_sender",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal",
"(",
"sender_vk",
",",
"target_pk",
")",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_sk_to_curve25519",
"(",
"sender_sk",
")",
"nonce",
"=",
"nacl",
".",
"utils",
".",
"random",
"(",
"nacl",
".",
"bindings",
".",
"crypto_box_NONCEBYTES",
")",
"enc_cek",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box",
"(",
"cek",
",",
"nonce",
",",
"target_pk",
",",
"sk",
")",
"else",
":",
"enc_sender",
"=",
"None",
"nonce",
"=",
"None",
"enc_cek",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal",
"(",
"cek",
",",
"target_pk",
")",
"recips",
".",
"append",
"(",
"OrderedDict",
"(",
"[",
"(",
"\"encrypted_key\"",
",",
"bytes_to_b64",
"(",
"enc_cek",
",",
"urlsafe",
"=",
"True",
")",
")",
",",
"(",
"\"header\"",
",",
"OrderedDict",
"(",
"[",
"(",
"\"kid\"",
",",
"bytes_to_b58",
"(",
"target_vk",
")",
")",
",",
"(",
"\"sender\"",
",",
"bytes_to_b64",
"(",
"enc_sender",
",",
"urlsafe",
"=",
"True",
")",
"if",
"enc_sender",
"else",
"None",
",",
")",
",",
"(",
"\"iv\"",
",",
"bytes_to_b64",
"(",
"nonce",
",",
"urlsafe",
"=",
"True",
")",
"if",
"nonce",
"else",
"None",
",",
")",
",",
"]",
")",
",",
")",
",",
"]",
")",
")",
"data",
"=",
"OrderedDict",
"(",
"[",
"(",
"\"enc\"",
",",
"\"xchacha20poly1305_ietf\"",
")",
",",
"(",
"\"typ\"",
",",
"\"JWM/1.0\"",
")",
",",
"(",
"\"alg\"",
",",
"\"Authcrypt\"",
"if",
"from_secret",
"else",
"\"Anoncrypt\"",
")",
",",
"(",
"\"recipients\"",
",",
"recips",
")",
",",
"]",
")",
"return",
"json",
".",
"dumps",
"(",
"data",
")",
",",
"cek"
] | [
250,
0
] | [
318,
32
] | python | en | ['en', 'error', 'th'] | False |
locate_pack_recipient_key | (
recipients: Sequence[dict], find_key: Callable
) |
Locate pack recipient key.
Decode the encryption key and sender verification key from a
corresponding recipient block, if any is defined.
Args:
recipients: Recipients to locate
find_key: Function used to find private key
Returns:
A tuple of (cek, sender_vk, recip_vk_b58)
Raises:
ValueError: If no corresponding recipient key found
|
Locate pack recipient key. | def locate_pack_recipient_key(
recipients: Sequence[dict], find_key: Callable
) -> (bytes, str, str):
"""
Locate pack recipient key.
Decode the encryption key and sender verification key from a
corresponding recipient block, if any is defined.
Args:
recipients: Recipients to locate
find_key: Function used to find private key
Returns:
A tuple of (cek, sender_vk, recip_vk_b58)
Raises:
ValueError: If no corresponding recipient key found
"""
not_found = []
for recip in recipients:
if not recip or "header" not in recip or "encrypted_key" not in recip:
raise ValueError("Invalid recipient header")
recip_vk_b58 = recip["header"].get("kid")
secret = find_key(recip_vk_b58)
if secret is None:
not_found.append(recip_vk_b58)
continue
recip_vk = b58_to_bytes(recip_vk_b58)
pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(recip_vk)
sk = nacl.bindings.crypto_sign_ed25519_sk_to_curve25519(secret)
encrypted_key = b64_to_bytes(recip["encrypted_key"], urlsafe=True)
nonce_b64 = recip["header"].get("iv")
nonce = b64_to_bytes(nonce_b64, urlsafe=True) if nonce_b64 else None
sender_b64 = recip["header"].get("sender")
enc_sender = b64_to_bytes(sender_b64, urlsafe=True) if sender_b64 else None
if nonce and enc_sender:
sender_vk_bin = nacl.bindings.crypto_box_seal_open(enc_sender, pk, sk)
sender_vk = sender_vk_bin.decode("ascii")
sender_pk = nacl.bindings.crypto_sign_ed25519_pk_to_curve25519(
b58_to_bytes(sender_vk_bin)
)
cek = nacl.bindings.crypto_box_open(encrypted_key, nonce, sender_pk, sk)
else:
sender_vk = None
cek = nacl.bindings.crypto_box_seal_open(encrypted_key, pk, sk)
return cek, sender_vk, recip_vk_b58
raise ValueError("No corresponding recipient key found in {}".format(not_found)) | [
"def",
"locate_pack_recipient_key",
"(",
"recipients",
":",
"Sequence",
"[",
"dict",
"]",
",",
"find_key",
":",
"Callable",
")",
"->",
"(",
"bytes",
",",
"str",
",",
"str",
")",
":",
"not_found",
"=",
"[",
"]",
"for",
"recip",
"in",
"recipients",
":",
"if",
"not",
"recip",
"or",
"\"header\"",
"not",
"in",
"recip",
"or",
"\"encrypted_key\"",
"not",
"in",
"recip",
":",
"raise",
"ValueError",
"(",
"\"Invalid recipient header\"",
")",
"recip_vk_b58",
"=",
"recip",
"[",
"\"header\"",
"]",
".",
"get",
"(",
"\"kid\"",
")",
"secret",
"=",
"find_key",
"(",
"recip_vk_b58",
")",
"if",
"secret",
"is",
"None",
":",
"not_found",
".",
"append",
"(",
"recip_vk_b58",
")",
"continue",
"recip_vk",
"=",
"b58_to_bytes",
"(",
"recip_vk_b58",
")",
"pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"recip_vk",
")",
"sk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_sk_to_curve25519",
"(",
"secret",
")",
"encrypted_key",
"=",
"b64_to_bytes",
"(",
"recip",
"[",
"\"encrypted_key\"",
"]",
",",
"urlsafe",
"=",
"True",
")",
"nonce_b64",
"=",
"recip",
"[",
"\"header\"",
"]",
".",
"get",
"(",
"\"iv\"",
")",
"nonce",
"=",
"b64_to_bytes",
"(",
"nonce_b64",
",",
"urlsafe",
"=",
"True",
")",
"if",
"nonce_b64",
"else",
"None",
"sender_b64",
"=",
"recip",
"[",
"\"header\"",
"]",
".",
"get",
"(",
"\"sender\"",
")",
"enc_sender",
"=",
"b64_to_bytes",
"(",
"sender_b64",
",",
"urlsafe",
"=",
"True",
")",
"if",
"sender_b64",
"else",
"None",
"if",
"nonce",
"and",
"enc_sender",
":",
"sender_vk_bin",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal_open",
"(",
"enc_sender",
",",
"pk",
",",
"sk",
")",
"sender_vk",
"=",
"sender_vk_bin",
".",
"decode",
"(",
"\"ascii\"",
")",
"sender_pk",
"=",
"nacl",
".",
"bindings",
".",
"crypto_sign_ed25519_pk_to_curve25519",
"(",
"b58_to_bytes",
"(",
"sender_vk_bin",
")",
")",
"cek",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_open",
"(",
"encrypted_key",
",",
"nonce",
",",
"sender_pk",
",",
"sk",
")",
"else",
":",
"sender_vk",
"=",
"None",
"cek",
"=",
"nacl",
".",
"bindings",
".",
"crypto_box_seal_open",
"(",
"encrypted_key",
",",
"pk",
",",
"sk",
")",
"return",
"cek",
",",
"sender_vk",
",",
"recip_vk_b58",
"raise",
"ValueError",
"(",
"\"No corresponding recipient key found in {}\"",
".",
"format",
"(",
"not_found",
")",
")"
] | [
321,
0
] | [
373,
84
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.