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 |
---|---|---|---|---|---|---|---|---|---|---|---|
ClassifierAgent._format_interactive_output | (self, probs, prediction_id) |
Format interactive mode output with scores.
|
Format interactive mode output with scores.
| def _format_interactive_output(self, probs, prediction_id):
"""
Format interactive mode output with scores.
"""
preds = []
for i, pred_id in enumerate(prediction_id.tolist()):
prob = round_sigfigs(probs[i][pred_id], 4)
preds.append(
'Predicted class: {}\nwith probability: {}'.format(
self.class_list[pred_id], prob
)
)
return preds | [
"def",
"_format_interactive_output",
"(",
"self",
",",
"probs",
",",
"prediction_id",
")",
":",
"preds",
"=",
"[",
"]",
"for",
"i",
",",
"pred_id",
"in",
"enumerate",
"(",
"prediction_id",
".",
"tolist",
"(",
")",
")",
":",
"prob",
"=",
"round_sigfigs",
"(",
"probs",
"[",
"i",
"]",
"[",
"pred_id",
"]",
",",
"4",
")",
"preds",
".",
"append",
"(",
"'Predicted class: {}\\nwith probability: {}'",
".",
"format",
"(",
"self",
".",
"class_list",
"[",
"pred_id",
"]",
",",
"prob",
")",
")",
"return",
"preds"
] | [
154,
4
] | [
166,
20
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.train_step | (self, batch) |
Train on a single batch of examples.
|
Train on a single batch of examples.
| def train_step(self, batch):
"""
Train on a single batch of examples.
"""
if batch.text_vec is None:
return Output()
self.model.train()
self.zero_grad()
# Calculate loss
labels = self._get_label_tensor(batch)
scores = self.score(batch)
loss = self.criterion(scores, labels)
self.record_local_metric('loss', AverageMetric.many(loss))
loss = loss.mean()
self.backward(loss)
self.update_params()
# Get predictions
_, prediction_id = torch.max(scores.float().cpu(), 1)
preds = [self.class_list[idx] for idx in prediction_id]
labels_field = self.get_labels_field(batch['observations'])
labels_lst = self._get_labels(batch['observations'], labels_field)
self._update_confusion_matrix(preds, labels_lst)
return Output(preds) | [
"def",
"train_step",
"(",
"self",
",",
"batch",
")",
":",
"if",
"batch",
".",
"text_vec",
"is",
"None",
":",
"return",
"Output",
"(",
")",
"self",
".",
"model",
".",
"train",
"(",
")",
"self",
".",
"zero_grad",
"(",
")",
"# Calculate loss",
"labels",
"=",
"self",
".",
"_get_label_tensor",
"(",
"batch",
")",
"scores",
"=",
"self",
".",
"score",
"(",
"batch",
")",
"loss",
"=",
"self",
".",
"criterion",
"(",
"scores",
",",
"labels",
")",
"self",
".",
"record_local_metric",
"(",
"'loss'",
",",
"AverageMetric",
".",
"many",
"(",
"loss",
")",
")",
"loss",
"=",
"loss",
".",
"mean",
"(",
")",
"self",
".",
"backward",
"(",
"loss",
")",
"self",
".",
"update_params",
"(",
")",
"# Get predictions",
"_",
",",
"prediction_id",
"=",
"torch",
".",
"max",
"(",
"scores",
".",
"float",
"(",
")",
".",
"cpu",
"(",
")",
",",
"1",
")",
"preds",
"=",
"[",
"self",
".",
"class_list",
"[",
"idx",
"]",
"for",
"idx",
"in",
"prediction_id",
"]",
"labels_field",
"=",
"self",
".",
"get_labels_field",
"(",
"batch",
"[",
"'observations'",
"]",
")",
"labels_lst",
"=",
"self",
".",
"_get_labels",
"(",
"batch",
"[",
"'observations'",
"]",
",",
"labels_field",
")",
"self",
".",
"_update_confusion_matrix",
"(",
"preds",
",",
"labels_lst",
")",
"return",
"Output",
"(",
"preds",
")"
] | [
177,
4
] | [
202,
28
] | python | en | ['en', 'error', 'th'] | False |
ClassifierAgent.eval_step | (self, batch) |
Evaluate a single batch of examples.
|
Evaluate a single batch of examples.
| def eval_step(self, batch):
"""
Evaluate a single batch of examples.
"""
if batch.text_vec is None:
return
self.model.eval()
scores = self.score(batch)
probs = F.softmax(scores, dim=1)
_, prediction_id = torch.max(probs.float().cpu(), 1)
preds = [self.class_list[idx] for idx in prediction_id]
if batch.labels is None or self.opt['ignore_labels']:
# interactive mode
if self.opt.get('print_scores', False):
preds = self._format_interactive_output(probs, prediction_id)
else:
labels = self._get_label_tensor(batch)
loss = self.criterion(scores, labels)
self.record_local_metric('loss', AverageMetric.many(loss))
preds = [self.class_list[idx] for idx in prediction_id]
labels_field = self.get_labels_field(batch['observations'])
if preds is not None and labels_field is not None:
labels_lst = self._get_labels(batch['observations'], labels_field)
self._update_confusion_matrix(preds, labels_lst)
if self.opt.get('print_scores', False):
return Output(preds, probs=probs.cpu())
else:
return Output(preds) | [
"def",
"eval_step",
"(",
"self",
",",
"batch",
")",
":",
"if",
"batch",
".",
"text_vec",
"is",
"None",
":",
"return",
"self",
".",
"model",
".",
"eval",
"(",
")",
"scores",
"=",
"self",
".",
"score",
"(",
"batch",
")",
"probs",
"=",
"F",
".",
"softmax",
"(",
"scores",
",",
"dim",
"=",
"1",
")",
"_",
",",
"prediction_id",
"=",
"torch",
".",
"max",
"(",
"probs",
".",
"float",
"(",
")",
".",
"cpu",
"(",
")",
",",
"1",
")",
"preds",
"=",
"[",
"self",
".",
"class_list",
"[",
"idx",
"]",
"for",
"idx",
"in",
"prediction_id",
"]",
"if",
"batch",
".",
"labels",
"is",
"None",
"or",
"self",
".",
"opt",
"[",
"'ignore_labels'",
"]",
":",
"# interactive mode",
"if",
"self",
".",
"opt",
".",
"get",
"(",
"'print_scores'",
",",
"False",
")",
":",
"preds",
"=",
"self",
".",
"_format_interactive_output",
"(",
"probs",
",",
"prediction_id",
")",
"else",
":",
"labels",
"=",
"self",
".",
"_get_label_tensor",
"(",
"batch",
")",
"loss",
"=",
"self",
".",
"criterion",
"(",
"scores",
",",
"labels",
")",
"self",
".",
"record_local_metric",
"(",
"'loss'",
",",
"AverageMetric",
".",
"many",
"(",
"loss",
")",
")",
"preds",
"=",
"[",
"self",
".",
"class_list",
"[",
"idx",
"]",
"for",
"idx",
"in",
"prediction_id",
"]",
"labels_field",
"=",
"self",
".",
"get_labels_field",
"(",
"batch",
"[",
"'observations'",
"]",
")",
"if",
"preds",
"is",
"not",
"None",
"and",
"labels_field",
"is",
"not",
"None",
":",
"labels_lst",
"=",
"self",
".",
"_get_labels",
"(",
"batch",
"[",
"'observations'",
"]",
",",
"labels_field",
")",
"self",
".",
"_update_confusion_matrix",
"(",
"preds",
",",
"labels_lst",
")",
"if",
"self",
".",
"opt",
".",
"get",
"(",
"'print_scores'",
",",
"False",
")",
":",
"return",
"Output",
"(",
"preds",
",",
"probs",
"=",
"probs",
".",
"cpu",
"(",
")",
")",
"else",
":",
"return",
"Output",
"(",
"preds",
")"
] | [
204,
4
] | [
236,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.color | (self) |
Sets the line color.
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.
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.
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.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\"",
"]"
] | [
74,
4
] | [
91,
27
] | python | en | ['en', 'error', 'th'] | False |
Line.shape | (self) |
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv']
Returns
-------
Any
|
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv'] | def shape(self):
"""
Determines the line shape. With "spline" the lines are drawn
using spline interpolation. The other available values
correspond to step-wise line shapes.
The 'shape' property is an enumeration that may be specified as:
- One of the following enumeration values:
['linear', 'spline', 'hv', 'vh', 'hvh', 'vhv']
Returns
-------
Any
"""
return self["shape"] | [
"def",
"shape",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"shape\"",
"]"
] | [
100,
4
] | [
114,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.simplify | (self) |
Simplifies lines by removing nearly-collinear points. When
transitioning lines, it may be desirable to disable this so
that the number of points along the resulting SVG path is
unaffected.
The 'simplify' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Simplifies lines by removing nearly-collinear points. When
transitioning lines, it may be desirable to disable this so
that the number of points along the resulting SVG path is
unaffected.
The 'simplify' property must be specified as a bool
(either True, or False) | def simplify(self):
"""
Simplifies lines by removing nearly-collinear points. When
transitioning lines, it may be desirable to disable this so
that the number of points along the resulting SVG path is
unaffected.
The 'simplify' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["simplify"] | [
"def",
"simplify",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"simplify\"",
"]"
] | [
123,
4
] | [
137,
31
] | python | en | ['en', 'error', 'th'] | False |
Line.smoothing | (self) |
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3]
Returns
-------
int|float
|
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
The 'smoothing' property is a number and may be specified as:
- An int or float in the interval [0, 1.3] | def smoothing(self):
"""
Has an effect only if `shape` is set to "spline" Sets the
amount of smoothing. 0 corresponds to no smoothing (equivalent
to a "linear" shape).
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\"",
"]"
] | [
146,
4
] | [
159,
32
] | python | en | ['en', 'error', 'th'] | False |
Line.width | (self) |
Sets the line width (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 line width (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 line width (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\"",
"]"
] | [
168,
4
] | [
179,
28
] | python | en | ['en', 'error', 'th'] | False |
Line.__init__ | (
self,
arg=None,
color=None,
dash=None,
shape=None,
simplify=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.scatter.Line`
color
Sets the line color.
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").
shape
Determines the line shape. With "spline" the lines are
drawn using spline interpolation. The other available
values correspond to step-wise line shapes.
simplify
Simplifies lines by removing nearly-collinear points.
When transitioning lines, it may be desirable to
disable this so that the number of points along the
resulting SVG path is unaffected.
smoothing
Has an effect only if `shape` is set to "spline" Sets
the amount of smoothing. 0 corresponds to no smoothing
(equivalent to a "linear" shape).
width
Sets the line width (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.scatter.Line`
color
Sets the line color.
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").
shape
Determines the line shape. With "spline" the lines are
drawn using spline interpolation. The other available
values correspond to step-wise line shapes.
simplify
Simplifies lines by removing nearly-collinear points.
When transitioning lines, it may be desirable to
disable this so that the number of points along the
resulting SVG path is unaffected.
smoothing
Has an effect only if `shape` is set to "spline" Sets
the amount of smoothing. 0 corresponds to no smoothing
(equivalent to a "linear" shape).
width
Sets the line width (in px). | def __init__(
self,
arg=None,
color=None,
dash=None,
shape=None,
simplify=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.scatter.Line`
color
Sets the line color.
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").
shape
Determines the line shape. With "spline" the lines are
drawn using spline interpolation. The other available
values correspond to step-wise line shapes.
simplify
Simplifies lines by removing nearly-collinear points.
When transitioning lines, it may be desirable to
disable this so that the number of points along the
resulting SVG path is unaffected.
smoothing
Has an effect only if `shape` is set to "spline" Sets
the amount of smoothing. 0 corresponds to no smoothing
(equivalent to a "linear" shape).
width
Sets the line width (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.scatter.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scatter.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("shape", None)
_v = shape if shape is not None else _v
if _v is not None:
self["shape"] = _v
_v = arg.pop("simplify", None)
_v = simplify if simplify is not None else _v
if _v is not None:
self["simplify"] = _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",
",",
"shape",
"=",
"None",
",",
"simplify",
"=",
"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.scatter.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scatter.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",
"(",
"\"shape\"",
",",
"None",
")",
"_v",
"=",
"shape",
"if",
"shape",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"shape\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"simplify\"",
",",
"None",
")",
"_v",
"=",
"simplify",
"if",
"simplify",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"simplify\"",
"]",
"=",
"_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"
] | [
214,
4
] | [
320,
34
] | python | en | ['en', 'error', 'th'] | False |
list_bans | (banlist) |
Helper function to display a list of active bans. Input argument
is the banlist read into the two commands @ban and @unban below.
|
Helper function to display a list of active bans. Input argument
is the banlist read into the two commands | def list_bans(banlist):
"""
Helper function to display a list of active bans. Input argument
is the banlist read into the two commands @ban and @unban below.
"""
if not banlist:
return "No active bans were found."
table = evtable.EvTable("|wid", "|wname/ip", "|wdate", "|wreason")
for inum, ban in enumerate(banlist):
table.add_row(str(inum + 1),
ban[0] and ban[0] or ban[1],
ban[3], ban[4])
return "|wActive bans:|n\n%s" % table | [
"def",
"list_bans",
"(",
"banlist",
")",
":",
"if",
"not",
"banlist",
":",
"return",
"\"No active bans were found.\"",
"table",
"=",
"evtable",
".",
"EvTable",
"(",
"\"|wid\"",
",",
"\"|wname/ip\"",
",",
"\"|wdate\"",
",",
"\"|wreason\"",
")",
"for",
"inum",
",",
"ban",
"in",
"enumerate",
"(",
"banlist",
")",
":",
"table",
".",
"add_row",
"(",
"str",
"(",
"inum",
"+",
"1",
")",
",",
"ban",
"[",
"0",
"]",
"and",
"ban",
"[",
"0",
"]",
"or",
"ban",
"[",
"1",
"]",
",",
"ban",
"[",
"3",
"]",
",",
"ban",
"[",
"4",
"]",
")",
"return",
"\"|wActive bans:|n\\n%s\"",
"%",
"table"
] | [
103,
0
] | [
116,
41
] | python | en | ['en', 'error', 'th'] | False |
CmdBoot.func | (self) | Implementing the function | Implementing the function | def func(self):
"""Implementing the function"""
caller = self.caller
args = self.args
if not args:
caller.msg("Usage: @boot[/switches] <account> [:reason]")
return
if ':' in args:
args, reason = [a.strip() for a in args.split(':', 1)]
else:
args, reason = args, ""
boot_list = []
if 'sid' in self.switches:
# Boot a particular session id.
sessions = SESSIONS.get_sessions(True)
for sess in sessions:
# Find the session with the matching session id.
if sess.sessid == int(args):
boot_list.append(sess)
break
else:
# Boot by account object
pobj = search.account_search(args)
if not pobj:
caller.msg("Account %s was not found." % args)
return
pobj = pobj[0]
if not pobj.access(caller, 'boot'):
string = "You don't have the permission to boot %s." % (pobj.key, )
caller.msg(string)
return
# we have a bootable object with a connected user
matches = SESSIONS.sessions_from_account(pobj)
for match in matches:
boot_list.append(match)
if not boot_list:
caller.msg("No matching sessions found. The Account does not seem to be online.")
return
# Carry out the booting of the sessions in the boot list.
feedback = None
if 'quiet' not in self.switches:
feedback = "You have been disconnected by %s.\n" % caller.name
if reason:
feedback += "\nReason given: %s" % reason
for session in boot_list:
session.msg(feedback)
session.account.disconnect_session_from_account(session) | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"args",
"=",
"self",
".",
"args",
"if",
"not",
"args",
":",
"caller",
".",
"msg",
"(",
"\"Usage: @boot[/switches] <account> [:reason]\"",
")",
"return",
"if",
"':'",
"in",
"args",
":",
"args",
",",
"reason",
"=",
"[",
"a",
".",
"strip",
"(",
")",
"for",
"a",
"in",
"args",
".",
"split",
"(",
"':'",
",",
"1",
")",
"]",
"else",
":",
"args",
",",
"reason",
"=",
"args",
",",
"\"\"",
"boot_list",
"=",
"[",
"]",
"if",
"'sid'",
"in",
"self",
".",
"switches",
":",
"# Boot a particular session id.",
"sessions",
"=",
"SESSIONS",
".",
"get_sessions",
"(",
"True",
")",
"for",
"sess",
"in",
"sessions",
":",
"# Find the session with the matching session id.",
"if",
"sess",
".",
"sessid",
"==",
"int",
"(",
"args",
")",
":",
"boot_list",
".",
"append",
"(",
"sess",
")",
"break",
"else",
":",
"# Boot by account object",
"pobj",
"=",
"search",
".",
"account_search",
"(",
"args",
")",
"if",
"not",
"pobj",
":",
"caller",
".",
"msg",
"(",
"\"Account %s was not found.\"",
"%",
"args",
")",
"return",
"pobj",
"=",
"pobj",
"[",
"0",
"]",
"if",
"not",
"pobj",
".",
"access",
"(",
"caller",
",",
"'boot'",
")",
":",
"string",
"=",
"\"You don't have the permission to boot %s.\"",
"%",
"(",
"pobj",
".",
"key",
",",
")",
"caller",
".",
"msg",
"(",
"string",
")",
"return",
"# we have a bootable object with a connected user",
"matches",
"=",
"SESSIONS",
".",
"sessions_from_account",
"(",
"pobj",
")",
"for",
"match",
"in",
"matches",
":",
"boot_list",
".",
"append",
"(",
"match",
")",
"if",
"not",
"boot_list",
":",
"caller",
".",
"msg",
"(",
"\"No matching sessions found. The Account does not seem to be online.\"",
")",
"return",
"# Carry out the booting of the sessions in the boot list.",
"feedback",
"=",
"None",
"if",
"'quiet'",
"not",
"in",
"self",
".",
"switches",
":",
"feedback",
"=",
"\"You have been disconnected by %s.\\n\"",
"%",
"caller",
".",
"name",
"if",
"reason",
":",
"feedback",
"+=",
"\"\\nReason given: %s\"",
"%",
"reason",
"for",
"session",
"in",
"boot_list",
":",
"session",
".",
"msg",
"(",
"feedback",
")",
"session",
".",
"account",
".",
"disconnect_session_from_account",
"(",
"session",
")"
] | [
42,
4
] | [
96,
68
] | python | en | ['en', 'en', 'en'] | True |
CmdBan.func | (self) |
Bans are stored in a serverconf db object as a list of
dictionaries:
[ (name, ip, ipregex, date, reason),
(name, ip, ipregex, date, reason),... ]
where name and ip are set by the user and are shown in
lists. ipregex is a converted form of ip where the * is
replaced by an appropriate regex pattern for fast
matching. date is the time stamp the ban was instigated and
'reason' is any optional info given to the command. Unset
values in each tuple is set to the empty string.
|
Bans are stored in a serverconf db object as a list of
dictionaries:
[ (name, ip, ipregex, date, reason),
(name, ip, ipregex, date, reason),... ]
where name and ip are set by the user and are shown in
lists. ipregex is a converted form of ip where the * is
replaced by an appropriate regex pattern for fast
matching. date is the time stamp the ban was instigated and
'reason' is any optional info given to the command. Unset
values in each tuple is set to the empty string.
| def func(self):
"""
Bans are stored in a serverconf db object as a list of
dictionaries:
[ (name, ip, ipregex, date, reason),
(name, ip, ipregex, date, reason),... ]
where name and ip are set by the user and are shown in
lists. ipregex is a converted form of ip where the * is
replaced by an appropriate regex pattern for fast
matching. date is the time stamp the ban was instigated and
'reason' is any optional info given to the command. Unset
values in each tuple is set to the empty string.
"""
banlist = ServerConfig.objects.conf('server_bans')
if not banlist:
banlist = []
if not self.args or (self.switches and
not any(switch in ('ip', 'name')
for switch in self.switches)):
self.caller.msg(list_bans(banlist))
return
now = time.ctime()
reason = ""
if ':' in self.args:
ban, reason = self.args.rsplit(':', 1)
else:
ban = self.args
ban = ban.lower()
ipban = IPREGEX.findall(ban)
if not ipban:
# store as name
typ = "Name"
bantup = (ban, "", "", now, reason)
else:
# an ip address.
typ = "IP"
ban = ipban[0]
# replace * with regex form and compile it
ipregex = ban.replace('.', '\.')
ipregex = ipregex.replace('*', '[0-9]{1,3}')
ipregex = re.compile(r"%s" % ipregex)
bantup = ("", ban, ipregex, now, reason)
# save updated banlist
banlist.append(bantup)
ServerConfig.objects.conf('server_bans', banlist)
self.caller.msg("%s-Ban |w%s|n was added." % (typ, ban)) | [
"def",
"func",
"(",
"self",
")",
":",
"banlist",
"=",
"ServerConfig",
".",
"objects",
".",
"conf",
"(",
"'server_bans'",
")",
"if",
"not",
"banlist",
":",
"banlist",
"=",
"[",
"]",
"if",
"not",
"self",
".",
"args",
"or",
"(",
"self",
".",
"switches",
"and",
"not",
"any",
"(",
"switch",
"in",
"(",
"'ip'",
",",
"'name'",
")",
"for",
"switch",
"in",
"self",
".",
"switches",
")",
")",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"list_bans",
"(",
"banlist",
")",
")",
"return",
"now",
"=",
"time",
".",
"ctime",
"(",
")",
"reason",
"=",
"\"\"",
"if",
"':'",
"in",
"self",
".",
"args",
":",
"ban",
",",
"reason",
"=",
"self",
".",
"args",
".",
"rsplit",
"(",
"':'",
",",
"1",
")",
"else",
":",
"ban",
"=",
"self",
".",
"args",
"ban",
"=",
"ban",
".",
"lower",
"(",
")",
"ipban",
"=",
"IPREGEX",
".",
"findall",
"(",
"ban",
")",
"if",
"not",
"ipban",
":",
"# store as name",
"typ",
"=",
"\"Name\"",
"bantup",
"=",
"(",
"ban",
",",
"\"\"",
",",
"\"\"",
",",
"now",
",",
"reason",
")",
"else",
":",
"# an ip address.",
"typ",
"=",
"\"IP\"",
"ban",
"=",
"ipban",
"[",
"0",
"]",
"# replace * with regex form and compile it",
"ipregex",
"=",
"ban",
".",
"replace",
"(",
"'.'",
",",
"'\\.'",
")",
"ipregex",
"=",
"ipregex",
".",
"replace",
"(",
"'*'",
",",
"'[0-9]{1,3}'",
")",
"ipregex",
"=",
"re",
".",
"compile",
"(",
"r\"%s\"",
"%",
"ipregex",
")",
"bantup",
"=",
"(",
"\"\"",
",",
"ban",
",",
"ipregex",
",",
"now",
",",
"reason",
")",
"# save updated banlist",
"banlist",
".",
"append",
"(",
"bantup",
")",
"ServerConfig",
".",
"objects",
".",
"conf",
"(",
"'server_bans'",
",",
"banlist",
")",
"self",
".",
"caller",
".",
"msg",
"(",
"\"%s-Ban |w%s|n was added.\"",
"%",
"(",
"typ",
",",
"ban",
")",
")"
] | [
157,
4
] | [
204,
64
] | python | en | ['en', 'error', 'th'] | False |
CmdUnban.func | (self) | Implement unbanning | Implement unbanning | def func(self):
"""Implement unbanning"""
banlist = ServerConfig.objects.conf('server_bans')
if not self.args:
self.caller.msg(list_bans(banlist))
return
try:
num = int(self.args)
except Exception:
self.caller.msg("You must supply a valid ban id to clear.")
return
if not banlist:
self.caller.msg("There are no bans to clear.")
elif not (0 < num < len(banlist) + 1):
self.caller.msg("Ban id |w%s|x was not found." % self.args)
else:
# all is ok, clear ban
ban = banlist[num - 1]
del banlist[num - 1]
ServerConfig.objects.conf('server_bans', banlist)
self.caller.msg("Cleared ban %s: %s" %
(num, " ".join([s for s in ban[:2]]))) | [
"def",
"func",
"(",
"self",
")",
":",
"banlist",
"=",
"ServerConfig",
".",
"objects",
".",
"conf",
"(",
"'server_bans'",
")",
"if",
"not",
"self",
".",
"args",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"list_bans",
"(",
"banlist",
")",
")",
"return",
"try",
":",
"num",
"=",
"int",
"(",
"self",
".",
"args",
")",
"except",
"Exception",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"\"You must supply a valid ban id to clear.\"",
")",
"return",
"if",
"not",
"banlist",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"\"There are no bans to clear.\"",
")",
"elif",
"not",
"(",
"0",
"<",
"num",
"<",
"len",
"(",
"banlist",
")",
"+",
"1",
")",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"\"Ban id |w%s|x was not found.\"",
"%",
"self",
".",
"args",
")",
"else",
":",
"# all is ok, clear ban",
"ban",
"=",
"banlist",
"[",
"num",
"-",
"1",
"]",
"del",
"banlist",
"[",
"num",
"-",
"1",
"]",
"ServerConfig",
".",
"objects",
".",
"conf",
"(",
"'server_bans'",
",",
"banlist",
")",
"self",
".",
"caller",
".",
"msg",
"(",
"\"Cleared ban %s: %s\"",
"%",
"(",
"num",
",",
"\" \"",
".",
"join",
"(",
"[",
"s",
"for",
"s",
"in",
"ban",
"[",
":",
"2",
"]",
"]",
")",
")",
")"
] | [
224,
4
] | [
249,
66
] | python | de | ['de', 'fr', 'en'] | False |
CmdDelAccount.func | (self) | Implements the command. | Implements the command. | def func(self):
"""Implements the command."""
caller = self.caller
args = self.args
if hasattr(caller, 'account'):
caller = caller.account
if not args:
self.msg("Usage: @delaccount <account/user name or #id> [: reason]")
return
reason = ""
if ':' in args:
args, reason = [arg.strip() for arg in args.split(':', 1)]
# We use account_search since we want to be sure to find also accounts
# that lack characters.
accounts = search.account_search(args)
if not accounts:
self.msg('Could not find an account by that name.')
return
if len(accounts) > 1:
string = "There were multiple matches:\n"
string += "\n".join(" %s %s" % (account.id, account.key) for account in accounts)
self.msg(string)
return
# one single match
account = accounts.first()
if not account.access(caller, 'delete'):
string = "You don't have the permissions to delete that account."
self.msg(string)
return
uname = account.username
# boot the account then delete
self.msg("Informing and disconnecting account ...")
string = "\nYour account '%s' is being *permanently* deleted.\n" % uname
if reason:
string += " Reason given:\n '%s'" % reason
account.msg(string)
account.delete()
self.msg("Account %s was successfully deleted." % uname) | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"args",
"=",
"self",
".",
"args",
"if",
"hasattr",
"(",
"caller",
",",
"'account'",
")",
":",
"caller",
"=",
"caller",
".",
"account",
"if",
"not",
"args",
":",
"self",
".",
"msg",
"(",
"\"Usage: @delaccount <account/user name or #id> [: reason]\"",
")",
"return",
"reason",
"=",
"\"\"",
"if",
"':'",
"in",
"args",
":",
"args",
",",
"reason",
"=",
"[",
"arg",
".",
"strip",
"(",
")",
"for",
"arg",
"in",
"args",
".",
"split",
"(",
"':'",
",",
"1",
")",
"]",
"# We use account_search since we want to be sure to find also accounts",
"# that lack characters.",
"accounts",
"=",
"search",
".",
"account_search",
"(",
"args",
")",
"if",
"not",
"accounts",
":",
"self",
".",
"msg",
"(",
"'Could not find an account by that name.'",
")",
"return",
"if",
"len",
"(",
"accounts",
")",
">",
"1",
":",
"string",
"=",
"\"There were multiple matches:\\n\"",
"string",
"+=",
"\"\\n\"",
".",
"join",
"(",
"\" %s %s\"",
"%",
"(",
"account",
".",
"id",
",",
"account",
".",
"key",
")",
"for",
"account",
"in",
"accounts",
")",
"self",
".",
"msg",
"(",
"string",
")",
"return",
"# one single match",
"account",
"=",
"accounts",
".",
"first",
"(",
")",
"if",
"not",
"account",
".",
"access",
"(",
"caller",
",",
"'delete'",
")",
":",
"string",
"=",
"\"You don't have the permissions to delete that account.\"",
"self",
".",
"msg",
"(",
"string",
")",
"return",
"uname",
"=",
"account",
".",
"username",
"# boot the account then delete",
"self",
".",
"msg",
"(",
"\"Informing and disconnecting account ...\"",
")",
"string",
"=",
"\"\\nYour account '%s' is being *permanently* deleted.\\n\"",
"%",
"uname",
"if",
"reason",
":",
"string",
"+=",
"\" Reason given:\\n '%s'\"",
"%",
"reason",
"account",
".",
"msg",
"(",
"string",
")",
"account",
".",
"delete",
"(",
")",
"self",
".",
"msg",
"(",
"\"Account %s was successfully deleted.\"",
"%",
"uname",
")"
] | [
272,
4
] | [
320,
64
] | python | en | ['en', 'en', 'en'] | True |
CmdEmit.func | (self) | Implement the command | Implement the command | def func(self):
"""Implement the command"""
caller = self.caller
args = self.args
if not args:
string = "Usage: "
string += "\n@emit[/switches] [<obj>, <obj>, ... =] <message>"
string += "\n@remit [<obj>, <obj>, ... =] <message>"
string += "\n@pemit [<obj>, <obj>, ... =] <message>"
caller.msg(string)
return
rooms_only = 'rooms' in self.switches
accounts_only = 'accounts' in self.switches
send_to_contents = 'contents' in self.switches
# we check which command was used to force the switches
if self.cmdstring == '@remit':
rooms_only = True
send_to_contents = True
elif self.cmdstring == '@pemit':
accounts_only = True
if not self.rhs:
message = self.args
objnames = [caller.location.key]
else:
message = self.rhs
objnames = self.lhslist
# send to all objects
for objname in objnames:
obj = caller.search(objname, global_search=True)
if not obj:
return
if rooms_only and obj.location is not None:
caller.msg("%s is not a room. Ignored." % objname)
continue
if accounts_only and not obj.has_account:
caller.msg("%s has no active account. Ignored." % objname)
continue
if obj.access(caller, 'tell'):
obj.msg(message)
if send_to_contents and hasattr(obj, "msg_contents"):
obj.msg_contents(message)
caller.msg("Emitted to %s and contents:\n%s" % (objname, message))
else:
caller.msg("Emitted to %s:\n%s" % (objname, message))
else:
caller.msg("You are not allowed to emit to %s." % objname) | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"args",
"=",
"self",
".",
"args",
"if",
"not",
"args",
":",
"string",
"=",
"\"Usage: \"",
"string",
"+=",
"\"\\n@emit[/switches] [<obj>, <obj>, ... =] <message>\"",
"string",
"+=",
"\"\\n@remit [<obj>, <obj>, ... =] <message>\"",
"string",
"+=",
"\"\\n@pemit [<obj>, <obj>, ... =] <message>\"",
"caller",
".",
"msg",
"(",
"string",
")",
"return",
"rooms_only",
"=",
"'rooms'",
"in",
"self",
".",
"switches",
"accounts_only",
"=",
"'accounts'",
"in",
"self",
".",
"switches",
"send_to_contents",
"=",
"'contents'",
"in",
"self",
".",
"switches",
"# we check which command was used to force the switches",
"if",
"self",
".",
"cmdstring",
"==",
"'@remit'",
":",
"rooms_only",
"=",
"True",
"send_to_contents",
"=",
"True",
"elif",
"self",
".",
"cmdstring",
"==",
"'@pemit'",
":",
"accounts_only",
"=",
"True",
"if",
"not",
"self",
".",
"rhs",
":",
"message",
"=",
"self",
".",
"args",
"objnames",
"=",
"[",
"caller",
".",
"location",
".",
"key",
"]",
"else",
":",
"message",
"=",
"self",
".",
"rhs",
"objnames",
"=",
"self",
".",
"lhslist",
"# send to all objects",
"for",
"objname",
"in",
"objnames",
":",
"obj",
"=",
"caller",
".",
"search",
"(",
"objname",
",",
"global_search",
"=",
"True",
")",
"if",
"not",
"obj",
":",
"return",
"if",
"rooms_only",
"and",
"obj",
".",
"location",
"is",
"not",
"None",
":",
"caller",
".",
"msg",
"(",
"\"%s is not a room. Ignored.\"",
"%",
"objname",
")",
"continue",
"if",
"accounts_only",
"and",
"not",
"obj",
".",
"has_account",
":",
"caller",
".",
"msg",
"(",
"\"%s has no active account. Ignored.\"",
"%",
"objname",
")",
"continue",
"if",
"obj",
".",
"access",
"(",
"caller",
",",
"'tell'",
")",
":",
"obj",
".",
"msg",
"(",
"message",
")",
"if",
"send_to_contents",
"and",
"hasattr",
"(",
"obj",
",",
"\"msg_contents\"",
")",
":",
"obj",
".",
"msg_contents",
"(",
"message",
")",
"caller",
".",
"msg",
"(",
"\"Emitted to %s and contents:\\n%s\"",
"%",
"(",
"objname",
",",
"message",
")",
")",
"else",
":",
"caller",
".",
"msg",
"(",
"\"Emitted to %s:\\n%s\"",
"%",
"(",
"objname",
",",
"message",
")",
")",
"else",
":",
"caller",
".",
"msg",
"(",
"\"You are not allowed to emit to %s.\"",
"%",
"objname",
")"
] | [
349,
4
] | [
400,
74
] | python | en | ['en', 'en', 'en'] | True |
CmdNewPassword.func | (self) | Implement the function. | Implement the function. | def func(self):
"""Implement the function."""
caller = self.caller
if not self.rhs:
self.msg("Usage: @userpassword <user obj> = <new password>")
return
# the account search also matches 'me' etc.
account = caller.search_account(self.lhs)
if not account:
return
newpass = self.rhs
# Validate password
validated, error = account.validate_password(newpass)
if not validated:
errors = [e for suberror in error.messages for e in error.messages]
string = "\n".join(errors)
caller.msg(string)
return
account.set_password(newpass)
account.save()
self.msg("%s - new password set to '%s'." % (account.name, newpass))
if account.character != caller:
account.msg("%s has changed your password to '%s'." % (caller.name,
newpass)) | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"if",
"not",
"self",
".",
"rhs",
":",
"self",
".",
"msg",
"(",
"\"Usage: @userpassword <user obj> = <new password>\"",
")",
"return",
"# the account search also matches 'me' etc.",
"account",
"=",
"caller",
".",
"search_account",
"(",
"self",
".",
"lhs",
")",
"if",
"not",
"account",
":",
"return",
"newpass",
"=",
"self",
".",
"rhs",
"# Validate password",
"validated",
",",
"error",
"=",
"account",
".",
"validate_password",
"(",
"newpass",
")",
"if",
"not",
"validated",
":",
"errors",
"=",
"[",
"e",
"for",
"suberror",
"in",
"error",
".",
"messages",
"for",
"e",
"in",
"error",
".",
"messages",
"]",
"string",
"=",
"\"\\n\"",
".",
"join",
"(",
"errors",
")",
"caller",
".",
"msg",
"(",
"string",
")",
"return",
"account",
".",
"set_password",
"(",
"newpass",
")",
"account",
".",
"save",
"(",
")",
"self",
".",
"msg",
"(",
"\"%s - new password set to '%s'.\"",
"%",
"(",
"account",
".",
"name",
",",
"newpass",
")",
")",
"if",
"account",
".",
"character",
"!=",
"caller",
":",
"account",
".",
"msg",
"(",
"\"%s has changed your password to '%s'.\"",
"%",
"(",
"caller",
".",
"name",
",",
"newpass",
")",
")"
] | [
417,
4
] | [
446,
76
] | python | en | ['en', 'en', 'en'] | True |
CmdPerm.func | (self) | Implement function | Implement function | def func(self):
"""Implement function"""
caller = self.caller
switches = self.switches
lhs, rhs = self.lhs, self.rhs
if not self.args:
string = "Usage: @perm[/switch] object [ = permission, permission, ...]"
caller.msg(string)
return
accountmode = 'account' in self.switches or lhs.startswith('*')
lhs = lhs.lstrip("*")
if accountmode:
obj = caller.search_account(lhs)
else:
obj = caller.search(lhs, global_search=True)
if not obj:
return
if not rhs:
if not obj.access(caller, 'examine'):
caller.msg("You are not allowed to examine this object.")
return
string = "Permissions on |w%s|n: " % obj.key
if not obj.permissions.all():
string += "<None>"
else:
string += ", ".join(obj.permissions.all())
if (hasattr(obj, 'account') and
hasattr(obj.account, 'is_superuser') and
obj.account.is_superuser):
string += "\n(... but this object is currently controlled by a SUPERUSER! "
string += "All access checks are passed automatically.)"
caller.msg(string)
return
# we supplied an argument on the form obj = perm
locktype = "edit" if accountmode else "control"
if not obj.access(caller, locktype):
caller.msg("You are not allowed to edit this %s's permissions."
% ("account" if accountmode else "object"))
return
caller_result = []
target_result = []
if 'del' in switches:
# delete the given permission(s) from object.
for perm in self.rhslist:
obj.permissions.remove(perm)
if obj.permissions.get(perm):
caller_result.append("\nPermissions %s could not be removed from %s." % (perm, obj.name))
else:
caller_result.append("\nPermission %s removed from %s (if they existed)." % (perm, obj.name))
target_result.append("\n%s revokes the permission(s) %s from you." % (caller.name, perm))
else:
# add a new permission
permissions = obj.permissions.all()
for perm in self.rhslist:
# don't allow to set a permission higher in the hierarchy than
# the one the caller has (to prevent self-escalation)
if (perm.lower() in PERMISSION_HIERARCHY and not
obj.locks.check_lockstring(caller, "dummy:perm(%s)" % perm)):
caller.msg("You cannot assign a permission higher than the one you have yourself.")
return
if perm in permissions:
caller_result.append("\nPermission '%s' is already defined on %s." % (perm, obj.name))
else:
obj.permissions.add(perm)
plystring = "the Account" if accountmode else "the Object/Character"
caller_result.append("\nPermission '%s' given to %s (%s)." % (perm, obj.name, plystring))
target_result.append("\n%s gives you (%s, %s) the permission '%s'."
% (caller.name, obj.name, plystring, perm))
caller.msg("".join(caller_result).strip())
if target_result:
obj.msg("".join(target_result).strip()) | [
"def",
"func",
"(",
"self",
")",
":",
"caller",
"=",
"self",
".",
"caller",
"switches",
"=",
"self",
".",
"switches",
"lhs",
",",
"rhs",
"=",
"self",
".",
"lhs",
",",
"self",
".",
"rhs",
"if",
"not",
"self",
".",
"args",
":",
"string",
"=",
"\"Usage: @perm[/switch] object [ = permission, permission, ...]\"",
"caller",
".",
"msg",
"(",
"string",
")",
"return",
"accountmode",
"=",
"'account'",
"in",
"self",
".",
"switches",
"or",
"lhs",
".",
"startswith",
"(",
"'*'",
")",
"lhs",
"=",
"lhs",
".",
"lstrip",
"(",
"\"*\"",
")",
"if",
"accountmode",
":",
"obj",
"=",
"caller",
".",
"search_account",
"(",
"lhs",
")",
"else",
":",
"obj",
"=",
"caller",
".",
"search",
"(",
"lhs",
",",
"global_search",
"=",
"True",
")",
"if",
"not",
"obj",
":",
"return",
"if",
"not",
"rhs",
":",
"if",
"not",
"obj",
".",
"access",
"(",
"caller",
",",
"'examine'",
")",
":",
"caller",
".",
"msg",
"(",
"\"You are not allowed to examine this object.\"",
")",
"return",
"string",
"=",
"\"Permissions on |w%s|n: \"",
"%",
"obj",
".",
"key",
"if",
"not",
"obj",
".",
"permissions",
".",
"all",
"(",
")",
":",
"string",
"+=",
"\"<None>\"",
"else",
":",
"string",
"+=",
"\", \"",
".",
"join",
"(",
"obj",
".",
"permissions",
".",
"all",
"(",
")",
")",
"if",
"(",
"hasattr",
"(",
"obj",
",",
"'account'",
")",
"and",
"hasattr",
"(",
"obj",
".",
"account",
",",
"'is_superuser'",
")",
"and",
"obj",
".",
"account",
".",
"is_superuser",
")",
":",
"string",
"+=",
"\"\\n(... but this object is currently controlled by a SUPERUSER! \"",
"string",
"+=",
"\"All access checks are passed automatically.)\"",
"caller",
".",
"msg",
"(",
"string",
")",
"return",
"# we supplied an argument on the form obj = perm",
"locktype",
"=",
"\"edit\"",
"if",
"accountmode",
"else",
"\"control\"",
"if",
"not",
"obj",
".",
"access",
"(",
"caller",
",",
"locktype",
")",
":",
"caller",
".",
"msg",
"(",
"\"You are not allowed to edit this %s's permissions.\"",
"%",
"(",
"\"account\"",
"if",
"accountmode",
"else",
"\"object\"",
")",
")",
"return",
"caller_result",
"=",
"[",
"]",
"target_result",
"=",
"[",
"]",
"if",
"'del'",
"in",
"switches",
":",
"# delete the given permission(s) from object.",
"for",
"perm",
"in",
"self",
".",
"rhslist",
":",
"obj",
".",
"permissions",
".",
"remove",
"(",
"perm",
")",
"if",
"obj",
".",
"permissions",
".",
"get",
"(",
"perm",
")",
":",
"caller_result",
".",
"append",
"(",
"\"\\nPermissions %s could not be removed from %s.\"",
"%",
"(",
"perm",
",",
"obj",
".",
"name",
")",
")",
"else",
":",
"caller_result",
".",
"append",
"(",
"\"\\nPermission %s removed from %s (if they existed).\"",
"%",
"(",
"perm",
",",
"obj",
".",
"name",
")",
")",
"target_result",
".",
"append",
"(",
"\"\\n%s revokes the permission(s) %s from you.\"",
"%",
"(",
"caller",
".",
"name",
",",
"perm",
")",
")",
"else",
":",
"# add a new permission",
"permissions",
"=",
"obj",
".",
"permissions",
".",
"all",
"(",
")",
"for",
"perm",
"in",
"self",
".",
"rhslist",
":",
"# don't allow to set a permission higher in the hierarchy than",
"# the one the caller has (to prevent self-escalation)",
"if",
"(",
"perm",
".",
"lower",
"(",
")",
"in",
"PERMISSION_HIERARCHY",
"and",
"not",
"obj",
".",
"locks",
".",
"check_lockstring",
"(",
"caller",
",",
"\"dummy:perm(%s)\"",
"%",
"perm",
")",
")",
":",
"caller",
".",
"msg",
"(",
"\"You cannot assign a permission higher than the one you have yourself.\"",
")",
"return",
"if",
"perm",
"in",
"permissions",
":",
"caller_result",
".",
"append",
"(",
"\"\\nPermission '%s' is already defined on %s.\"",
"%",
"(",
"perm",
",",
"obj",
".",
"name",
")",
")",
"else",
":",
"obj",
".",
"permissions",
".",
"add",
"(",
"perm",
")",
"plystring",
"=",
"\"the Account\"",
"if",
"accountmode",
"else",
"\"the Object/Character\"",
"caller_result",
".",
"append",
"(",
"\"\\nPermission '%s' given to %s (%s).\"",
"%",
"(",
"perm",
",",
"obj",
".",
"name",
",",
"plystring",
")",
")",
"target_result",
".",
"append",
"(",
"\"\\n%s gives you (%s, %s) the permission '%s'.\"",
"%",
"(",
"caller",
".",
"name",
",",
"obj",
".",
"name",
",",
"plystring",
",",
"perm",
")",
")",
"caller",
".",
"msg",
"(",
"\"\"",
".",
"join",
"(",
"caller_result",
")",
".",
"strip",
"(",
")",
")",
"if",
"target_result",
":",
"obj",
".",
"msg",
"(",
"\"\"",
".",
"join",
"(",
"target_result",
")",
".",
"strip",
"(",
")",
")"
] | [
470,
4
] | [
551,
51
] | python | en | ['en', 'en', 'en'] | False |
CmdWall.func | (self) | Implements command | Implements command | def func(self):
"""Implements command"""
if not self.args:
self.caller.msg("Usage: @wall <message>")
return
message = "%s shouts \"%s\"" % (self.caller.name, self.args)
self.msg("Announcing to all connected sessions ...")
SESSIONS.announce_all(message) | [
"def",
"func",
"(",
"self",
")",
":",
"if",
"not",
"self",
".",
"args",
":",
"self",
".",
"caller",
".",
"msg",
"(",
"\"Usage: @wall <message>\"",
")",
"return",
"message",
"=",
"\"%s shouts \\\"%s\\\"\"",
"%",
"(",
"self",
".",
"caller",
".",
"name",
",",
"self",
".",
"args",
")",
"self",
".",
"msg",
"(",
"\"Announcing to all connected sessions ...\"",
")",
"SESSIONS",
".",
"announce_all",
"(",
"message",
")"
] | [
568,
4
] | [
575,
38
] | python | en | ['en', 'en', 'en'] | False |
Marker.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color` array are
all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color` array are
all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False) | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in `marker.color`is
set to a numerical array. In case `colorscale` is unspecified
or `autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color` array are
all positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autocolorscale"] | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
38,
4
] | [
55,
37
] | python | en | ['en', 'error', 'th'] | False |
Marker.cauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false` when `marker.cmin` and `marker.cmax` are set by the
user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false` when `marker.cmin` and `marker.cmax` are set by the
user.
The 'cauto' property must be specified as a bool
(either True, or False) | def cauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `marker.color`) or the
bounds set in `marker.cmin` and `marker.cmax` Has an effect
only if in `marker.color`is set to a numerical array. Defaults
to `false` when `marker.cmin` and `marker.cmax` are set by the
user.
The 'cauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["cauto"] | [
"def",
"cauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cauto\"",
"]"
] | [
64,
4
] | [
80,
28
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmax | (self) |
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float | def cmax(self):
"""
Sets the upper bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmin`
must be set as well.
The 'cmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmax"] | [
"def",
"cmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmax\"",
"]"
] | [
89,
4
] | [
103,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmid | (self) |
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effect when `marker.cauto` is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effect when `marker.cauto` is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float | def cmid(self):
"""
Sets the mid-point of the color domain by scaling `marker.cmin`
and/or `marker.cmax` to be equidistant to this point. Has an
effect only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`. Has no
effect when `marker.cauto` is `false`.
The 'cmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmid"] | [
"def",
"cmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmid\"",
"]"
] | [
112,
4
] | [
127,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.cmin | (self) |
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float | def cmin(self):
"""
Sets the lower bound of the color domain. Has an effect only if
in `marker.color`is set to a numerical array. Value should have
the same units as in `marker.color` and if set, `marker.cmax`
must be set as well.
The 'cmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["cmin"] | [
"def",
"cmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cmin\"",
"]"
] | [
136,
4
] | [
150,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.color | (self) |
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
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
- A number that will be interpreted as a color
according to scattergl.marker.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
|
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
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
- A number that will be interpreted as a color
according to scattergl.marker.colorscale
- A list or array of any of the above | def color(self):
"""
Sets themarkercolor. It accepts either a specific color or an
array of numbers that are mapped to the colorscale relative to
the max and min values of the array or relative to
`marker.cmin` and `marker.cmax` if set.
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
- A number that will be interpreted as a color
according to scattergl.marker.colorscale
- A list or array of any of the above
Returns
-------
str|numpy.ndarray
"""
return self["color"] | [
"def",
"color",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"color\"",
"]"
] | [
159,
4
] | [
215,
28
] | python | en | ['en', 'error', 'th'] | False |
Marker.coloraxis | (self) |
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
|
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.) | def coloraxis(self):
"""
Sets a reference to a shared color axis. References to these
shared color axes are "coloraxis", "coloraxis2", "coloraxis3",
etc. Settings for these shared color axes are set in the
layout, under `layout.coloraxis`, `layout.coloraxis2`, etc.
Note that multiple color scales can be linked to the same color
axis.
The 'coloraxis' property is an identifier of a particular
subplot, of type 'coloraxis', that may be specified as the string 'coloraxis'
optionally followed by an integer >= 1
(e.g. 'coloraxis', 'coloraxis1', 'coloraxis2', 'coloraxis3', etc.)
Returns
-------
str
"""
return self["coloraxis"] | [
"def",
"coloraxis",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"coloraxis\"",
"]"
] | [
224,
4
] | [
242,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.colorbar | (self) |
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
dtick
Sets the step in-between ticks on this axis.
Use with `tick0`. Must be a positive number, or
special strings available to "log" and "date"
axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick
number. For example, to set a tick mark at 1,
10, 100, 1000, ... set dtick to 1. To set tick
marks at 1, 100, 10000, ... set dtick to 2. To
set tick marks at 1, 5, 25, 125, 625, 3125, ...
set dtick to log_10(5), or 0.69897000433. "log"
has several special values; "L<f>", where `f`
is a positive number, gives ticks linearly
spaced in value (but not position). For example
`tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10
plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is
ignored for "D1" and "D2". If the axis `type`
is "date", then you must convert the time to
milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to
86400000.0. "date" also has special values
"M<n>" gives ticks spaced by a number of
months. `n` must be a positive integer. To set
ticks on the 15th of every third month, set
`tick0` to "2000-01-15" and `dtick` to "M3". To
set ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick
exponents. For example, consider the number
1,000,000,000. If "none", it appears as
1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If
"SI", 1G. If "B", 1B.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks
will be chosen automatically to be less than or
equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of
the first tick is shown. If "last", only the
exponent of the last tick is shown. If "none",
no exponents appear.
showticklabels
Determines whether or not the tick labels are
drawn.
showtickprefix
If "all", all tick labels are displayed with a
prefix. If "first", only the first tick is
displayed with a prefix. If "last", only the
last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
tick0
Sets the placement of the first tick on this
axis. Use with `dtick`. If the axis `type` is
"log", then you must take the log of your
starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when
`dtick`=*L<f>* (see `dtick` for more info). If
the axis `type` is "date", it should be a date
string, like date data. If the axis `type` is
"category", it should be a number, using the
scale where each category is assigned a serial
number from zero in the order it appears.
tickangle
Sets the angle of the tick labels with respect
to the horizontal. For example, a `tickangle`
of -90 draws the tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
Sets the tick label formatting rule using d3
formatting mini-languages which are very
similar to those in Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
And for dates see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format
We add one item to d3's date formatter: "%{n}f"
for fractional seconds with n digits. For
example, *2016-10-13 09:15:23.456* with
tickformat "%H~%M~%S.%2f" would display
"09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.scatter
gl.marker.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.scattergl.marker.colorbar.tickformatstopdefau
lts), sets the default property values to use
for elements of
scattergl.marker.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto",
the number of ticks is set via `nticks`. If
"linear", the placement of the ticks is
determined by a starting position `tick0` and a
tick step `dtick` ("linear" is the default
value if `tick0` and `dtick` are provided). If
"array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`.
("array" is the default value if `tickvals` is
provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If
"", this axis' ticks are not drawn. If
"outside" ("inside"), this axis' are drawn
outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position
via `tickvals`. Only has an effect if
`tickmode` is set to "array". Used with
`tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud
for ticktext .
tickvals
Sets the values at which ticks on this axis
appear. Only has an effect if `tickmode` is set
to "array". Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud
for tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.scattergl.marker.c
olorbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
scattergl.marker.colorbar.title.font instead.
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
scattergl.marker.colorbar.title.side instead.
Determines the location of color bar's title
with respect to the color bar. Note that the
title's location used to be set by the now
deprecated `titleside` attribute.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
plotly.graph_objs.scattergl.marker.ColorBar
|
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
dtick
Sets the step in-between ticks on this axis.
Use with `tick0`. Must be a positive number, or
special strings available to "log" and "date"
axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick
number. For example, to set a tick mark at 1,
10, 100, 1000, ... set dtick to 1. To set tick
marks at 1, 100, 10000, ... set dtick to 2. To
set tick marks at 1, 5, 25, 125, 625, 3125, ...
set dtick to log_10(5), or 0.69897000433. "log"
has several special values; "L<f>", where `f`
is a positive number, gives ticks linearly
spaced in value (but not position). For example
`tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10
plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is
ignored for "D1" and "D2". If the axis `type`
is "date", then you must convert the time to
milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to
86400000.0. "date" also has special values
"M<n>" gives ticks spaced by a number of
months. `n` must be a positive integer. To set
ticks on the 15th of every third month, set
`tick0` to "2000-01-15" and `dtick` to "M3". To
set ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick
exponents. For example, consider the number
1,000,000,000. If "none", it appears as
1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If
"SI", 1G. If "B", 1B.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks
will be chosen automatically to be less than or
equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of
the first tick is shown. If "last", only the
exponent of the last tick is shown. If "none",
no exponents appear.
showticklabels
Determines whether or not the tick labels are
drawn.
showtickprefix
If "all", all tick labels are displayed with a
prefix. If "first", only the first tick is
displayed with a prefix. If "last", only the
last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
tick0
Sets the placement of the first tick on this
axis. Use with `dtick`. If the axis `type` is
"log", then you must take the log of your
starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when
`dtick`=*L<f>* (see `dtick` for more info). If
the axis `type` is "date", it should be a date
string, like date data. If the axis `type` is
"category", it should be a number, using the
scale where each category is assigned a serial
number from zero in the order it appears.
tickangle
Sets the angle of the tick labels with respect
to the horizontal. For example, a `tickangle`
of -90 draws the tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
Sets the tick label formatting rule using d3
formatting mini-languages which are very
similar to those in Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
And for dates see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format
We add one item to d3's date formatter: "%{n}f"
for fractional seconds with n digits. For
example, *2016-10-13 09:15:23.456* with
tickformat "%H~%M~%S.%2f" would display
"09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.scatter
gl.marker.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.scattergl.marker.colorbar.tickformatstopdefau
lts), sets the default property values to use
for elements of
scattergl.marker.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto",
the number of ticks is set via `nticks`. If
"linear", the placement of the ticks is
determined by a starting position `tick0` and a
tick step `dtick` ("linear" is the default
value if `tick0` and `dtick` are provided). If
"array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`.
("array" is the default value if `tickvals` is
provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If
"", this axis' ticks are not drawn. If
"outside" ("inside"), this axis' are drawn
outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position
via `tickvals`. Only has an effect if
`tickmode` is set to "array". Used with
`tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud
for ticktext .
tickvals
Sets the values at which ticks on this axis
appear. Only has an effect if `tickmode` is set
to "array". Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud
for tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.scattergl.marker.c
olorbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
scattergl.marker.colorbar.title.font instead.
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
scattergl.marker.colorbar.title.side instead.
Determines the location of color bar's title
with respect to the color bar. Note that the
title's location used to be set by the now
deprecated `titleside` attribute.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction. | def colorbar(self):
"""
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.ColorBar`
- A dict of string/value properties that will be passed
to the ColorBar constructor
Supported dict properties:
bgcolor
Sets the color of padded area.
bordercolor
Sets the axis line color.
borderwidth
Sets the width (in px) or the border enclosing
this color bar.
dtick
Sets the step in-between ticks on this axis.
Use with `tick0`. Must be a positive number, or
special strings available to "log" and "date"
axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick
number. For example, to set a tick mark at 1,
10, 100, 1000, ... set dtick to 1. To set tick
marks at 1, 100, 10000, ... set dtick to 2. To
set tick marks at 1, 5, 25, 125, 625, 3125, ...
set dtick to log_10(5), or 0.69897000433. "log"
has several special values; "L<f>", where `f`
is a positive number, gives ticks linearly
spaced in value (but not position). For example
`tick0` = 0.1, `dtick` = "L0.5" will put ticks
at 0.1, 0.6, 1.1, 1.6 etc. To show powers of 10
plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is
ignored for "D1" and "D2". If the axis `type`
is "date", then you must convert the time to
milliseconds. For example, to set the interval
between ticks to one day, set `dtick` to
86400000.0. "date" also has special values
"M<n>" gives ticks spaced by a number of
months. `n` must be a positive integer. To set
ticks on the 15th of every third month, set
`tick0` to "2000-01-15" and `dtick` to "M3". To
set ticks every 4 years, set `dtick` to "M48"
exponentformat
Determines a formatting rule for the tick
exponents. For example, consider the number
1,000,000,000. If "none", it appears as
1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If
"SI", 1G. If "B", 1B.
len
Sets the length of the color bar This measure
excludes the padding of both ends. That is, the
color bar length is this length minus the
padding on both ends.
lenmode
Determines whether this color bar's length
(i.e. the measure in the color variation
direction) is set in units of plot "fraction"
or in *pixels. Use `len` to set the value.
nticks
Specifies the maximum number of ticks for the
particular axis. The actual number of ticks
will be chosen automatically to be less than or
equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
outlinecolor
Sets the axis line color.
outlinewidth
Sets the width (in px) of the axis line.
separatethousands
If "true", even 4-digit integers are separated
showexponent
If "all", all exponents are shown besides their
significands. If "first", only the exponent of
the first tick is shown. If "last", only the
exponent of the last tick is shown. If "none",
no exponents appear.
showticklabels
Determines whether or not the tick labels are
drawn.
showtickprefix
If "all", all tick labels are displayed with a
prefix. If "first", only the first tick is
displayed with a prefix. If "last", only the
last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
showticksuffix
Same as `showtickprefix` but for tick suffixes.
thickness
Sets the thickness of the color bar This
measure excludes the size of the padding, ticks
and labels.
thicknessmode
Determines whether this color bar's thickness
(i.e. the measure in the constant color
direction) is set in units of plot "fraction"
or in "pixels". Use `thickness` to set the
value.
tick0
Sets the placement of the first tick on this
axis. Use with `dtick`. If the axis `type` is
"log", then you must take the log of your
starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when
`dtick`=*L<f>* (see `dtick` for more info). If
the axis `type` is "date", it should be a date
string, like date data. If the axis `type` is
"category", it should be a number, using the
scale where each category is assigned a serial
number from zero in the order it appears.
tickangle
Sets the angle of the tick labels with respect
to the horizontal. For example, a `tickangle`
of -90 draws the tick labels vertically.
tickcolor
Sets the tick color.
tickfont
Sets the color bar's tick label font
tickformat
Sets the tick label formatting rule using d3
formatting mini-languages which are very
similar to those in Python. For numbers, see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format
And for dates see:
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format
We add one item to d3's date formatter: "%{n}f"
for fractional seconds with n digits. For
example, *2016-10-13 09:15:23.456* with
tickformat "%H~%M~%S.%2f" would display
"09~15~23.46"
tickformatstops
A tuple of :class:`plotly.graph_objects.scatter
gl.marker.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.scattergl.marker.colorbar.tickformatstopdefau
lts), sets the default property values to use
for elements of
scattergl.marker.colorbar.tickformatstops
ticklen
Sets the tick length (in px).
tickmode
Sets the tick mode for this axis. If "auto",
the number of ticks is set via `nticks`. If
"linear", the placement of the ticks is
determined by a starting position `tick0` and a
tick step `dtick` ("linear" is the default
value if `tick0` and `dtick` are provided). If
"array", the placement of the ticks is set via
`tickvals` and the tick text is `ticktext`.
("array" is the default value if `tickvals` is
provided).
tickprefix
Sets a tick label prefix.
ticks
Determines whether ticks are drawn or not. If
"", this axis' ticks are not drawn. If
"outside" ("inside"), this axis' are drawn
outside (inside) the axis lines.
ticksuffix
Sets a tick label suffix.
ticktext
Sets the text displayed at the ticks position
via `tickvals`. Only has an effect if
`tickmode` is set to "array". Used with
`tickvals`.
ticktextsrc
Sets the source reference on Chart Studio Cloud
for ticktext .
tickvals
Sets the values at which ticks on this axis
appear. Only has an effect if `tickmode` is set
to "array". Used with `ticktext`.
tickvalssrc
Sets the source reference on Chart Studio Cloud
for tickvals .
tickwidth
Sets the tick width (in px).
title
:class:`plotly.graph_objects.scattergl.marker.c
olorbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
scattergl.marker.colorbar.title.font instead.
Sets this color bar's title font. Note that the
title's font used to be set by the now
deprecated `titlefont` attribute.
titleside
Deprecated: Please use
scattergl.marker.colorbar.title.side instead.
Determines the location of color bar's title
with respect to the color bar. Note that the
title's location used to be set by the now
deprecated `titleside` attribute.
x
Sets the x position of the color bar (in plot
fraction).
xanchor
Sets this color bar's horizontal position
anchor. This anchor binds the `x` position to
the "left", "center" or "right" of the color
bar.
xpad
Sets the amount of padding (in px) along the x
direction.
y
Sets the y position of the color bar (in plot
fraction).
yanchor
Sets this color bar's vertical position anchor
This anchor binds the `y` position to the
"top", "middle" or "bottom" of the color bar.
ypad
Sets the amount of padding (in px) along the y
direction.
Returns
-------
plotly.graph_objs.scattergl.marker.ColorBar
"""
return self["colorbar"] | [
"def",
"colorbar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorbar\"",
"]"
] | [
251,
4
] | [
478,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.colorscale | (self) |
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
the lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To
control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively, `colorscale`
may be a palette name string of the following list: Greys,YlGnB
u,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland
,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
|
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
the lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To
control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively, `colorscale`
may be a palette name string of the following list: Greys,YlGnB
u,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland
,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it. | def colorscale(self):
"""
Sets the colorscale. Has an effect only if in `marker.color`is
set to a numerical array. The colorscale must be an array
containing arrays mapping a normalized value to an rgb, rgba,
hex, hsl, hsv, or named color string. At minimum, a mapping for
the lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To
control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively, `colorscale`
may be a palette name string of the following list: Greys,YlGnB
u,Greens,YlOrRd,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland
,Jet,Hot,Blackbody,Earth,Electric,Viridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
"""
return self["colorscale"] | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
487,
4
] | [
531,
33
] | python | en | ['en', 'error', 'th'] | False |
Marker.colorsrc | (self) |
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' 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 color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def colorsrc(self):
"""
Sets the source reference on Chart Studio Cloud for color .
The 'colorsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["colorsrc"] | [
"def",
"colorsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorsrc\"",
"]"
] | [
540,
4
] | [
551,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.line | (self) |
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.line.colorscale`. Has an
effect only if in `marker.line.color`is set to
a numerical array. In case `colorscale` is
unspecified or `autocolorscale` is true, the
default palette will be chosen according to
whether numbers in the `color` array are all
positive, all negative or mixed.
cauto
Determines whether or not the color domain is
computed with respect to the input data (here
in `marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has
an effect only if in `marker.line.color`is set
to a numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are
set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.line.cmin` and/or
`marker.line.cmax` to be equidistant to this
point. Has an effect only if in
`marker.line.color`is set to a numerical array.
Value should have the same units as in
`marker.line.color`. Has no effect when
`marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmax` must be set as well.
color
Sets themarker.linecolor. It accepts either a
specific color or an array of numbers that are
mapped to the colorscale relative to the max
and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if
set.
coloraxis
Sets a reference to a shared color axis.
References to these shared color axes are
"coloraxis", "coloraxis2", "coloraxis3", etc.
Settings for these shared color axes are set in
the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple
color scales can be linked to the same color
axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array.
The colorscale must be an array containing
arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and
highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in
color space, use`marker.line.cmin` and
`marker.line.cmax`. Alternatively, `colorscale`
may be a palette name string of the following
list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,R
eds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Black
body,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.line.color`is set to
a numerical array. If true, `marker.line.cmin`
will correspond to the last color in the array
and `marker.line.cmax` will correspond to the
first color.
width
Sets the width (in px) of the lines bounding
the marker points.
widthsrc
Sets the source reference on Chart Studio Cloud
for width .
Returns
-------
plotly.graph_objs.scattergl.marker.Line
|
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.line.colorscale`. Has an
effect only if in `marker.line.color`is set to
a numerical array. In case `colorscale` is
unspecified or `autocolorscale` is true, the
default palette will be chosen according to
whether numbers in the `color` array are all
positive, all negative or mixed.
cauto
Determines whether or not the color domain is
computed with respect to the input data (here
in `marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has
an effect only if in `marker.line.color`is set
to a numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are
set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.line.cmin` and/or
`marker.line.cmax` to be equidistant to this
point. Has an effect only if in
`marker.line.color`is set to a numerical array.
Value should have the same units as in
`marker.line.color`. Has no effect when
`marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmax` must be set as well.
color
Sets themarker.linecolor. It accepts either a
specific color or an array of numbers that are
mapped to the colorscale relative to the max
and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if
set.
coloraxis
Sets a reference to a shared color axis.
References to these shared color axes are
"coloraxis", "coloraxis2", "coloraxis3", etc.
Settings for these shared color axes are set in
the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple
color scales can be linked to the same color
axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array.
The colorscale must be an array containing
arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and
highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in
color space, use`marker.line.cmin` and
`marker.line.cmax`. Alternatively, `colorscale`
may be a palette name string of the following
list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,R
eds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Black
body,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.line.color`is set to
a numerical array. If true, `marker.line.cmin`
will correspond to the last color in the array
and `marker.line.cmax` will correspond to the
first color.
width
Sets the width (in px) of the lines bounding
the marker points.
widthsrc
Sets the source reference on Chart Studio Cloud
for width . | def line(self):
"""
The 'line' property is an instance of Line
that may be specified as:
- An instance of :class:`plotly.graph_objs.scattergl.marker.Line`
- A dict of string/value properties that will be passed
to the Line constructor
Supported dict properties:
autocolorscale
Determines whether the colorscale is a default
palette (`autocolorscale: true`) or the palette
determined by `marker.line.colorscale`. Has an
effect only if in `marker.line.color`is set to
a numerical array. In case `colorscale` is
unspecified or `autocolorscale` is true, the
default palette will be chosen according to
whether numbers in the `color` array are all
positive, all negative or mixed.
cauto
Determines whether or not the color domain is
computed with respect to the input data (here
in `marker.line.color`) or the bounds set in
`marker.line.cmin` and `marker.line.cmax` Has
an effect only if in `marker.line.color`is set
to a numerical array. Defaults to `false` when
`marker.line.cmin` and `marker.line.cmax` are
set by the user.
cmax
Sets the upper bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by
scaling `marker.line.cmin` and/or
`marker.line.cmax` to be equidistant to this
point. Has an effect only if in
`marker.line.color`is set to a numerical array.
Value should have the same units as in
`marker.line.color`. Has no effect when
`marker.line.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has
an effect only if in `marker.line.color`is set
to a numerical array. Value should have the
same units as in `marker.line.color` and if
set, `marker.line.cmax` must be set as well.
color
Sets themarker.linecolor. It accepts either a
specific color or an array of numbers that are
mapped to the colorscale relative to the max
and min values of the array or relative to
`marker.line.cmin` and `marker.line.cmax` if
set.
coloraxis
Sets a reference to a shared color axis.
References to these shared color axes are
"coloraxis", "coloraxis2", "coloraxis3", etc.
Settings for these shared color axes are set in
the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple
color scales can be linked to the same color
axis.
colorscale
Sets the colorscale. Has an effect only if in
`marker.line.color`is set to a numerical array.
The colorscale must be an array containing
arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At
minimum, a mapping for the lowest (0) and
highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in
color space, use`marker.line.cmin` and
`marker.line.cmax`. Alternatively, `colorscale`
may be a palette name string of the following
list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,R
eds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Black
body,Earth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud
for color .
reversescale
Reverses the color mapping if true. Has an
effect only if in `marker.line.color`is set to
a numerical array. If true, `marker.line.cmin`
will correspond to the last color in the array
and `marker.line.cmax` will correspond to the
first color.
width
Sets the width (in px) of the lines bounding
the marker points.
widthsrc
Sets the source reference on Chart Studio Cloud
for width .
Returns
-------
plotly.graph_objs.scattergl.marker.Line
"""
return self["line"] | [
"def",
"line",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"line\"",
"]"
] | [
560,
4
] | [
663,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.opacity | (self) |
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above | def opacity(self):
"""
Sets the marker opacity.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["opacity"] | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
672,
4
] | [
684,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.opacitysrc | (self) |
Sets the source reference on Chart Studio Cloud for opacity .
The 'opacitysrc' 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 opacity .
The 'opacitysrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def opacitysrc(self):
"""
Sets the source reference on Chart Studio Cloud for opacity .
The 'opacitysrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["opacitysrc"] | [
"def",
"opacitysrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacitysrc\"",
"]"
] | [
693,
4
] | [
704,
33
] | python | en | ['en', 'error', 'th'] | False |
Marker.reversescale | (self) |
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False) | def reversescale(self):
"""
Reverses the color mapping if true. Has an effect only if in
`marker.color`is set to a numerical array. If true,
`marker.cmin` will correspond to the last color in the array
and `marker.cmax` will correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["reversescale"] | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
713,
4
] | [
727,
35
] | python | en | ['en', 'error', 'th'] | False |
Marker.showscale | (self) |
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False) | def showscale(self):
"""
Determines whether or not a colorbar is displayed for this
trace. Has an effect only if in `marker.color`is set to a
numerical array.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showscale"] | [
"def",
"showscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showscale\"",
"]"
] | [
736,
4
] | [
749,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.size | (self) |
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above | def size(self):
"""
Sets the marker size (in px).
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
758,
4
] | [
770,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizemin | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def sizemin(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the minimum size (in px) of the rendered marker
points.
The 'sizemin' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["sizemin"] | [
"def",
"sizemin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizemin\"",
"]"
] | [
779,
4
] | [
792,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizemode | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['diameter', 'area']
Returns
-------
Any
|
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['diameter', 'area'] | def sizemode(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the rule for which the data in `size` is converted
to pixels.
The 'sizemode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['diameter', 'area']
Returns
-------
Any
"""
return self["sizemode"] | [
"def",
"sizemode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizemode\"",
"]"
] | [
801,
4
] | [
815,
31
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizeref | (self) |
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An int or float | def sizeref(self):
"""
Has an effect only if `marker.size` is set to a numerical
array. Sets the scale factor used to determine the rendered
size of marker points. Use with `sizemin` and `sizemode`.
The 'sizeref' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["sizeref"] | [
"def",
"sizeref",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizeref\"",
"]"
] | [
824,
4
] | [
837,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.sizesrc | (self) |
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' 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 size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def sizesrc(self):
"""
Sets the source reference on Chart Studio Cloud for size .
The 'sizesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["sizesrc"] | [
"def",
"sizesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sizesrc\"",
"]"
] | [
846,
4
] | [
857,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.symbol | (self) |
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'symbol' property is an enumeration that may be specified as:
- One of the following enumeration values:
[0, 'circle', 100, 'circle-open', 200, 'circle-dot', 300,
'circle-open-dot', 1, 'square', 101, 'square-open', 201,
'square-dot', 301, 'square-open-dot', 2, 'diamond', 102,
'diamond-open', 202, 'diamond-dot', 302,
'diamond-open-dot', 3, 'cross', 103, 'cross-open', 203,
'cross-dot', 303, 'cross-open-dot', 4, 'x', 104, 'x-open',
204, 'x-dot', 304, 'x-open-dot', 5, 'triangle-up', 105,
'triangle-up-open', 205, 'triangle-up-dot', 305,
'triangle-up-open-dot', 6, 'triangle-down', 106,
'triangle-down-open', 206, 'triangle-down-dot', 306,
'triangle-down-open-dot', 7, 'triangle-left', 107,
'triangle-left-open', 207, 'triangle-left-dot', 307,
'triangle-left-open-dot', 8, 'triangle-right', 108,
'triangle-right-open', 208, 'triangle-right-dot', 308,
'triangle-right-open-dot', 9, 'triangle-ne', 109,
'triangle-ne-open', 209, 'triangle-ne-dot', 309,
'triangle-ne-open-dot', 10, 'triangle-se', 110,
'triangle-se-open', 210, 'triangle-se-dot', 310,
'triangle-se-open-dot', 11, 'triangle-sw', 111,
'triangle-sw-open', 211, 'triangle-sw-dot', 311,
'triangle-sw-open-dot', 12, 'triangle-nw', 112,
'triangle-nw-open', 212, 'triangle-nw-dot', 312,
'triangle-nw-open-dot', 13, 'pentagon', 113,
'pentagon-open', 213, 'pentagon-dot', 313,
'pentagon-open-dot', 14, 'hexagon', 114, 'hexagon-open',
214, 'hexagon-dot', 314, 'hexagon-open-dot', 15,
'hexagon2', 115, 'hexagon2-open', 215, 'hexagon2-dot',
315, 'hexagon2-open-dot', 16, 'octagon', 116,
'octagon-open', 216, 'octagon-dot', 316,
'octagon-open-dot', 17, 'star', 117, 'star-open', 217,
'star-dot', 317, 'star-open-dot', 18, 'hexagram', 118,
'hexagram-open', 218, 'hexagram-dot', 318,
'hexagram-open-dot', 19, 'star-triangle-up', 119,
'star-triangle-up-open', 219, 'star-triangle-up-dot', 319,
'star-triangle-up-open-dot', 20, 'star-triangle-down',
120, 'star-triangle-down-open', 220,
'star-triangle-down-dot', 320,
'star-triangle-down-open-dot', 21, 'star-square', 121,
'star-square-open', 221, 'star-square-dot', 321,
'star-square-open-dot', 22, 'star-diamond', 122,
'star-diamond-open', 222, 'star-diamond-dot', 322,
'star-diamond-open-dot', 23, 'diamond-tall', 123,
'diamond-tall-open', 223, 'diamond-tall-dot', 323,
'diamond-tall-open-dot', 24, 'diamond-wide', 124,
'diamond-wide-open', 224, 'diamond-wide-dot', 324,
'diamond-wide-open-dot', 25, 'hourglass', 125,
'hourglass-open', 26, 'bowtie', 126, 'bowtie-open', 27,
'circle-cross', 127, 'circle-cross-open', 28, 'circle-x',
128, 'circle-x-open', 29, 'square-cross', 129,
'square-cross-open', 30, 'square-x', 130, 'square-x-open',
31, 'diamond-cross', 131, 'diamond-cross-open', 32,
'diamond-x', 132, 'diamond-x-open', 33, 'cross-thin', 133,
'cross-thin-open', 34, 'x-thin', 134, 'x-thin-open', 35,
'asterisk', 135, 'asterisk-open', 36, 'hash', 136,
'hash-open', 236, 'hash-dot', 336, 'hash-open-dot', 37,
'y-up', 137, 'y-up-open', 38, 'y-down', 138,
'y-down-open', 39, 'y-left', 139, 'y-left-open', 40,
'y-right', 140, 'y-right-open', 41, 'line-ew', 141,
'line-ew-open', 42, 'line-ns', 142, 'line-ns-open', 43,
'line-ne', 143, 'line-ne-open', 44, 'line-nw', 144,
'line-nw-open']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
|
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'symbol' property is an enumeration that may be specified as:
- One of the following enumeration values:
[0, 'circle', 100, 'circle-open', 200, 'circle-dot', 300,
'circle-open-dot', 1, 'square', 101, 'square-open', 201,
'square-dot', 301, 'square-open-dot', 2, 'diamond', 102,
'diamond-open', 202, 'diamond-dot', 302,
'diamond-open-dot', 3, 'cross', 103, 'cross-open', 203,
'cross-dot', 303, 'cross-open-dot', 4, 'x', 104, 'x-open',
204, 'x-dot', 304, 'x-open-dot', 5, 'triangle-up', 105,
'triangle-up-open', 205, 'triangle-up-dot', 305,
'triangle-up-open-dot', 6, 'triangle-down', 106,
'triangle-down-open', 206, 'triangle-down-dot', 306,
'triangle-down-open-dot', 7, 'triangle-left', 107,
'triangle-left-open', 207, 'triangle-left-dot', 307,
'triangle-left-open-dot', 8, 'triangle-right', 108,
'triangle-right-open', 208, 'triangle-right-dot', 308,
'triangle-right-open-dot', 9, 'triangle-ne', 109,
'triangle-ne-open', 209, 'triangle-ne-dot', 309,
'triangle-ne-open-dot', 10, 'triangle-se', 110,
'triangle-se-open', 210, 'triangle-se-dot', 310,
'triangle-se-open-dot', 11, 'triangle-sw', 111,
'triangle-sw-open', 211, 'triangle-sw-dot', 311,
'triangle-sw-open-dot', 12, 'triangle-nw', 112,
'triangle-nw-open', 212, 'triangle-nw-dot', 312,
'triangle-nw-open-dot', 13, 'pentagon', 113,
'pentagon-open', 213, 'pentagon-dot', 313,
'pentagon-open-dot', 14, 'hexagon', 114, 'hexagon-open',
214, 'hexagon-dot', 314, 'hexagon-open-dot', 15,
'hexagon2', 115, 'hexagon2-open', 215, 'hexagon2-dot',
315, 'hexagon2-open-dot', 16, 'octagon', 116,
'octagon-open', 216, 'octagon-dot', 316,
'octagon-open-dot', 17, 'star', 117, 'star-open', 217,
'star-dot', 317, 'star-open-dot', 18, 'hexagram', 118,
'hexagram-open', 218, 'hexagram-dot', 318,
'hexagram-open-dot', 19, 'star-triangle-up', 119,
'star-triangle-up-open', 219, 'star-triangle-up-dot', 319,
'star-triangle-up-open-dot', 20, 'star-triangle-down',
120, 'star-triangle-down-open', 220,
'star-triangle-down-dot', 320,
'star-triangle-down-open-dot', 21, 'star-square', 121,
'star-square-open', 221, 'star-square-dot', 321,
'star-square-open-dot', 22, 'star-diamond', 122,
'star-diamond-open', 222, 'star-diamond-dot', 322,
'star-diamond-open-dot', 23, 'diamond-tall', 123,
'diamond-tall-open', 223, 'diamond-tall-dot', 323,
'diamond-tall-open-dot', 24, 'diamond-wide', 124,
'diamond-wide-open', 224, 'diamond-wide-dot', 324,
'diamond-wide-open-dot', 25, 'hourglass', 125,
'hourglass-open', 26, 'bowtie', 126, 'bowtie-open', 27,
'circle-cross', 127, 'circle-cross-open', 28, 'circle-x',
128, 'circle-x-open', 29, 'square-cross', 129,
'square-cross-open', 30, 'square-x', 130, 'square-x-open',
31, 'diamond-cross', 131, 'diamond-cross-open', 32,
'diamond-x', 132, 'diamond-x-open', 33, 'cross-thin', 133,
'cross-thin-open', 34, 'x-thin', 134, 'x-thin-open', 35,
'asterisk', 135, 'asterisk-open', 36, 'hash', 136,
'hash-open', 236, 'hash-dot', 336, 'hash-open-dot', 37,
'y-up', 137, 'y-up-open', 38, 'y-down', 138,
'y-down-open', 39, 'y-left', 139, 'y-left-open', 40,
'y-right', 140, 'y-right-open', 41, 'line-ew', 141,
'line-ew-open', 42, 'line-ns', 142, 'line-ns-open', 43,
'line-ne', 143, 'line-ne-open', 44, 'line-nw', 144,
'line-nw-open']
- A tuple, list, or one-dimensional numpy array of the above | def symbol(self):
"""
Sets the marker symbol type. Adding 100 is equivalent to
appending "-open" to a symbol name. Adding 200 is equivalent to
appending "-dot" to a symbol name. Adding 300 is equivalent to
appending "-open-dot" or "dot-open" to a symbol name.
The 'symbol' property is an enumeration that may be specified as:
- One of the following enumeration values:
[0, 'circle', 100, 'circle-open', 200, 'circle-dot', 300,
'circle-open-dot', 1, 'square', 101, 'square-open', 201,
'square-dot', 301, 'square-open-dot', 2, 'diamond', 102,
'diamond-open', 202, 'diamond-dot', 302,
'diamond-open-dot', 3, 'cross', 103, 'cross-open', 203,
'cross-dot', 303, 'cross-open-dot', 4, 'x', 104, 'x-open',
204, 'x-dot', 304, 'x-open-dot', 5, 'triangle-up', 105,
'triangle-up-open', 205, 'triangle-up-dot', 305,
'triangle-up-open-dot', 6, 'triangle-down', 106,
'triangle-down-open', 206, 'triangle-down-dot', 306,
'triangle-down-open-dot', 7, 'triangle-left', 107,
'triangle-left-open', 207, 'triangle-left-dot', 307,
'triangle-left-open-dot', 8, 'triangle-right', 108,
'triangle-right-open', 208, 'triangle-right-dot', 308,
'triangle-right-open-dot', 9, 'triangle-ne', 109,
'triangle-ne-open', 209, 'triangle-ne-dot', 309,
'triangle-ne-open-dot', 10, 'triangle-se', 110,
'triangle-se-open', 210, 'triangle-se-dot', 310,
'triangle-se-open-dot', 11, 'triangle-sw', 111,
'triangle-sw-open', 211, 'triangle-sw-dot', 311,
'triangle-sw-open-dot', 12, 'triangle-nw', 112,
'triangle-nw-open', 212, 'triangle-nw-dot', 312,
'triangle-nw-open-dot', 13, 'pentagon', 113,
'pentagon-open', 213, 'pentagon-dot', 313,
'pentagon-open-dot', 14, 'hexagon', 114, 'hexagon-open',
214, 'hexagon-dot', 314, 'hexagon-open-dot', 15,
'hexagon2', 115, 'hexagon2-open', 215, 'hexagon2-dot',
315, 'hexagon2-open-dot', 16, 'octagon', 116,
'octagon-open', 216, 'octagon-dot', 316,
'octagon-open-dot', 17, 'star', 117, 'star-open', 217,
'star-dot', 317, 'star-open-dot', 18, 'hexagram', 118,
'hexagram-open', 218, 'hexagram-dot', 318,
'hexagram-open-dot', 19, 'star-triangle-up', 119,
'star-triangle-up-open', 219, 'star-triangle-up-dot', 319,
'star-triangle-up-open-dot', 20, 'star-triangle-down',
120, 'star-triangle-down-open', 220,
'star-triangle-down-dot', 320,
'star-triangle-down-open-dot', 21, 'star-square', 121,
'star-square-open', 221, 'star-square-dot', 321,
'star-square-open-dot', 22, 'star-diamond', 122,
'star-diamond-open', 222, 'star-diamond-dot', 322,
'star-diamond-open-dot', 23, 'diamond-tall', 123,
'diamond-tall-open', 223, 'diamond-tall-dot', 323,
'diamond-tall-open-dot', 24, 'diamond-wide', 124,
'diamond-wide-open', 224, 'diamond-wide-dot', 324,
'diamond-wide-open-dot', 25, 'hourglass', 125,
'hourglass-open', 26, 'bowtie', 126, 'bowtie-open', 27,
'circle-cross', 127, 'circle-cross-open', 28, 'circle-x',
128, 'circle-x-open', 29, 'square-cross', 129,
'square-cross-open', 30, 'square-x', 130, 'square-x-open',
31, 'diamond-cross', 131, 'diamond-cross-open', 32,
'diamond-x', 132, 'diamond-x-open', 33, 'cross-thin', 133,
'cross-thin-open', 34, 'x-thin', 134, 'x-thin-open', 35,
'asterisk', 135, 'asterisk-open', 36, 'hash', 136,
'hash-open', 236, 'hash-dot', 336, 'hash-open-dot', 37,
'y-up', 137, 'y-up-open', 38, 'y-down', 138,
'y-down-open', 39, 'y-left', 139, 'y-left-open', 40,
'y-right', 140, 'y-right-open', 41, 'line-ew', 141,
'line-ew-open', 42, 'line-ns', 142, 'line-ns-open', 43,
'line-ne', 143, 'line-ne-open', 44, 'line-nw', 144,
'line-nw-open']
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["symbol"] | [
"def",
"symbol",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"symbol\"",
"]"
] | [
866,
4
] | [
942,
29
] | python | en | ['en', 'error', 'th'] | False |
Marker.symbolsrc | (self) |
Sets the source reference on Chart Studio Cloud for symbol .
The 'symbolsrc' 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 symbol .
The 'symbolsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def symbolsrc(self):
"""
Sets the source reference on Chart Studio Cloud for symbol .
The 'symbolsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["symbolsrc"] | [
"def",
"symbolsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"symbolsrc\"",
"]"
] | [
951,
4
] | [
962,
32
] | python | en | ['en', 'error', 'th'] | False |
Marker.__init__ | (
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorbar=None,
colorscale=None,
colorsrc=None,
line=None,
opacity=None,
opacitysrc=None,
reversescale=None,
showscale=None,
size=None,
sizemin=None,
sizemode=None,
sizeref=None,
sizesrc=None,
symbol=None,
symbolsrc=None,
**kwargs
) |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.Marker`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in
`marker.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in `marker.color`)
or the bounds set in `marker.cmin` and `marker.cmax`
Has an effect only if in `marker.color`is set to a
numerical array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.cmin` and/or `marker.cmax` to be equidistant to
this point. Has an effect only if in `marker.color`is
set to a numerical array. Value should have the same
units as in `marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmax` must be set as well.
color
Sets themarkercolor. It accepts either a specific color
or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.cmin` and `marker.cmax` if
set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorbar
:class:`plotly.graph_objects.scattergl.marker.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively,
`colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu
,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
line
:class:`plotly.graph_objects.scattergl.marker.Line`
instance or dict with compatible properties
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud for
opacity .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.color`is set to a numerical array. If
true, `marker.cmin` will correspond to the last color
in the array and `marker.cmax` will correspond to the
first color.
showscale
Determines whether or not a colorbar is displayed for
this trace. Has an effect only if in `marker.color`is
set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px) of the
rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the data in
`size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points. Use with
`sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud for
size .
symbol
Sets the marker symbol type. Adding 100 is equivalent
to appending "-open" to a symbol name. Adding 200 is
equivalent to appending "-dot" to a symbol name. Adding
300 is equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud for
symbol .
Returns
-------
Marker
|
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.Marker`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in
`marker.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in `marker.color`)
or the bounds set in `marker.cmin` and `marker.cmax`
Has an effect only if in `marker.color`is set to a
numerical array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.cmin` and/or `marker.cmax` to be equidistant to
this point. Has an effect only if in `marker.color`is
set to a numerical array. Value should have the same
units as in `marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmax` must be set as well.
color
Sets themarkercolor. It accepts either a specific color
or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.cmin` and `marker.cmax` if
set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorbar
:class:`plotly.graph_objects.scattergl.marker.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively,
`colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu
,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
line
:class:`plotly.graph_objects.scattergl.marker.Line`
instance or dict with compatible properties
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud for
opacity .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.color`is set to a numerical array. If
true, `marker.cmin` will correspond to the last color
in the array and `marker.cmax` will correspond to the
first color.
showscale
Determines whether or not a colorbar is displayed for
this trace. Has an effect only if in `marker.color`is
set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px) of the
rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the data in
`size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points. Use with
`sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud for
size .
symbol
Sets the marker symbol type. Adding 100 is equivalent
to appending "-open" to a symbol name. Adding 200 is
equivalent to appending "-dot" to a symbol name. Adding
300 is equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud for
symbol . | def __init__(
self,
arg=None,
autocolorscale=None,
cauto=None,
cmax=None,
cmid=None,
cmin=None,
color=None,
coloraxis=None,
colorbar=None,
colorscale=None,
colorsrc=None,
line=None,
opacity=None,
opacitysrc=None,
reversescale=None,
showscale=None,
size=None,
sizemin=None,
sizemode=None,
sizeref=None,
sizesrc=None,
symbol=None,
symbolsrc=None,
**kwargs
):
"""
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.scattergl.Marker`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`marker.colorscale`. Has an effect only if in
`marker.color`is set to a numerical array. In case
`colorscale` is unspecified or `autocolorscale` is
true, the default palette will be chosen according to
whether numbers in the `color` array are all positive,
all negative or mixed.
cauto
Determines whether or not the color domain is computed
with respect to the input data (here in `marker.color`)
or the bounds set in `marker.cmin` and `marker.cmax`
Has an effect only if in `marker.color`is set to a
numerical array. Defaults to `false` when `marker.cmin`
and `marker.cmax` are set by the user.
cmax
Sets the upper bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmin` must be set as well.
cmid
Sets the mid-point of the color domain by scaling
`marker.cmin` and/or `marker.cmax` to be equidistant to
this point. Has an effect only if in `marker.color`is
set to a numerical array. Value should have the same
units as in `marker.color`. Has no effect when
`marker.cauto` is `false`.
cmin
Sets the lower bound of the color domain. Has an effect
only if in `marker.color`is set to a numerical array.
Value should have the same units as in `marker.color`
and if set, `marker.cmax` must be set as well.
color
Sets themarkercolor. It accepts either a specific color
or an array of numbers that are mapped to the
colorscale relative to the max and min values of the
array or relative to `marker.cmin` and `marker.cmax` if
set.
coloraxis
Sets a reference to a shared color axis. References to
these shared color axes are "coloraxis", "coloraxis2",
"coloraxis3", etc. Settings for these shared color axes
are set in the layout, under `layout.coloraxis`,
`layout.coloraxis2`, etc. Note that multiple color
scales can be linked to the same color axis.
colorbar
:class:`plotly.graph_objects.scattergl.marker.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. Has an effect only if in
`marker.color`is set to a numerical array. The
colorscale must be an array containing arrays mapping a
normalized value to an rgb, rgba, hex, hsl, hsv, or
named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For
example, `[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`.
To control the bounds of the colorscale in color space,
use`marker.cmin` and `marker.cmax`. Alternatively,
`colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu
,Reds,Blues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,E
arth,Electric,Viridis,Cividis.
colorsrc
Sets the source reference on Chart Studio Cloud for
color .
line
:class:`plotly.graph_objects.scattergl.marker.Line`
instance or dict with compatible properties
opacity
Sets the marker opacity.
opacitysrc
Sets the source reference on Chart Studio Cloud for
opacity .
reversescale
Reverses the color mapping if true. Has an effect only
if in `marker.color`is set to a numerical array. If
true, `marker.cmin` will correspond to the last color
in the array and `marker.cmax` will correspond to the
first color.
showscale
Determines whether or not a colorbar is displayed for
this trace. Has an effect only if in `marker.color`is
set to a numerical array.
size
Sets the marker size (in px).
sizemin
Has an effect only if `marker.size` is set to a
numerical array. Sets the minimum size (in px) of the
rendered marker points.
sizemode
Has an effect only if `marker.size` is set to a
numerical array. Sets the rule for which the data in
`size` is converted to pixels.
sizeref
Has an effect only if `marker.size` is set to a
numerical array. Sets the scale factor used to
determine the rendered size of marker points. Use with
`sizemin` and `sizemode`.
sizesrc
Sets the source reference on Chart Studio Cloud for
size .
symbol
Sets the marker symbol type. Adding 100 is equivalent
to appending "-open" to a symbol name. Adding 200 is
equivalent to appending "-dot" to a symbol name. Adding
300 is equivalent to appending "-open-dot" or "dot-
open" to a symbol name.
symbolsrc
Sets the source reference on Chart Studio Cloud for
symbol .
Returns
-------
Marker
"""
super(Marker, self).__init__("marker")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scattergl.Marker
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scattergl.Marker`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("autocolorscale", None)
_v = autocolorscale if autocolorscale is not None else _v
if _v is not None:
self["autocolorscale"] = _v
_v = arg.pop("cauto", None)
_v = cauto if cauto is not None else _v
if _v is not None:
self["cauto"] = _v
_v = arg.pop("cmax", None)
_v = cmax if cmax is not None else _v
if _v is not None:
self["cmax"] = _v
_v = arg.pop("cmid", None)
_v = cmid if cmid is not None else _v
if _v is not None:
self["cmid"] = _v
_v = arg.pop("cmin", None)
_v = cmin if cmin is not None else _v
if _v is not None:
self["cmin"] = _v
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _v
_v = arg.pop("coloraxis", None)
_v = coloraxis if coloraxis is not None else _v
if _v is not None:
self["coloraxis"] = _v
_v = arg.pop("colorbar", None)
_v = colorbar if colorbar is not None else _v
if _v is not None:
self["colorbar"] = _v
_v = arg.pop("colorscale", None)
_v = colorscale if colorscale is not None else _v
if _v is not None:
self["colorscale"] = _v
_v = arg.pop("colorsrc", None)
_v = colorsrc if colorsrc is not None else _v
if _v is not None:
self["colorsrc"] = _v
_v = arg.pop("line", None)
_v = line if line is not None else _v
if _v is not None:
self["line"] = _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("opacitysrc", None)
_v = opacitysrc if opacitysrc is not None else _v
if _v is not None:
self["opacitysrc"] = _v
_v = arg.pop("reversescale", None)
_v = reversescale if reversescale is not None else _v
if _v is not None:
self["reversescale"] = _v
_v = arg.pop("showscale", None)
_v = showscale if showscale is not None else _v
if _v is not None:
self["showscale"] = _v
_v = arg.pop("size", None)
_v = size if size is not None else _v
if _v is not None:
self["size"] = _v
_v = arg.pop("sizemin", None)
_v = sizemin if sizemin is not None else _v
if _v is not None:
self["sizemin"] = _v
_v = arg.pop("sizemode", None)
_v = sizemode if sizemode is not None else _v
if _v is not None:
self["sizemode"] = _v
_v = arg.pop("sizeref", None)
_v = sizeref if sizeref is not None else _v
if _v is not None:
self["sizeref"] = _v
_v = arg.pop("sizesrc", None)
_v = sizesrc if sizesrc is not None else _v
if _v is not None:
self["sizesrc"] = _v
_v = arg.pop("symbol", None)
_v = symbol if symbol is not None else _v
if _v is not None:
self["symbol"] = _v
_v = arg.pop("symbolsrc", None)
_v = symbolsrc if symbolsrc is not None else _v
if _v is not None:
self["symbolsrc"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"cauto",
"=",
"None",
",",
"cmax",
"=",
"None",
",",
"cmid",
"=",
"None",
",",
"cmin",
"=",
"None",
",",
"color",
"=",
"None",
",",
"coloraxis",
"=",
"None",
",",
"colorbar",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"colorsrc",
"=",
"None",
",",
"line",
"=",
"None",
",",
"opacity",
"=",
"None",
",",
"opacitysrc",
"=",
"None",
",",
"reversescale",
"=",
"None",
",",
"showscale",
"=",
"None",
",",
"size",
"=",
"None",
",",
"sizemin",
"=",
"None",
",",
"sizemode",
"=",
"None",
",",
"sizeref",
"=",
"None",
",",
"sizesrc",
"=",
"None",
",",
"symbol",
"=",
"None",
",",
"symbolsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Marker",
",",
"self",
")",
".",
"__init__",
"(",
"\"marker\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scattergl.Marker \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scattergl.Marker`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"autocolorscale\"",
",",
"None",
")",
"_v",
"=",
"autocolorscale",
"if",
"autocolorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"autocolorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cauto\"",
",",
"None",
")",
"_v",
"=",
"cauto",
"if",
"cauto",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cauto\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmax\"",
",",
"None",
")",
"_v",
"=",
"cmax",
"if",
"cmax",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmax\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmid\"",
",",
"None",
")",
"_v",
"=",
"cmid",
"if",
"cmid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"cmin\"",
",",
"None",
")",
"_v",
"=",
"cmin",
"if",
"cmin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"cmin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"coloraxis\"",
",",
"None",
")",
"_v",
"=",
"coloraxis",
"if",
"coloraxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"coloraxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorbar\"",
",",
"None",
")",
"_v",
"=",
"colorbar",
"if",
"colorbar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorbar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorscale\"",
",",
"None",
")",
"_v",
"=",
"colorscale",
"if",
"colorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorsrc\"",
",",
"None",
")",
"_v",
"=",
"colorsrc",
"if",
"colorsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"line\"",
",",
"None",
")",
"_v",
"=",
"line",
"if",
"line",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"line\"",
"]",
"=",
"_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",
"(",
"\"opacitysrc\"",
",",
"None",
")",
"_v",
"=",
"opacitysrc",
"if",
"opacitysrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"opacitysrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"reversescale\"",
",",
"None",
")",
"_v",
"=",
"reversescale",
"if",
"reversescale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"reversescale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showscale\"",
",",
"None",
")",
"_v",
"=",
"showscale",
"if",
"showscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"size\"",
",",
"None",
")",
"_v",
"=",
"size",
"if",
"size",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"size\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sizemin\"",
",",
"None",
")",
"_v",
"=",
"sizemin",
"if",
"sizemin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sizemin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sizemode\"",
",",
"None",
")",
"_v",
"=",
"sizemode",
"if",
"sizemode",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sizemode\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sizeref\"",
",",
"None",
")",
"_v",
"=",
"sizeref",
"if",
"sizeref",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sizeref\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"sizesrc\"",
",",
"None",
")",
"_v",
"=",
"sizesrc",
"if",
"sizesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"sizesrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"symbol\"",
",",
"None",
")",
"_v",
"=",
"symbol",
"if",
"symbol",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"symbol\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"symbolsrc\"",
",",
"None",
")",
"_v",
"=",
"symbolsrc",
"if",
"symbolsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"symbolsrc\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1086,
4
] | [
1362,
34
] | python | en | ['en', 'error', 'th'] | False |
ClassLoader.load_module | (cls, mod_path: str, package: str = None) |
Load a module by its absolute path.
Args:
mod_path: the absolute or relative module path
package: the parent package to search for the module
Returns:
The resolved module or `None` if the module cannot be found
Raises:
ModuleLoadError: If there was an error loading the module
|
Load a module by its absolute path. | def load_module(cls, mod_path: str, package: str = None) -> ModuleType:
"""
Load a module by its absolute path.
Args:
mod_path: the absolute or relative module path
package: the parent package to search for the module
Returns:
The resolved module or `None` if the module cannot be found
Raises:
ModuleLoadError: If there was an error loading the module
"""
if package:
# preload parent package
if not cls.load_module(package):
return None
# must treat as a relative import
if not mod_path.startswith("."):
mod_path = f".{mod_path}"
full_path = resolve_name(mod_path, package)
if full_path in sys.modules:
return sys.modules[full_path]
if "." in mod_path:
parent_mod_path, mod_name = mod_path.rsplit(".", 1)
if parent_mod_path and parent_mod_path[-1] != ".":
parent_mod = cls.load_module(parent_mod_path, package)
if not parent_mod:
return None
package = parent_mod.__name__
mod_path = f".{mod_name}"
# Load the module spec first
# this means that a later ModuleNotFoundError indicates a code issue
spec = find_spec(mod_path, package)
if not spec:
return None
try:
return import_module(mod_path, package)
except ModuleNotFoundError as e:
raise ModuleLoadError(
f"Unable to import module {mod_path}: {str(e)}"
) from e | [
"def",
"load_module",
"(",
"cls",
",",
"mod_path",
":",
"str",
",",
"package",
":",
"str",
"=",
"None",
")",
"->",
"ModuleType",
":",
"if",
"package",
":",
"# preload parent package",
"if",
"not",
"cls",
".",
"load_module",
"(",
"package",
")",
":",
"return",
"None",
"# must treat as a relative import",
"if",
"not",
"mod_path",
".",
"startswith",
"(",
"\".\"",
")",
":",
"mod_path",
"=",
"f\".{mod_path}\"",
"full_path",
"=",
"resolve_name",
"(",
"mod_path",
",",
"package",
")",
"if",
"full_path",
"in",
"sys",
".",
"modules",
":",
"return",
"sys",
".",
"modules",
"[",
"full_path",
"]",
"if",
"\".\"",
"in",
"mod_path",
":",
"parent_mod_path",
",",
"mod_name",
"=",
"mod_path",
".",
"rsplit",
"(",
"\".\"",
",",
"1",
")",
"if",
"parent_mod_path",
"and",
"parent_mod_path",
"[",
"-",
"1",
"]",
"!=",
"\".\"",
":",
"parent_mod",
"=",
"cls",
".",
"load_module",
"(",
"parent_mod_path",
",",
"package",
")",
"if",
"not",
"parent_mod",
":",
"return",
"None",
"package",
"=",
"parent_mod",
".",
"__name__",
"mod_path",
"=",
"f\".{mod_name}\"",
"# Load the module spec first",
"# this means that a later ModuleNotFoundError indicates a code issue",
"spec",
"=",
"find_spec",
"(",
"mod_path",
",",
"package",
")",
"if",
"not",
"spec",
":",
"return",
"None",
"try",
":",
"return",
"import_module",
"(",
"mod_path",
",",
"package",
")",
"except",
"ModuleNotFoundError",
"as",
"e",
":",
"raise",
"ModuleLoadError",
"(",
"f\"Unable to import module {mod_path}: {str(e)}\"",
")",
"from",
"e"
] | [
26,
4
] | [
73,
20
] | python | en | ['en', 'error', 'th'] | False |
ClassLoader.load_class | (
cls, class_name: str, default_module: str = None, package: str = None
) |
Resolve a complete class path (ie. typing.Dict) to the class itself.
Args:
class_name: the class name
default_module: the default module to load, if not part of in the class name
package: the parent package to search for the module
Returns:
The resolved class
Raises:
ClassNotFoundError: If the class could not be resolved at path
ModuleLoadError: If there was an error loading the module
|
Resolve a complete class path (ie. typing.Dict) to the class itself. | def load_class(
cls, class_name: str, default_module: str = None, package: str = None
):
"""
Resolve a complete class path (ie. typing.Dict) to the class itself.
Args:
class_name: the class name
default_module: the default module to load, if not part of in the class name
package: the parent package to search for the module
Returns:
The resolved class
Raises:
ClassNotFoundError: If the class could not be resolved at path
ModuleLoadError: If there was an error loading the module
"""
if "." in class_name:
# import module and find class
mod_path, class_name = class_name.rsplit(".", 1)
elif default_module:
mod_path = default_module
else:
raise ClassNotFoundError(
f"Cannot resolve class name with no default module: {class_name}"
)
mod = cls.load_module(mod_path, package)
if not mod:
raise ClassNotFoundError(f"Module '{mod_path}' not found")
resolved = getattr(mod, class_name, None)
if not resolved:
raise ClassNotFoundError(
f"Class '{class_name}' not defined in module: {mod_path}"
)
if not isinstance(resolved, type):
raise ClassNotFoundError(
f"Resolved value is not a class: {mod_path}.{class_name}"
)
return resolved | [
"def",
"load_class",
"(",
"cls",
",",
"class_name",
":",
"str",
",",
"default_module",
":",
"str",
"=",
"None",
",",
"package",
":",
"str",
"=",
"None",
")",
":",
"if",
"\".\"",
"in",
"class_name",
":",
"# import module and find class",
"mod_path",
",",
"class_name",
"=",
"class_name",
".",
"rsplit",
"(",
"\".\"",
",",
"1",
")",
"elif",
"default_module",
":",
"mod_path",
"=",
"default_module",
"else",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Cannot resolve class name with no default module: {class_name}\"",
")",
"mod",
"=",
"cls",
".",
"load_module",
"(",
"mod_path",
",",
"package",
")",
"if",
"not",
"mod",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Module '{mod_path}' not found\"",
")",
"resolved",
"=",
"getattr",
"(",
"mod",
",",
"class_name",
",",
"None",
")",
"if",
"not",
"resolved",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Class '{class_name}' not defined in module: {mod_path}\"",
")",
"if",
"not",
"isinstance",
"(",
"resolved",
",",
"type",
")",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Resolved value is not a class: {mod_path}.{class_name}\"",
")",
"return",
"resolved"
] | [
76,
4
] | [
119,
23
] | python | en | ['en', 'error', 'th'] | False |
ClassLoader.load_subclass_of | (cls, base_class: Type, mod_path: str, package: str = None) |
Resolve an implementation of a base path within a module.
Args:
base_class: the base class being implemented
mod_path: the absolute module path
package: the parent package to search for the module
Returns:
The resolved class
Raises:
ClassNotFoundError: If the module or class implementation could not be found
ModuleLoadError: If there was an error loading the module
|
Resolve an implementation of a base path within a module. | def load_subclass_of(cls, base_class: Type, mod_path: str, package: str = None):
"""
Resolve an implementation of a base path within a module.
Args:
base_class: the base class being implemented
mod_path: the absolute module path
package: the parent package to search for the module
Returns:
The resolved class
Raises:
ClassNotFoundError: If the module or class implementation could not be found
ModuleLoadError: If there was an error loading the module
"""
mod = cls.load_module(mod_path, package)
if not mod:
raise ClassNotFoundError(f"Module '{mod_path}' not found")
# Find an the first declared class that inherits from
try:
imported_class = next(
obj
for name, obj in inspect.getmembers(mod, inspect.isclass)
if issubclass(obj, base_class) and obj is not base_class
)
except StopIteration:
raise ClassNotFoundError(
f"Could not resolve a class that inherits from {base_class}"
) from None
return imported_class | [
"def",
"load_subclass_of",
"(",
"cls",
",",
"base_class",
":",
"Type",
",",
"mod_path",
":",
"str",
",",
"package",
":",
"str",
"=",
"None",
")",
":",
"mod",
"=",
"cls",
".",
"load_module",
"(",
"mod_path",
",",
"package",
")",
"if",
"not",
"mod",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Module '{mod_path}' not found\"",
")",
"# Find an the first declared class that inherits from",
"try",
":",
"imported_class",
"=",
"next",
"(",
"obj",
"for",
"name",
",",
"obj",
"in",
"inspect",
".",
"getmembers",
"(",
"mod",
",",
"inspect",
".",
"isclass",
")",
"if",
"issubclass",
"(",
"obj",
",",
"base_class",
")",
"and",
"obj",
"is",
"not",
"base_class",
")",
"except",
"StopIteration",
":",
"raise",
"ClassNotFoundError",
"(",
"f\"Could not resolve a class that inherits from {base_class}\"",
")",
"from",
"None",
"return",
"imported_class"
] | [
122,
4
] | [
155,
29
] | python | en | ['en', 'error', 'th'] | False |
ClassLoader.scan_subpackages | (cls, package: str) | Return a list of sub-packages defined under a named package. | Return a list of sub-packages defined under a named package. | def scan_subpackages(cls, package: str) -> Sequence[str]:
"""Return a list of sub-packages defined under a named package."""
# FIXME use importlib.resources in python 3.7
if "." in package:
package, sub_pkg = package.split(".", 1)
else:
sub_pkg = "."
if not pkg_resources.resource_isdir(package, sub_pkg):
raise ModuleLoadError(f"Undefined package {package}")
found = []
joiner = "" if sub_pkg == "." else f"{sub_pkg}."
for sub_path in pkg_resources.resource_listdir(package, sub_pkg):
if pkg_resources.resource_exists(
package, f"{sub_pkg}/{sub_path}/__init__.py"
):
found.append(f"{package}.{joiner}{sub_path}")
return found | [
"def",
"scan_subpackages",
"(",
"cls",
",",
"package",
":",
"str",
")",
"->",
"Sequence",
"[",
"str",
"]",
":",
"# FIXME use importlib.resources in python 3.7",
"if",
"\".\"",
"in",
"package",
":",
"package",
",",
"sub_pkg",
"=",
"package",
".",
"split",
"(",
"\".\"",
",",
"1",
")",
"else",
":",
"sub_pkg",
"=",
"\".\"",
"if",
"not",
"pkg_resources",
".",
"resource_isdir",
"(",
"package",
",",
"sub_pkg",
")",
":",
"raise",
"ModuleLoadError",
"(",
"f\"Undefined package {package}\"",
")",
"found",
"=",
"[",
"]",
"joiner",
"=",
"\"\"",
"if",
"sub_pkg",
"==",
"\".\"",
"else",
"f\"{sub_pkg}.\"",
"for",
"sub_path",
"in",
"pkg_resources",
".",
"resource_listdir",
"(",
"package",
",",
"sub_pkg",
")",
":",
"if",
"pkg_resources",
".",
"resource_exists",
"(",
"package",
",",
"f\"{sub_pkg}/{sub_path}/__init__.py\"",
")",
":",
"found",
".",
"append",
"(",
"f\"{package}.{joiner}{sub_path}\"",
")",
"return",
"found"
] | [
158,
4
] | [
174,
20
] | python | en | ['en', 'en', 'en'] | True |
Line.color | (self) |
Sets the color of the line enclosing each sector.
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 line enclosing each sector.
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 line enclosing each sector.
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 width (in px) of the line enclosing each sector.
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 width (in px) of the line enclosing each sector.
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 width (in px) of the line enclosing each sector.
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.indicator.gauge.step.Line`
color
Sets the color of the line enclosing each sector.
width
Sets the width (in px) of the line enclosing each
sector.
Returns
-------
Line
|
Construct a new Line object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of
:class:`plotly.graph_objs.indicator.gauge.step.Line`
color
Sets the color of the line enclosing each sector.
width
Sets the width (in px) of the line enclosing each
sector. | 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.indicator.gauge.step.Line`
color
Sets the color of the line enclosing each sector.
width
Sets the width (in px) of the line enclosing each
sector.
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.indicator.gauge.step.Line
constructor must be a dict or
an instance of :class:`plotly.graph_objs.indicator.gauge.step.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.indicator.gauge.step.Line \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.indicator.gauge.step.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"
] | [
103,
4
] | [
167,
34
] | python | en | ['en', 'error', 'th'] | False |
Marker.color | (self) |
Sets the marker color of unselected points, applied only when a
selection exists.
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 marker color of unselected points, applied only when a
selection exists.
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 marker color of unselected points, applied only when a
selection exists.
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 |
Marker.opacity | (self) |
Sets the marker opacity of unselected points, applied only when
a selection exists.
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 marker opacity of unselected points, applied only when
a selection exists.
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 marker opacity of unselected points, applied only when
a selection exists.
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\"",
"]"
] | [
75,
4
] | [
87,
30
] | python | en | ['en', 'error', 'th'] | False |
Marker.size | (self) |
Sets the marker size of unselected points, applied only when a
selection exists.
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the marker size of unselected points, applied only when a
selection exists.
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def size(self):
"""
Sets the marker size of unselected points, applied only when a
selection exists.
The 'size' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["size"] | [
"def",
"size",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"size\"",
"]"
] | [
96,
4
] | [
108,
27
] | python | en | ['en', 'error', 'th'] | False |
Marker.__init__ | (self, arg=None, color=None, opacity=None, size=None, **kwargs) |
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattercarpet.
unselected.Marker`
color
Sets the marker color of unselected points, applied
only when a selection exists.
opacity
Sets the marker opacity of unselected points, applied
only when a selection exists.
size
Sets the marker size of unselected points, applied only
when a selection exists.
Returns
-------
Marker
|
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattercarpet.
unselected.Marker`
color
Sets the marker color of unselected points, applied
only when a selection exists.
opacity
Sets the marker opacity of unselected points, applied
only when a selection exists.
size
Sets the marker size of unselected points, applied only
when a selection exists. | def __init__(self, arg=None, color=None, opacity=None, size=None, **kwargs):
"""
Construct a new Marker object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.scattercarpet.
unselected.Marker`
color
Sets the marker color of unselected points, applied
only when a selection exists.
opacity
Sets the marker opacity of unselected points, applied
only when a selection exists.
size
Sets the marker size of unselected points, applied only
when a selection exists.
Returns
-------
Marker
"""
super(Marker, self).__init__("marker")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.scattercarpet.unselected.Marker
constructor must be a dict or
an instance of :class:`plotly.graph_objs.scattercarpet.unselected.Marker`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("color", None)
_v = color if color is not None else _v
if _v is not None:
self["color"] = _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("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",
",",
"opacity",
"=",
"None",
",",
"size",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Marker",
",",
"self",
")",
".",
"__init__",
"(",
"\"marker\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.scattercarpet.unselected.Marker \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.scattercarpet.unselected.Marker`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"color\"",
",",
"None",
")",
"_v",
"=",
"color",
"if",
"color",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"color\"",
"]",
"=",
"_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",
"(",
"\"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"
] | [
130,
4
] | [
202,
34
] | python | en | ['en', 'error', 'th'] | False |
Stream.maxpoints | (self) |
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]
Returns
-------
int|float
|
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000] | def maxpoints(self):
"""
Sets the maximum number of points to keep on the plots from an
incoming stream. If `maxpoints` is set to 50, only the newest
50 points will be displayed on the plot.
The 'maxpoints' property is a number and may be specified as:
- An int or float in the interval [0, 10000]
Returns
-------
int|float
"""
return self["maxpoints"] | [
"def",
"maxpoints",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"maxpoints\"",
"]"
] | [
15,
4
] | [
28,
32
] | python | en | ['en', 'error', 'th'] | False |
Stream.token | (self) |
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
|
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string | def token(self):
"""
The stream id number links a data trace on a plot with a
stream. See https://chart-studio.plotly.com/settings for more
details.
The 'token' property is a string and must be specified as:
- A non-empty string
Returns
-------
str
"""
return self["token"] | [
"def",
"token",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"token\"",
"]"
] | [
37,
4
] | [
50,
28
] | python | en | ['en', 'error', 'th'] | False |
Stream.__init__ | (self, arg=None, maxpoints=None, token=None, **kwargs) |
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.bar.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details.
Returns
-------
Stream
|
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.bar.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details. | def __init__(self, arg=None, maxpoints=None, token=None, **kwargs):
"""
Construct a new Stream object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.bar.Stream`
maxpoints
Sets the maximum number of points to keep on the plots
from an incoming stream. If `maxpoints` is set to 50,
only the newest 50 points will be displayed on the
plot.
token
The stream id number links a data trace on a plot with
a stream. See https://chart-studio.plotly.com/settings
for more details.
Returns
-------
Stream
"""
super(Stream, self).__init__("stream")
if "_parent" in kwargs:
self._parent = kwargs["_parent"]
return
# Validate arg
# ------------
if arg is None:
arg = {}
elif isinstance(arg, self.__class__):
arg = arg.to_plotly_json()
elif isinstance(arg, dict):
arg = _copy.copy(arg)
else:
raise ValueError(
"""\
The first argument to the plotly.graph_objs.bar.Stream
constructor must be a dict or
an instance of :class:`plotly.graph_objs.bar.Stream`"""
)
# Handle skip_invalid
# -------------------
self._skip_invalid = kwargs.pop("skip_invalid", False)
self._validate = kwargs.pop("_validate", True)
# Populate data dict with properties
# ----------------------------------
_v = arg.pop("maxpoints", None)
_v = maxpoints if maxpoints is not None else _v
if _v is not None:
self["maxpoints"] = _v
_v = arg.pop("token", None)
_v = token if token is not None else _v
if _v is not None:
self["token"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"maxpoints",
"=",
"None",
",",
"token",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Stream",
",",
"self",
")",
".",
"__init__",
"(",
"\"stream\"",
")",
"if",
"\"_parent\"",
"in",
"kwargs",
":",
"self",
".",
"_parent",
"=",
"kwargs",
"[",
"\"_parent\"",
"]",
"return",
"# Validate arg",
"# ------------",
"if",
"arg",
"is",
"None",
":",
"arg",
"=",
"{",
"}",
"elif",
"isinstance",
"(",
"arg",
",",
"self",
".",
"__class__",
")",
":",
"arg",
"=",
"arg",
".",
"to_plotly_json",
"(",
")",
"elif",
"isinstance",
"(",
"arg",
",",
"dict",
")",
":",
"arg",
"=",
"_copy",
".",
"copy",
"(",
"arg",
")",
"else",
":",
"raise",
"ValueError",
"(",
"\"\"\"\\\nThe first argument to the plotly.graph_objs.bar.Stream \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.bar.Stream`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"maxpoints\"",
",",
"None",
")",
"_v",
"=",
"maxpoints",
"if",
"maxpoints",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"maxpoints\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"token\"",
",",
"None",
")",
"_v",
"=",
"token",
"if",
"token",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"token\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
72,
4
] | [
139,
34
] | python | en | ['en', 'error', 'th'] | False |
create_attachment | (payload) |
Create a simple url-based attachment.
|
Create a simple url-based attachment.
| def create_attachment(payload):
"""
Create a simple url-based attachment.
"""
# TODO support data-based attachments?
assert payload['type'] in [
'image',
'video',
'file',
'audio',
], 'unsupported attachment type'
assert (
'url' in payload or 'attachment_id' in payload
), 'unsupported attachment method: must contain url or attachment_id'
if 'url' in payload:
return {'type': payload['type'], 'payload': {'url': payload['url']}}
elif 'attachment_id' in payload:
return {
'type': payload['type'],
'payload': {'attachment_id': payload['attachment_id']},
} | [
"def",
"create_attachment",
"(",
"payload",
")",
":",
"# TODO support data-based attachments?",
"assert",
"payload",
"[",
"'type'",
"]",
"in",
"[",
"'image'",
",",
"'video'",
",",
"'file'",
",",
"'audio'",
",",
"]",
",",
"'unsupported attachment type'",
"assert",
"(",
"'url'",
"in",
"payload",
"or",
"'attachment_id'",
"in",
"payload",
")",
",",
"'unsupported attachment method: must contain url or attachment_id'",
"if",
"'url'",
"in",
"payload",
":",
"return",
"{",
"'type'",
":",
"payload",
"[",
"'type'",
"]",
",",
"'payload'",
":",
"{",
"'url'",
":",
"payload",
"[",
"'url'",
"]",
"}",
"}",
"elif",
"'attachment_id'",
"in",
"payload",
":",
"return",
"{",
"'type'",
":",
"payload",
"[",
"'type'",
"]",
",",
"'payload'",
":",
"{",
"'attachment_id'",
":",
"payload",
"[",
"'attachment_id'",
"]",
"}",
",",
"}"
] | [
22,
0
] | [
42,
9
] | python | en | ['en', 'error', 'th'] | False |
create_reply_option | (title, payload='') |
Create a quick reply option.
Takes in display title and optionally extra custom data.
|
Create a quick reply option. | def create_reply_option(title, payload=''):
"""
Create a quick reply option.
Takes in display title and optionally extra custom data.
"""
assert (
len(title) <= MAX_QUICK_REPLY_TITLE_CHARS
), 'Quick reply title length {} greater than the max of {}'.format(
len(title), MAX_QUICK_REPLY_TITLE_CHARS
)
assert (
len(payload) <= MAX_POSTBACK_CHARS
), 'Payload length {} greater than the max of {}'.format(
len(payload), MAX_POSTBACK_CHARS
)
return {'content_type': 'text', 'title': title, 'payload': payload} | [
"def",
"create_reply_option",
"(",
"title",
",",
"payload",
"=",
"''",
")",
":",
"assert",
"(",
"len",
"(",
"title",
")",
"<=",
"MAX_QUICK_REPLY_TITLE_CHARS",
")",
",",
"'Quick reply title length {} greater than the max of {}'",
".",
"format",
"(",
"len",
"(",
"title",
")",
",",
"MAX_QUICK_REPLY_TITLE_CHARS",
")",
"assert",
"(",
"len",
"(",
"payload",
")",
"<=",
"MAX_POSTBACK_CHARS",
")",
",",
"'Payload length {} greater than the max of {}'",
".",
"format",
"(",
"len",
"(",
"payload",
")",
",",
"MAX_POSTBACK_CHARS",
")",
"return",
"{",
"'content_type'",
":",
"'text'",
",",
"'title'",
":",
"title",
",",
"'payload'",
":",
"payload",
"}"
] | [
45,
0
] | [
61,
71
] | python | en | ['en', 'error', 'th'] | False |
create_text_message | (text, quick_replies=None) |
Return a list of text messages from the given text.
If the message is too long it is split into multiple messages. quick_replies should
be a list of options made with create_reply_option.
|
Return a list of text messages from the given text. | def create_text_message(text, quick_replies=None):
"""
Return a list of text messages from the given text.
If the message is too long it is split into multiple messages. quick_replies should
be a list of options made with create_reply_option.
"""
def _message(text_content, replies):
payload = {'text': text_content[:MAX_TEXT_CHARS]}
if replies:
payload['quick_replies'] = replies
return payload
tokens = [s[:MAX_TEXT_CHARS] for s in text.split(' ')]
splits = []
cutoff = 0
curr_length = 0
if quick_replies:
assert (
len(quick_replies) <= MAX_QUICK_REPLIES
), 'Number of quick replies {} greater than the max of {}'.format(
len(quick_replies), MAX_QUICK_REPLIES
)
for i in range(len(tokens)):
if tokens[i] == '[*SPLIT*]':
if ' '.join(tokens[cutoff : i - 1]).strip() != '':
splits.append(_message(' '.join(tokens[cutoff:i]), None))
cutoff = i + 1
curr_length = 0
if curr_length + len(tokens[i]) > MAX_TEXT_CHARS:
splits.append(_message(' '.join(tokens[cutoff:i]), None))
cutoff = i
curr_length = 0
curr_length += len(tokens[i]) + 1
if cutoff < len(tokens):
splits.append(_message(' '.join(tokens[cutoff:]), quick_replies))
return splits | [
"def",
"create_text_message",
"(",
"text",
",",
"quick_replies",
"=",
"None",
")",
":",
"def",
"_message",
"(",
"text_content",
",",
"replies",
")",
":",
"payload",
"=",
"{",
"'text'",
":",
"text_content",
"[",
":",
"MAX_TEXT_CHARS",
"]",
"}",
"if",
"replies",
":",
"payload",
"[",
"'quick_replies'",
"]",
"=",
"replies",
"return",
"payload",
"tokens",
"=",
"[",
"s",
"[",
":",
"MAX_TEXT_CHARS",
"]",
"for",
"s",
"in",
"text",
".",
"split",
"(",
"' '",
")",
"]",
"splits",
"=",
"[",
"]",
"cutoff",
"=",
"0",
"curr_length",
"=",
"0",
"if",
"quick_replies",
":",
"assert",
"(",
"len",
"(",
"quick_replies",
")",
"<=",
"MAX_QUICK_REPLIES",
")",
",",
"'Number of quick replies {} greater than the max of {}'",
".",
"format",
"(",
"len",
"(",
"quick_replies",
")",
",",
"MAX_QUICK_REPLIES",
")",
"for",
"i",
"in",
"range",
"(",
"len",
"(",
"tokens",
")",
")",
":",
"if",
"tokens",
"[",
"i",
"]",
"==",
"'[*SPLIT*]'",
":",
"if",
"' '",
".",
"join",
"(",
"tokens",
"[",
"cutoff",
":",
"i",
"-",
"1",
"]",
")",
".",
"strip",
"(",
")",
"!=",
"''",
":",
"splits",
".",
"append",
"(",
"_message",
"(",
"' '",
".",
"join",
"(",
"tokens",
"[",
"cutoff",
":",
"i",
"]",
")",
",",
"None",
")",
")",
"cutoff",
"=",
"i",
"+",
"1",
"curr_length",
"=",
"0",
"if",
"curr_length",
"+",
"len",
"(",
"tokens",
"[",
"i",
"]",
")",
">",
"MAX_TEXT_CHARS",
":",
"splits",
".",
"append",
"(",
"_message",
"(",
"' '",
".",
"join",
"(",
"tokens",
"[",
"cutoff",
":",
"i",
"]",
")",
",",
"None",
")",
")",
"cutoff",
"=",
"i",
"curr_length",
"=",
"0",
"curr_length",
"+=",
"len",
"(",
"tokens",
"[",
"i",
"]",
")",
"+",
"1",
"if",
"cutoff",
"<",
"len",
"(",
"tokens",
")",
":",
"splits",
".",
"append",
"(",
"_message",
"(",
"' '",
".",
"join",
"(",
"tokens",
"[",
"cutoff",
":",
"]",
")",
",",
"quick_replies",
")",
")",
"return",
"splits"
] | [
64,
0
] | [
101,
17
] | python | en | ['en', 'error', 'th'] | False |
create_attachment_message | (attachment_item, quick_replies=None) |
Create a message list made with only an attachment.
quick_replies should be a list of options made with create_reply_option.
|
Create a message list made with only an attachment. | def create_attachment_message(attachment_item, quick_replies=None):
"""
Create a message list made with only an attachment.
quick_replies should be a list of options made with create_reply_option.
"""
payload = {'attachment': attachment_item}
if quick_replies:
assert (
len(quick_replies) <= MAX_QUICK_REPLIES
), 'Number of quick replies {} greater than the max of {}'.format(
len(quick_replies), MAX_QUICK_REPLIES
)
payload['quick_replies'] = quick_replies
return [payload] | [
"def",
"create_attachment_message",
"(",
"attachment_item",
",",
"quick_replies",
"=",
"None",
")",
":",
"payload",
"=",
"{",
"'attachment'",
":",
"attachment_item",
"}",
"if",
"quick_replies",
":",
"assert",
"(",
"len",
"(",
"quick_replies",
")",
"<=",
"MAX_QUICK_REPLIES",
")",
",",
"'Number of quick replies {} greater than the max of {}'",
".",
"format",
"(",
"len",
"(",
"quick_replies",
")",
",",
"MAX_QUICK_REPLIES",
")",
"payload",
"[",
"'quick_replies'",
"]",
"=",
"quick_replies",
"return",
"[",
"payload",
"]"
] | [
104,
0
] | [
118,
20
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.__init__ | (self, secret_token) |
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
|
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
| def __init__(self, secret_token):
"""
server_url: url at which the server is to be run
port: port for the socket to operate on
message_callback: function to be called on incoming message objects (format: message_callback(self, data))
"""
self.auth_args = {'access_token': secret_token} | [
"def",
"__init__",
"(",
"self",
",",
"secret_token",
")",
":",
"self",
".",
"auth_args",
"=",
"{",
"'access_token'",
":",
"secret_token",
"}"
] | [
155,
4
] | [
161,
55
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.send_fb_payload | (
self, receiver_id, payload, quick_replies=None, persona_id=None
) |
Sends a payload to messenger, processes it if we can.
|
Sends a payload to messenger, processes it if we can.
| def send_fb_payload(
self, receiver_id, payload, quick_replies=None, persona_id=None
):
"""
Sends a payload to messenger, processes it if we can.
"""
api_address = f'https://graph.facebook.com/{API_VERSION}/me/messages'
if payload['type'] == 'list':
data = create_compact_list_message(payload['data'])
elif payload['type'] in ['image', 'video', 'file', 'audio']:
data = create_attachment(payload)
else:
data = payload['data']
message = {
"messaging_type": 'RESPONSE',
"recipient": {"id": receiver_id},
"message": {"attachment": data},
}
if quick_replies is not None:
quick_replies = [create_reply_option(x, x) for x in quick_replies]
message['message']['quick_replies'] = quick_replies
if persona_id is not None:
payload['persona_id'] = persona_id
response = requests.post(api_address, params=self.auth_args, json=message)
result = response.json()
if 'error' in result:
if result['error']['code'] == 1200:
# temporary error please retry
response = requests.post(
api_address, params=self.auth_args, json=message
)
result = response.json()
log_utils.print_and_log(
logging.INFO, '"Facebook response from message send: {}"'.format(result)
)
return result | [
"def",
"send_fb_payload",
"(",
"self",
",",
"receiver_id",
",",
"payload",
",",
"quick_replies",
"=",
"None",
",",
"persona_id",
"=",
"None",
")",
":",
"api_address",
"=",
"f'https://graph.facebook.com/{API_VERSION}/me/messages'",
"if",
"payload",
"[",
"'type'",
"]",
"==",
"'list'",
":",
"data",
"=",
"create_compact_list_message",
"(",
"payload",
"[",
"'data'",
"]",
")",
"elif",
"payload",
"[",
"'type'",
"]",
"in",
"[",
"'image'",
",",
"'video'",
",",
"'file'",
",",
"'audio'",
"]",
":",
"data",
"=",
"create_attachment",
"(",
"payload",
")",
"else",
":",
"data",
"=",
"payload",
"[",
"'data'",
"]",
"message",
"=",
"{",
"\"messaging_type\"",
":",
"'RESPONSE'",
",",
"\"recipient\"",
":",
"{",
"\"id\"",
":",
"receiver_id",
"}",
",",
"\"message\"",
":",
"{",
"\"attachment\"",
":",
"data",
"}",
",",
"}",
"if",
"quick_replies",
"is",
"not",
"None",
":",
"quick_replies",
"=",
"[",
"create_reply_option",
"(",
"x",
",",
"x",
")",
"for",
"x",
"in",
"quick_replies",
"]",
"message",
"[",
"'message'",
"]",
"[",
"'quick_replies'",
"]",
"=",
"quick_replies",
"if",
"persona_id",
"is",
"not",
"None",
":",
"payload",
"[",
"'persona_id'",
"]",
"=",
"persona_id",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"message",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"if",
"'error'",
"in",
"result",
":",
"if",
"result",
"[",
"'error'",
"]",
"[",
"'code'",
"]",
"==",
"1200",
":",
"# temporary error please retry",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"message",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"INFO",
",",
"'\"Facebook response from message send: {}\"'",
".",
"format",
"(",
"result",
")",
")",
"return",
"result"
] | [
176,
4
] | [
212,
21
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.send_fb_message | (
self, receiver_id, message, is_response, quick_replies=None, persona_id=None
) |
Sends a message directly to messenger.
|
Sends a message directly to messenger.
| def send_fb_message(
self, receiver_id, message, is_response, quick_replies=None, persona_id=None
):
"""
Sends a message directly to messenger.
"""
api_address = f'https://graph.facebook.com/{API_VERSION}/me/messages'
if quick_replies is not None:
quick_replies = [create_reply_option(x, x) for x in quick_replies]
ms = create_text_message(message, quick_replies)
results = []
for m in ms:
if m['text'] == '':
continue # Skip blank messages
payload = {
"messaging_type": 'RESPONSE' if is_response else 'UPDATE',
"recipient": {"id": receiver_id},
"message": m,
}
if persona_id is not None:
payload['persona_id'] = persona_id
response = requests.post(api_address, params=self.auth_args, json=payload)
result = response.json()
if 'error' in result:
if result['error']['code'] == 1200:
# temporary error please retry
response = requests.post(
api_address, params=self.auth_args, json=payload
)
result = response.json()
log_utils.print_and_log(
logging.INFO, '"Facebook response from message send: {}"'.format(result)
)
results.append(result)
return results | [
"def",
"send_fb_message",
"(",
"self",
",",
"receiver_id",
",",
"message",
",",
"is_response",
",",
"quick_replies",
"=",
"None",
",",
"persona_id",
"=",
"None",
")",
":",
"api_address",
"=",
"f'https://graph.facebook.com/{API_VERSION}/me/messages'",
"if",
"quick_replies",
"is",
"not",
"None",
":",
"quick_replies",
"=",
"[",
"create_reply_option",
"(",
"x",
",",
"x",
")",
"for",
"x",
"in",
"quick_replies",
"]",
"ms",
"=",
"create_text_message",
"(",
"message",
",",
"quick_replies",
")",
"results",
"=",
"[",
"]",
"for",
"m",
"in",
"ms",
":",
"if",
"m",
"[",
"'text'",
"]",
"==",
"''",
":",
"continue",
"# Skip blank messages",
"payload",
"=",
"{",
"\"messaging_type\"",
":",
"'RESPONSE'",
"if",
"is_response",
"else",
"'UPDATE'",
",",
"\"recipient\"",
":",
"{",
"\"id\"",
":",
"receiver_id",
"}",
",",
"\"message\"",
":",
"m",
",",
"}",
"if",
"persona_id",
"is",
"not",
"None",
":",
"payload",
"[",
"'persona_id'",
"]",
"=",
"persona_id",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"payload",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"if",
"'error'",
"in",
"result",
":",
"if",
"result",
"[",
"'error'",
"]",
"[",
"'code'",
"]",
"==",
"1200",
":",
"# temporary error please retry",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"payload",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"INFO",
",",
"'\"Facebook response from message send: {}\"'",
".",
"format",
"(",
"result",
")",
")",
"results",
".",
"append",
"(",
"result",
")",
"return",
"results"
] | [
214,
4
] | [
248,
22
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.create_persona | (self, name, image_url) |
Creates a new persona and returns persona_id.
|
Creates a new persona and returns persona_id.
| def create_persona(self, name, image_url):
"""
Creates a new persona and returns persona_id.
"""
api_address = 'https://graph.facebook.com/me/personas'
message = {'name': name, "profile_picture_url": image_url}
response = requests.post(api_address, params=self.auth_args, json=message)
result = response.json()
log_utils.print_and_log(
logging.INFO, '"Facebook response from create persona: {}"'.format(result)
)
return result | [
"def",
"create_persona",
"(",
"self",
",",
"name",
",",
"image_url",
")",
":",
"api_address",
"=",
"'https://graph.facebook.com/me/personas'",
"message",
"=",
"{",
"'name'",
":",
"name",
",",
"\"profile_picture_url\"",
":",
"image_url",
"}",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"message",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"INFO",
",",
"'\"Facebook response from create persona: {}\"'",
".",
"format",
"(",
"result",
")",
")",
"return",
"result"
] | [
250,
4
] | [
261,
21
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.delete_persona | (self, persona_id) |
Deletes the persona.
|
Deletes the persona.
| def delete_persona(self, persona_id):
"""
Deletes the persona.
"""
api_address = 'https://graph.facebook.com/' + persona_id
response = requests.delete(api_address, params=self.auth_args)
result = response.json()
log_utils.print_and_log(
logging.INFO, '"Facebook response from delete persona: {}"'.format(result)
)
return result | [
"def",
"delete_persona",
"(",
"self",
",",
"persona_id",
")",
":",
"api_address",
"=",
"'https://graph.facebook.com/'",
"+",
"persona_id",
"response",
"=",
"requests",
".",
"delete",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"INFO",
",",
"'\"Facebook response from delete persona: {}\"'",
".",
"format",
"(",
"result",
")",
")",
"return",
"result"
] | [
263,
4
] | [
273,
21
] | python | en | ['en', 'error', 'th'] | False |
MessageSender.upload_fb_attachment | (self, payload) |
Uploads an attachment using the Attachment Upload API and returns an attachment
ID.
|
Uploads an attachment using the Attachment Upload API and returns an attachment
ID.
| def upload_fb_attachment(self, payload):
"""
Uploads an attachment using the Attachment Upload API and returns an attachment
ID.
"""
api_address = f'https://graph.facebook.com/{API_VERSION}/me/message_attachments'
assert payload['type'] in [
'image',
'video',
'file',
'audio',
], 'unsupported attachment type'
if 'url' in payload:
message = {
"message": {
"attachment": {
"type": payload['type'],
"payload": {"is_reusable": "true", "url": payload['url']},
}
}
}
response = requests.post(api_address, params=self.auth_args, json=message)
elif 'filename' in payload:
message = {
"attachment": {
"type": payload['type'],
"payload": {"is_reusable": "true"},
}
}
with open(payload['filename'], 'rb') as f:
filedata = {
"filedata": (
payload['filename'],
f,
payload['type'] + '/' + payload['format'],
)
}
response = requests.post(
api_address,
params=self.auth_args,
data={"message": json.dumps(message)},
files=filedata,
)
result = response.json()
log_utils.print_and_log(
logging.INFO,
'"Facebook response from attachment upload: {}"'.format(result),
)
return result | [
"def",
"upload_fb_attachment",
"(",
"self",
",",
"payload",
")",
":",
"api_address",
"=",
"f'https://graph.facebook.com/{API_VERSION}/me/message_attachments'",
"assert",
"payload",
"[",
"'type'",
"]",
"in",
"[",
"'image'",
",",
"'video'",
",",
"'file'",
",",
"'audio'",
",",
"]",
",",
"'unsupported attachment type'",
"if",
"'url'",
"in",
"payload",
":",
"message",
"=",
"{",
"\"message\"",
":",
"{",
"\"attachment\"",
":",
"{",
"\"type\"",
":",
"payload",
"[",
"'type'",
"]",
",",
"\"payload\"",
":",
"{",
"\"is_reusable\"",
":",
"\"true\"",
",",
"\"url\"",
":",
"payload",
"[",
"'url'",
"]",
"}",
",",
"}",
"}",
"}",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"json",
"=",
"message",
")",
"elif",
"'filename'",
"in",
"payload",
":",
"message",
"=",
"{",
"\"attachment\"",
":",
"{",
"\"type\"",
":",
"payload",
"[",
"'type'",
"]",
",",
"\"payload\"",
":",
"{",
"\"is_reusable\"",
":",
"\"true\"",
"}",
",",
"}",
"}",
"with",
"open",
"(",
"payload",
"[",
"'filename'",
"]",
",",
"'rb'",
")",
"as",
"f",
":",
"filedata",
"=",
"{",
"\"filedata\"",
":",
"(",
"payload",
"[",
"'filename'",
"]",
",",
"f",
",",
"payload",
"[",
"'type'",
"]",
"+",
"'/'",
"+",
"payload",
"[",
"'format'",
"]",
",",
")",
"}",
"response",
"=",
"requests",
".",
"post",
"(",
"api_address",
",",
"params",
"=",
"self",
".",
"auth_args",
",",
"data",
"=",
"{",
"\"message\"",
":",
"json",
".",
"dumps",
"(",
"message",
")",
"}",
",",
"files",
"=",
"filedata",
",",
")",
"result",
"=",
"response",
".",
"json",
"(",
")",
"log_utils",
".",
"print_and_log",
"(",
"logging",
".",
"INFO",
",",
"'\"Facebook response from attachment upload: {}\"'",
".",
"format",
"(",
"result",
")",
",",
")",
"return",
"result"
] | [
275,
4
] | [
323,
21
] | python | en | ['en', 'error', 'th'] | False |
test_check_equal | (constraints) |
The same constraints as from fixture but should have not the same id
|
The same constraints as from fixture but should have not the same id
| def test_check_equal(constraints):
same_role, same_and, same_or, same_forbidden = constraints
"""
The same constraints as from fixture but should have not the same id
"""
role_constraints = [AuthConstraint(role=TRUSTEE,
sig_count=1,
need_to_be_owner=True),
AuthConstraint(role=STEWARD,
sig_count=1,
need_to_be_owner=True)]
and_constraint = AuthConstraintAnd(role_constraints)
or_constraint = AuthConstraintOr(role_constraints)
forbidden_constraint = AuthConstraintForbidden()
assert id(same_role) != id(role_constraints[0])
assert id(same_or) != id(or_constraint)
assert id(same_and) != id(and_constraint)
assert id(same_forbidden) != id(forbidden_constraint)
assert same_role == role_constraints[0]
assert same_or == or_constraint
assert same_and == and_constraint
assert same_forbidden == forbidden_constraint | [
"def",
"test_check_equal",
"(",
"constraints",
")",
":",
"same_role",
",",
"same_and",
",",
"same_or",
",",
"same_forbidden",
"=",
"constraints",
"role_constraints",
"=",
"[",
"AuthConstraint",
"(",
"role",
"=",
"TRUSTEE",
",",
"sig_count",
"=",
"1",
",",
"need_to_be_owner",
"=",
"True",
")",
",",
"AuthConstraint",
"(",
"role",
"=",
"STEWARD",
",",
"sig_count",
"=",
"1",
",",
"need_to_be_owner",
"=",
"True",
")",
"]",
"and_constraint",
"=",
"AuthConstraintAnd",
"(",
"role_constraints",
")",
"or_constraint",
"=",
"AuthConstraintOr",
"(",
"role_constraints",
")",
"forbidden_constraint",
"=",
"AuthConstraintForbidden",
"(",
")",
"assert",
"id",
"(",
"same_role",
")",
"!=",
"id",
"(",
"role_constraints",
"[",
"0",
"]",
")",
"assert",
"id",
"(",
"same_or",
")",
"!=",
"id",
"(",
"or_constraint",
")",
"assert",
"id",
"(",
"same_and",
")",
"!=",
"id",
"(",
"and_constraint",
")",
"assert",
"id",
"(",
"same_forbidden",
")",
"!=",
"id",
"(",
"forbidden_constraint",
")",
"assert",
"same_role",
"==",
"role_constraints",
"[",
"0",
"]",
"assert",
"same_or",
"==",
"or_constraint",
"assert",
"same_and",
"==",
"and_constraint",
"assert",
"same_forbidden",
"==",
"forbidden_constraint"
] | [
124,
0
] | [
146,
49
] | python | en | ['en', 'error', 'th'] | False |
CredentialIssue.__init__ | (
self,
_id: str = None,
*,
comment: str = None,
credentials_attach: Sequence[AttachDecorator] = None,
**kwargs,
) |
Initialize credential issue object.
Args:
comment: optional comment
credentials_attach: credentials attachments
|
Initialize credential issue object. | def __init__(
self,
_id: str = None,
*,
comment: str = None,
credentials_attach: Sequence[AttachDecorator] = None,
**kwargs,
):
"""
Initialize credential issue object.
Args:
comment: optional comment
credentials_attach: credentials attachments
"""
super().__init__(_id=_id, **kwargs)
self.comment = comment
self.credentials_attach = list(credentials_attach) if credentials_attach else [] | [
"def",
"__init__",
"(",
"self",
",",
"_id",
":",
"str",
"=",
"None",
",",
"*",
",",
"comment",
":",
"str",
"=",
"None",
",",
"credentials_attach",
":",
"Sequence",
"[",
"AttachDecorator",
"]",
"=",
"None",
",",
"*",
"*",
"kwargs",
",",
")",
":",
"super",
"(",
")",
".",
"__init__",
"(",
"_id",
"=",
"_id",
",",
"*",
"*",
"kwargs",
")",
"self",
".",
"comment",
"=",
"comment",
"self",
".",
"credentials_attach",
"=",
"list",
"(",
"credentials_attach",
")",
"if",
"credentials_attach",
"else",
"[",
"]"
] | [
30,
4
] | [
48,
88
] | python | en | ['en', 'error', 'th'] | False |
CredentialIssue.indy_credential | (self, index: int = 0) |
Retrieve and decode indy credential from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
|
Retrieve and decode indy credential from attachment. | def indy_credential(self, index: int = 0):
"""
Retrieve and decode indy credential from attachment.
Args:
index: ordinal in attachment list to decode and return
(typically, list has length 1)
"""
return self.credentials_attach[index].indy_dict | [
"def",
"indy_credential",
"(",
"self",
",",
"index",
":",
"int",
"=",
"0",
")",
":",
"return",
"self",
".",
"credentials_attach",
"[",
"index",
"]",
".",
"indy_dict"
] | [
50,
4
] | [
59,
55
] | python | en | ['en', 'error', 'th'] | False |
CredentialIssue.wrap_indy_credential | (cls, indy_cred: dict) | Convert an indy credential offer to an attachment decorator. | Convert an indy credential offer to an attachment decorator. | def wrap_indy_credential(cls, indy_cred: dict) -> AttachDecorator:
"""Convert an indy credential offer to an attachment decorator."""
return AttachDecorator.from_indy_dict(
indy_dict=indy_cred, ident=ATTACH_DECO_IDS[CREDENTIAL_ISSUE]
) | [
"def",
"wrap_indy_credential",
"(",
"cls",
",",
"indy_cred",
":",
"dict",
")",
"->",
"AttachDecorator",
":",
"return",
"AttachDecorator",
".",
"from_indy_dict",
"(",
"indy_dict",
"=",
"indy_cred",
",",
"ident",
"=",
"ATTACH_DECO_IDS",
"[",
"CREDENTIAL_ISSUE",
"]",
")"
] | [
62,
4
] | [
66,
9
] | python | en | ['en', 'en', 'en'] | True |
Data.area | (self) |
The 'area' property is a tuple of instances of
Area that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Area
- A list or tuple of dicts of string/value properties that
will be passed to the Area constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Area]
|
The 'area' property is a tuple of instances of
Area that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Area
- A list or tuple of dicts of string/value properties that
will be passed to the Area constructor
Supported dict properties: | def area(self):
"""
The 'area' property is a tuple of instances of
Area that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Area
- A list or tuple of dicts of string/value properties that
will be passed to the Area constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Area]
"""
return self["area"] | [
"def",
"area",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"area\"",
"]"
] | [
63,
4
] | [
77,
27
] | python | en | ['en', 'error', 'th'] | False |
Data.barpolar | (self) |
The 'barpolar' property is a tuple of instances of
Barpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Barpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Barpolar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Barpolar]
|
The 'barpolar' property is a tuple of instances of
Barpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Barpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Barpolar constructor
Supported dict properties: | def barpolar(self):
"""
The 'barpolar' property is a tuple of instances of
Barpolar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Barpolar
- A list or tuple of dicts of string/value properties that
will be passed to the Barpolar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Barpolar]
"""
return self["barpolar"] | [
"def",
"barpolar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"barpolar\"",
"]"
] | [
86,
4
] | [
100,
31
] | python | en | ['en', 'error', 'th'] | False |
Data.bar | (self) |
The 'bar' property is a tuple of instances of
Bar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Bar
- A list or tuple of dicts of string/value properties that
will be passed to the Bar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Bar]
|
The 'bar' property is a tuple of instances of
Bar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Bar
- A list or tuple of dicts of string/value properties that
will be passed to the Bar constructor
Supported dict properties: | def bar(self):
"""
The 'bar' property is a tuple of instances of
Bar that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Bar
- A list or tuple of dicts of string/value properties that
will be passed to the Bar constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Bar]
"""
return self["bar"] | [
"def",
"bar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bar\"",
"]"
] | [
109,
4
] | [
123,
26
] | python | en | ['en', 'error', 'th'] | False |
Data.box | (self) |
The 'box' property is a tuple of instances of
Box that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Box
- A list or tuple of dicts of string/value properties that
will be passed to the Box constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Box]
|
The 'box' property is a tuple of instances of
Box that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Box
- A list or tuple of dicts of string/value properties that
will be passed to the Box constructor
Supported dict properties: | def box(self):
"""
The 'box' property is a tuple of instances of
Box that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Box
- A list or tuple of dicts of string/value properties that
will be passed to the Box constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Box]
"""
return self["box"] | [
"def",
"box",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"box\"",
"]"
] | [
132,
4
] | [
146,
26
] | python | en | ['en', 'error', 'th'] | False |
Data.candlestick | (self) |
The 'candlestick' property is a tuple of instances of
Candlestick that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Candlestick
- A list or tuple of dicts of string/value properties that
will be passed to the Candlestick constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Candlestick]
|
The 'candlestick' property is a tuple of instances of
Candlestick that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Candlestick
- A list or tuple of dicts of string/value properties that
will be passed to the Candlestick constructor
Supported dict properties: | def candlestick(self):
"""
The 'candlestick' property is a tuple of instances of
Candlestick that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Candlestick
- A list or tuple of dicts of string/value properties that
will be passed to the Candlestick constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Candlestick]
"""
return self["candlestick"] | [
"def",
"candlestick",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"candlestick\"",
"]"
] | [
155,
4
] | [
169,
34
] | python | en | ['en', 'error', 'th'] | False |
Data.carpet | (self) |
The 'carpet' property is a tuple of instances of
Carpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Carpet
- A list or tuple of dicts of string/value properties that
will be passed to the Carpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Carpet]
|
The 'carpet' property is a tuple of instances of
Carpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Carpet
- A list or tuple of dicts of string/value properties that
will be passed to the Carpet constructor
Supported dict properties: | def carpet(self):
"""
The 'carpet' property is a tuple of instances of
Carpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Carpet
- A list or tuple of dicts of string/value properties that
will be passed to the Carpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Carpet]
"""
return self["carpet"] | [
"def",
"carpet",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"carpet\"",
"]"
] | [
178,
4
] | [
192,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.choroplethmapbox | (self) |
The 'choroplethmapbox' property is a tuple of instances of
Choroplethmapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choroplethmapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Choroplethmapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Choroplethmapbox]
|
The 'choroplethmapbox' property is a tuple of instances of
Choroplethmapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choroplethmapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Choroplethmapbox constructor
Supported dict properties: | def choroplethmapbox(self):
"""
The 'choroplethmapbox' property is a tuple of instances of
Choroplethmapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choroplethmapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Choroplethmapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Choroplethmapbox]
"""
return self["choroplethmapbox"] | [
"def",
"choroplethmapbox",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"choroplethmapbox\"",
"]"
] | [
201,
4
] | [
215,
39
] | python | en | ['en', 'error', 'th'] | False |
Data.choropleth | (self) |
The 'choropleth' property is a tuple of instances of
Choropleth that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choropleth
- A list or tuple of dicts of string/value properties that
will be passed to the Choropleth constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Choropleth]
|
The 'choropleth' property is a tuple of instances of
Choropleth that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choropleth
- A list or tuple of dicts of string/value properties that
will be passed to the Choropleth constructor
Supported dict properties: | def choropleth(self):
"""
The 'choropleth' property is a tuple of instances of
Choropleth that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Choropleth
- A list or tuple of dicts of string/value properties that
will be passed to the Choropleth constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Choropleth]
"""
return self["choropleth"] | [
"def",
"choropleth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"choropleth\"",
"]"
] | [
224,
4
] | [
238,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.cone | (self) |
The 'cone' property is a tuple of instances of
Cone that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Cone
- A list or tuple of dicts of string/value properties that
will be passed to the Cone constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Cone]
|
The 'cone' property is a tuple of instances of
Cone that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Cone
- A list or tuple of dicts of string/value properties that
will be passed to the Cone constructor
Supported dict properties: | def cone(self):
"""
The 'cone' property is a tuple of instances of
Cone that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Cone
- A list or tuple of dicts of string/value properties that
will be passed to the Cone constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Cone]
"""
return self["cone"] | [
"def",
"cone",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"cone\"",
"]"
] | [
247,
4
] | [
261,
27
] | python | en | ['en', 'error', 'th'] | False |
Data.contourcarpet | (self) |
The 'contourcarpet' property is a tuple of instances of
Contourcarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contourcarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Contourcarpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Contourcarpet]
|
The 'contourcarpet' property is a tuple of instances of
Contourcarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contourcarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Contourcarpet constructor
Supported dict properties: | def contourcarpet(self):
"""
The 'contourcarpet' property is a tuple of instances of
Contourcarpet that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contourcarpet
- A list or tuple of dicts of string/value properties that
will be passed to the Contourcarpet constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Contourcarpet]
"""
return self["contourcarpet"] | [
"def",
"contourcarpet",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"contourcarpet\"",
"]"
] | [
270,
4
] | [
284,
36
] | python | en | ['en', 'error', 'th'] | False |
Data.contour | (self) |
The 'contour' property is a tuple of instances of
Contour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contour
- A list or tuple of dicts of string/value properties that
will be passed to the Contour constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Contour]
|
The 'contour' property is a tuple of instances of
Contour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contour
- A list or tuple of dicts of string/value properties that
will be passed to the Contour constructor
Supported dict properties: | def contour(self):
"""
The 'contour' property is a tuple of instances of
Contour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Contour
- A list or tuple of dicts of string/value properties that
will be passed to the Contour constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Contour]
"""
return self["contour"] | [
"def",
"contour",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"contour\"",
"]"
] | [
293,
4
] | [
307,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.densitymapbox | (self) |
The 'densitymapbox' property is a tuple of instances of
Densitymapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Densitymapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Densitymapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Densitymapbox]
|
The 'densitymapbox' property is a tuple of instances of
Densitymapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Densitymapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Densitymapbox constructor
Supported dict properties: | def densitymapbox(self):
"""
The 'densitymapbox' property is a tuple of instances of
Densitymapbox that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Densitymapbox
- A list or tuple of dicts of string/value properties that
will be passed to the Densitymapbox constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Densitymapbox]
"""
return self["densitymapbox"] | [
"def",
"densitymapbox",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"densitymapbox\"",
"]"
] | [
316,
4
] | [
330,
36
] | python | en | ['en', 'error', 'th'] | False |
Data.funnelarea | (self) |
The 'funnelarea' property is a tuple of instances of
Funnelarea that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnelarea
- A list or tuple of dicts of string/value properties that
will be passed to the Funnelarea constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Funnelarea]
|
The 'funnelarea' property is a tuple of instances of
Funnelarea that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnelarea
- A list or tuple of dicts of string/value properties that
will be passed to the Funnelarea constructor
Supported dict properties: | def funnelarea(self):
"""
The 'funnelarea' property is a tuple of instances of
Funnelarea that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnelarea
- A list or tuple of dicts of string/value properties that
will be passed to the Funnelarea constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Funnelarea]
"""
return self["funnelarea"] | [
"def",
"funnelarea",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"funnelarea\"",
"]"
] | [
339,
4
] | [
353,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.funnel | (self) |
The 'funnel' property is a tuple of instances of
Funnel that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnel
- A list or tuple of dicts of string/value properties that
will be passed to the Funnel constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Funnel]
|
The 'funnel' property is a tuple of instances of
Funnel that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnel
- A list or tuple of dicts of string/value properties that
will be passed to the Funnel constructor
Supported dict properties: | def funnel(self):
"""
The 'funnel' property is a tuple of instances of
Funnel that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Funnel
- A list or tuple of dicts of string/value properties that
will be passed to the Funnel constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Funnel]
"""
return self["funnel"] | [
"def",
"funnel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"funnel\"",
"]"
] | [
362,
4
] | [
376,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.heatmapgl | (self) |
The 'heatmapgl' property is a tuple of instances of
Heatmapgl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmapgl
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmapgl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Heatmapgl]
|
The 'heatmapgl' property is a tuple of instances of
Heatmapgl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmapgl
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmapgl constructor
Supported dict properties: | def heatmapgl(self):
"""
The 'heatmapgl' property is a tuple of instances of
Heatmapgl that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmapgl
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmapgl constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Heatmapgl]
"""
return self["heatmapgl"] | [
"def",
"heatmapgl",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"heatmapgl\"",
"]"
] | [
385,
4
] | [
399,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.heatmap | (self) |
The 'heatmap' property is a tuple of instances of
Heatmap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmap
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmap constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Heatmap]
|
The 'heatmap' property is a tuple of instances of
Heatmap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmap
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmap constructor
Supported dict properties: | def heatmap(self):
"""
The 'heatmap' property is a tuple of instances of
Heatmap that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Heatmap
- A list or tuple of dicts of string/value properties that
will be passed to the Heatmap constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Heatmap]
"""
return self["heatmap"] | [
"def",
"heatmap",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"heatmap\"",
"]"
] | [
408,
4
] | [
422,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.histogram2dcontour | (self) |
The 'histogram2dcontour' property is a tuple of instances of
Histogram2dContour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2dContour
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2dContour constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram2dContour]
|
The 'histogram2dcontour' property is a tuple of instances of
Histogram2dContour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2dContour
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2dContour constructor
Supported dict properties: | def histogram2dcontour(self):
"""
The 'histogram2dcontour' property is a tuple of instances of
Histogram2dContour that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2dContour
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2dContour constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram2dContour]
"""
return self["histogram2dcontour"] | [
"def",
"histogram2dcontour",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"histogram2dcontour\"",
"]"
] | [
431,
4
] | [
445,
41
] | python | en | ['en', 'error', 'th'] | False |
Data.histogram2d | (self) |
The 'histogram2d' property is a tuple of instances of
Histogram2d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2d
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram2d]
|
The 'histogram2d' property is a tuple of instances of
Histogram2d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2d
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2d constructor
Supported dict properties: | def histogram2d(self):
"""
The 'histogram2d' property is a tuple of instances of
Histogram2d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram2d
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram2d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram2d]
"""
return self["histogram2d"] | [
"def",
"histogram2d",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"histogram2d\"",
"]"
] | [
454,
4
] | [
468,
34
] | python | en | ['en', 'error', 'th'] | False |
Data.histogram | (self) |
The 'histogram' property is a tuple of instances of
Histogram that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram]
|
The 'histogram' property is a tuple of instances of
Histogram that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram constructor
Supported dict properties: | def histogram(self):
"""
The 'histogram' property is a tuple of instances of
Histogram that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Histogram
- A list or tuple of dicts of string/value properties that
will be passed to the Histogram constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Histogram]
"""
return self["histogram"] | [
"def",
"histogram",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"histogram\"",
"]"
] | [
477,
4
] | [
491,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.image | (self) |
The 'image' property is a tuple of instances of
Image that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Image
- A list or tuple of dicts of string/value properties that
will be passed to the Image constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Image]
|
The 'image' property is a tuple of instances of
Image that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Image
- A list or tuple of dicts of string/value properties that
will be passed to the Image constructor
Supported dict properties: | def image(self):
"""
The 'image' property is a tuple of instances of
Image that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Image
- A list or tuple of dicts of string/value properties that
will be passed to the Image constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Image]
"""
return self["image"] | [
"def",
"image",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"image\"",
"]"
] | [
500,
4
] | [
514,
28
] | python | en | ['en', 'error', 'th'] | False |
Data.indicator | (self) |
The 'indicator' property is a tuple of instances of
Indicator that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Indicator
- A list or tuple of dicts of string/value properties that
will be passed to the Indicator constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Indicator]
|
The 'indicator' property is a tuple of instances of
Indicator that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Indicator
- A list or tuple of dicts of string/value properties that
will be passed to the Indicator constructor
Supported dict properties: | def indicator(self):
"""
The 'indicator' property is a tuple of instances of
Indicator that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Indicator
- A list or tuple of dicts of string/value properties that
will be passed to the Indicator constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Indicator]
"""
return self["indicator"] | [
"def",
"indicator",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"indicator\"",
"]"
] | [
523,
4
] | [
537,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.isosurface | (self) |
The 'isosurface' property is a tuple of instances of
Isosurface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Isosurface
- A list or tuple of dicts of string/value properties that
will be passed to the Isosurface constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Isosurface]
|
The 'isosurface' property is a tuple of instances of
Isosurface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Isosurface
- A list or tuple of dicts of string/value properties that
will be passed to the Isosurface constructor
Supported dict properties: | def isosurface(self):
"""
The 'isosurface' property is a tuple of instances of
Isosurface that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Isosurface
- A list or tuple of dicts of string/value properties that
will be passed to the Isosurface constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Isosurface]
"""
return self["isosurface"] | [
"def",
"isosurface",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"isosurface\"",
"]"
] | [
546,
4
] | [
560,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.mesh3d | (self) |
The 'mesh3d' property is a tuple of instances of
Mesh3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Mesh3d
- A list or tuple of dicts of string/value properties that
will be passed to the Mesh3d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Mesh3d]
|
The 'mesh3d' property is a tuple of instances of
Mesh3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Mesh3d
- A list or tuple of dicts of string/value properties that
will be passed to the Mesh3d constructor
Supported dict properties: | def mesh3d(self):
"""
The 'mesh3d' property is a tuple of instances of
Mesh3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Mesh3d
- A list or tuple of dicts of string/value properties that
will be passed to the Mesh3d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Mesh3d]
"""
return self["mesh3d"] | [
"def",
"mesh3d",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"mesh3d\"",
"]"
] | [
569,
4
] | [
583,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.ohlc | (self) |
The 'ohlc' property is a tuple of instances of
Ohlc that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Ohlc
- A list or tuple of dicts of string/value properties that
will be passed to the Ohlc constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Ohlc]
|
The 'ohlc' property is a tuple of instances of
Ohlc that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Ohlc
- A list or tuple of dicts of string/value properties that
will be passed to the Ohlc constructor
Supported dict properties: | def ohlc(self):
"""
The 'ohlc' property is a tuple of instances of
Ohlc that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Ohlc
- A list or tuple of dicts of string/value properties that
will be passed to the Ohlc constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Ohlc]
"""
return self["ohlc"] | [
"def",
"ohlc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ohlc\"",
"]"
] | [
592,
4
] | [
606,
27
] | python | en | ['en', 'error', 'th'] | False |
Data.parcats | (self) |
The 'parcats' property is a tuple of instances of
Parcats that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcats
- A list or tuple of dicts of string/value properties that
will be passed to the Parcats constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Parcats]
|
The 'parcats' property is a tuple of instances of
Parcats that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcats
- A list or tuple of dicts of string/value properties that
will be passed to the Parcats constructor
Supported dict properties: | def parcats(self):
"""
The 'parcats' property is a tuple of instances of
Parcats that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcats
- A list or tuple of dicts of string/value properties that
will be passed to the Parcats constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Parcats]
"""
return self["parcats"] | [
"def",
"parcats",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"parcats\"",
"]"
] | [
615,
4
] | [
629,
30
] | python | en | ['en', 'error', 'th'] | False |
Data.parcoords | (self) |
The 'parcoords' property is a tuple of instances of
Parcoords that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcoords
- A list or tuple of dicts of string/value properties that
will be passed to the Parcoords constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Parcoords]
|
The 'parcoords' property is a tuple of instances of
Parcoords that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcoords
- A list or tuple of dicts of string/value properties that
will be passed to the Parcoords constructor
Supported dict properties: | def parcoords(self):
"""
The 'parcoords' property is a tuple of instances of
Parcoords that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Parcoords
- A list or tuple of dicts of string/value properties that
will be passed to the Parcoords constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Parcoords]
"""
return self["parcoords"] | [
"def",
"parcoords",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"parcoords\"",
"]"
] | [
638,
4
] | [
652,
32
] | python | en | ['en', 'error', 'th'] | False |
Data.pie | (self) |
The 'pie' property is a tuple of instances of
Pie that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pie
- A list or tuple of dicts of string/value properties that
will be passed to the Pie constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Pie]
|
The 'pie' property is a tuple of instances of
Pie that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pie
- A list or tuple of dicts of string/value properties that
will be passed to the Pie constructor
Supported dict properties: | def pie(self):
"""
The 'pie' property is a tuple of instances of
Pie that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pie
- A list or tuple of dicts of string/value properties that
will be passed to the Pie constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Pie]
"""
return self["pie"] | [
"def",
"pie",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"pie\"",
"]"
] | [
661,
4
] | [
675,
26
] | python | en | ['en', 'error', 'th'] | False |
Data.pointcloud | (self) |
The 'pointcloud' property is a tuple of instances of
Pointcloud that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pointcloud
- A list or tuple of dicts of string/value properties that
will be passed to the Pointcloud constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Pointcloud]
|
The 'pointcloud' property is a tuple of instances of
Pointcloud that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pointcloud
- A list or tuple of dicts of string/value properties that
will be passed to the Pointcloud constructor
Supported dict properties: | def pointcloud(self):
"""
The 'pointcloud' property is a tuple of instances of
Pointcloud that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Pointcloud
- A list or tuple of dicts of string/value properties that
will be passed to the Pointcloud constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Pointcloud]
"""
return self["pointcloud"] | [
"def",
"pointcloud",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"pointcloud\"",
"]"
] | [
684,
4
] | [
698,
33
] | python | en | ['en', 'error', 'th'] | False |
Data.sankey | (self) |
The 'sankey' property is a tuple of instances of
Sankey that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sankey
- A list or tuple of dicts of string/value properties that
will be passed to the Sankey constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Sankey]
|
The 'sankey' property is a tuple of instances of
Sankey that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sankey
- A list or tuple of dicts of string/value properties that
will be passed to the Sankey constructor
Supported dict properties: | def sankey(self):
"""
The 'sankey' property is a tuple of instances of
Sankey that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Sankey
- A list or tuple of dicts of string/value properties that
will be passed to the Sankey constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Sankey]
"""
return self["sankey"] | [
"def",
"sankey",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"sankey\"",
"]"
] | [
707,
4
] | [
721,
29
] | python | en | ['en', 'error', 'th'] | False |
Data.scatter3d | (self) |
The 'scatter3d' property is a tuple of instances of
Scatter3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter3d
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter3d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatter3d]
|
The 'scatter3d' property is a tuple of instances of
Scatter3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter3d
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter3d constructor
Supported dict properties: | def scatter3d(self):
"""
The 'scatter3d' property is a tuple of instances of
Scatter3d that may be specified as:
- A list or tuple of instances of plotly.graph_objs.layout.template.data.Scatter3d
- A list or tuple of dicts of string/value properties that
will be passed to the Scatter3d constructor
Supported dict properties:
Returns
-------
tuple[plotly.graph_objs.layout.template.data.Scatter3d]
"""
return self["scatter3d"] | [
"def",
"scatter3d",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"scatter3d\"",
"]"
] | [
730,
4
] | [
744,
32
] | python | en | ['en', 'error', 'th'] | False |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.