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 |
---|---|---|---|---|---|---|---|---|---|---|---|
Funnelarea.domain | (self) |
The 'domain' property is an instance of Domain
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Domain`
- A dict of string/value properties that will be passed
to the Domain constructor
Supported dict properties:
column
If there is a layout grid, use the domain for
this column in the grid for this funnelarea
trace .
row
If there is a layout grid, use the domain for
this row in the grid for this funnelarea trace
.
x
Sets the horizontal domain of this funnelarea
trace (in plot fraction).
y
Sets the vertical domain of this funnelarea
trace (in plot fraction).
Returns
-------
plotly.graph_objs.funnelarea.Domain
|
The 'domain' property is an instance of Domain
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Domain`
- A dict of string/value properties that will be passed
to the Domain constructor
Supported dict properties:
column
If there is a layout grid, use the domain for
this column in the grid for this funnelarea
trace .
row
If there is a layout grid, use the domain for
this row in the grid for this funnelarea trace
.
x
Sets the horizontal domain of this funnelarea
trace (in plot fraction).
y
Sets the vertical domain of this funnelarea
trace (in plot fraction). | def domain(self):
"""
The 'domain' property is an instance of Domain
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Domain`
- A dict of string/value properties that will be passed
to the Domain constructor
Supported dict properties:
column
If there is a layout grid, use the domain for
this column in the grid for this funnelarea
trace .
row
If there is a layout grid, use the domain for
this row in the grid for this funnelarea trace
.
x
Sets the horizontal domain of this funnelarea
trace (in plot fraction).
y
Sets the vertical domain of this funnelarea
trace (in plot fraction).
Returns
-------
plotly.graph_objs.funnelarea.Domain
"""
return self["domain"] | [
"def",
"domain",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"domain\"",
"]"
] | [
163,
4
] | [
192,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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 ['label', 'text', 'value', 'percent', 'name'] joined with '+' characters
(e.g. 'label+text')
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 ['label', 'text', 'value', 'percent', 'name'] joined with '+' characters
(e.g. 'label+text')
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 ['label', 'text', 'value', 'percent', 'name'] joined with '+' characters
(e.g. 'label+text')
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\"",
"]"
] | [
201,
4
] | [
218,
32
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
227,
4
] | [
239,
35
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.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.funnelarea.Hoverlabel
|
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.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.funnelarea.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.funnelarea.Hoverlabel
"""
return self["hoverlabel"] | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
248,
4
] | [
298,
33
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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.
variables `label`, `color`, `value`, `text` and `percent`.
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.
variables `label`, `color`, `value`, `text` and `percent`.
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.
variables `label`, `color`, `value`, `text` and `percent`.
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\"",
"]"
] | [
307,
4
] | [
340,
36
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
349,
4
] | [
361,
39
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.hovertext | (self) |
Sets hover text elements associated with each sector. If a
single string, the same string appears for all data points. If
an array of string, the items are mapped in order of this
trace's sectors. To be seen, trace `hoverinfo` must contain a
"text" flag.
The 'hovertext' 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
|
Sets hover text elements associated with each sector. If a
single string, the same string appears for all data points. If
an array of string, the items are mapped in order of this
trace's sectors. To be seen, trace `hoverinfo` must contain a
"text" flag.
The 'hovertext' 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 hovertext(self):
"""
Sets hover text elements associated with each sector. If a
single string, the same string appears for all data points. If
an array of string, the items are mapped in order of this
trace's sectors. To be seen, trace `hoverinfo` must contain a
"text" flag.
The 'hovertext' 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["hovertext"] | [
"def",
"hovertext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertext\"",
"]"
] | [
370,
4
] | [
387,
32
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.hovertextsrc | (self) |
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' 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 hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertextsrc(self):
"""
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertextsrc"] | [
"def",
"hovertextsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertextsrc\"",
"]"
] | [
396,
4
] | [
408,
35
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
417,
4
] | [
430,
26
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
439,
4
] | [
450,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.insidetextfont | (self) |
Sets the font used for `textinfo` lying inside the sector.
The 'insidetextfont' property is an instance of Insidetextfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Insidetextfont`
- A dict of string/value properties that will be passed
to the Insidetextfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.funnelarea.Insidetextfont
|
Sets the font used for `textinfo` lying inside the sector.
The 'insidetextfont' property is an instance of Insidetextfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Insidetextfont`
- A dict of string/value properties that will be passed
to the Insidetextfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def insidetextfont(self):
"""
Sets the font used for `textinfo` lying inside the sector.
The 'insidetextfont' property is an instance of Insidetextfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Insidetextfont`
- A dict of string/value properties that will be passed
to the Insidetextfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.funnelarea.Insidetextfont
"""
return self["insidetextfont"] | [
"def",
"insidetextfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"insidetextfont\"",
"]"
] | [
459,
4
] | [
506,
37
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.label0 | (self) |
Alternate to `labels`. Builds a numeric set of labels. Use with
`dlabel` where `label0` is the starting label and `dlabel` the
step.
The 'label0' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Alternate to `labels`. Builds a numeric set of labels. Use with
`dlabel` where `label0` is the starting label and `dlabel` the
step.
The 'label0' property is a number and may be specified as:
- An int or float | def label0(self):
"""
Alternate to `labels`. Builds a numeric set of labels. Use with
`dlabel` where `label0` is the starting label and `dlabel` the
step.
The 'label0' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["label0"] | [
"def",
"label0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"label0\"",
"]"
] | [
515,
4
] | [
528,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.labels | (self) |
Sets the sector labels. If `labels` entries are duplicated, we
sum associated `values` or simply count occurrences if `values`
is not provided. For other array attributes (including color)
we use the first non-empty entry among all occurrences of the
label.
The 'labels' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the sector labels. If `labels` entries are duplicated, we
sum associated `values` or simply count occurrences if `values`
is not provided. For other array attributes (including color)
we use the first non-empty entry among all occurrences of the
label.
The 'labels' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def labels(self):
"""
Sets the sector labels. If `labels` entries are duplicated, we
sum associated `values` or simply count occurrences if `values`
is not provided. For other array attributes (including color)
we use the first non-empty entry among all occurrences of the
label.
The 'labels' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["labels"] | [
"def",
"labels",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"labels\"",
"]"
] | [
537,
4
] | [
552,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.labelssrc | (self) |
Sets the source reference on Chart Studio Cloud for labels .
The 'labelssrc' 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 labels .
The 'labelssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def labelssrc(self):
"""
Sets the source reference on Chart Studio Cloud for labels .
The 'labelssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["labelssrc"] | [
"def",
"labelssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"labelssrc\"",
"]"
] | [
561,
4
] | [
572,
32
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
581,
4
] | [
595,
34
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.marker | (self) |
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
colors
Sets the color of each sector. If not
specified, the default trace color set is used
to pick the sector colors.
colorssrc
Sets the source reference on Chart Studio Cloud
for colors .
line
:class:`plotly.graph_objects.funnelarea.marker.
Line` instance or dict with compatible
properties
Returns
-------
plotly.graph_objs.funnelarea.Marker
|
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
colors
Sets the color of each sector. If not
specified, the default trace color set is used
to pick the sector colors.
colorssrc
Sets the source reference on Chart Studio Cloud
for colors .
line
:class:`plotly.graph_objects.funnelarea.marker.
Line` instance or dict with compatible
properties | def marker(self):
"""
The 'marker' property is an instance of Marker
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Marker`
- A dict of string/value properties that will be passed
to the Marker constructor
Supported dict properties:
colors
Sets the color of each sector. If not
specified, the default trace color set is used
to pick the sector colors.
colorssrc
Sets the source reference on Chart Studio Cloud
for colors .
line
:class:`plotly.graph_objects.funnelarea.marker.
Line` instance or dict with compatible
properties
Returns
-------
plotly.graph_objs.funnelarea.Marker
"""
return self["marker"] | [
"def",
"marker",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"marker\"",
"]"
] | [
604,
4
] | [
630,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
639,
4
] | [
658,
27
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
667,
4
] | [
678,
30
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
687,
4
] | [
700,
27
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
709,
4
] | [
720,
30
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.scalegroup | (self) |
If there are multiple funnelareas that should be sized
according to their totals, link them by providing a non-empty
group id here shared by every trace in the same group.
The 'scalegroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
If there are multiple funnelareas that should be sized
according to their totals, link them by providing a non-empty
group id here shared by every trace in the same group.
The 'scalegroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def scalegroup(self):
"""
If there are multiple funnelareas that should be sized
according to their totals, link them by providing a non-empty
group id here shared by every trace in the same group.
The 'scalegroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["scalegroup"] | [
"def",
"scalegroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scalegroup\"",
"]"
] | [
729,
4
] | [
743,
33
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
752,
4
] | [
764,
33
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.stream | (self) |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.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.funnelarea.Stream
|
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.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.funnelarea.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.funnelarea.Stream
"""
return self["stream"] | [
"def",
"stream",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stream\"",
"]"
] | [
773,
4
] | [
797,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.text | (self) |
Sets text elements associated with each sector. If trace
`textinfo` contains a "text" flag, these elements will be seen
on the chart. If trace `hoverinfo` contains a "text" flag and
"hovertext" is not set, these elements will be seen in the
hover labels.
The 'text' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets text elements associated with each sector. If trace
`textinfo` contains a "text" flag, these elements will be seen
on the chart. If trace `hoverinfo` contains a "text" flag and
"hovertext" is not set, these elements will be seen in the
hover labels.
The 'text' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def text(self):
"""
Sets text elements associated with each sector. If trace
`textinfo` contains a "text" flag, these elements will be seen
on the chart. If trace `hoverinfo` contains a "text" flag and
"hovertext" is not set, these elements will be seen in the
hover labels.
The 'text' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["text"] | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
806,
4
] | [
821,
27
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.textfont | (self) |
Sets the font used for `textinfo`.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.funnelarea.Textfont
|
Sets the font used for `textinfo`.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def textfont(self):
"""
Sets the font used for `textinfo`.
The 'textfont' property is an instance of Textfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Textfont`
- A dict of string/value properties that will be passed
to the Textfont constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.funnelarea.Textfont
"""
return self["textfont"] | [
"def",
"textfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textfont\"",
"]"
] | [
830,
4
] | [
877,
31
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.textinfo | (self) |
Determines which trace information appear on the graph.
The 'textinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['label', 'text', 'value', 'percent'] joined with '+' characters
(e.g. 'label+text')
OR exactly one of ['none'] (e.g. 'none')
Returns
-------
Any
|
Determines which trace information appear on the graph.
The 'textinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['label', 'text', 'value', 'percent'] joined with '+' characters
(e.g. 'label+text')
OR exactly one of ['none'] (e.g. 'none') | def textinfo(self):
"""
Determines which trace information appear on the graph.
The 'textinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['label', 'text', 'value', 'percent'] joined with '+' characters
(e.g. 'label+text')
OR exactly one of ['none'] (e.g. 'none')
Returns
-------
Any
"""
return self["textinfo"] | [
"def",
"textinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textinfo\"",
"]"
] | [
886,
4
] | [
900,
31
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.textposition | (self) |
Specifies the location of the `textinfo`.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'none']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Specifies the location of the `textinfo`.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'none']
- A tuple, list, or one-dimensional numpy array of the above | def textposition(self):
"""
Specifies the location of the `textinfo`.
The 'textposition' property is an enumeration that may be specified as:
- One of the following enumeration values:
['inside', 'none']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["textposition"] | [
"def",
"textposition",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textposition\"",
"]"
] | [
909,
4
] | [
922,
35
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.textpositionsrc | (self) |
Sets the source reference on Chart Studio Cloud for
textposition .
The 'textpositionsrc' 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
textposition .
The 'textpositionsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def textpositionsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
textposition .
The 'textpositionsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["textpositionsrc"] | [
"def",
"textpositionsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textpositionsrc\"",
"]"
] | [
931,
4
] | [
943,
38
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.textsrc | (self) |
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' 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 text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def textsrc(self):
"""
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["textsrc"] | [
"def",
"textsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textsrc\"",
"]"
] | [
952,
4
] | [
963,
30
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.texttemplate | (self) |
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
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. Every attributes that can be
specified per-point (the ones that are `arrayOk: true`) are
available. variables `label`, `color`, `value`, `text` and
`percent`.
The 'texttemplate' 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 text that
appear on points. Note that this will override `textinfo`.
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. Every attributes that can be
specified per-point (the ones that are `arrayOk: true`) are
available. variables `label`, `color`, `value`, `text` and
`percent`.
The 'texttemplate' 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 texttemplate(self):
"""
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
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. Every attributes that can be
specified per-point (the ones that are `arrayOk: true`) are
available. variables `label`, `color`, `value`, `text` and
`percent`.
The 'texttemplate' 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["texttemplate"] | [
"def",
"texttemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"texttemplate\"",
"]"
] | [
972,
4
] | [
999,
35
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.texttemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
texttemplate .
The 'texttemplatesrc' 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
texttemplate .
The 'texttemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def texttemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
texttemplate .
The 'texttemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["texttemplatesrc"] | [
"def",
"texttemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"texttemplatesrc\"",
"]"
] | [
1008,
4
] | [
1020,
38
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.title | (self) |
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets the font used for `title`. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
position
Specifies the location of the `title`. Note
that the title's position used to be set by the
now deprecated `titleposition` attribute.
text
Sets the title of the chart. If it is empty, no
title is displayed. Note that before the
existence of `title.text`, the title's contents
used to be defined as the `title` attribute
itself. This behavior has been deprecated.
Returns
-------
plotly.graph_objs.funnelarea.Title
|
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets the font used for `title`. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
position
Specifies the location of the `title`. Note
that the title's position used to be set by the
now deprecated `titleposition` attribute.
text
Sets the title of the chart. If it is empty, no
title is displayed. Note that before the
existence of `title.text`, the title's contents
used to be defined as the `title` attribute
itself. This behavior has been deprecated. | def title(self):
"""
The 'title' property is an instance of Title
that may be specified as:
- An instance of :class:`plotly.graph_objs.funnelarea.Title`
- A dict of string/value properties that will be passed
to the Title constructor
Supported dict properties:
font
Sets the font used for `title`. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
position
Specifies the location of the `title`. Note
that the title's position used to be set by the
now deprecated `titleposition` attribute.
text
Sets the title of the chart. If it is empty, no
title is displayed. Note that before the
existence of `title.text`, the title's contents
used to be defined as the `title` attribute
itself. This behavior has been deprecated.
Returns
-------
plotly.graph_objs.funnelarea.Title
"""
return self["title"] | [
"def",
"title",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"title\"",
"]"
] | [
1029,
4
] | [
1058,
28
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
1067,
4
] | [
1080,
26
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
1089,
4
] | [
1113,
33
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.values | (self) |
Sets the values of the sectors. If omitted, we count
occurrences of each label.
The 'values' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the values of the sectors. If omitted, we count
occurrences of each label.
The 'values' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def values(self):
"""
Sets the values of the sectors. If omitted, we count
occurrences of each label.
The 'values' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["values"] | [
"def",
"values",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"values\"",
"]"
] | [
1122,
4
] | [
1134,
29
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.valuessrc | (self) |
Sets the source reference on Chart Studio Cloud for values .
The 'valuessrc' 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 values .
The 'valuessrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def valuessrc(self):
"""
Sets the source reference on Chart Studio Cloud for values .
The 'valuessrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["valuessrc"] | [
"def",
"valuessrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"valuessrc\"",
"]"
] | [
1143,
4
] | [
1154,
32
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.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\"",
"]"
] | [
1163,
4
] | [
1177,
30
] | python | en | ['en', 'error', 'th'] | False |
Funnelarea.__init__ | (
self,
arg=None,
aspectratio=None,
baseratio=None,
customdata=None,
customdatasrc=None,
dlabel=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovertext=None,
hovertextsrc=None,
ids=None,
idssrc=None,
insidetextfont=None,
label0=None,
labels=None,
labelssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,
opacity=None,
scalegroup=None,
showlegend=None,
stream=None,
text=None,
textfont=None,
textinfo=None,
textposition=None,
textpositionsrc=None,
textsrc=None,
texttemplate=None,
texttemplatesrc=None,
title=None,
uid=None,
uirevision=None,
values=None,
valuessrc=None,
visible=None,
**kwargs
) |
Construct a new Funnelarea object
Visualize stages in a process using area-encoded trapezoids.
This trace can be used to show data in a part-to-whole
representation similar to a "pie" trace, wherein each item
appears in a single stage. See also the "funnel" trace type for
a different approach to visualizing funnel data.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Funnelarea`
aspectratio
Sets the ratio between height and width
baseratio
Sets the ratio between bottom length and maximum top
length.
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 .
dlabel
Sets the label step. See `label0` for more info.
domain
:class:`plotly.graph_objects.funnelarea.Domain`
instance or dict with compatible properties
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.funnelarea.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. variables `label`, `color`, `value`,
`text` and `percent`. 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 .
hovertext
Sets hover text elements associated with each sector.
If a single string, the same string appears for all
data points. If an array of string, the items are
mapped in order of this trace's sectors. To be seen,
trace `hoverinfo` must contain a "text" flag.
hovertextsrc
Sets the source reference on Chart Studio Cloud for
hovertext .
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 .
insidetextfont
Sets the font used for `textinfo` lying inside the
sector.
label0
Alternate to `labels`. Builds a numeric set of labels.
Use with `dlabel` where `label0` is the starting label
and `dlabel` the step.
labels
Sets the sector labels. If `labels` entries are
duplicated, we sum associated `values` or simply count
occurrences if `values` is not provided. For other
array attributes (including color) we use the first
non-empty entry among all occurrences of the label.
labelssrc
Sets the source reference on Chart Studio Cloud for
labels .
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.funnelarea.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.
opacity
Sets the opacity of the trace.
scalegroup
If there are multiple funnelareas that should be sized
according to their totals, link them by providing a
non-empty group id here shared by every trace in the
same group.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
stream
:class:`plotly.graph_objects.funnelarea.Stream`
instance or dict with compatible properties
text
Sets text elements associated with each sector. If
trace `textinfo` contains a "text" flag, these elements
will be seen on the chart. If trace `hoverinfo`
contains a "text" flag and "hovertext" is not set,
these elements will be seen in the hover labels.
textfont
Sets the font used for `textinfo`.
textinfo
Determines which trace information appear on the graph.
textposition
Specifies the location of the `textinfo`.
textpositionsrc
Sets the source reference on Chart Studio Cloud for
textposition .
textsrc
Sets the source reference on Chart Studio Cloud for
text .
texttemplate
Template string used for rendering the information text
that appear on points. Note that this will override
`textinfo`. 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. Every attributes
that can be specified per-point (the ones that are
`arrayOk: true`) are available. variables `label`,
`color`, `value`, `text` and `percent`.
texttemplatesrc
Sets the source reference on Chart Studio Cloud for
texttemplate .
title
:class:`plotly.graph_objects.funnelarea.Title` 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.
values
Sets the values of the sectors. If omitted, we count
occurrences of each label.
valuessrc
Sets the source reference on Chart Studio Cloud for
values .
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).
Returns
-------
Funnelarea
|
Construct a new Funnelarea object
Visualize stages in a process using area-encoded trapezoids.
This trace can be used to show data in a part-to-whole
representation similar to a "pie" trace, wherein each item
appears in a single stage. See also the "funnel" trace type for
a different approach to visualizing funnel data. | def __init__(
self,
arg=None,
aspectratio=None,
baseratio=None,
customdata=None,
customdatasrc=None,
dlabel=None,
domain=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovertext=None,
hovertextsrc=None,
ids=None,
idssrc=None,
insidetextfont=None,
label0=None,
labels=None,
labelssrc=None,
legendgroup=None,
marker=None,
meta=None,
metasrc=None,
name=None,
opacity=None,
scalegroup=None,
showlegend=None,
stream=None,
text=None,
textfont=None,
textinfo=None,
textposition=None,
textpositionsrc=None,
textsrc=None,
texttemplate=None,
texttemplatesrc=None,
title=None,
uid=None,
uirevision=None,
values=None,
valuessrc=None,
visible=None,
**kwargs
):
"""
Construct a new Funnelarea object
Visualize stages in a process using area-encoded trapezoids.
This trace can be used to show data in a part-to-whole
representation similar to a "pie" trace, wherein each item
appears in a single stage. See also the "funnel" trace type for
a different approach to visualizing funnel data.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Funnelarea`
aspectratio
Sets the ratio between height and width
baseratio
Sets the ratio between bottom length and maximum top
length.
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 .
dlabel
Sets the label step. See `label0` for more info.
domain
:class:`plotly.graph_objects.funnelarea.Domain`
instance or dict with compatible properties
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.funnelarea.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. variables `label`, `color`, `value`,
`text` and `percent`. 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 .
hovertext
Sets hover text elements associated with each sector.
If a single string, the same string appears for all
data points. If an array of string, the items are
mapped in order of this trace's sectors. To be seen,
trace `hoverinfo` must contain a "text" flag.
hovertextsrc
Sets the source reference on Chart Studio Cloud for
hovertext .
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 .
insidetextfont
Sets the font used for `textinfo` lying inside the
sector.
label0
Alternate to `labels`. Builds a numeric set of labels.
Use with `dlabel` where `label0` is the starting label
and `dlabel` the step.
labels
Sets the sector labels. If `labels` entries are
duplicated, we sum associated `values` or simply count
occurrences if `values` is not provided. For other
array attributes (including color) we use the first
non-empty entry among all occurrences of the label.
labelssrc
Sets the source reference on Chart Studio Cloud for
labels .
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.funnelarea.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.
opacity
Sets the opacity of the trace.
scalegroup
If there are multiple funnelareas that should be sized
according to their totals, link them by providing a
non-empty group id here shared by every trace in the
same group.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
stream
:class:`plotly.graph_objects.funnelarea.Stream`
instance or dict with compatible properties
text
Sets text elements associated with each sector. If
trace `textinfo` contains a "text" flag, these elements
will be seen on the chart. If trace `hoverinfo`
contains a "text" flag and "hovertext" is not set,
these elements will be seen in the hover labels.
textfont
Sets the font used for `textinfo`.
textinfo
Determines which trace information appear on the graph.
textposition
Specifies the location of the `textinfo`.
textpositionsrc
Sets the source reference on Chart Studio Cloud for
textposition .
textsrc
Sets the source reference on Chart Studio Cloud for
text .
texttemplate
Template string used for rendering the information text
that appear on points. Note that this will override
`textinfo`. 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. Every attributes
that can be specified per-point (the ones that are
`arrayOk: true`) are available. variables `label`,
`color`, `value`, `text` and `percent`.
texttemplatesrc
Sets the source reference on Chart Studio Cloud for
texttemplate .
title
:class:`plotly.graph_objects.funnelarea.Title` 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.
values
Sets the values of the sectors. If omitted, we count
occurrences of each label.
valuessrc
Sets the source reference on Chart Studio Cloud for
values .
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).
Returns
-------
Funnelarea
"""
super(Funnelarea, self).__init__("funnelarea")
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.Funnelarea
constructor must be a dict or
an instance of :class:`plotly.graph_objs.Funnelarea`"""
)
# 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("aspectratio", None)
_v = aspectratio if aspectratio is not None else _v
if _v is not None:
self["aspectratio"] = _v
_v = arg.pop("baseratio", None)
_v = baseratio if baseratio is not None else _v
if _v is not None:
self["baseratio"] = _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("dlabel", None)
_v = dlabel if dlabel is not None else _v
if _v is not None:
self["dlabel"] = _v
_v = arg.pop("domain", None)
_v = domain if domain is not None else _v
if _v is not None:
self["domain"] = _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("hovertext", None)
_v = hovertext if hovertext is not None else _v
if _v is not None:
self["hovertext"] = _v
_v = arg.pop("hovertextsrc", None)
_v = hovertextsrc if hovertextsrc is not None else _v
if _v is not None:
self["hovertextsrc"] = _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("insidetextfont", None)
_v = insidetextfont if insidetextfont is not None else _v
if _v is not None:
self["insidetextfont"] = _v
_v = arg.pop("label0", None)
_v = label0 if label0 is not None else _v
if _v is not None:
self["label0"] = _v
_v = arg.pop("labels", None)
_v = labels if labels is not None else _v
if _v is not None:
self["labels"] = _v
_v = arg.pop("labelssrc", None)
_v = labelssrc if labelssrc is not None else _v
if _v is not None:
self["labelssrc"] = _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("opacity", None)
_v = opacity if opacity is not None else _v
if _v is not None:
self["opacity"] = _v
_v = arg.pop("scalegroup", None)
_v = scalegroup if scalegroup is not None else _v
if _v is not None:
self["scalegroup"] = _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("stream", None)
_v = stream if stream is not None else _v
if _v is not None:
self["stream"] = _v
_v = arg.pop("text", None)
_v = text if text is not None else _v
if _v is not None:
self["text"] = _v
_v = arg.pop("textfont", None)
_v = textfont if textfont is not None else _v
if _v is not None:
self["textfont"] = _v
_v = arg.pop("textinfo", None)
_v = textinfo if textinfo is not None else _v
if _v is not None:
self["textinfo"] = _v
_v = arg.pop("textposition", None)
_v = textposition if textposition is not None else _v
if _v is not None:
self["textposition"] = _v
_v = arg.pop("textpositionsrc", None)
_v = textpositionsrc if textpositionsrc is not None else _v
if _v is not None:
self["textpositionsrc"] = _v
_v = arg.pop("textsrc", None)
_v = textsrc if textsrc is not None else _v
if _v is not None:
self["textsrc"] = _v
_v = arg.pop("texttemplate", None)
_v = texttemplate if texttemplate is not None else _v
if _v is not None:
self["texttemplate"] = _v
_v = arg.pop("texttemplatesrc", None)
_v = texttemplatesrc if texttemplatesrc is not None else _v
if _v is not None:
self["texttemplatesrc"] = _v
_v = arg.pop("title", None)
_v = title if title is not None else _v
if _v is not None:
self["title"] = _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("values", None)
_v = values if values is not None else _v
if _v is not None:
self["values"] = _v
_v = arg.pop("valuessrc", None)
_v = valuessrc if valuessrc is not None else _v
if _v is not None:
self["valuessrc"] = _v
_v = arg.pop("visible", None)
_v = visible if visible is not None else _v
if _v is not None:
self["visible"] = _v
# Read-only literals
# ------------------
self._props["type"] = "funnelarea"
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",
",",
"aspectratio",
"=",
"None",
",",
"baseratio",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"dlabel",
"=",
"None",
",",
"domain",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hoverinfosrc",
"=",
"None",
",",
"hoverlabel",
"=",
"None",
",",
"hovertemplate",
"=",
"None",
",",
"hovertemplatesrc",
"=",
"None",
",",
"hovertext",
"=",
"None",
",",
"hovertextsrc",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"idssrc",
"=",
"None",
",",
"insidetextfont",
"=",
"None",
",",
"label0",
"=",
"None",
",",
"labels",
"=",
"None",
",",
"labelssrc",
"=",
"None",
",",
"legendgroup",
"=",
"None",
",",
"marker",
"=",
"None",
",",
"meta",
"=",
"None",
",",
"metasrc",
"=",
"None",
",",
"name",
"=",
"None",
",",
"opacity",
"=",
"None",
",",
"scalegroup",
"=",
"None",
",",
"showlegend",
"=",
"None",
",",
"stream",
"=",
"None",
",",
"text",
"=",
"None",
",",
"textfont",
"=",
"None",
",",
"textinfo",
"=",
"None",
",",
"textposition",
"=",
"None",
",",
"textpositionsrc",
"=",
"None",
",",
"textsrc",
"=",
"None",
",",
"texttemplate",
"=",
"None",
",",
"texttemplatesrc",
"=",
"None",
",",
"title",
"=",
"None",
",",
"uid",
"=",
"None",
",",
"uirevision",
"=",
"None",
",",
"values",
"=",
"None",
",",
"valuessrc",
"=",
"None",
",",
"visible",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Funnelarea",
",",
"self",
")",
".",
"__init__",
"(",
"\"funnelarea\"",
")",
"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.Funnelarea \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.Funnelarea`\"\"\"",
")",
"# 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",
"(",
"\"aspectratio\"",
",",
"None",
")",
"_v",
"=",
"aspectratio",
"if",
"aspectratio",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"aspectratio\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"baseratio\"",
",",
"None",
")",
"_v",
"=",
"baseratio",
"if",
"baseratio",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"baseratio\"",
"]",
"=",
"_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",
"(",
"\"dlabel\"",
",",
"None",
")",
"_v",
"=",
"dlabel",
"if",
"dlabel",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dlabel\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"domain\"",
",",
"None",
")",
"_v",
"=",
"domain",
"if",
"domain",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"domain\"",
"]",
"=",
"_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",
"(",
"\"hovertext\"",
",",
"None",
")",
"_v",
"=",
"hovertext",
"if",
"hovertext",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertext\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertextsrc\"",
",",
"None",
")",
"_v",
"=",
"hovertextsrc",
"if",
"hovertextsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertextsrc\"",
"]",
"=",
"_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",
"(",
"\"insidetextfont\"",
",",
"None",
")",
"_v",
"=",
"insidetextfont",
"if",
"insidetextfont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"insidetextfont\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"label0\"",
",",
"None",
")",
"_v",
"=",
"label0",
"if",
"label0",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"label0\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"labels\"",
",",
"None",
")",
"_v",
"=",
"labels",
"if",
"labels",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"labels\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"labelssrc\"",
",",
"None",
")",
"_v",
"=",
"labelssrc",
"if",
"labelssrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"labelssrc\"",
"]",
"=",
"_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",
"(",
"\"opacity\"",
",",
"None",
")",
"_v",
"=",
"opacity",
"if",
"opacity",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"opacity\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"scalegroup\"",
",",
"None",
")",
"_v",
"=",
"scalegroup",
"if",
"scalegroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"scalegroup\"",
"]",
"=",
"_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",
"(",
"\"stream\"",
",",
"None",
")",
"_v",
"=",
"stream",
"if",
"stream",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"stream\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"text\"",
",",
"None",
")",
"_v",
"=",
"text",
"if",
"text",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"text\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textfont\"",
",",
"None",
")",
"_v",
"=",
"textfont",
"if",
"textfont",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textfont\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textinfo\"",
",",
"None",
")",
"_v",
"=",
"textinfo",
"if",
"textinfo",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textinfo\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textposition\"",
",",
"None",
")",
"_v",
"=",
"textposition",
"if",
"textposition",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textposition\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textpositionsrc\"",
",",
"None",
")",
"_v",
"=",
"textpositionsrc",
"if",
"textpositionsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textpositionsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textsrc\"",
",",
"None",
")",
"_v",
"=",
"textsrc",
"if",
"textsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"texttemplate\"",
",",
"None",
")",
"_v",
"=",
"texttemplate",
"if",
"texttemplate",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"texttemplate\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"texttemplatesrc\"",
",",
"None",
")",
"_v",
"=",
"texttemplatesrc",
"if",
"texttemplatesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"texttemplatesrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"title\"",
",",
"None",
")",
"_v",
"=",
"title",
"if",
"title",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"title\"",
"]",
"=",
"_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",
"(",
"\"values\"",
",",
"None",
")",
"_v",
"=",
"values",
"if",
"values",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"values\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"valuessrc\"",
",",
"None",
")",
"_v",
"=",
"valuessrc",
"if",
"valuessrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"valuessrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"visible\"",
",",
"None",
")",
"_v",
"=",
"visible",
"if",
"visible",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"visible\"",
"]",
"=",
"_v",
"# Read-only literals",
"# ------------------",
"self",
".",
"_props",
"[",
"\"type\"",
"]",
"=",
"\"funnelarea\"",
"arg",
".",
"pop",
"(",
"\"type\"",
",",
"None",
")",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1398,
4
] | [
1876,
34
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_attr | (looper, nodeSetWithOneNodeResponding,
attributeName,
sdk_pool_handle,
sdk_wallet_endorser) |
Tests that state proof is returned in the reply for GET_ATTR transactions
|
Tests that state proof is returned in the reply for GET_ATTR transactions
| def test_state_proof_returned_for_missing_attr(looper, nodeSetWithOneNodeResponding,
attributeName,
sdk_pool_handle,
sdk_wallet_endorser):
"""
Tests that state proof is returned in the reply for GET_ATTR transactions
"""
_, dest = sdk_wallet_endorser
get_attr_operation = {
TARGET_NYM: dest,
TXN_TYPE: GET_ATTR,
RAW: attributeName
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_endorser, get_attr_operation)
check_no_data_and_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_attr",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"attributeName",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
")",
":",
"_",
",",
"dest",
"=",
"sdk_wallet_endorser",
"get_attr_operation",
"=",
"{",
"TARGET_NYM",
":",
"dest",
",",
"TXN_TYPE",
":",
"GET_ATTR",
",",
"RAW",
":",
"attributeName",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"get_attr_operation",
")",
"check_no_data_and_valid_proof",
"(",
"result",
")"
] | [
24,
0
] | [
40,
41
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_nym | (looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser,
sdk_user_wallet_a) |
Tests that state proof is returned in the reply for GET_NYM transactions
|
Tests that state proof is returned in the reply for GET_NYM transactions
| def test_state_proof_returned_for_missing_nym(looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser,
sdk_user_wallet_a):
"""
Tests that state proof is returned in the reply for GET_NYM transactions
"""
# Make not existing id
_, dest = sdk_user_wallet_a
dest = dest[:-3]
dest += "fff"
get_nym_operation = {
TARGET_NYM: dest,
TXN_TYPE: GET_NYM
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_endorser, get_nym_operation)
check_no_data_and_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_nym",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"sdk_user_wallet_a",
")",
":",
"# Make not existing id",
"_",
",",
"dest",
"=",
"sdk_user_wallet_a",
"dest",
"=",
"dest",
"[",
":",
"-",
"3",
"]",
"dest",
"+=",
"\"fff\"",
"get_nym_operation",
"=",
"{",
"TARGET_NYM",
":",
"dest",
",",
"TXN_TYPE",
":",
"GET_NYM",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"get_nym_operation",
")",
"check_no_data_and_valid_proof",
"(",
"result",
")"
] | [
43,
0
] | [
62,
41
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_schema | (looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser) |
Tests that state proof is returned in the reply for GET_SCHEMA transactions
|
Tests that state proof is returned in the reply for GET_SCHEMA transactions
| def test_state_proof_returned_for_missing_schema(looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser):
"""
Tests that state proof is returned in the reply for GET_SCHEMA transactions
"""
_, dest = sdk_wallet_endorser
schema_name = "test_schema"
schema_version = "1.0"
get_schema_operation = {
TARGET_NYM: dest,
TXN_TYPE: GET_SCHEMA,
DATA: {
SCHEMA_NAME: schema_name,
SCHEMA_VERSION: schema_version,
}
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_endorser,
get_schema_operation)
assert SCHEMA_ATTR_NAMES not in result[DATA]
check_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_schema",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
")",
":",
"_",
",",
"dest",
"=",
"sdk_wallet_endorser",
"schema_name",
"=",
"\"test_schema\"",
"schema_version",
"=",
"\"1.0\"",
"get_schema_operation",
"=",
"{",
"TARGET_NYM",
":",
"dest",
",",
"TXN_TYPE",
":",
"GET_SCHEMA",
",",
"DATA",
":",
"{",
"SCHEMA_NAME",
":",
"schema_name",
",",
"SCHEMA_VERSION",
":",
"schema_version",
",",
"}",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"get_schema_operation",
")",
"assert",
"SCHEMA_ATTR_NAMES",
"not",
"in",
"result",
"[",
"DATA",
"]",
"check_valid_proof",
"(",
"result",
")"
] | [
65,
0
] | [
86,
29
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_claim_def | (looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser) |
Tests that state proof is returned in the reply for GET_CLAIM_DEF
transactions
|
Tests that state proof is returned in the reply for GET_CLAIM_DEF
transactions
| def test_state_proof_returned_for_missing_claim_def(looper, nodeSetWithOneNodeResponding,
sdk_pool_handle,
sdk_wallet_endorser):
"""
Tests that state proof is returned in the reply for GET_CLAIM_DEF
transactions
"""
_, dest = sdk_wallet_endorser
get_claim_def_operation = {
CLAIM_DEF_FROM: dest,
TXN_TYPE: GET_CLAIM_DEF,
CLAIM_DEF_SCHEMA_REF: 12,
CLAIM_DEF_SIGNATURE_TYPE: 'CL'
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_endorser,
get_claim_def_operation)
check_no_data_and_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_claim_def",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
")",
":",
"_",
",",
"dest",
"=",
"sdk_wallet_endorser",
"get_claim_def_operation",
"=",
"{",
"CLAIM_DEF_FROM",
":",
"dest",
",",
"TXN_TYPE",
":",
"GET_CLAIM_DEF",
",",
"CLAIM_DEF_SCHEMA_REF",
":",
"12",
",",
"CLAIM_DEF_SIGNATURE_TYPE",
":",
"'CL'",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_endorser",
",",
"get_claim_def_operation",
")",
"check_no_data_and_valid_proof",
"(",
"result",
")"
] | [
89,
0
] | [
106,
41
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_get_rich_schema_obj_by_id | (looper,
nodeSetWithOneNodeResponding,
sdk_wallet_endorser,
sdk_pool_handle,
sdk_wallet_client) |
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
|
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
| def test_state_proof_returned_for_missing_get_rich_schema_obj_by_id(looper,
nodeSetWithOneNodeResponding,
sdk_wallet_endorser,
sdk_pool_handle,
sdk_wallet_client):
"""
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
"""
rs_id = randomString()
get_rich_schema_by_id_operation = {
TXN_TYPE: GET_RICH_SCHEMA_OBJECT_BY_ID,
RS_ID: rs_id,
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_client,
get_rich_schema_by_id_operation)
check_no_data_and_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_get_rich_schema_obj_by_id",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"sdk_wallet_endorser",
",",
"sdk_pool_handle",
",",
"sdk_wallet_client",
")",
":",
"rs_id",
"=",
"randomString",
"(",
")",
"get_rich_schema_by_id_operation",
"=",
"{",
"TXN_TYPE",
":",
"GET_RICH_SCHEMA_OBJECT_BY_ID",
",",
"RS_ID",
":",
"rs_id",
",",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_client",
",",
"get_rich_schema_by_id_operation",
")",
"check_no_data_and_valid_proof",
"(",
"result",
")"
] | [
112,
0
] | [
130,
41
] | python | en | ['en', 'error', 'th'] | False |
test_state_proof_returned_for_missing_get_rich_schema_obj_by_metadata | (looper,
nodeSetWithOneNodeResponding,
sdk_wallet_endorser,
sdk_pool_handle,
sdk_wallet_client,
rs_type) |
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
|
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
| def test_state_proof_returned_for_missing_get_rich_schema_obj_by_metadata(looper,
nodeSetWithOneNodeResponding,
sdk_wallet_endorser,
sdk_pool_handle,
sdk_wallet_client,
rs_type):
"""
Tests that state proof is returned in the reply for GET_RICH_SCHEMA_OBJECT_BY_ID.
Use different submitter and reader!
"""
rs_name = randomString()
rs_version = '1.0'
get_rich_schema_by_metadata_operation = {
TXN_TYPE: GET_RICH_SCHEMA_OBJECT_BY_METADATA,
RS_NAME: rs_name,
RS_VERSION: rs_version,
RS_TYPE: rs_type
}
result = sdk_submit_operation_and_get_result(looper, sdk_pool_handle,
sdk_wallet_client,
get_rich_schema_by_metadata_operation)
check_no_data_and_valid_proof(result) | [
"def",
"test_state_proof_returned_for_missing_get_rich_schema_obj_by_metadata",
"(",
"looper",
",",
"nodeSetWithOneNodeResponding",
",",
"sdk_wallet_endorser",
",",
"sdk_pool_handle",
",",
"sdk_wallet_client",
",",
"rs_type",
")",
":",
"rs_name",
"=",
"randomString",
"(",
")",
"rs_version",
"=",
"'1.0'",
"get_rich_schema_by_metadata_operation",
"=",
"{",
"TXN_TYPE",
":",
"GET_RICH_SCHEMA_OBJECT_BY_METADATA",
",",
"RS_NAME",
":",
"rs_name",
",",
"RS_VERSION",
":",
"rs_version",
",",
"RS_TYPE",
":",
"rs_type",
"}",
"result",
"=",
"sdk_submit_operation_and_get_result",
"(",
"looper",
",",
"sdk_pool_handle",
",",
"sdk_wallet_client",
",",
"get_rich_schema_by_metadata_operation",
")",
"check_no_data_and_valid_proof",
"(",
"result",
")"
] | [
139,
0
] | [
160,
41
] | python | en | ['en', 'error', 'th'] | False |
map_face2color | (face, colormap, scale, vmin, vmax) |
Normalize facecolor values by vmin/vmax and return rgb-color strings
This function takes a tuple color along with a colormap and a minimum
(vmin) and maximum (vmax) range of possible mean distances for the
given parametrized surface. It returns an rgb color based on the mean
distance between vmin and vmax
|
Normalize facecolor values by vmin/vmax and return rgb-color strings | def map_face2color(face, colormap, scale, vmin, vmax):
"""
Normalize facecolor values by vmin/vmax and return rgb-color strings
This function takes a tuple color along with a colormap and a minimum
(vmin) and maximum (vmax) range of possible mean distances for the
given parametrized surface. It returns an rgb color based on the mean
distance between vmin and vmax
"""
if vmin >= vmax:
raise exceptions.PlotlyError(
"Incorrect relation between vmin "
"and vmax. The vmin value cannot be "
"bigger than or equal to the value "
"of vmax."
)
if len(colormap) == 1:
# color each triangle face with the same color in colormap
face_color = colormap[0]
face_color = clrs.convert_to_RGB_255(face_color)
face_color = clrs.label_rgb(face_color)
return face_color
if face == vmax:
# pick last color in colormap
face_color = colormap[-1]
face_color = clrs.convert_to_RGB_255(face_color)
face_color = clrs.label_rgb(face_color)
return face_color
else:
if scale is None:
# find the normalized distance t of a triangle face between
# vmin and vmax where the distance is between 0 and 1
t = (face - vmin) / float((vmax - vmin))
low_color_index = int(t / (1.0 / (len(colormap) - 1)))
face_color = clrs.find_intermediate_color(
colormap[low_color_index],
colormap[low_color_index + 1],
t * (len(colormap) - 1) - low_color_index,
)
face_color = clrs.convert_to_RGB_255(face_color)
face_color = clrs.label_rgb(face_color)
else:
# find the face color for a non-linearly interpolated scale
t = (face - vmin) / float((vmax - vmin))
low_color_index = 0
for k in range(len(scale) - 1):
if scale[k] <= t < scale[k + 1]:
break
low_color_index += 1
low_scale_val = scale[low_color_index]
high_scale_val = scale[low_color_index + 1]
face_color = clrs.find_intermediate_color(
colormap[low_color_index],
colormap[low_color_index + 1],
(t - low_scale_val) / (high_scale_val - low_scale_val),
)
face_color = clrs.convert_to_RGB_255(face_color)
face_color = clrs.label_rgb(face_color)
return face_color | [
"def",
"map_face2color",
"(",
"face",
",",
"colormap",
",",
"scale",
",",
"vmin",
",",
"vmax",
")",
":",
"if",
"vmin",
">=",
"vmax",
":",
"raise",
"exceptions",
".",
"PlotlyError",
"(",
"\"Incorrect relation between vmin \"",
"\"and vmax. The vmin value cannot be \"",
"\"bigger than or equal to the value \"",
"\"of vmax.\"",
")",
"if",
"len",
"(",
"colormap",
")",
"==",
"1",
":",
"# color each triangle face with the same color in colormap",
"face_color",
"=",
"colormap",
"[",
"0",
"]",
"face_color",
"=",
"clrs",
".",
"convert_to_RGB_255",
"(",
"face_color",
")",
"face_color",
"=",
"clrs",
".",
"label_rgb",
"(",
"face_color",
")",
"return",
"face_color",
"if",
"face",
"==",
"vmax",
":",
"# pick last color in colormap",
"face_color",
"=",
"colormap",
"[",
"-",
"1",
"]",
"face_color",
"=",
"clrs",
".",
"convert_to_RGB_255",
"(",
"face_color",
")",
"face_color",
"=",
"clrs",
".",
"label_rgb",
"(",
"face_color",
")",
"return",
"face_color",
"else",
":",
"if",
"scale",
"is",
"None",
":",
"# find the normalized distance t of a triangle face between",
"# vmin and vmax where the distance is between 0 and 1",
"t",
"=",
"(",
"face",
"-",
"vmin",
")",
"/",
"float",
"(",
"(",
"vmax",
"-",
"vmin",
")",
")",
"low_color_index",
"=",
"int",
"(",
"t",
"/",
"(",
"1.0",
"/",
"(",
"len",
"(",
"colormap",
")",
"-",
"1",
")",
")",
")",
"face_color",
"=",
"clrs",
".",
"find_intermediate_color",
"(",
"colormap",
"[",
"low_color_index",
"]",
",",
"colormap",
"[",
"low_color_index",
"+",
"1",
"]",
",",
"t",
"*",
"(",
"len",
"(",
"colormap",
")",
"-",
"1",
")",
"-",
"low_color_index",
",",
")",
"face_color",
"=",
"clrs",
".",
"convert_to_RGB_255",
"(",
"face_color",
")",
"face_color",
"=",
"clrs",
".",
"label_rgb",
"(",
"face_color",
")",
"else",
":",
"# find the face color for a non-linearly interpolated scale",
"t",
"=",
"(",
"face",
"-",
"vmin",
")",
"/",
"float",
"(",
"(",
"vmax",
"-",
"vmin",
")",
")",
"low_color_index",
"=",
"0",
"for",
"k",
"in",
"range",
"(",
"len",
"(",
"scale",
")",
"-",
"1",
")",
":",
"if",
"scale",
"[",
"k",
"]",
"<=",
"t",
"<",
"scale",
"[",
"k",
"+",
"1",
"]",
":",
"break",
"low_color_index",
"+=",
"1",
"low_scale_val",
"=",
"scale",
"[",
"low_color_index",
"]",
"high_scale_val",
"=",
"scale",
"[",
"low_color_index",
"+",
"1",
"]",
"face_color",
"=",
"clrs",
".",
"find_intermediate_color",
"(",
"colormap",
"[",
"low_color_index",
"]",
",",
"colormap",
"[",
"low_color_index",
"+",
"1",
"]",
",",
"(",
"t",
"-",
"low_scale_val",
")",
"/",
"(",
"high_scale_val",
"-",
"low_scale_val",
")",
",",
")",
"face_color",
"=",
"clrs",
".",
"convert_to_RGB_255",
"(",
"face_color",
")",
"face_color",
"=",
"clrs",
".",
"label_rgb",
"(",
"face_color",
")",
"return",
"face_color"
] | [
9,
0
] | [
74,
25
] | python | en | ['en', 'error', 'th'] | False |
trisurf | (
x,
y,
z,
simplices,
show_colorbar,
edges_color,
scale,
colormap=None,
color_func=None,
plot_edges=False,
x_edge=None,
y_edge=None,
z_edge=None,
facecolor=None,
) |
Refer to FigureFactory.create_trisurf() for docstring
|
Refer to FigureFactory.create_trisurf() for docstring
| def trisurf(
x,
y,
z,
simplices,
show_colorbar,
edges_color,
scale,
colormap=None,
color_func=None,
plot_edges=False,
x_edge=None,
y_edge=None,
z_edge=None,
facecolor=None,
):
"""
Refer to FigureFactory.create_trisurf() for docstring
"""
# numpy import check
if not np:
raise ImportError("FigureFactory._trisurf() requires " "numpy imported.")
points3D = np.vstack((x, y, z)).T
simplices = np.atleast_2d(simplices)
# vertices of the surface triangles
tri_vertices = points3D[simplices]
# Define colors for the triangle faces
if color_func is None:
# mean values of z-coordinates of triangle vertices
mean_dists = tri_vertices[:, :, 2].mean(-1)
elif isinstance(color_func, (list, np.ndarray)):
# Pre-computed list / array of values to map onto color
if len(color_func) != len(simplices):
raise ValueError(
"If color_func is a list/array, it must "
"be the same length as simplices."
)
# convert all colors in color_func to rgb
for index in range(len(color_func)):
if isinstance(color_func[index], str):
if "#" in color_func[index]:
foo = clrs.hex_to_rgb(color_func[index])
color_func[index] = clrs.label_rgb(foo)
if isinstance(color_func[index], tuple):
foo = clrs.convert_to_RGB_255(color_func[index])
color_func[index] = clrs.label_rgb(foo)
mean_dists = np.asarray(color_func)
else:
# apply user inputted function to calculate
# custom coloring for triangle vertices
mean_dists = []
for triangle in tri_vertices:
dists = []
for vertex in triangle:
dist = color_func(vertex[0], vertex[1], vertex[2])
dists.append(dist)
mean_dists.append(np.mean(dists))
mean_dists = np.asarray(mean_dists)
# Check if facecolors are already strings and can be skipped
if isinstance(mean_dists[0], str):
facecolor = mean_dists
else:
min_mean_dists = np.min(mean_dists)
max_mean_dists = np.max(mean_dists)
if facecolor is None:
facecolor = []
for index in range(len(mean_dists)):
color = map_face2color(
mean_dists[index], colormap, scale, min_mean_dists, max_mean_dists
)
facecolor.append(color)
# Make sure facecolor is a list so output is consistent across Pythons
facecolor = np.asarray(facecolor)
ii, jj, kk = simplices.T
triangles = graph_objs.Mesh3d(
x=x, y=y, z=z, facecolor=facecolor, i=ii, j=jj, k=kk, name=""
)
mean_dists_are_numbers = not isinstance(mean_dists[0], str)
if mean_dists_are_numbers and show_colorbar is True:
# make a colorscale from the colors
colorscale = clrs.make_colorscale(colormap, scale)
colorscale = clrs.convert_colorscale_to_rgb(colorscale)
colorbar = graph_objs.Scatter3d(
x=x[:1],
y=y[:1],
z=z[:1],
mode="markers",
marker=dict(
size=0.1,
color=[min_mean_dists, max_mean_dists],
colorscale=colorscale,
showscale=True,
),
hoverinfo="none",
showlegend=False,
)
# the triangle sides are not plotted
if plot_edges is False:
if mean_dists_are_numbers and show_colorbar is True:
return [triangles, colorbar]
else:
return [triangles]
# define the lists x_edge, y_edge and z_edge, of x, y, resp z
# coordinates of edge end points for each triangle
# None separates data corresponding to two consecutive triangles
is_none = [ii is None for ii in [x_edge, y_edge, z_edge]]
if any(is_none):
if not all(is_none):
raise ValueError(
"If any (x_edge, y_edge, z_edge) is None, " "all must be None"
)
else:
x_edge = []
y_edge = []
z_edge = []
# Pull indices we care about, then add a None column to separate tris
ixs_triangles = [0, 1, 2, 0]
pull_edges = tri_vertices[:, ixs_triangles, :]
x_edge_pull = np.hstack(
[pull_edges[:, :, 0], np.tile(None, [pull_edges.shape[0], 1])]
)
y_edge_pull = np.hstack(
[pull_edges[:, :, 1], np.tile(None, [pull_edges.shape[0], 1])]
)
z_edge_pull = np.hstack(
[pull_edges[:, :, 2], np.tile(None, [pull_edges.shape[0], 1])]
)
# Now unravel the edges into a 1-d vector for plotting
x_edge = np.hstack([x_edge, x_edge_pull.reshape([1, -1])[0]])
y_edge = np.hstack([y_edge, y_edge_pull.reshape([1, -1])[0]])
z_edge = np.hstack([z_edge, z_edge_pull.reshape([1, -1])[0]])
if not (len(x_edge) == len(y_edge) == len(z_edge)):
raise exceptions.PlotlyError(
"The lengths of x_edge, y_edge and " "z_edge are not the same."
)
# define the lines for plotting
lines = graph_objs.Scatter3d(
x=x_edge,
y=y_edge,
z=z_edge,
mode="lines",
line=graph_objs.scatter3d.Line(color=edges_color, width=1.5),
showlegend=False,
)
if mean_dists_are_numbers and show_colorbar is True:
return [triangles, lines, colorbar]
else:
return [triangles, lines] | [
"def",
"trisurf",
"(",
"x",
",",
"y",
",",
"z",
",",
"simplices",
",",
"show_colorbar",
",",
"edges_color",
",",
"scale",
",",
"colormap",
"=",
"None",
",",
"color_func",
"=",
"None",
",",
"plot_edges",
"=",
"False",
",",
"x_edge",
"=",
"None",
",",
"y_edge",
"=",
"None",
",",
"z_edge",
"=",
"None",
",",
"facecolor",
"=",
"None",
",",
")",
":",
"# numpy import check",
"if",
"not",
"np",
":",
"raise",
"ImportError",
"(",
"\"FigureFactory._trisurf() requires \"",
"\"numpy imported.\"",
")",
"points3D",
"=",
"np",
".",
"vstack",
"(",
"(",
"x",
",",
"y",
",",
"z",
")",
")",
".",
"T",
"simplices",
"=",
"np",
".",
"atleast_2d",
"(",
"simplices",
")",
"# vertices of the surface triangles",
"tri_vertices",
"=",
"points3D",
"[",
"simplices",
"]",
"# Define colors for the triangle faces",
"if",
"color_func",
"is",
"None",
":",
"# mean values of z-coordinates of triangle vertices",
"mean_dists",
"=",
"tri_vertices",
"[",
":",
",",
":",
",",
"2",
"]",
".",
"mean",
"(",
"-",
"1",
")",
"elif",
"isinstance",
"(",
"color_func",
",",
"(",
"list",
",",
"np",
".",
"ndarray",
")",
")",
":",
"# Pre-computed list / array of values to map onto color",
"if",
"len",
"(",
"color_func",
")",
"!=",
"len",
"(",
"simplices",
")",
":",
"raise",
"ValueError",
"(",
"\"If color_func is a list/array, it must \"",
"\"be the same length as simplices.\"",
")",
"# convert all colors in color_func to rgb",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"color_func",
")",
")",
":",
"if",
"isinstance",
"(",
"color_func",
"[",
"index",
"]",
",",
"str",
")",
":",
"if",
"\"#\"",
"in",
"color_func",
"[",
"index",
"]",
":",
"foo",
"=",
"clrs",
".",
"hex_to_rgb",
"(",
"color_func",
"[",
"index",
"]",
")",
"color_func",
"[",
"index",
"]",
"=",
"clrs",
".",
"label_rgb",
"(",
"foo",
")",
"if",
"isinstance",
"(",
"color_func",
"[",
"index",
"]",
",",
"tuple",
")",
":",
"foo",
"=",
"clrs",
".",
"convert_to_RGB_255",
"(",
"color_func",
"[",
"index",
"]",
")",
"color_func",
"[",
"index",
"]",
"=",
"clrs",
".",
"label_rgb",
"(",
"foo",
")",
"mean_dists",
"=",
"np",
".",
"asarray",
"(",
"color_func",
")",
"else",
":",
"# apply user inputted function to calculate",
"# custom coloring for triangle vertices",
"mean_dists",
"=",
"[",
"]",
"for",
"triangle",
"in",
"tri_vertices",
":",
"dists",
"=",
"[",
"]",
"for",
"vertex",
"in",
"triangle",
":",
"dist",
"=",
"color_func",
"(",
"vertex",
"[",
"0",
"]",
",",
"vertex",
"[",
"1",
"]",
",",
"vertex",
"[",
"2",
"]",
")",
"dists",
".",
"append",
"(",
"dist",
")",
"mean_dists",
".",
"append",
"(",
"np",
".",
"mean",
"(",
"dists",
")",
")",
"mean_dists",
"=",
"np",
".",
"asarray",
"(",
"mean_dists",
")",
"# Check if facecolors are already strings and can be skipped",
"if",
"isinstance",
"(",
"mean_dists",
"[",
"0",
"]",
",",
"str",
")",
":",
"facecolor",
"=",
"mean_dists",
"else",
":",
"min_mean_dists",
"=",
"np",
".",
"min",
"(",
"mean_dists",
")",
"max_mean_dists",
"=",
"np",
".",
"max",
"(",
"mean_dists",
")",
"if",
"facecolor",
"is",
"None",
":",
"facecolor",
"=",
"[",
"]",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"mean_dists",
")",
")",
":",
"color",
"=",
"map_face2color",
"(",
"mean_dists",
"[",
"index",
"]",
",",
"colormap",
",",
"scale",
",",
"min_mean_dists",
",",
"max_mean_dists",
")",
"facecolor",
".",
"append",
"(",
"color",
")",
"# Make sure facecolor is a list so output is consistent across Pythons",
"facecolor",
"=",
"np",
".",
"asarray",
"(",
"facecolor",
")",
"ii",
",",
"jj",
",",
"kk",
"=",
"simplices",
".",
"T",
"triangles",
"=",
"graph_objs",
".",
"Mesh3d",
"(",
"x",
"=",
"x",
",",
"y",
"=",
"y",
",",
"z",
"=",
"z",
",",
"facecolor",
"=",
"facecolor",
",",
"i",
"=",
"ii",
",",
"j",
"=",
"jj",
",",
"k",
"=",
"kk",
",",
"name",
"=",
"\"\"",
")",
"mean_dists_are_numbers",
"=",
"not",
"isinstance",
"(",
"mean_dists",
"[",
"0",
"]",
",",
"str",
")",
"if",
"mean_dists_are_numbers",
"and",
"show_colorbar",
"is",
"True",
":",
"# make a colorscale from the colors",
"colorscale",
"=",
"clrs",
".",
"make_colorscale",
"(",
"colormap",
",",
"scale",
")",
"colorscale",
"=",
"clrs",
".",
"convert_colorscale_to_rgb",
"(",
"colorscale",
")",
"colorbar",
"=",
"graph_objs",
".",
"Scatter3d",
"(",
"x",
"=",
"x",
"[",
":",
"1",
"]",
",",
"y",
"=",
"y",
"[",
":",
"1",
"]",
",",
"z",
"=",
"z",
"[",
":",
"1",
"]",
",",
"mode",
"=",
"\"markers\"",
",",
"marker",
"=",
"dict",
"(",
"size",
"=",
"0.1",
",",
"color",
"=",
"[",
"min_mean_dists",
",",
"max_mean_dists",
"]",
",",
"colorscale",
"=",
"colorscale",
",",
"showscale",
"=",
"True",
",",
")",
",",
"hoverinfo",
"=",
"\"none\"",
",",
"showlegend",
"=",
"False",
",",
")",
"# the triangle sides are not plotted",
"if",
"plot_edges",
"is",
"False",
":",
"if",
"mean_dists_are_numbers",
"and",
"show_colorbar",
"is",
"True",
":",
"return",
"[",
"triangles",
",",
"colorbar",
"]",
"else",
":",
"return",
"[",
"triangles",
"]",
"# define the lists x_edge, y_edge and z_edge, of x, y, resp z",
"# coordinates of edge end points for each triangle",
"# None separates data corresponding to two consecutive triangles",
"is_none",
"=",
"[",
"ii",
"is",
"None",
"for",
"ii",
"in",
"[",
"x_edge",
",",
"y_edge",
",",
"z_edge",
"]",
"]",
"if",
"any",
"(",
"is_none",
")",
":",
"if",
"not",
"all",
"(",
"is_none",
")",
":",
"raise",
"ValueError",
"(",
"\"If any (x_edge, y_edge, z_edge) is None, \"",
"\"all must be None\"",
")",
"else",
":",
"x_edge",
"=",
"[",
"]",
"y_edge",
"=",
"[",
"]",
"z_edge",
"=",
"[",
"]",
"# Pull indices we care about, then add a None column to separate tris",
"ixs_triangles",
"=",
"[",
"0",
",",
"1",
",",
"2",
",",
"0",
"]",
"pull_edges",
"=",
"tri_vertices",
"[",
":",
",",
"ixs_triangles",
",",
":",
"]",
"x_edge_pull",
"=",
"np",
".",
"hstack",
"(",
"[",
"pull_edges",
"[",
":",
",",
":",
",",
"0",
"]",
",",
"np",
".",
"tile",
"(",
"None",
",",
"[",
"pull_edges",
".",
"shape",
"[",
"0",
"]",
",",
"1",
"]",
")",
"]",
")",
"y_edge_pull",
"=",
"np",
".",
"hstack",
"(",
"[",
"pull_edges",
"[",
":",
",",
":",
",",
"1",
"]",
",",
"np",
".",
"tile",
"(",
"None",
",",
"[",
"pull_edges",
".",
"shape",
"[",
"0",
"]",
",",
"1",
"]",
")",
"]",
")",
"z_edge_pull",
"=",
"np",
".",
"hstack",
"(",
"[",
"pull_edges",
"[",
":",
",",
":",
",",
"2",
"]",
",",
"np",
".",
"tile",
"(",
"None",
",",
"[",
"pull_edges",
".",
"shape",
"[",
"0",
"]",
",",
"1",
"]",
")",
"]",
")",
"# Now unravel the edges into a 1-d vector for plotting",
"x_edge",
"=",
"np",
".",
"hstack",
"(",
"[",
"x_edge",
",",
"x_edge_pull",
".",
"reshape",
"(",
"[",
"1",
",",
"-",
"1",
"]",
")",
"[",
"0",
"]",
"]",
")",
"y_edge",
"=",
"np",
".",
"hstack",
"(",
"[",
"y_edge",
",",
"y_edge_pull",
".",
"reshape",
"(",
"[",
"1",
",",
"-",
"1",
"]",
")",
"[",
"0",
"]",
"]",
")",
"z_edge",
"=",
"np",
".",
"hstack",
"(",
"[",
"z_edge",
",",
"z_edge_pull",
".",
"reshape",
"(",
"[",
"1",
",",
"-",
"1",
"]",
")",
"[",
"0",
"]",
"]",
")",
"if",
"not",
"(",
"len",
"(",
"x_edge",
")",
"==",
"len",
"(",
"y_edge",
")",
"==",
"len",
"(",
"z_edge",
")",
")",
":",
"raise",
"exceptions",
".",
"PlotlyError",
"(",
"\"The lengths of x_edge, y_edge and \"",
"\"z_edge are not the same.\"",
")",
"# define the lines for plotting",
"lines",
"=",
"graph_objs",
".",
"Scatter3d",
"(",
"x",
"=",
"x_edge",
",",
"y",
"=",
"y_edge",
",",
"z",
"=",
"z_edge",
",",
"mode",
"=",
"\"lines\"",
",",
"line",
"=",
"graph_objs",
".",
"scatter3d",
".",
"Line",
"(",
"color",
"=",
"edges_color",
",",
"width",
"=",
"1.5",
")",
",",
"showlegend",
"=",
"False",
",",
")",
"if",
"mean_dists_are_numbers",
"and",
"show_colorbar",
"is",
"True",
":",
"return",
"[",
"triangles",
",",
"lines",
",",
"colorbar",
"]",
"else",
":",
"return",
"[",
"triangles",
",",
"lines",
"]"
] | [
77,
0
] | [
243,
33
] | python | en | ['en', 'error', 'th'] | False |
create_trisurf | (
x,
y,
z,
simplices,
colormap=None,
show_colorbar=True,
scale=None,
color_func=None,
title="Trisurf Plot",
plot_edges=True,
showbackground=True,
backgroundcolor="rgb(230, 230, 230)",
gridcolor="rgb(255, 255, 255)",
zerolinecolor="rgb(255, 255, 255)",
edges_color="rgb(50, 50, 50)",
height=800,
width=800,
aspectratio=None,
) |
Returns figure for a triangulated surface plot
:param (array) x: data values of x in a 1D array
:param (array) y: data values of y in a 1D array
:param (array) z: data values of z in a 1D array
:param (array) simplices: an array of shape (ntri, 3) where ntri is
the number of triangles in the triangularization. Each row of the
array contains the indicies of the verticies of each triangle
:param (str|tuple|list) colormap: either a plotly scale name, an rgb
or hex color, a color tuple or a list of colors. An rgb color is
of the form 'rgb(x, y, z)' where x, y, z belong to the interval
[0, 255] and a color tuple is a tuple of the form (a, b, c) where
a, b and c belong to [0, 1]. If colormap is a list, it must
contain the valid color types aforementioned as its members
:param (bool) show_colorbar: determines if colorbar is visible
:param (list|array) scale: sets the scale values to be used if a non-
linearly interpolated colormap is desired. If left as None, a
linear interpolation between the colors will be excecuted
:param (function|list) color_func: The parameter that determines the
coloring of the surface. Takes either a function with 3 arguments
x, y, z or a list/array of color values the same length as
simplices. If None, coloring will only depend on the z axis
:param (str) title: title of the plot
:param (bool) plot_edges: determines if the triangles on the trisurf
are visible
:param (bool) showbackground: makes background in plot visible
:param (str) backgroundcolor: color of background. Takes a string of
the form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive
:param (str) gridcolor: color of the gridlines besides the axes. Takes
a string of the form 'rgb(x,y,z)' x,y,z are between 0 and 255
inclusive
:param (str) zerolinecolor: color of the axes. Takes a string of the
form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive
:param (str) edges_color: color of the edges, if plot_edges is True
:param (int|float) height: the height of the plot (in pixels)
:param (int|float) width: the width of the plot (in pixels)
:param (dict) aspectratio: a dictionary of the aspect ratio values for
the x, y and z axes. 'x', 'y' and 'z' take (int|float) values
Example 1: Sphere
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 20)
>>> v = np.linspace(0, np.pi, 20)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> x = np.sin(v)*np.cos(u)
>>> y = np.sin(v)*np.sin(u)
>>> z = np.cos(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap="Rainbow",
... simplices=simplices)
Example 2: Torus
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 20)
>>> v = np.linspace(0, 2*np.pi, 20)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> x = (3 + (np.cos(v)))*np.cos(u)
>>> y = (3 + (np.cos(v)))*np.sin(u)
>>> z = np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap="Viridis",
... simplices=simplices)
Example 3: Mobius Band
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 24)
>>> v = np.linspace(-1, 1, 8)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> tp = 1 + 0.5*v*np.cos(u/2.)
>>> x = tp*np.cos(u)
>>> y = tp*np.sin(u)
>>> z = 0.5*v*np.sin(u/2.)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap=[(0.2, 0.4, 0.6), (1, 1, 1)],
... simplices=simplices)
Example 4: Using a Custom Colormap Function with Light Cone
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u=np.linspace(-np.pi, np.pi, 30)
>>> v=np.linspace(-np.pi, np.pi, 30)
>>> u,v=np.meshgrid(u,v)
>>> u=u.flatten()
>>> v=v.flatten()
>>> x = u
>>> y = u*np.cos(v)
>>> z = u*np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Define distance function
>>> def dist_origin(x, y, z):
... return np.sqrt((1.0 * x)**2 + (1.0 * y)**2 + (1.0 * z)**2)
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z,
... colormap=['#FFFFFF', '#E4FFFE',
... '#A4F6F9', '#FF99FE',
... '#BA52ED'],
... scale=[0, 0.6, 0.71, 0.89, 1],
... simplices=simplices,
... color_func=dist_origin)
Example 5: Enter color_func as a list of colors
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> import random
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u=np.linspace(-np.pi, np.pi, 30)
>>> v=np.linspace(-np.pi, np.pi, 30)
>>> u,v=np.meshgrid(u,v)
>>> u=u.flatten()
>>> v=v.flatten()
>>> x = u
>>> y = u*np.cos(v)
>>> z = u*np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> colors = []
>>> color_choices = ['rgb(0, 0, 0)', '#6c4774', '#d6c7dd']
>>> for index in range(len(simplices)):
... colors.append(random.choice(color_choices))
>>> fig = create_trisurf(
... x, y, z, simplices,
... color_func=colors,
... show_colorbar=True,
... edges_color='rgb(2, 85, 180)',
... title=' Modern Art'
... )
|
Returns figure for a triangulated surface plot | def create_trisurf(
x,
y,
z,
simplices,
colormap=None,
show_colorbar=True,
scale=None,
color_func=None,
title="Trisurf Plot",
plot_edges=True,
showbackground=True,
backgroundcolor="rgb(230, 230, 230)",
gridcolor="rgb(255, 255, 255)",
zerolinecolor="rgb(255, 255, 255)",
edges_color="rgb(50, 50, 50)",
height=800,
width=800,
aspectratio=None,
):
"""
Returns figure for a triangulated surface plot
:param (array) x: data values of x in a 1D array
:param (array) y: data values of y in a 1D array
:param (array) z: data values of z in a 1D array
:param (array) simplices: an array of shape (ntri, 3) where ntri is
the number of triangles in the triangularization. Each row of the
array contains the indicies of the verticies of each triangle
:param (str|tuple|list) colormap: either a plotly scale name, an rgb
or hex color, a color tuple or a list of colors. An rgb color is
of the form 'rgb(x, y, z)' where x, y, z belong to the interval
[0, 255] and a color tuple is a tuple of the form (a, b, c) where
a, b and c belong to [0, 1]. If colormap is a list, it must
contain the valid color types aforementioned as its members
:param (bool) show_colorbar: determines if colorbar is visible
:param (list|array) scale: sets the scale values to be used if a non-
linearly interpolated colormap is desired. If left as None, a
linear interpolation between the colors will be excecuted
:param (function|list) color_func: The parameter that determines the
coloring of the surface. Takes either a function with 3 arguments
x, y, z or a list/array of color values the same length as
simplices. If None, coloring will only depend on the z axis
:param (str) title: title of the plot
:param (bool) plot_edges: determines if the triangles on the trisurf
are visible
:param (bool) showbackground: makes background in plot visible
:param (str) backgroundcolor: color of background. Takes a string of
the form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive
:param (str) gridcolor: color of the gridlines besides the axes. Takes
a string of the form 'rgb(x,y,z)' x,y,z are between 0 and 255
inclusive
:param (str) zerolinecolor: color of the axes. Takes a string of the
form 'rgb(x,y,z)' x,y,z are between 0 and 255 inclusive
:param (str) edges_color: color of the edges, if plot_edges is True
:param (int|float) height: the height of the plot (in pixels)
:param (int|float) width: the width of the plot (in pixels)
:param (dict) aspectratio: a dictionary of the aspect ratio values for
the x, y and z axes. 'x', 'y' and 'z' take (int|float) values
Example 1: Sphere
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 20)
>>> v = np.linspace(0, np.pi, 20)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> x = np.sin(v)*np.cos(u)
>>> y = np.sin(v)*np.sin(u)
>>> z = np.cos(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap="Rainbow",
... simplices=simplices)
Example 2: Torus
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 20)
>>> v = np.linspace(0, 2*np.pi, 20)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> x = (3 + (np.cos(v)))*np.cos(u)
>>> y = (3 + (np.cos(v)))*np.sin(u)
>>> z = np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap="Viridis",
... simplices=simplices)
Example 3: Mobius Band
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u = np.linspace(0, 2*np.pi, 24)
>>> v = np.linspace(-1, 1, 8)
>>> u,v = np.meshgrid(u,v)
>>> u = u.flatten()
>>> v = v.flatten()
>>> tp = 1 + 0.5*v*np.cos(u/2.)
>>> x = tp*np.cos(u)
>>> y = tp*np.sin(u)
>>> z = 0.5*v*np.sin(u/2.)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z, colormap=[(0.2, 0.4, 0.6), (1, 1, 1)],
... simplices=simplices)
Example 4: Using a Custom Colormap Function with Light Cone
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u=np.linspace(-np.pi, np.pi, 30)
>>> v=np.linspace(-np.pi, np.pi, 30)
>>> u,v=np.meshgrid(u,v)
>>> u=u.flatten()
>>> v=v.flatten()
>>> x = u
>>> y = u*np.cos(v)
>>> z = u*np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> # Define distance function
>>> def dist_origin(x, y, z):
... return np.sqrt((1.0 * x)**2 + (1.0 * y)**2 + (1.0 * z)**2)
>>> # Create a figure
>>> fig1 = create_trisurf(x=x, y=y, z=z,
... colormap=['#FFFFFF', '#E4FFFE',
... '#A4F6F9', '#FF99FE',
... '#BA52ED'],
... scale=[0, 0.6, 0.71, 0.89, 1],
... simplices=simplices,
... color_func=dist_origin)
Example 5: Enter color_func as a list of colors
>>> # Necessary Imports for Trisurf
>>> import numpy as np
>>> from scipy.spatial import Delaunay
>>> import random
>>> from plotly.figure_factory import create_trisurf
>>> from plotly.graph_objs import graph_objs
>>> # Make data for plot
>>> u=np.linspace(-np.pi, np.pi, 30)
>>> v=np.linspace(-np.pi, np.pi, 30)
>>> u,v=np.meshgrid(u,v)
>>> u=u.flatten()
>>> v=v.flatten()
>>> x = u
>>> y = u*np.cos(v)
>>> z = u*np.sin(v)
>>> points2D = np.vstack([u,v]).T
>>> tri = Delaunay(points2D)
>>> simplices = tri.simplices
>>> colors = []
>>> color_choices = ['rgb(0, 0, 0)', '#6c4774', '#d6c7dd']
>>> for index in range(len(simplices)):
... colors.append(random.choice(color_choices))
>>> fig = create_trisurf(
... x, y, z, simplices,
... color_func=colors,
... show_colorbar=True,
... edges_color='rgb(2, 85, 180)',
... title=' Modern Art'
... )
"""
if aspectratio is None:
aspectratio = {"x": 1, "y": 1, "z": 1}
# Validate colormap
clrs.validate_colors(colormap)
colormap, scale = clrs.convert_colors_to_same_type(
colormap, colortype="tuple", return_default_colors=True, scale=scale
)
data1 = trisurf(
x,
y,
z,
simplices,
show_colorbar=show_colorbar,
color_func=color_func,
colormap=colormap,
scale=scale,
edges_color=edges_color,
plot_edges=plot_edges,
)
axis = dict(
showbackground=showbackground,
backgroundcolor=backgroundcolor,
gridcolor=gridcolor,
zerolinecolor=zerolinecolor,
)
layout = graph_objs.Layout(
title=title,
width=width,
height=height,
scene=graph_objs.layout.Scene(
xaxis=graph_objs.layout.scene.XAxis(**axis),
yaxis=graph_objs.layout.scene.YAxis(**axis),
zaxis=graph_objs.layout.scene.ZAxis(**axis),
aspectratio=dict(
x=aspectratio["x"], y=aspectratio["y"], z=aspectratio["z"]
),
),
)
return graph_objs.Figure(data=data1, layout=layout) | [
"def",
"create_trisurf",
"(",
"x",
",",
"y",
",",
"z",
",",
"simplices",
",",
"colormap",
"=",
"None",
",",
"show_colorbar",
"=",
"True",
",",
"scale",
"=",
"None",
",",
"color_func",
"=",
"None",
",",
"title",
"=",
"\"Trisurf Plot\"",
",",
"plot_edges",
"=",
"True",
",",
"showbackground",
"=",
"True",
",",
"backgroundcolor",
"=",
"\"rgb(230, 230, 230)\"",
",",
"gridcolor",
"=",
"\"rgb(255, 255, 255)\"",
",",
"zerolinecolor",
"=",
"\"rgb(255, 255, 255)\"",
",",
"edges_color",
"=",
"\"rgb(50, 50, 50)\"",
",",
"height",
"=",
"800",
",",
"width",
"=",
"800",
",",
"aspectratio",
"=",
"None",
",",
")",
":",
"if",
"aspectratio",
"is",
"None",
":",
"aspectratio",
"=",
"{",
"\"x\"",
":",
"1",
",",
"\"y\"",
":",
"1",
",",
"\"z\"",
":",
"1",
"}",
"# Validate colormap",
"clrs",
".",
"validate_colors",
"(",
"colormap",
")",
"colormap",
",",
"scale",
"=",
"clrs",
".",
"convert_colors_to_same_type",
"(",
"colormap",
",",
"colortype",
"=",
"\"tuple\"",
",",
"return_default_colors",
"=",
"True",
",",
"scale",
"=",
"scale",
")",
"data1",
"=",
"trisurf",
"(",
"x",
",",
"y",
",",
"z",
",",
"simplices",
",",
"show_colorbar",
"=",
"show_colorbar",
",",
"color_func",
"=",
"color_func",
",",
"colormap",
"=",
"colormap",
",",
"scale",
"=",
"scale",
",",
"edges_color",
"=",
"edges_color",
",",
"plot_edges",
"=",
"plot_edges",
",",
")",
"axis",
"=",
"dict",
"(",
"showbackground",
"=",
"showbackground",
",",
"backgroundcolor",
"=",
"backgroundcolor",
",",
"gridcolor",
"=",
"gridcolor",
",",
"zerolinecolor",
"=",
"zerolinecolor",
",",
")",
"layout",
"=",
"graph_objs",
".",
"Layout",
"(",
"title",
"=",
"title",
",",
"width",
"=",
"width",
",",
"height",
"=",
"height",
",",
"scene",
"=",
"graph_objs",
".",
"layout",
".",
"Scene",
"(",
"xaxis",
"=",
"graph_objs",
".",
"layout",
".",
"scene",
".",
"XAxis",
"(",
"*",
"*",
"axis",
")",
",",
"yaxis",
"=",
"graph_objs",
".",
"layout",
".",
"scene",
".",
"YAxis",
"(",
"*",
"*",
"axis",
")",
",",
"zaxis",
"=",
"graph_objs",
".",
"layout",
".",
"scene",
".",
"ZAxis",
"(",
"*",
"*",
"axis",
")",
",",
"aspectratio",
"=",
"dict",
"(",
"x",
"=",
"aspectratio",
"[",
"\"x\"",
"]",
",",
"y",
"=",
"aspectratio",
"[",
"\"y\"",
"]",
",",
"z",
"=",
"aspectratio",
"[",
"\"z\"",
"]",
")",
",",
")",
",",
")",
"return",
"graph_objs",
".",
"Figure",
"(",
"data",
"=",
"data1",
",",
"layout",
"=",
"layout",
")"
] | [
246,
0
] | [
510,
55
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
66,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.dash | (self) |
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
- One of the following dash styles:
['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot']
- A string containing a dash length list in pixels or percentages
(e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.)
Returns
-------
str
|
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
- One of the following dash styles:
['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot']
- A string containing a dash length list in pixels or percentages
(e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.) | def dash(self):
"""
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
The 'dash' property is an enumeration that may be specified as:
- One of the following dash styles:
['solid', 'dot', 'dash', 'longdash', 'dashdot', 'longdashdot']
- A string containing a dash length list in pixels or percentages
(e.g. '5px 10px 2px 2px', '5, 10, 2, 2', '10% 20% 40%', etc.)
Returns
-------
str
"""
return self["dash"] | [
"def",
"dash",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dash\"",
"]"
] | [
75,
4
] | [
92,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.smoothing | (self) |
Sets the amount of smoothing for the contour lines, where 0
corresponds to no smoothing.
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3]
Returns
-------
int|float
|
Sets the amount of smoothing for the contour lines, where 0
corresponds to no smoothing.
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3] | def smoothing(self):
"""
Sets the amount of smoothing for the contour lines, where 0
corresponds to no smoothing.
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3]
Returns
-------
int|float
"""
return self["smoothing"] | [
"def",
"smoothing",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"smoothing\"",
"]"
] | [
101,
4
] | [
113,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the contour line width in (in px)
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the contour line width in (in px)
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the contour line width in (in px)
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
122,
4
] | [
133,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self, arg=None, color=None, dash=None, smoothing=None, width=None, **kwargs
) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2dcontour.Line`
color
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
dash
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
smoothing
Sets the amount of smoothing for the contour lines,
where 0 corresponds to no smoothing.
width
Sets the contour line width in (in px)
Returns
-------
Line
|
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2dcontour.Line`
color
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
dash
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
smoothing
Sets the amount of smoothing for the contour lines,
where 0 corresponds to no smoothing.
width
Sets the contour line width in (in px) | def __init__(
self, arg=None, color=None, dash=None, smoothing=None, width=None, **kwargs
):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.histogram2dcontour.Line`
color
Sets the color of the contour level. Has no effect if
`contours.coloring` is set to "lines".
dash
Sets the dash style of lines. Set to a dash type string
("solid", "dot", "dash", "longdash", "dashdot", or
"longdashdot") or a dash length list in px (eg
"5px,10px,2px,2px").
smoothing
Sets the amount of smoothing for the contour lines,
where 0 corresponds to no smoothing.
width
Sets the contour line width in (in px)
Returns
-------
Line
"""
super(Line, self).__init__("line")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.histogram2dcontour.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.histogram2dcontour.Line`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("dash", None)
_v = dash if dash is not None else _v
if _v is not None:
self["dash"] = _v
_v = arg.pop("smoothing", None)
_v = smoothing if smoothing is not None else _v
if _v is not None:
self["smoothing"] = _v
_v = arg.pop("width", None)
_v = width if width is not None else _v
if _v is not None:
self["width"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"dash",
"=",
"None",
",",
"smoothing",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.histogram2dcontour.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.histogram2dcontour.Line`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"dash\"",
",",
"None",
")",
"_v",
"=",
"dash",
"if",
"dash",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"dash\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"smoothing\"",
",",
"None",
")",
"_v",
"=",
"smoothing",
"if",
"smoothing",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"smoothing\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"width\"",
",",
"None",
")",
"_v",
"=",
"width",
"if",
"width",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"width\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
159,
4
] | [
241,
34
] | python | en | ['en', 'error', 'th'] | False |
create_quiver | (
x, y, u, v, scale=0.1, arrow_scale=0.3, angle=math.pi / 9, scaleratio=None, **kwargs
) |
Returns data for a quiver plot.
:param (list|ndarray) x: x coordinates of the arrow locations
:param (list|ndarray) y: y coordinates of the arrow locations
:param (list|ndarray) u: x components of the arrow vectors
:param (list|ndarray) v: y components of the arrow vectors
:param (float in [0,1]) scale: scales size of the arrows(ideally to
avoid overlap). Default = .1
:param (float in [0,1]) arrow_scale: value multiplied to length of barb
to get length of arrowhead. Default = .3
:param (angle in radians) angle: angle of arrowhead. Default = pi/9
:param (positive float) scaleratio: the ratio between the scale of the y-axis
and the scale of the x-axis (scale_y / scale_x). Default = None, the
scale ratio is not fixed.
:param kwargs: kwargs passed through plotly.graph_objs.Scatter
for more information on valid kwargs call
help(plotly.graph_objs.Scatter)
:rtype (dict): returns a representation of quiver figure.
Example 1: Trivial Quiver
>>> from plotly.figure_factory import create_quiver
>>> import math
>>> # 1 Arrow from (0,0) to (1,1)
>>> fig = create_quiver(x=[0], y=[0], u=[1], v=[1], scale=1)
>>> fig.show()
Example 2: Quiver plot using meshgrid
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> import math
>>> # Add data
>>> x,y = np.meshgrid(np.arange(0, 2, .2), np.arange(0, 2, .2))
>>> u = np.cos(x)*y
>>> v = np.sin(x)*y
>>> #Create quiver
>>> fig = create_quiver(x, y, u, v)
>>> fig.show()
Example 3: Styling the quiver plot
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> import math
>>> # Add data
>>> x, y = np.meshgrid(np.arange(-np.pi, math.pi, .5),
... np.arange(-math.pi, math.pi, .5))
>>> u = np.cos(x)*y
>>> v = np.sin(x)*y
>>> # Create quiver
>>> fig = create_quiver(x, y, u, v, scale=.2, arrow_scale=.3, angle=math.pi/6,
... name='Wind Velocity', line=dict(width=1))
>>> # Add title to layout
>>> fig.update_layout(title='Quiver Plot') # doctest: +SKIP
>>> fig.show()
Example 4: Forcing a fix scale ratio to maintain the arrow length
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> # Add data
>>> x,y = np.meshgrid(np.arange(0.5, 3.5, .5), np.arange(0.5, 4.5, .5))
>>> u = x
>>> v = y
>>> angle = np.arctan(v / u)
>>> norm = 0.25
>>> u = norm * np.cos(angle)
>>> v = norm * np.sin(angle)
>>> # Create quiver with a fix scale ratio
>>> fig = create_quiver(x, y, u, v, scale = 1, scaleratio = 0.5)
>>> fig.show()
|
Returns data for a quiver plot. | def create_quiver(
x, y, u, v, scale=0.1, arrow_scale=0.3, angle=math.pi / 9, scaleratio=None, **kwargs
):
"""
Returns data for a quiver plot.
:param (list|ndarray) x: x coordinates of the arrow locations
:param (list|ndarray) y: y coordinates of the arrow locations
:param (list|ndarray) u: x components of the arrow vectors
:param (list|ndarray) v: y components of the arrow vectors
:param (float in [0,1]) scale: scales size of the arrows(ideally to
avoid overlap). Default = .1
:param (float in [0,1]) arrow_scale: value multiplied to length of barb
to get length of arrowhead. Default = .3
:param (angle in radians) angle: angle of arrowhead. Default = pi/9
:param (positive float) scaleratio: the ratio between the scale of the y-axis
and the scale of the x-axis (scale_y / scale_x). Default = None, the
scale ratio is not fixed.
:param kwargs: kwargs passed through plotly.graph_objs.Scatter
for more information on valid kwargs call
help(plotly.graph_objs.Scatter)
:rtype (dict): returns a representation of quiver figure.
Example 1: Trivial Quiver
>>> from plotly.figure_factory import create_quiver
>>> import math
>>> # 1 Arrow from (0,0) to (1,1)
>>> fig = create_quiver(x=[0], y=[0], u=[1], v=[1], scale=1)
>>> fig.show()
Example 2: Quiver plot using meshgrid
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> import math
>>> # Add data
>>> x,y = np.meshgrid(np.arange(0, 2, .2), np.arange(0, 2, .2))
>>> u = np.cos(x)*y
>>> v = np.sin(x)*y
>>> #Create quiver
>>> fig = create_quiver(x, y, u, v)
>>> fig.show()
Example 3: Styling the quiver plot
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> import math
>>> # Add data
>>> x, y = np.meshgrid(np.arange(-np.pi, math.pi, .5),
... np.arange(-math.pi, math.pi, .5))
>>> u = np.cos(x)*y
>>> v = np.sin(x)*y
>>> # Create quiver
>>> fig = create_quiver(x, y, u, v, scale=.2, arrow_scale=.3, angle=math.pi/6,
... name='Wind Velocity', line=dict(width=1))
>>> # Add title to layout
>>> fig.update_layout(title='Quiver Plot') # doctest: +SKIP
>>> fig.show()
Example 4: Forcing a fix scale ratio to maintain the arrow length
>>> from plotly.figure_factory import create_quiver
>>> import numpy as np
>>> # Add data
>>> x,y = np.meshgrid(np.arange(0.5, 3.5, .5), np.arange(0.5, 4.5, .5))
>>> u = x
>>> v = y
>>> angle = np.arctan(v / u)
>>> norm = 0.25
>>> u = norm * np.cos(angle)
>>> v = norm * np.sin(angle)
>>> # Create quiver with a fix scale ratio
>>> fig = create_quiver(x, y, u, v, scale = 1, scaleratio = 0.5)
>>> fig.show()
"""
utils.validate_equal_length(x, y, u, v)
utils.validate_positive_scalars(arrow_scale=arrow_scale, scale=scale)
if scaleratio is None:
quiver_obj = _Quiver(x, y, u, v, scale, arrow_scale, angle)
else:
quiver_obj = _Quiver(x, y, u, v, scale, arrow_scale, angle, scaleratio)
barb_x, barb_y = quiver_obj.get_barbs()
arrow_x, arrow_y = quiver_obj.get_quiver_arrows()
quiver_plot = graph_objs.Scatter(
x=barb_x + arrow_x, y=barb_y + arrow_y, mode="lines", **kwargs
)
data = [quiver_plot]
if scaleratio is None:
layout = graph_objs.Layout(hovermode="closest")
else:
layout = graph_objs.Layout(
hovermode="closest", yaxis=dict(scaleratio=scaleratio, scaleanchor="x")
)
return graph_objs.Figure(data=data, layout=layout) | [
"def",
"create_quiver",
"(",
"x",
",",
"y",
",",
"u",
",",
"v",
",",
"scale",
"=",
"0.1",
",",
"arrow_scale",
"=",
"0.3",
",",
"angle",
"=",
"math",
".",
"pi",
"/",
"9",
",",
"scaleratio",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"utils",
".",
"validate_equal_length",
"(",
"x",
",",
"y",
",",
"u",
",",
"v",
")",
"utils",
".",
"validate_positive_scalars",
"(",
"arrow_scale",
"=",
"arrow_scale",
",",
"scale",
"=",
"scale",
")",
"if",
"scaleratio",
"is",
"None",
":",
"quiver_obj",
"=",
"_Quiver",
"(",
"x",
",",
"y",
",",
"u",
",",
"v",
",",
"scale",
",",
"arrow_scale",
",",
"angle",
")",
"else",
":",
"quiver_obj",
"=",
"_Quiver",
"(",
"x",
",",
"y",
",",
"u",
",",
"v",
",",
"scale",
",",
"arrow_scale",
",",
"angle",
",",
"scaleratio",
")",
"barb_x",
",",
"barb_y",
"=",
"quiver_obj",
".",
"get_barbs",
"(",
")",
"arrow_x",
",",
"arrow_y",
"=",
"quiver_obj",
".",
"get_quiver_arrows",
"(",
")",
"quiver_plot",
"=",
"graph_objs",
".",
"Scatter",
"(",
"x",
"=",
"barb_x",
"+",
"arrow_x",
",",
"y",
"=",
"barb_y",
"+",
"arrow_y",
",",
"mode",
"=",
"\"lines\"",
",",
"*",
"*",
"kwargs",
")",
"data",
"=",
"[",
"quiver_plot",
"]",
"if",
"scaleratio",
"is",
"None",
":",
"layout",
"=",
"graph_objs",
".",
"Layout",
"(",
"hovermode",
"=",
"\"closest\"",
")",
"else",
":",
"layout",
"=",
"graph_objs",
".",
"Layout",
"(",
"hovermode",
"=",
"\"closest\"",
",",
"yaxis",
"=",
"dict",
"(",
"scaleratio",
"=",
"scaleratio",
",",
"scaleanchor",
"=",
"\"x\"",
")",
")",
"return",
"graph_objs",
".",
"Figure",
"(",
"data",
"=",
"data",
",",
"layout",
"=",
"layout",
")"
] | [
9,
0
] | [
123,
54
] | python | en | ['en', 'error', 'th'] | False |
_Quiver.scale_uv | (self) |
Scales u and v to avoid overlap of the arrows.
u and v are added to x and y to get the
endpoints of the arrows so a smaller scale value will
result in less overlap of arrows.
|
Scales u and v to avoid overlap of the arrows. | def scale_uv(self):
"""
Scales u and v to avoid overlap of the arrows.
u and v are added to x and y to get the
endpoints of the arrows so a smaller scale value will
result in less overlap of arrows.
"""
self.u = [i * self.scale * self.scaleratio for i in self.u]
self.v = [i * self.scale for i in self.v] | [
"def",
"scale_uv",
"(",
"self",
")",
":",
"self",
".",
"u",
"=",
"[",
"i",
"*",
"self",
".",
"scale",
"*",
"self",
".",
"scaleratio",
"for",
"i",
"in",
"self",
".",
"u",
"]",
"self",
".",
"v",
"=",
"[",
"i",
"*",
"self",
".",
"scale",
"for",
"i",
"in",
"self",
".",
"v",
"]"
] | [
166,
4
] | [
175,
49
] | python | en | ['en', 'error', 'th'] | False |
_Quiver.get_barbs | (self) |
Creates x and y startpoint and endpoint pairs
After finding the endpoint of each barb this zips startpoint and
endpoint pairs to create 2 lists: x_values for barbs and y values
for barbs
:rtype: (list, list) barb_x, barb_y: list of startpoint and endpoint
x_value pairs separated by a None to create the barb of the arrow,
and list of startpoint and endpoint y_value pairs separated by a
None to create the barb of the arrow.
|
Creates x and y startpoint and endpoint pairs | def get_barbs(self):
"""
Creates x and y startpoint and endpoint pairs
After finding the endpoint of each barb this zips startpoint and
endpoint pairs to create 2 lists: x_values for barbs and y values
for barbs
:rtype: (list, list) barb_x, barb_y: list of startpoint and endpoint
x_value pairs separated by a None to create the barb of the arrow,
and list of startpoint and endpoint y_value pairs separated by a
None to create the barb of the arrow.
"""
self.end_x = [i + j for i, j in zip(self.x, self.u)]
self.end_y = [i + j for i, j in zip(self.y, self.v)]
empty = [None] * len(self.x)
barb_x = utils.flatten(zip(self.x, self.end_x, empty))
barb_y = utils.flatten(zip(self.y, self.end_y, empty))
return barb_x, barb_y | [
"def",
"get_barbs",
"(",
"self",
")",
":",
"self",
".",
"end_x",
"=",
"[",
"i",
"+",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"x",
",",
"self",
".",
"u",
")",
"]",
"self",
".",
"end_y",
"=",
"[",
"i",
"+",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"y",
",",
"self",
".",
"v",
")",
"]",
"empty",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"x",
")",
"barb_x",
"=",
"utils",
".",
"flatten",
"(",
"zip",
"(",
"self",
".",
"x",
",",
"self",
".",
"end_x",
",",
"empty",
")",
")",
"barb_y",
"=",
"utils",
".",
"flatten",
"(",
"zip",
"(",
"self",
".",
"y",
",",
"self",
".",
"end_y",
",",
"empty",
")",
")",
"return",
"barb_x",
",",
"barb_y"
] | [
177,
4
] | [
195,
29
] | python | en | ['en', 'error', 'th'] | False |
_Quiver.get_quiver_arrows | (self) |
Creates lists of x and y values to plot the arrows
Gets length of each barb then calculates the length of each side of
the arrow. Gets angle of barb and applies angle to each side of the
arrowhead. Next uses arrow_scale to scale the length of arrowhead and
creates x and y values for arrowhead point1 and point2. Finally x and y
values for point1, endpoint and point2s for each arrowhead are
separated by a None and zipped to create lists of x and y values for
the arrows.
:rtype: (list, list) arrow_x, arrow_y: list of point1, endpoint, point2
x_values separated by a None to create the arrowhead and list of
point1, endpoint, point2 y_values separated by a None to create
the barb of the arrow.
|
Creates lists of x and y values to plot the arrows | def get_quiver_arrows(self):
"""
Creates lists of x and y values to plot the arrows
Gets length of each barb then calculates the length of each side of
the arrow. Gets angle of barb and applies angle to each side of the
arrowhead. Next uses arrow_scale to scale the length of arrowhead and
creates x and y values for arrowhead point1 and point2. Finally x and y
values for point1, endpoint and point2s for each arrowhead are
separated by a None and zipped to create lists of x and y values for
the arrows.
:rtype: (list, list) arrow_x, arrow_y: list of point1, endpoint, point2
x_values separated by a None to create the arrowhead and list of
point1, endpoint, point2 y_values separated by a None to create
the barb of the arrow.
"""
dif_x = [i - j for i, j in zip(self.end_x, self.x)]
dif_y = [i - j for i, j in zip(self.end_y, self.y)]
# Get barb lengths(default arrow length = 30% barb length)
barb_len = [None] * len(self.x)
for index in range(len(barb_len)):
barb_len[index] = math.hypot(dif_x[index] / self.scaleratio, dif_y[index])
# Make arrow lengths
arrow_len = [None] * len(self.x)
arrow_len = [i * self.arrow_scale for i in barb_len]
# Get barb angles
barb_ang = [None] * len(self.x)
for index in range(len(barb_ang)):
barb_ang[index] = math.atan2(dif_y[index], dif_x[index] / self.scaleratio)
# Set angles to create arrow
ang1 = [i + self.angle for i in barb_ang]
ang2 = [i - self.angle for i in barb_ang]
cos_ang1 = [None] * len(ang1)
for index in range(len(ang1)):
cos_ang1[index] = math.cos(ang1[index])
seg1_x = [i * j for i, j in zip(arrow_len, cos_ang1)]
sin_ang1 = [None] * len(ang1)
for index in range(len(ang1)):
sin_ang1[index] = math.sin(ang1[index])
seg1_y = [i * j for i, j in zip(arrow_len, sin_ang1)]
cos_ang2 = [None] * len(ang2)
for index in range(len(ang2)):
cos_ang2[index] = math.cos(ang2[index])
seg2_x = [i * j for i, j in zip(arrow_len, cos_ang2)]
sin_ang2 = [None] * len(ang2)
for index in range(len(ang2)):
sin_ang2[index] = math.sin(ang2[index])
seg2_y = [i * j for i, j in zip(arrow_len, sin_ang2)]
# Set coordinates to create arrow
for index in range(len(self.end_x)):
point1_x = [i - j * self.scaleratio for i, j in zip(self.end_x, seg1_x)]
point1_y = [i - j for i, j in zip(self.end_y, seg1_y)]
point2_x = [i - j * self.scaleratio for i, j in zip(self.end_x, seg2_x)]
point2_y = [i - j for i, j in zip(self.end_y, seg2_y)]
# Combine lists to create arrow
empty = [None] * len(self.end_x)
arrow_x = utils.flatten(zip(point1_x, self.end_x, point2_x, empty))
arrow_y = utils.flatten(zip(point1_y, self.end_y, point2_y, empty))
return arrow_x, arrow_y | [
"def",
"get_quiver_arrows",
"(",
"self",
")",
":",
"dif_x",
"=",
"[",
"i",
"-",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_x",
",",
"self",
".",
"x",
")",
"]",
"dif_y",
"=",
"[",
"i",
"-",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_y",
",",
"self",
".",
"y",
")",
"]",
"# Get barb lengths(default arrow length = 30% barb length)",
"barb_len",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"x",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"barb_len",
")",
")",
":",
"barb_len",
"[",
"index",
"]",
"=",
"math",
".",
"hypot",
"(",
"dif_x",
"[",
"index",
"]",
"/",
"self",
".",
"scaleratio",
",",
"dif_y",
"[",
"index",
"]",
")",
"# Make arrow lengths",
"arrow_len",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"x",
")",
"arrow_len",
"=",
"[",
"i",
"*",
"self",
".",
"arrow_scale",
"for",
"i",
"in",
"barb_len",
"]",
"# Get barb angles",
"barb_ang",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"x",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"barb_ang",
")",
")",
":",
"barb_ang",
"[",
"index",
"]",
"=",
"math",
".",
"atan2",
"(",
"dif_y",
"[",
"index",
"]",
",",
"dif_x",
"[",
"index",
"]",
"/",
"self",
".",
"scaleratio",
")",
"# Set angles to create arrow",
"ang1",
"=",
"[",
"i",
"+",
"self",
".",
"angle",
"for",
"i",
"in",
"barb_ang",
"]",
"ang2",
"=",
"[",
"i",
"-",
"self",
".",
"angle",
"for",
"i",
"in",
"barb_ang",
"]",
"cos_ang1",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"ang1",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"ang1",
")",
")",
":",
"cos_ang1",
"[",
"index",
"]",
"=",
"math",
".",
"cos",
"(",
"ang1",
"[",
"index",
"]",
")",
"seg1_x",
"=",
"[",
"i",
"*",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"arrow_len",
",",
"cos_ang1",
")",
"]",
"sin_ang1",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"ang1",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"ang1",
")",
")",
":",
"sin_ang1",
"[",
"index",
"]",
"=",
"math",
".",
"sin",
"(",
"ang1",
"[",
"index",
"]",
")",
"seg1_y",
"=",
"[",
"i",
"*",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"arrow_len",
",",
"sin_ang1",
")",
"]",
"cos_ang2",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"ang2",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"ang2",
")",
")",
":",
"cos_ang2",
"[",
"index",
"]",
"=",
"math",
".",
"cos",
"(",
"ang2",
"[",
"index",
"]",
")",
"seg2_x",
"=",
"[",
"i",
"*",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"arrow_len",
",",
"cos_ang2",
")",
"]",
"sin_ang2",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"ang2",
")",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"ang2",
")",
")",
":",
"sin_ang2",
"[",
"index",
"]",
"=",
"math",
".",
"sin",
"(",
"ang2",
"[",
"index",
"]",
")",
"seg2_y",
"=",
"[",
"i",
"*",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"arrow_len",
",",
"sin_ang2",
")",
"]",
"# Set coordinates to create arrow",
"for",
"index",
"in",
"range",
"(",
"len",
"(",
"self",
".",
"end_x",
")",
")",
":",
"point1_x",
"=",
"[",
"i",
"-",
"j",
"*",
"self",
".",
"scaleratio",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_x",
",",
"seg1_x",
")",
"]",
"point1_y",
"=",
"[",
"i",
"-",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_y",
",",
"seg1_y",
")",
"]",
"point2_x",
"=",
"[",
"i",
"-",
"j",
"*",
"self",
".",
"scaleratio",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_x",
",",
"seg2_x",
")",
"]",
"point2_y",
"=",
"[",
"i",
"-",
"j",
"for",
"i",
",",
"j",
"in",
"zip",
"(",
"self",
".",
"end_y",
",",
"seg2_y",
")",
"]",
"# Combine lists to create arrow",
"empty",
"=",
"[",
"None",
"]",
"*",
"len",
"(",
"self",
".",
"end_x",
")",
"arrow_x",
"=",
"utils",
".",
"flatten",
"(",
"zip",
"(",
"point1_x",
",",
"self",
".",
"end_x",
",",
"point2_x",
",",
"empty",
")",
")",
"arrow_y",
"=",
"utils",
".",
"flatten",
"(",
"zip",
"(",
"point1_y",
",",
"self",
".",
"end_y",
",",
"point2_y",
",",
"empty",
")",
")",
"return",
"arrow_x",
",",
"arrow_y"
] | [
197,
4
] | [
266,
31
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.color | (self) |
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
63,
28
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.family | (self) |
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string | def family(self):
"""
HTML font family - the typeface that will be applied by the web
browser. The web browser will only be able to apply a font if
it is available on the system which it operates. Provide
multiple font families, separated by commas, to indicate the
preference in which to apply fonts if they aren't available on
the system. The Chart Studio Cloud (at https://chart-
studio.plotly.com or on-premise) generates images on a server,
where only a select number of fonts are installed and
supported. These include "Arial", "Balto", "Courier New",
"Droid Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
The 'family' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["family"] | [
"def",
"family",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"family\"",
"]"
] | [
72,
4
] | [
94,
29
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.size | (self) |
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
|
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf] | def size(self):
"""
The 'size' property is a number and may be specified as:
- An int or float in the interval [1, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
103,
4
] | [
112,
27
] | python | en | ['en', 'error', 'th'] | False |
Tickfont.__init__ | (self, arg=None, color=None, family=None, size=None, **kwargs) |
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
|
Construct a new Tickfont object
Sets the color bar's tick label font | def __init__(self, arg=None, color=None, family=None, size=None, **kwargs):
"""
Construct a new Tickfont object
Sets the color bar's tick label font
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.surface.colorbar.Tickfont`
color
family
HTML font family - the typeface that will be applied by
the web browser. The web browser will only be able to
apply a font if it is available on the system which it
operates. Provide multiple font families, separated by
commas, to indicate the preference in which to apply
fonts if they aren't available on the system. The Chart
Studio Cloud (at https://chart-studio.plotly.com or on-
premise) generates images on a server, where only a
select number of fonts are installed and supported.
These include "Arial", "Balto", "Courier New", "Droid
Sans",, "Droid Serif", "Droid Sans Mono", "Gravitas
One", "Old Standard TT", "Open Sans", "Overpass", "PT
Sans Narrow", "Raleway", "Times New Roman".
size
Returns
-------
Tickfont
"""
super(Tickfont, self).__init__("tickfont")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.surface.colorbar.Tickfont
constructor must be a dict or
an instance of :class:`plotly.graph_objs.surface.colorbar.Tickfont`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("family", None)
_v = family if family is not None else _v
if _v is not None:
self["family"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"family",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Tickfont",
",",
"self",
")",
".",
"__init__",
"(",
"\"tickfont\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.surface.colorbar.Tickfont \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.surface.colorbar.Tickfont`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"family\"",
",",
"None",
")",
"_v",
"=",
"family",
"if",
"family",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"family\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
143,
4
] | [
226,
34
] | python | en | ['en', 'error', 'th'] | False |
OeTeacher.next_example | (self) |
Returns the next example from this dataset after starting to queue up the next
example.
|
Returns the next example from this dataset after starting to queue up the next
example.
| def next_example(self):
"""
Returns the next example from this dataset after starting to queue up the next
example.
"""
ready = None
# pull up the currently queued example
if self.example is not None:
if self.image_mode != 'no_image_model':
# move the image we loaded in the background into the example
image = self.data_queue.get()
self.example['image'] = image
ready = (self.example, self.epochDone)
# get the next base example: super().next_example() calls self.get()
self.example, self.epochDone = super().next_example()
if self.image_mode != 'no_image_model' and 'image_id' in self.example:
# load the next image in the background
image_id = self.example['image_id']
self.submit_load_request(image_id)
# Try to return the previously cached example
if ready is None:
return self.next_example()
else:
return ready | [
"def",
"next_example",
"(",
"self",
")",
":",
"ready",
"=",
"None",
"# pull up the currently queued example",
"if",
"self",
".",
"example",
"is",
"not",
"None",
":",
"if",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
":",
"# move the image we loaded in the background into the example",
"image",
"=",
"self",
".",
"data_queue",
".",
"get",
"(",
")",
"self",
".",
"example",
"[",
"'image'",
"]",
"=",
"image",
"ready",
"=",
"(",
"self",
".",
"example",
",",
"self",
".",
"epochDone",
")",
"# get the next base example: super().next_example() calls self.get()",
"self",
".",
"example",
",",
"self",
".",
"epochDone",
"=",
"super",
"(",
")",
".",
"next_example",
"(",
")",
"if",
"self",
".",
"image_mode",
"!=",
"'no_image_model'",
"and",
"'image_id'",
"in",
"self",
".",
"example",
":",
"# load the next image in the background",
"image_id",
"=",
"self",
".",
"example",
"[",
"'image_id'",
"]",
"self",
".",
"submit_load_request",
"(",
"image_id",
")",
"# Try to return the previously cached example",
"if",
"ready",
"is",
"None",
":",
"return",
"self",
".",
"next_example",
"(",
")",
"else",
":",
"return",
"ready"
] | [
108,
4
] | [
131,
24
] | python | en | ['en', 'error', 'th'] | False |
_get_rand_id | () |
:return: The string of a random id using uuid4
|
:return: The string of a random id using uuid4
| def _get_rand_id():
"""
:return: The string of a random id using uuid4
"""
return str(uuid.uuid4()) | [
"def",
"_get_rand_id",
"(",
")",
":",
"return",
"str",
"(",
"uuid",
".",
"uuid4",
"(",
")",
")"
] | [
14,
0
] | [
18,
28
] | python | en | ['en', 'error', 'th'] | False |
_prBlueBG | (text) |
Print given in text with a blue background.
:param text: The text to be printed
|
Print given in text with a blue background. | def _prBlueBG(text):
"""
Print given in text with a blue background.
:param text: The text to be printed
"""
print("\033[44m{}\033[0m".format(text), sep="") | [
"def",
"_prBlueBG",
"(",
"text",
")",
":",
"print",
"(",
"\"\\033[44m{}\\033[0m\"",
".",
"format",
"(",
"text",
")",
",",
"sep",
"=",
"\"\"",
")"
] | [
21,
0
] | [
27,
51
] | python | en | ['en', 'error', 'th'] | False |
on_message | (ws, message) |
Prints the incoming message from the server.
:param ws: a WebSocketApp
:param message: json with 'text' field to be printed
|
Prints the incoming message from the server. | def on_message(ws, message):
"""
Prints the incoming message from the server.
:param ws: a WebSocketApp
:param message: json with 'text' field to be printed
"""
incoming_message = json.loads(message)
print("\033[0m\n")
print("Bot: " + incoming_message['text'])
quick_replies = incoming_message.get('quick_replies')
if quick_replies is not None and len(quick_replies) > 0:
print(f"\nOptions: [{'|'.join(quick_replies)}]")
print("\033[44m\n") | [
"def",
"on_message",
"(",
"ws",
",",
"message",
")",
":",
"incoming_message",
"=",
"json",
".",
"loads",
"(",
"message",
")",
"print",
"(",
"\"\\033[0m\\n\"",
")",
"print",
"(",
"\"Bot: \"",
"+",
"incoming_message",
"[",
"'text'",
"]",
")",
"quick_replies",
"=",
"incoming_message",
".",
"get",
"(",
"'quick_replies'",
")",
"if",
"quick_replies",
"is",
"not",
"None",
"and",
"len",
"(",
"quick_replies",
")",
">",
"0",
":",
"print",
"(",
"f\"\\nOptions: [{'|'.join(quick_replies)}]\"",
")",
"print",
"(",
"\"\\033[44m\\n\"",
")"
] | [
30,
0
] | [
43,
23
] | python | en | ['en', 'error', 'th'] | False |
on_error | (ws, error) |
Prints an error, if occurs.
:param ws: WebSocketApp
:param error: An error
|
Prints an error, if occurs. | def on_error(ws, error):
"""
Prints an error, if occurs.
:param ws: WebSocketApp
:param error: An error
"""
print(error) | [
"def",
"on_error",
"(",
"ws",
",",
"error",
")",
":",
"print",
"(",
"error",
")"
] | [
46,
0
] | [
53,
16
] | python | en | ['en', 'error', 'th'] | False |
on_close | (ws) |
Cleanup before closing connection.
:param ws: WebSocketApp
|
Cleanup before closing connection. | def on_close(ws):
"""
Cleanup before closing connection.
:param ws: WebSocketApp
"""
# Reset color formatting if necessary
print("\033[0m")
print("Connection closed") | [
"def",
"on_close",
"(",
"ws",
")",
":",
"# Reset color formatting if necessary",
"print",
"(",
"\"\\033[0m\"",
")",
"print",
"(",
"\"Connection closed\"",
")"
] | [
56,
0
] | [
64,
30
] | python | en | ['en', 'error', 'th'] | False |
_run | (ws, id) |
Takes user input and sends it to a websocket.
:param ws: websocket.WebSocketApp
|
Takes user input and sends it to a websocket. | def _run(ws, id):
"""
Takes user input and sends it to a websocket.
:param ws: websocket.WebSocketApp
"""
while True:
x = input("\033[44m Me: ")
print("\033[0m", end="")
data = {}
data['id'] = id
data['text'] = x
json_data = json.dumps(data)
ws.send(json_data)
time.sleep(1)
if x == "[DONE]":
break
ws.close() | [
"def",
"_run",
"(",
"ws",
",",
"id",
")",
":",
"while",
"True",
":",
"x",
"=",
"input",
"(",
"\"\\033[44m Me: \"",
")",
"print",
"(",
"\"\\033[0m\"",
",",
"end",
"=",
"\"\"",
")",
"data",
"=",
"{",
"}",
"data",
"[",
"'id'",
"]",
"=",
"id",
"data",
"[",
"'text'",
"]",
"=",
"x",
"json_data",
"=",
"json",
".",
"dumps",
"(",
"data",
")",
"ws",
".",
"send",
"(",
"json_data",
")",
"time",
".",
"sleep",
"(",
"1",
")",
"if",
"x",
"==",
"\"[DONE]\"",
":",
"break",
"ws",
".",
"close",
"(",
")"
] | [
67,
0
] | [
84,
14
] | python | en | ['en', 'error', 'th'] | False |
on_open | (ws) |
Starts a new thread that loops, taking user input and sending it to the websocket.
:param ws: websocket.WebSocketApp that sends messages to a terminal_manager
|
Starts a new thread that loops, taking user input and sending it to the websocket. | def on_open(ws):
"""
Starts a new thread that loops, taking user input and sending it to the websocket.
:param ws: websocket.WebSocketApp that sends messages to a terminal_manager
"""
id = _get_rand_id()
threading.Thread(target=_run, args=(ws, id)).start() | [
"def",
"on_open",
"(",
"ws",
")",
":",
"id",
"=",
"_get_rand_id",
"(",
")",
"threading",
".",
"Thread",
"(",
"target",
"=",
"_run",
",",
"args",
"=",
"(",
"ws",
",",
"id",
")",
")",
".",
"start",
"(",
")"
] | [
87,
0
] | [
94,
56
] | python | en | ['en', 'error', 'th'] | False |
setup_args | () |
Set up args, specifically for the port number.
:return: A parser that parses the port from commandline arguments.
|
Set up args, specifically for the port number. | def setup_args():
"""
Set up args, specifically for the port number.
:return: A parser that parses the port from commandline arguments.
"""
parser = ParlaiParser(False, False)
parser_grp = parser.add_argument_group('Terminal Chat')
parser_grp.add_argument(
'--port', default=35496, type=int, help='Port to run the terminal chat server'
)
return parser.parse_args() | [
"def",
"setup_args",
"(",
")",
":",
"parser",
"=",
"ParlaiParser",
"(",
"False",
",",
"False",
")",
"parser_grp",
"=",
"parser",
".",
"add_argument_group",
"(",
"'Terminal Chat'",
")",
"parser_grp",
".",
"add_argument",
"(",
"'--port'",
",",
"default",
"=",
"35496",
",",
"type",
"=",
"int",
",",
"help",
"=",
"'Port to run the terminal chat server'",
")",
"return",
"parser",
".",
"parse_args",
"(",
")"
] | [
97,
0
] | [
108,
30
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the line color of all decreasing values.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the line color of all decreasing values.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def color(self):
"""
Sets the line color of all decreasing values.
The 'color' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
15,
4
] | [
65,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the line width of all decreasing values.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the line width of all decreasing values.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def width(self):
"""
Sets the line width of all decreasing values.
The 'width' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["width"] | [
"def",
"width",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"width\"",
"]"
] | [
74,
4
] | [
85,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (self, arg=None, color=None, width=None, **kwargs) |
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.waterfall.decr
easing.marker.Line`
color
Sets the line color of all decreasing values.
width
Sets the line width of all decreasing values.
Returns
-------
Line
|
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.waterfall.decr
easing.marker.Line`
color
Sets the line color of all decreasing values.
width
Sets the line width of all decreasing values. | def __init__(self, arg=None, color=None, width=None, **kwargs):
"""
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.waterfall.decr
easing.marker.Line`
color
Sets the line color of all decreasing values.
width
Sets the line width of all decreasing values.
Returns
-------
Line
"""
super(Line, self).__init__("line")
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.waterfall.decreasing.marker.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.waterfall.decreasing.marker.Line`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("width", None)
_v = width if width is not None else _v
if _v is not None:
self["width"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"color",
"=",
"None",
",",
"width",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Line",
",",
"self",
")",
".",
"__init__",
"(",
"\"line\"",
")",
"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.waterfall.decreasing.marker.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.waterfall.decreasing.marker.Line`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"width\"",
",",
"None",
")",
"_v",
"=",
"width",
"if",
"width",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"width\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
102,
4
] | [
165,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.align | (self) |
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above | def align(self):
"""
Sets the horizontal alignment of the text content within hover
label box. Has an effect only if the hover label text spans
more two or more lines
The 'align' property is an enumeration that may be specified as:
- One of the following enumeration values:
['left', 'right', 'auto']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["align"] | [
"def",
"align",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"align\"",
"]"
] | [
25,
4
] | [
40,
28
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.alignsrc | (self) |
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def alignsrc(self):
"""
Sets the source reference on Chart Studio Cloud for align .
The 'alignsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["alignsrc"] | [
"def",
"alignsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"alignsrc\"",
"]"
] | [
49,
4
] | [
60,
31
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolor | (self) |
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bgcolor(self):
"""
Sets the background color of the hover labels for this trace
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bgcolor"] | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
69,
4
] | [
120,
30
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bgcolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bgcolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for bgcolor .
The 'bgcolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bgcolorsrc"] | [
"def",
"bgcolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolorsrc\"",
"]"
] | [
129,
4
] | [
140,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolor | (self) |
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above | def bordercolor(self):
"""
Sets the border color of the hover labels for this trace.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["bordercolor"] | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
149,
4
] | [
200,
34
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.bordercolorsrc | (self) |
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def bordercolorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for
bordercolor .
The 'bordercolorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["bordercolorsrc"] | [
"def",
"bordercolorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolorsrc\"",
"]"
] | [
209,
4
] | [
221,
37
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.font | (self) |
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.cone.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.cone.hoverlabel.Font
|
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.cone.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size . | def font(self):
"""
Sets the font used in hover labels.
The 'font' property is an instance of Font
that may be specified as:
- An instance of :class:`plotly.graph_objs.cone.hoverlabel.Font`
- A dict of string/value properties that will be passed
to the Font constructor
Supported dict properties:
color
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
familysrc
Sets the source reference on Chart Studio Cloud
for family .
size
sizesrc
Sets the source reference on Chart Studio Cloud
for size .
Returns
-------
plotly.graph_objs.cone.hoverlabel.Font
"""
return self["font"] | [
"def",
"font",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"font\"",
"]"
] | [
230,
4
] | [
277,
27
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelength | (self) |
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
|
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above | def namelength(self):
"""
Sets the default length (in number of characters) of the trace
name in the hover labels for all traces. -1 shows the whole
name regardless of length. 0-3 shows the first 0-3 characters,
and an integer >3 will show the whole name if it is less than
that many characters, but if it is longer, will truncate to
`namelength - 3` characters and add an ellipsis.
The 'namelength' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [-1, 9223372036854775807]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|numpy.ndarray
"""
return self["namelength"] | [
"def",
"namelength",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelength\"",
"]"
] | [
286,
4
] | [
304,
33
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.namelengthsrc | (self) |
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def namelengthsrc(self):
"""
Sets the source reference on Chart Studio Cloud for namelength
.
The 'namelengthsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["namelengthsrc"] | [
"def",
"namelengthsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"namelengthsrc\"",
"]"
] | [
313,
4
] | [
325,
36
] | python | en | ['en', 'error', 'th'] | False |
Hoverlabel.__init__ | (
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
) |
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
Returns
-------
Hoverlabel
|
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength . | def __init__(
self,
arg=None,
align=None,
alignsrc=None,
bgcolor=None,
bgcolorsrc=None,
bordercolor=None,
bordercolorsrc=None,
font=None,
namelength=None,
namelengthsrc=None,
**kwargs
):
"""
Construct a new Hoverlabel object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.cone.Hoverlabel`
align
Sets the horizontal alignment of the text content
within hover label box. Has an effect only if the hover
label text spans more two or more lines
alignsrc
Sets the source reference on Chart Studio Cloud for
align .
bgcolor
Sets the background color of the hover labels for this
trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud for
bgcolor .
bordercolor
Sets the border color of the hover labels for this
trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud for
bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of characters) of
the trace name in the hover labels for all traces. -1
shows the whole name regardless of length. 0-3 shows
the first 0-3 characters, and an integer >3 will show
the whole name if it is less than that many characters,
but if it is longer, will truncate to `namelength - 3`
characters and add an ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud for
namelength .
Returns
-------
Hoverlabel
"""
super(Hoverlabel, self).__init__("hoverlabel")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.cone.Hoverlabel
constructor must be a dict or
an instance of :class:`plotly.graph_objs.cone.Hoverlabel`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("align", None)
_v = align if align is not None else _v
if _v is not None:
self["align"] = _v
_v = arg.pop("alignsrc", None)
_v = alignsrc if alignsrc is not None else _v
if _v is not None:
self["alignsrc"] = _v
_v = arg.pop("bgcolor", None)
_v = bgcolor if bgcolor is not None else _v
if _v is not None:
self["bgcolor"] = _v
_v = arg.pop("bgcolorsrc", None)
_v = bgcolorsrc if bgcolorsrc is not None else _v
if _v is not None:
self["bgcolorsrc"] = _v
_v = arg.pop("bordercolor", None)
_v = bordercolor if bordercolor is not None else _v
if _v is not None:
self["bordercolor"] = _v
_v = arg.pop("bordercolorsrc", None)
_v = bordercolorsrc if bordercolorsrc is not None else _v
if _v is not None:
self["bordercolorsrc"] = _v
_v = arg.pop("font", None)
_v = font if font is not None else _v
if _v is not None:
self["font"] = _v
_v = arg.pop("namelength", None)
_v = namelength if namelength is not None else _v
if _v is not None:
self["namelength"] = _v
_v = arg.pop("namelengthsrc", None)
_v = namelengthsrc if namelengthsrc is not None else _v
if _v is not None:
self["namelengthsrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"align",
"=",
"None",
",",
"alignsrc",
"=",
"None",
",",
"bgcolor",
"=",
"None",
",",
"bgcolorsrc",
"=",
"None",
",",
"bordercolor",
"=",
"None",
",",
"bordercolorsrc",
"=",
"None",
",",
"font",
"=",
"None",
",",
"namelength",
"=",
"None",
",",
"namelengthsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Hoverlabel",
",",
"self",
")",
".",
"__init__",
"(",
"\"hoverlabel\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.cone.Hoverlabel \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.cone.Hoverlabel`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"align\"",
",",
"None",
")",
"_v",
"=",
"align",
"if",
"align",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"align\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"alignsrc\"",
",",
"None",
")",
"_v",
"=",
"alignsrc",
"if",
"alignsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"alignsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolor\"",
",",
"None",
")",
"_v",
"=",
"bgcolor",
"if",
"bgcolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bgcolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bgcolorsrc",
"if",
"bgcolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bgcolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolor\"",
",",
"None",
")",
"_v",
"=",
"bordercolor",
"if",
"bordercolor",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolor\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"bordercolorsrc\"",
",",
"None",
")",
"_v",
"=",
"bordercolorsrc",
"if",
"bordercolorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"bordercolorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"font\"",
",",
"None",
")",
"_v",
"=",
"font",
"if",
"font",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"font\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelength\"",
",",
"None",
")",
"_v",
"=",
"namelength",
"if",
"namelength",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelength\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"namelengthsrc\"",
",",
"None",
")",
"_v",
"=",
"namelengthsrc",
"if",
"namelengthsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"namelengthsrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
370,
4
] | [
502,
34
] | python | en | ['en', 'error', 'th'] | False |
async_to_sync | (func: Awaitable[R]) | Wraps `asyncio.run` on an async function making it sync callable. | Wraps `asyncio.run` on an async function making it sync callable. | def async_to_sync(func: Awaitable[R]) -> R:
'''Wraps `asyncio.run` on an async function making it sync callable.'''
if not asyncio.iscoroutinefunction(func):
raise TypeError(f"{func} is not a coroutine function")
@wraps(func)
def wrapper(*args, **kwargs):
return asyncio.run(func(*args, **kwargs))
return wrapper | [
"def",
"async_to_sync",
"(",
"func",
":",
"Awaitable",
"[",
"R",
"]",
")",
"->",
"R",
":",
"if",
"not",
"asyncio",
".",
"iscoroutinefunction",
"(",
"func",
")",
":",
"raise",
"TypeError",
"(",
"f\"{func} is not a coroutine function\"",
")",
"@",
"wraps",
"(",
"func",
")",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"asyncio",
".",
"run",
"(",
"func",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
")",
"return",
"wrapper"
] | [
192,
0
] | [
200,
18
] | python | en | ['en', 'gl', 'en'] | True |
check_if_url | (possible_url: str) |
checks if input `possible_url` is and valid url.
Appends "https://" in front of it beforehand. (maybe not necessary).
Args:
possible_url `str`: The string to check.
Returns:
`bool`: `True` if it is and valid url.
|
checks if input `possible_url` is and valid url. | def check_if_url(possible_url: str):
"""
checks if input `possible_url` is and valid url.
Appends "https://" in front of it beforehand. (maybe not necessary).
Args:
possible_url `str`: The string to check.
Returns:
`bool`: `True` if it is and valid url.
"""
possible_url = fix_url_prefix(possible_url)
try:
validators.url(possible_url)
return True
except validator_collection.errors.InvalidURLError:
return False | [
"def",
"check_if_url",
"(",
"possible_url",
":",
"str",
")",
":",
"possible_url",
"=",
"fix_url_prefix",
"(",
"possible_url",
")",
"try",
":",
"validators",
".",
"url",
"(",
"possible_url",
")",
"return",
"True",
"except",
"validator_collection",
".",
"errors",
".",
"InvalidURLError",
":",
"return",
"False"
] | [
459,
0
] | [
476,
20
] | python | en | ['en', 'error', 'th'] | False |
help_to_file | (in_object, out_file=None) |
redirects the output of the `help` built-in function to a file.
https://gist.github.com/abingham/e19cfd042fefcd11ba60
Args:
in_object (`object`): the object to use as argument for `help()`
out_file (`str`, optional): filepath where the output should be redirected to. Defaults to `[class_name of the object]_help.txt`.
|
redirects the output of the `help` built-in function to a file. | def help_to_file(in_object, out_file=None):
"""
redirects the output of the `help` built-in function to a file.
https://gist.github.com/abingham/e19cfd042fefcd11ba60
Args:
in_object (`object`): the object to use as argument for `help()`
out_file (`str`, optional): filepath where the output should be redirected to. Defaults to `[class_name of the object]_help.txt`.
"""
out_file = f'{in_object.__class__.__name__}_help.txt' if out_file is None else pathmaker(out_file)
import sys
# Temporarily redirect stdout to a StringIO.
stdout = sys.stdout
with open('helpy.txt', 'w') as f:
sys.stdout = f
help(in_object)
# Don't forget to reset stdout!
sys.stdout = stdout | [
"def",
"help_to_file",
"(",
"in_object",
",",
"out_file",
"=",
"None",
")",
":",
"out_file",
"=",
"f'{in_object.__class__.__name__}_help.txt'",
"if",
"out_file",
"is",
"None",
"else",
"pathmaker",
"(",
"out_file",
")",
"import",
"sys",
"# Temporarily redirect stdout to a StringIO.",
"stdout",
"=",
"sys",
".",
"stdout",
"with",
"open",
"(",
"'helpy.txt'",
",",
"'w'",
")",
"as",
"f",
":",
"sys",
".",
"stdout",
"=",
"f",
"help",
"(",
"in_object",
")",
"# Don't forget to reset stdout!",
"sys",
".",
"stdout",
"=",
"stdout"
] | [
628,
0
] | [
648,
27
] | python | en | ['en', 'error', 'th'] | False |
BaseCache.__init__ | (self) | Initialize the cache instance. | Initialize the cache instance. | def __init__(self):
"""Initialize the cache instance."""
self._key_locks = {} | [
"def",
"__init__",
"(",
"self",
")",
":",
"self",
".",
"_key_locks",
"=",
"{",
"}"
] | [
16,
4
] | [
18,
28
] | python | en | ['en', 'en', 'en'] | True |
BaseCache.get | (self, key: Text) |
Get an item from the cache.
Args:
key: the key to retrieve an item for
Returns:
The record found or `None`
|
Get an item from the cache. | async def get(self, key: Text):
"""
Get an item from the cache.
Args:
key: the key to retrieve an item for
Returns:
The record found or `None`
""" | [
"async",
"def",
"get",
"(",
"self",
",",
"key",
":",
"Text",
")",
":"
] | [
21,
4
] | [
31,
11
] | python | en | ['en', 'error', 'th'] | False |
BaseCache.set | (self, keys: Union[Text, Sequence[Text]], value: Any, ttl: int = None) |
Add an item to the cache with an optional ttl.
Args:
keys: the key or keys for which to set an item
value: the value to store in the cache
ttl: number of second that the record should persist
|
Add an item to the cache with an optional ttl. | async def set(self, keys: Union[Text, Sequence[Text]], value: Any, ttl: int = None):
"""
Add an item to the cache with an optional ttl.
Args:
keys: the key or keys for which to set an item
value: the value to store in the cache
ttl: number of second that the record should persist
""" | [
"async",
"def",
"set",
"(",
"self",
",",
"keys",
":",
"Union",
"[",
"Text",
",",
"Sequence",
"[",
"Text",
"]",
"]",
",",
"value",
":",
"Any",
",",
"ttl",
":",
"int",
"=",
"None",
")",
":"
] | [
34,
4
] | [
43,
11
] | python | en | ['en', 'error', 'th'] | False |
BaseCache.clear | (self, key: Text) |
Remove an item from the cache, if present.
Args:
key: the key to remove
|
Remove an item from the cache, if present. | async def clear(self, key: Text):
"""
Remove an item from the cache, if present.
Args:
key: the key to remove
""" | [
"async",
"def",
"clear",
"(",
"self",
",",
"key",
":",
"Text",
")",
":"
] | [
46,
4
] | [
53,
11
] | python | en | ['en', 'error', 'th'] | False |
BaseCache.flush | (self) | Remove all items from the cache. | Remove all items from the cache. | async def flush(self):
"""Remove all items from the cache.""" | [
"async",
"def",
"flush",
"(",
"self",
")",
":"
] | [
56,
4
] | [
57,
46
] | python | en | ['en', 'en', 'en'] | True |
BaseCache.acquire | (self, key: Text) | Acquire a lock on a given cache key. | Acquire a lock on a given cache key. | def acquire(self, key: Text):
"""Acquire a lock on a given cache key."""
result = CacheKeyLock(self, key)
first = self._key_locks.setdefault(key, result)
if first is not result:
result.parent = first
return result | [
"def",
"acquire",
"(",
"self",
",",
"key",
":",
"Text",
")",
":",
"result",
"=",
"CacheKeyLock",
"(",
"self",
",",
"key",
")",
"first",
"=",
"self",
".",
"_key_locks",
".",
"setdefault",
"(",
"key",
",",
"result",
")",
"if",
"first",
"is",
"not",
"result",
":",
"result",
".",
"parent",
"=",
"first",
"return",
"result"
] | [
59,
4
] | [
65,
21
] | python | en | ['en', 'en', 'en'] | True |
BaseCache.release | (self, key: Text) | Release the lock on a given cache key. | Release the lock on a given cache key. | def release(self, key: Text):
"""Release the lock on a given cache key."""
if key in self._key_locks:
del self._key_locks[key] | [
"def",
"release",
"(",
"self",
",",
"key",
":",
"Text",
")",
":",
"if",
"key",
"in",
"self",
".",
"_key_locks",
":",
"del",
"self",
".",
"_key_locks",
"[",
"key",
"]"
] | [
67,
4
] | [
70,
36
] | python | en | ['en', 'en', 'en'] | True |
BaseCache.__repr__ | (self) | Human readable representation of `BaseStorageRecordSearch`. | Human readable representation of `BaseStorageRecordSearch`. | def __repr__(self) -> str:
"""Human readable representation of `BaseStorageRecordSearch`."""
return "<{}>".format(self.__class__.__name__) | [
"def",
"__repr__",
"(",
"self",
")",
"->",
"str",
":",
"return",
"\"<{}>\"",
".",
"format",
"(",
"self",
".",
"__class__",
".",
"__name__",
")"
] | [
72,
4
] | [
74,
53
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock.__init__ | (self, cache: BaseCache, key: Text) | Initialize the key lock. | Initialize the key lock. | def __init__(self, cache: BaseCache, key: Text):
"""Initialize the key lock."""
self.cache = cache
self.exception: BaseException = None
self.key = key
self.released = False
self._future: asyncio.Future = asyncio.get_event_loop().create_future()
self._parent: "CacheKeyLock" = None | [
"def",
"__init__",
"(",
"self",
",",
"cache",
":",
"BaseCache",
",",
"key",
":",
"Text",
")",
":",
"self",
".",
"cache",
"=",
"cache",
"self",
".",
"exception",
":",
"BaseException",
"=",
"None",
"self",
".",
"key",
"=",
"key",
"self",
".",
"released",
"=",
"False",
"self",
".",
"_future",
":",
"asyncio",
".",
"Future",
"=",
"asyncio",
".",
"get_event_loop",
"(",
")",
".",
"create_future",
"(",
")",
"self",
".",
"_parent",
":",
"\"CacheKeyLock\"",
"=",
"None"
] | [
85,
4
] | [
92,
43
] | python | en | ['en', 'pl', 'en'] | True |
CacheKeyLock.done | (self) | Accessor for the done state. | Accessor for the done state. | def done(self) -> bool:
"""Accessor for the done state."""
return self._future.done() | [
"def",
"done",
"(",
"self",
")",
"->",
"bool",
":",
"return",
"self",
".",
"_future",
".",
"done",
"(",
")"
] | [
95,
4
] | [
97,
34
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock.future | (self) | Fetch the result in the form of an awaitable future. | Fetch the result in the form of an awaitable future. | def future(self) -> asyncio.Future:
"""Fetch the result in the form of an awaitable future."""
return self._future | [
"def",
"future",
"(",
"self",
")",
"->",
"asyncio",
".",
"Future",
":",
"return",
"self",
".",
"_future"
] | [
100,
4
] | [
102,
27
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock.result | (self) | Fetch the current result, if any. | Fetch the current result, if any. | def result(self) -> Any:
"""Fetch the current result, if any."""
if self.done:
return self._future.result() | [
"def",
"result",
"(",
"self",
")",
"->",
"Any",
":",
"if",
"self",
".",
"done",
":",
"return",
"self",
".",
"_future",
".",
"result",
"(",
")"
] | [
105,
4
] | [
108,
40
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock.parent | (self) | Accessor for the parent key lock, if any. | Accessor for the parent key lock, if any. | def parent(self) -> "CacheKeyLock":
"""Accessor for the parent key lock, if any."""
return self._parent | [
"def",
"parent",
"(",
"self",
")",
"->",
"\"CacheKeyLock\"",
":",
"return",
"self",
".",
"_parent"
] | [
111,
4
] | [
113,
27
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock.parent | (self, parent: "CacheKeyLock") | Setter for the parent lock. | Setter for the parent lock. | def parent(self, parent: "CacheKeyLock"):
"""Setter for the parent lock."""
self._parent = parent
parent._future.add_done_callback(self._handle_parent_done) | [
"def",
"parent",
"(",
"self",
",",
"parent",
":",
"\"CacheKeyLock\"",
")",
":",
"self",
".",
"_parent",
"=",
"parent",
"parent",
".",
"_future",
".",
"add_done_callback",
"(",
"self",
".",
"_handle_parent_done",
")"
] | [
116,
4
] | [
119,
66
] | python | en | ['en', 'en', 'en'] | True |
CacheKeyLock._handle_parent_done | (self, fut: asyncio.Future) | Handle completion of parent's future. | Handle completion of parent's future. | def _handle_parent_done(self, fut: asyncio.Future):
"""Handle completion of parent's future."""
result = fut.result()
if result:
self._future.set_result(fut.result()) | [
"def",
"_handle_parent_done",
"(",
"self",
",",
"fut",
":",
"asyncio",
".",
"Future",
")",
":",
"result",
"=",
"fut",
".",
"result",
"(",
")",
"if",
"result",
":",
"self",
".",
"_future",
".",
"set_result",
"(",
"fut",
".",
"result",
"(",
")",
")"
] | [
121,
4
] | [
125,
49
] | python | en | ['en', 'en', 'en'] | True |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.