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 |
---|---|---|---|---|---|---|---|---|---|---|---|
Match.attach_text | (self, text: str) | add a simple text as an attachment
|methcoro|
Args:
text: content you want to add (description)
Returns:
Attachment: newly created instance
Raises:
ValueError: text must not be None
APIException
| add a simple text as an attachment | async def attach_text(self, text: str) -> Attachment:
""" add a simple text as an attachment
|methcoro|
Args:
text: content you want to add (description)
Returns:
Attachment: newly created instance
Raises:
ValueError: text must not be None
APIException
"""
return await self._attach(description=text) | [
"async",
"def",
"attach_text",
"(",
"self",
",",
"text",
":",
"str",
")",
"->",
"Attachment",
":",
"return",
"await",
"self",
".",
"_attach",
"(",
"description",
"=",
"text",
")"
] | [
247,
4
] | [
263,
51
] | python | en | ['en', 'en', 'en'] | True |
Match.destroy_attachment | (self, a: Attachment) | destroy a match attachment
|methcoro|
Args:
a: the attachment you want to destroy
Raises:
APIException
| destroy a match attachment | async def destroy_attachment(self, a: Attachment):
""" destroy a match attachment
|methcoro|
Args:
a: the attachment you want to destroy
Raises:
APIException
"""
await self.connection('DELETE', 'tournaments/{}/matches/{}/attachments/{}'.format(self._tournament_id, self._id, a._id))
if a in self.attachments:
self.attachments.remove(a) | [
"async",
"def",
"destroy_attachment",
"(",
"self",
",",
"a",
":",
"Attachment",
")",
":",
"await",
"self",
".",
"connection",
"(",
"'DELETE'",
",",
"'tournaments/{}/matches/{}/attachments/{}'",
".",
"format",
"(",
"self",
".",
"_tournament_id",
",",
"self",
".",
"_id",
",",
"a",
".",
"_id",
")",
")",
"if",
"a",
"in",
"self",
".",
"attachments",
":",
"self",
".",
"attachments",
".",
"remove",
"(",
"a",
")"
] | [
265,
4
] | [
279,
38
] | python | en | ['en', 'fr', 'en'] | True |
_rotation_box2d_jit_ | (corners, angle, rot_mat_T) | Rotate 2D boxes.
Args:
corners (np.ndarray): Corners of boxes.
angle (float): Rotation angle.
rot_mat_T (np.ndarray): Transposed rotation matrix.
| Rotate 2D boxes. | def _rotation_box2d_jit_(corners, angle, rot_mat_T):
"""Rotate 2D boxes.
Args:
corners (np.ndarray): Corners of boxes.
angle (float): Rotation angle.
rot_mat_T (np.ndarray): Transposed rotation matrix.
"""
rot_sin = np.sin(angle)
rot_cos = np.cos(angle)
rot_mat_T[0, 0] = rot_cos
rot_mat_T[0, 1] = -rot_sin
rot_mat_T[1, 0] = rot_sin
rot_mat_T[1, 1] = rot_cos
corners[:] = corners @ rot_mat_T | [
"def",
"_rotation_box2d_jit_",
"(",
"corners",
",",
"angle",
",",
"rot_mat_T",
")",
":",
"rot_sin",
"=",
"np",
".",
"sin",
"(",
"angle",
")",
"rot_cos",
"=",
"np",
".",
"cos",
"(",
"angle",
")",
"rot_mat_T",
"[",
"0",
",",
"0",
"]",
"=",
"rot_cos",
"rot_mat_T",
"[",
"0",
",",
"1",
"]",
"=",
"-",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"0",
"]",
"=",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"1",
"]",
"=",
"rot_cos",
"corners",
"[",
":",
"]",
"=",
"corners",
"@",
"rot_mat_T"
] | [
11,
0
] | [
25,
36
] | python | en | ['en', 'en', 'en'] | True |
box_collision_test | (boxes, qboxes, clockwise=True) | Box collision test.
Args:
boxes (np.ndarray): Corners of current boxes.
qboxes (np.ndarray): Boxes to be avoid colliding.
clockwise (bool): Whether the corners are in clockwise order.
Default: True.
| Box collision test. | def box_collision_test(boxes, qboxes, clockwise=True):
"""Box collision test.
Args:
boxes (np.ndarray): Corners of current boxes.
qboxes (np.ndarray): Boxes to be avoid colliding.
clockwise (bool): Whether the corners are in clockwise order.
Default: True.
"""
N = boxes.shape[0]
K = qboxes.shape[0]
ret = np.zeros((N, K), dtype=np.bool_)
slices = np.array([1, 2, 3, 0])
lines_boxes = np.stack((boxes, boxes[:, slices, :]),
axis=2) # [N, 4, 2(line), 2(xy)]
lines_qboxes = np.stack((qboxes, qboxes[:, slices, :]), axis=2)
# vec = np.zeros((2,), dtype=boxes.dtype)
boxes_standup = box_np_ops.corner_to_standup_nd_jit(boxes)
qboxes_standup = box_np_ops.corner_to_standup_nd_jit(qboxes)
for i in range(N):
for j in range(K):
# calculate standup first
iw = (
min(boxes_standup[i, 2], qboxes_standup[j, 2]) -
max(boxes_standup[i, 0], qboxes_standup[j, 0]))
if iw > 0:
ih = (
min(boxes_standup[i, 3], qboxes_standup[j, 3]) -
max(boxes_standup[i, 1], qboxes_standup[j, 1]))
if ih > 0:
for k in range(4):
for box_l in range(4):
A = lines_boxes[i, k, 0]
B = lines_boxes[i, k, 1]
C = lines_qboxes[j, box_l, 0]
D = lines_qboxes[j, box_l, 1]
acd = (D[1] - A[1]) * (C[0] -
A[0]) > (C[1] - A[1]) * (
D[0] - A[0])
bcd = (D[1] - B[1]) * (C[0] -
B[0]) > (C[1] - B[1]) * (
D[0] - B[0])
if acd != bcd:
abc = (C[1] - A[1]) * (B[0] - A[0]) > (
B[1] - A[1]) * (
C[0] - A[0])
abd = (D[1] - A[1]) * (B[0] - A[0]) > (
B[1] - A[1]) * (
D[0] - A[0])
if abc != abd:
ret[i, j] = True # collision.
break
if ret[i, j] is True:
break
if ret[i, j] is False:
# now check complete overlap.
# box overlap qbox:
box_overlap_qbox = True
for box_l in range(4): # point l in qboxes
for k in range(4): # corner k in boxes
vec = boxes[i, k] - boxes[i, (k + 1) % 4]
if clockwise:
vec = -vec
cross = vec[1] * (
boxes[i, k, 0] - qboxes[j, box_l, 0])
cross -= vec[0] * (
boxes[i, k, 1] - qboxes[j, box_l, 1])
if cross >= 0:
box_overlap_qbox = False
break
if box_overlap_qbox is False:
break
if box_overlap_qbox is False:
qbox_overlap_box = True
for box_l in range(4): # point box_l in boxes
for k in range(4): # corner k in qboxes
vec = qboxes[j, k] - qboxes[j, (k + 1) % 4]
if clockwise:
vec = -vec
cross = vec[1] * (
qboxes[j, k, 0] - boxes[i, box_l, 0])
cross -= vec[0] * (
qboxes[j, k, 1] - boxes[i, box_l, 1])
if cross >= 0: #
qbox_overlap_box = False
break
if qbox_overlap_box is False:
break
if qbox_overlap_box:
ret[i, j] = True # collision.
else:
ret[i, j] = True # collision.
return ret | [
"def",
"box_collision_test",
"(",
"boxes",
",",
"qboxes",
",",
"clockwise",
"=",
"True",
")",
":",
"N",
"=",
"boxes",
".",
"shape",
"[",
"0",
"]",
"K",
"=",
"qboxes",
".",
"shape",
"[",
"0",
"]",
"ret",
"=",
"np",
".",
"zeros",
"(",
"(",
"N",
",",
"K",
")",
",",
"dtype",
"=",
"np",
".",
"bool_",
")",
"slices",
"=",
"np",
".",
"array",
"(",
"[",
"1",
",",
"2",
",",
"3",
",",
"0",
"]",
")",
"lines_boxes",
"=",
"np",
".",
"stack",
"(",
"(",
"boxes",
",",
"boxes",
"[",
":",
",",
"slices",
",",
":",
"]",
")",
",",
"axis",
"=",
"2",
")",
"# [N, 4, 2(line), 2(xy)]",
"lines_qboxes",
"=",
"np",
".",
"stack",
"(",
"(",
"qboxes",
",",
"qboxes",
"[",
":",
",",
"slices",
",",
":",
"]",
")",
",",
"axis",
"=",
"2",
")",
"# vec = np.zeros((2,), dtype=boxes.dtype)",
"boxes_standup",
"=",
"box_np_ops",
".",
"corner_to_standup_nd_jit",
"(",
"boxes",
")",
"qboxes_standup",
"=",
"box_np_ops",
".",
"corner_to_standup_nd_jit",
"(",
"qboxes",
")",
"for",
"i",
"in",
"range",
"(",
"N",
")",
":",
"for",
"j",
"in",
"range",
"(",
"K",
")",
":",
"# calculate standup first",
"iw",
"=",
"(",
"min",
"(",
"boxes_standup",
"[",
"i",
",",
"2",
"]",
",",
"qboxes_standup",
"[",
"j",
",",
"2",
"]",
")",
"-",
"max",
"(",
"boxes_standup",
"[",
"i",
",",
"0",
"]",
",",
"qboxes_standup",
"[",
"j",
",",
"0",
"]",
")",
")",
"if",
"iw",
">",
"0",
":",
"ih",
"=",
"(",
"min",
"(",
"boxes_standup",
"[",
"i",
",",
"3",
"]",
",",
"qboxes_standup",
"[",
"j",
",",
"3",
"]",
")",
"-",
"max",
"(",
"boxes_standup",
"[",
"i",
",",
"1",
"]",
",",
"qboxes_standup",
"[",
"j",
",",
"1",
"]",
")",
")",
"if",
"ih",
">",
"0",
":",
"for",
"k",
"in",
"range",
"(",
"4",
")",
":",
"for",
"box_l",
"in",
"range",
"(",
"4",
")",
":",
"A",
"=",
"lines_boxes",
"[",
"i",
",",
"k",
",",
"0",
"]",
"B",
"=",
"lines_boxes",
"[",
"i",
",",
"k",
",",
"1",
"]",
"C",
"=",
"lines_qboxes",
"[",
"j",
",",
"box_l",
",",
"0",
"]",
"D",
"=",
"lines_qboxes",
"[",
"j",
",",
"box_l",
",",
"1",
"]",
"acd",
"=",
"(",
"D",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"C",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
">",
"(",
"C",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"D",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
"bcd",
"=",
"(",
"D",
"[",
"1",
"]",
"-",
"B",
"[",
"1",
"]",
")",
"*",
"(",
"C",
"[",
"0",
"]",
"-",
"B",
"[",
"0",
"]",
")",
">",
"(",
"C",
"[",
"1",
"]",
"-",
"B",
"[",
"1",
"]",
")",
"*",
"(",
"D",
"[",
"0",
"]",
"-",
"B",
"[",
"0",
"]",
")",
"if",
"acd",
"!=",
"bcd",
":",
"abc",
"=",
"(",
"C",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"B",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
">",
"(",
"B",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"C",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
"abd",
"=",
"(",
"D",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"B",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
">",
"(",
"B",
"[",
"1",
"]",
"-",
"A",
"[",
"1",
"]",
")",
"*",
"(",
"D",
"[",
"0",
"]",
"-",
"A",
"[",
"0",
"]",
")",
"if",
"abc",
"!=",
"abd",
":",
"ret",
"[",
"i",
",",
"j",
"]",
"=",
"True",
"# collision.",
"break",
"if",
"ret",
"[",
"i",
",",
"j",
"]",
"is",
"True",
":",
"break",
"if",
"ret",
"[",
"i",
",",
"j",
"]",
"is",
"False",
":",
"# now check complete overlap.",
"# box overlap qbox:",
"box_overlap_qbox",
"=",
"True",
"for",
"box_l",
"in",
"range",
"(",
"4",
")",
":",
"# point l in qboxes",
"for",
"k",
"in",
"range",
"(",
"4",
")",
":",
"# corner k in boxes",
"vec",
"=",
"boxes",
"[",
"i",
",",
"k",
"]",
"-",
"boxes",
"[",
"i",
",",
"(",
"k",
"+",
"1",
")",
"%",
"4",
"]",
"if",
"clockwise",
":",
"vec",
"=",
"-",
"vec",
"cross",
"=",
"vec",
"[",
"1",
"]",
"*",
"(",
"boxes",
"[",
"i",
",",
"k",
",",
"0",
"]",
"-",
"qboxes",
"[",
"j",
",",
"box_l",
",",
"0",
"]",
")",
"cross",
"-=",
"vec",
"[",
"0",
"]",
"*",
"(",
"boxes",
"[",
"i",
",",
"k",
",",
"1",
"]",
"-",
"qboxes",
"[",
"j",
",",
"box_l",
",",
"1",
"]",
")",
"if",
"cross",
">=",
"0",
":",
"box_overlap_qbox",
"=",
"False",
"break",
"if",
"box_overlap_qbox",
"is",
"False",
":",
"break",
"if",
"box_overlap_qbox",
"is",
"False",
":",
"qbox_overlap_box",
"=",
"True",
"for",
"box_l",
"in",
"range",
"(",
"4",
")",
":",
"# point box_l in boxes",
"for",
"k",
"in",
"range",
"(",
"4",
")",
":",
"# corner k in qboxes",
"vec",
"=",
"qboxes",
"[",
"j",
",",
"k",
"]",
"-",
"qboxes",
"[",
"j",
",",
"(",
"k",
"+",
"1",
")",
"%",
"4",
"]",
"if",
"clockwise",
":",
"vec",
"=",
"-",
"vec",
"cross",
"=",
"vec",
"[",
"1",
"]",
"*",
"(",
"qboxes",
"[",
"j",
",",
"k",
",",
"0",
"]",
"-",
"boxes",
"[",
"i",
",",
"box_l",
",",
"0",
"]",
")",
"cross",
"-=",
"vec",
"[",
"0",
"]",
"*",
"(",
"qboxes",
"[",
"j",
",",
"k",
",",
"1",
"]",
"-",
"boxes",
"[",
"i",
",",
"box_l",
",",
"1",
"]",
")",
"if",
"cross",
">=",
"0",
":",
"#",
"qbox_overlap_box",
"=",
"False",
"break",
"if",
"qbox_overlap_box",
"is",
"False",
":",
"break",
"if",
"qbox_overlap_box",
":",
"ret",
"[",
"i",
",",
"j",
"]",
"=",
"True",
"# collision.",
"else",
":",
"ret",
"[",
"i",
",",
"j",
"]",
"=",
"True",
"# collision.",
"return",
"ret"
] | [
29,
0
] | [
122,
14
] | python | en | ['fi', 'ja', 'en'] | False |
noise_per_box | (boxes, valid_mask, loc_noises, rot_noises) | Add noise to every box (only on the horizontal plane).
Args:
boxes (np.ndarray): Input boxes with shape (N, 5).
valid_mask (np.ndarray): Mask to indicate which boxes are valid
with shape (N).
loc_noises (np.ndarray): Location noises with shape (N, M, 3).
rot_noises (np.ndarray): Rotation noises with shape (N, M).
Returns:
np.ndarray: Mask to indicate whether the noise is
added successfully (pass the collision test).
| Add noise to every box (only on the horizontal plane). | def noise_per_box(boxes, valid_mask, loc_noises, rot_noises):
"""Add noise to every box (only on the horizontal plane).
Args:
boxes (np.ndarray): Input boxes with shape (N, 5).
valid_mask (np.ndarray): Mask to indicate which boxes are valid
with shape (N).
loc_noises (np.ndarray): Location noises with shape (N, M, 3).
rot_noises (np.ndarray): Rotation noises with shape (N, M).
Returns:
np.ndarray: Mask to indicate whether the noise is
added successfully (pass the collision test).
"""
num_boxes = boxes.shape[0]
num_tests = loc_noises.shape[1]
box_corners = box_np_ops.box2d_to_corner_jit(boxes)
current_corners = np.zeros((4, 2), dtype=boxes.dtype)
rot_mat_T = np.zeros((2, 2), dtype=boxes.dtype)
success_mask = -np.ones((num_boxes, ), dtype=np.int64)
# print(valid_mask)
for i in range(num_boxes):
if valid_mask[i]:
for j in range(num_tests):
current_corners[:] = box_corners[i]
current_corners -= boxes[i, :2]
_rotation_box2d_jit_(current_corners, rot_noises[i, j],
rot_mat_T)
current_corners += boxes[i, :2] + loc_noises[i, j, :2]
coll_mat = box_collision_test(
current_corners.reshape(1, 4, 2), box_corners)
coll_mat[0, i] = False
# print(coll_mat)
if not coll_mat.any():
success_mask[i] = j
box_corners[i] = current_corners
break
return success_mask | [
"def",
"noise_per_box",
"(",
"boxes",
",",
"valid_mask",
",",
"loc_noises",
",",
"rot_noises",
")",
":",
"num_boxes",
"=",
"boxes",
".",
"shape",
"[",
"0",
"]",
"num_tests",
"=",
"loc_noises",
".",
"shape",
"[",
"1",
"]",
"box_corners",
"=",
"box_np_ops",
".",
"box2d_to_corner_jit",
"(",
"boxes",
")",
"current_corners",
"=",
"np",
".",
"zeros",
"(",
"(",
"4",
",",
"2",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"rot_mat_T",
"=",
"np",
".",
"zeros",
"(",
"(",
"2",
",",
"2",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"success_mask",
"=",
"-",
"np",
".",
"ones",
"(",
"(",
"num_boxes",
",",
")",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
"# print(valid_mask)",
"for",
"i",
"in",
"range",
"(",
"num_boxes",
")",
":",
"if",
"valid_mask",
"[",
"i",
"]",
":",
"for",
"j",
"in",
"range",
"(",
"num_tests",
")",
":",
"current_corners",
"[",
":",
"]",
"=",
"box_corners",
"[",
"i",
"]",
"current_corners",
"-=",
"boxes",
"[",
"i",
",",
":",
"2",
"]",
"_rotation_box2d_jit_",
"(",
"current_corners",
",",
"rot_noises",
"[",
"i",
",",
"j",
"]",
",",
"rot_mat_T",
")",
"current_corners",
"+=",
"boxes",
"[",
"i",
",",
":",
"2",
"]",
"+",
"loc_noises",
"[",
"i",
",",
"j",
",",
":",
"2",
"]",
"coll_mat",
"=",
"box_collision_test",
"(",
"current_corners",
".",
"reshape",
"(",
"1",
",",
"4",
",",
"2",
")",
",",
"box_corners",
")",
"coll_mat",
"[",
"0",
",",
"i",
"]",
"=",
"False",
"# print(coll_mat)",
"if",
"not",
"coll_mat",
".",
"any",
"(",
")",
":",
"success_mask",
"[",
"i",
"]",
"=",
"j",
"box_corners",
"[",
"i",
"]",
"=",
"current_corners",
"break",
"return",
"success_mask"
] | [
126,
0
] | [
163,
23
] | python | en | ['en', 'en', 'en'] | True |
noise_per_box_v2_ | (boxes, valid_mask, loc_noises, rot_noises,
global_rot_noises) | Add noise to every box (only on the horizontal plane). Version 2 used
when enable global rotations.
Args:
boxes (np.ndarray): Input boxes with shape (N, 5).
valid_mask (np.ndarray): Mask to indicate which boxes are valid
with shape (N).
loc_noises (np.ndarray): Location noises with shape (N, M, 3).
rot_noises (np.ndarray): Rotation noises with shape (N, M).
Returns:
np.ndarray: Mask to indicate whether the noise is
added successfully (pass the collision test).
| Add noise to every box (only on the horizontal plane). Version 2 used
when enable global rotations. | def noise_per_box_v2_(boxes, valid_mask, loc_noises, rot_noises,
global_rot_noises):
"""Add noise to every box (only on the horizontal plane). Version 2 used
when enable global rotations.
Args:
boxes (np.ndarray): Input boxes with shape (N, 5).
valid_mask (np.ndarray): Mask to indicate which boxes are valid
with shape (N).
loc_noises (np.ndarray): Location noises with shape (N, M, 3).
rot_noises (np.ndarray): Rotation noises with shape (N, M).
Returns:
np.ndarray: Mask to indicate whether the noise is
added successfully (pass the collision test).
"""
num_boxes = boxes.shape[0]
num_tests = loc_noises.shape[1]
box_corners = box_np_ops.box2d_to_corner_jit(boxes)
current_corners = np.zeros((4, 2), dtype=boxes.dtype)
current_box = np.zeros((1, 5), dtype=boxes.dtype)
rot_mat_T = np.zeros((2, 2), dtype=boxes.dtype)
dst_pos = np.zeros((2, ), dtype=boxes.dtype)
success_mask = -np.ones((num_boxes, ), dtype=np.int64)
corners_norm = np.zeros((4, 2), dtype=boxes.dtype)
corners_norm[1, 1] = 1.0
corners_norm[2] = 1.0
corners_norm[3, 0] = 1.0
corners_norm -= np.array([0.5, 0.5], dtype=boxes.dtype)
corners_norm = corners_norm.reshape(4, 2)
for i in range(num_boxes):
if valid_mask[i]:
for j in range(num_tests):
current_box[0, :] = boxes[i]
current_radius = np.sqrt(boxes[i, 0]**2 + boxes[i, 1]**2)
current_grot = np.arctan2(boxes[i, 0], boxes[i, 1])
dst_grot = current_grot + global_rot_noises[i, j]
dst_pos[0] = current_radius * np.sin(dst_grot)
dst_pos[1] = current_radius * np.cos(dst_grot)
current_box[0, :2] = dst_pos
current_box[0, -1] += (dst_grot - current_grot)
rot_sin = np.sin(current_box[0, -1])
rot_cos = np.cos(current_box[0, -1])
rot_mat_T[0, 0] = rot_cos
rot_mat_T[0, 1] = -rot_sin
rot_mat_T[1, 0] = rot_sin
rot_mat_T[1, 1] = rot_cos
current_corners[:] = current_box[
0, 2:4] * corners_norm @ rot_mat_T + current_box[0, :2]
current_corners -= current_box[0, :2]
_rotation_box2d_jit_(current_corners, rot_noises[i, j],
rot_mat_T)
current_corners += current_box[0, :2] + loc_noises[i, j, :2]
coll_mat = box_collision_test(
current_corners.reshape(1, 4, 2), box_corners)
coll_mat[0, i] = False
if not coll_mat.any():
success_mask[i] = j
box_corners[i] = current_corners
loc_noises[i, j, :2] += (dst_pos - boxes[i, :2])
rot_noises[i, j] += (dst_grot - current_grot)
break
return success_mask | [
"def",
"noise_per_box_v2_",
"(",
"boxes",
",",
"valid_mask",
",",
"loc_noises",
",",
"rot_noises",
",",
"global_rot_noises",
")",
":",
"num_boxes",
"=",
"boxes",
".",
"shape",
"[",
"0",
"]",
"num_tests",
"=",
"loc_noises",
".",
"shape",
"[",
"1",
"]",
"box_corners",
"=",
"box_np_ops",
".",
"box2d_to_corner_jit",
"(",
"boxes",
")",
"current_corners",
"=",
"np",
".",
"zeros",
"(",
"(",
"4",
",",
"2",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"current_box",
"=",
"np",
".",
"zeros",
"(",
"(",
"1",
",",
"5",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"rot_mat_T",
"=",
"np",
".",
"zeros",
"(",
"(",
"2",
",",
"2",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"dst_pos",
"=",
"np",
".",
"zeros",
"(",
"(",
"2",
",",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"success_mask",
"=",
"-",
"np",
".",
"ones",
"(",
"(",
"num_boxes",
",",
")",
",",
"dtype",
"=",
"np",
".",
"int64",
")",
"corners_norm",
"=",
"np",
".",
"zeros",
"(",
"(",
"4",
",",
"2",
")",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"corners_norm",
"[",
"1",
",",
"1",
"]",
"=",
"1.0",
"corners_norm",
"[",
"2",
"]",
"=",
"1.0",
"corners_norm",
"[",
"3",
",",
"0",
"]",
"=",
"1.0",
"corners_norm",
"-=",
"np",
".",
"array",
"(",
"[",
"0.5",
",",
"0.5",
"]",
",",
"dtype",
"=",
"boxes",
".",
"dtype",
")",
"corners_norm",
"=",
"corners_norm",
".",
"reshape",
"(",
"4",
",",
"2",
")",
"for",
"i",
"in",
"range",
"(",
"num_boxes",
")",
":",
"if",
"valid_mask",
"[",
"i",
"]",
":",
"for",
"j",
"in",
"range",
"(",
"num_tests",
")",
":",
"current_box",
"[",
"0",
",",
":",
"]",
"=",
"boxes",
"[",
"i",
"]",
"current_radius",
"=",
"np",
".",
"sqrt",
"(",
"boxes",
"[",
"i",
",",
"0",
"]",
"**",
"2",
"+",
"boxes",
"[",
"i",
",",
"1",
"]",
"**",
"2",
")",
"current_grot",
"=",
"np",
".",
"arctan2",
"(",
"boxes",
"[",
"i",
",",
"0",
"]",
",",
"boxes",
"[",
"i",
",",
"1",
"]",
")",
"dst_grot",
"=",
"current_grot",
"+",
"global_rot_noises",
"[",
"i",
",",
"j",
"]",
"dst_pos",
"[",
"0",
"]",
"=",
"current_radius",
"*",
"np",
".",
"sin",
"(",
"dst_grot",
")",
"dst_pos",
"[",
"1",
"]",
"=",
"current_radius",
"*",
"np",
".",
"cos",
"(",
"dst_grot",
")",
"current_box",
"[",
"0",
",",
":",
"2",
"]",
"=",
"dst_pos",
"current_box",
"[",
"0",
",",
"-",
"1",
"]",
"+=",
"(",
"dst_grot",
"-",
"current_grot",
")",
"rot_sin",
"=",
"np",
".",
"sin",
"(",
"current_box",
"[",
"0",
",",
"-",
"1",
"]",
")",
"rot_cos",
"=",
"np",
".",
"cos",
"(",
"current_box",
"[",
"0",
",",
"-",
"1",
"]",
")",
"rot_mat_T",
"[",
"0",
",",
"0",
"]",
"=",
"rot_cos",
"rot_mat_T",
"[",
"0",
",",
"1",
"]",
"=",
"-",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"0",
"]",
"=",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"1",
"]",
"=",
"rot_cos",
"current_corners",
"[",
":",
"]",
"=",
"current_box",
"[",
"0",
",",
"2",
":",
"4",
"]",
"*",
"corners_norm",
"@",
"rot_mat_T",
"+",
"current_box",
"[",
"0",
",",
":",
"2",
"]",
"current_corners",
"-=",
"current_box",
"[",
"0",
",",
":",
"2",
"]",
"_rotation_box2d_jit_",
"(",
"current_corners",
",",
"rot_noises",
"[",
"i",
",",
"j",
"]",
",",
"rot_mat_T",
")",
"current_corners",
"+=",
"current_box",
"[",
"0",
",",
":",
"2",
"]",
"+",
"loc_noises",
"[",
"i",
",",
"j",
",",
":",
"2",
"]",
"coll_mat",
"=",
"box_collision_test",
"(",
"current_corners",
".",
"reshape",
"(",
"1",
",",
"4",
",",
"2",
")",
",",
"box_corners",
")",
"coll_mat",
"[",
"0",
",",
"i",
"]",
"=",
"False",
"if",
"not",
"coll_mat",
".",
"any",
"(",
")",
":",
"success_mask",
"[",
"i",
"]",
"=",
"j",
"box_corners",
"[",
"i",
"]",
"=",
"current_corners",
"loc_noises",
"[",
"i",
",",
"j",
",",
":",
"2",
"]",
"+=",
"(",
"dst_pos",
"-",
"boxes",
"[",
"i",
",",
":",
"2",
"]",
")",
"rot_noises",
"[",
"i",
",",
"j",
"]",
"+=",
"(",
"dst_grot",
"-",
"current_grot",
")",
"break",
"return",
"success_mask"
] | [
167,
0
] | [
230,
23
] | python | en | ['en', 'en', 'en'] | True |
_select_transform | (transform, indices) | Select transform.
Args:
transform (np.ndarray): Transforms to select from.
indices (np.ndarray): Mask to indicate which transform to select.
Returns:
np.ndarray: Selected transforms.
| Select transform. | def _select_transform(transform, indices):
"""Select transform.
Args:
transform (np.ndarray): Transforms to select from.
indices (np.ndarray): Mask to indicate which transform to select.
Returns:
np.ndarray: Selected transforms.
"""
result = np.zeros((transform.shape[0], *transform.shape[2:]),
dtype=transform.dtype)
for i in range(transform.shape[0]):
if indices[i] != -1:
result[i] = transform[i, indices[i]]
return result | [
"def",
"_select_transform",
"(",
"transform",
",",
"indices",
")",
":",
"result",
"=",
"np",
".",
"zeros",
"(",
"(",
"transform",
".",
"shape",
"[",
"0",
"]",
",",
"*",
"transform",
".",
"shape",
"[",
"2",
":",
"]",
")",
",",
"dtype",
"=",
"transform",
".",
"dtype",
")",
"for",
"i",
"in",
"range",
"(",
"transform",
".",
"shape",
"[",
"0",
"]",
")",
":",
"if",
"indices",
"[",
"i",
"]",
"!=",
"-",
"1",
":",
"result",
"[",
"i",
"]",
"=",
"transform",
"[",
"i",
",",
"indices",
"[",
"i",
"]",
"]",
"return",
"result"
] | [
233,
0
] | [
248,
17
] | python | en | ['en', 'mk', 'en'] | False |
_rotation_matrix_3d_ | (rot_mat_T, angle, axis) | Get the 3D rotation matrix.
Args:
rot_mat_T (np.ndarray): Transposed rotation matrix.
angle (float): Rotation angle.
axis (int): Rotation axis.
| Get the 3D rotation matrix. | def _rotation_matrix_3d_(rot_mat_T, angle, axis):
"""Get the 3D rotation matrix.
Args:
rot_mat_T (np.ndarray): Transposed rotation matrix.
angle (float): Rotation angle.
axis (int): Rotation axis.
"""
rot_sin = np.sin(angle)
rot_cos = np.cos(angle)
rot_mat_T[:] = np.eye(3)
if axis == 1:
rot_mat_T[0, 0] = rot_cos
rot_mat_T[0, 2] = -rot_sin
rot_mat_T[2, 0] = rot_sin
rot_mat_T[2, 2] = rot_cos
elif axis == 2 or axis == -1:
rot_mat_T[0, 0] = rot_cos
rot_mat_T[0, 1] = -rot_sin
rot_mat_T[1, 0] = rot_sin
rot_mat_T[1, 1] = rot_cos
elif axis == 0:
rot_mat_T[1, 1] = rot_cos
rot_mat_T[1, 2] = -rot_sin
rot_mat_T[2, 1] = rot_sin
rot_mat_T[2, 2] = rot_cos | [
"def",
"_rotation_matrix_3d_",
"(",
"rot_mat_T",
",",
"angle",
",",
"axis",
")",
":",
"rot_sin",
"=",
"np",
".",
"sin",
"(",
"angle",
")",
"rot_cos",
"=",
"np",
".",
"cos",
"(",
"angle",
")",
"rot_mat_T",
"[",
":",
"]",
"=",
"np",
".",
"eye",
"(",
"3",
")",
"if",
"axis",
"==",
"1",
":",
"rot_mat_T",
"[",
"0",
",",
"0",
"]",
"=",
"rot_cos",
"rot_mat_T",
"[",
"0",
",",
"2",
"]",
"=",
"-",
"rot_sin",
"rot_mat_T",
"[",
"2",
",",
"0",
"]",
"=",
"rot_sin",
"rot_mat_T",
"[",
"2",
",",
"2",
"]",
"=",
"rot_cos",
"elif",
"axis",
"==",
"2",
"or",
"axis",
"==",
"-",
"1",
":",
"rot_mat_T",
"[",
"0",
",",
"0",
"]",
"=",
"rot_cos",
"rot_mat_T",
"[",
"0",
",",
"1",
"]",
"=",
"-",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"0",
"]",
"=",
"rot_sin",
"rot_mat_T",
"[",
"1",
",",
"1",
"]",
"=",
"rot_cos",
"elif",
"axis",
"==",
"0",
":",
"rot_mat_T",
"[",
"1",
",",
"1",
"]",
"=",
"rot_cos",
"rot_mat_T",
"[",
"1",
",",
"2",
"]",
"=",
"-",
"rot_sin",
"rot_mat_T",
"[",
"2",
",",
"1",
"]",
"=",
"rot_sin",
"rot_mat_T",
"[",
"2",
",",
"2",
"]",
"=",
"rot_cos"
] | [
252,
0
] | [
277,
33
] | python | en | ['en', 'ca', 'en'] | True |
points_transform_ | (points, centers, point_masks, loc_transform,
rot_transform, valid_mask) | Apply transforms to points and box centers.
Args:
points (np.ndarray): Input points.
centers (np.ndarray): Input box centers.
point_masks (np.ndarray): Mask to indicate which points need
to be transformed.
loc_transform (np.ndarray): Location transform to be applied.
rot_transform (np.ndarray): Rotation transform to be applied.
valid_mask (np.ndarray): Mask to indicate which boxes are valid.
| Apply transforms to points and box centers. | def points_transform_(points, centers, point_masks, loc_transform,
rot_transform, valid_mask):
"""Apply transforms to points and box centers.
Args:
points (np.ndarray): Input points.
centers (np.ndarray): Input box centers.
point_masks (np.ndarray): Mask to indicate which points need
to be transformed.
loc_transform (np.ndarray): Location transform to be applied.
rot_transform (np.ndarray): Rotation transform to be applied.
valid_mask (np.ndarray): Mask to indicate which boxes are valid.
"""
num_box = centers.shape[0]
num_points = points.shape[0]
rot_mat_T = np.zeros((num_box, 3, 3), dtype=points.dtype)
for i in range(num_box):
_rotation_matrix_3d_(rot_mat_T[i], rot_transform[i], 2)
for i in range(num_points):
for j in range(num_box):
if valid_mask[j]:
if point_masks[i, j] == 1:
points[i, :3] -= centers[j, :3]
points[i:i + 1, :3] = points[i:i + 1, :3] @ rot_mat_T[j]
points[i, :3] += centers[j, :3]
points[i, :3] += loc_transform[j]
break | [
"def",
"points_transform_",
"(",
"points",
",",
"centers",
",",
"point_masks",
",",
"loc_transform",
",",
"rot_transform",
",",
"valid_mask",
")",
":",
"num_box",
"=",
"centers",
".",
"shape",
"[",
"0",
"]",
"num_points",
"=",
"points",
".",
"shape",
"[",
"0",
"]",
"rot_mat_T",
"=",
"np",
".",
"zeros",
"(",
"(",
"num_box",
",",
"3",
",",
"3",
")",
",",
"dtype",
"=",
"points",
".",
"dtype",
")",
"for",
"i",
"in",
"range",
"(",
"num_box",
")",
":",
"_rotation_matrix_3d_",
"(",
"rot_mat_T",
"[",
"i",
"]",
",",
"rot_transform",
"[",
"i",
"]",
",",
"2",
")",
"for",
"i",
"in",
"range",
"(",
"num_points",
")",
":",
"for",
"j",
"in",
"range",
"(",
"num_box",
")",
":",
"if",
"valid_mask",
"[",
"j",
"]",
":",
"if",
"point_masks",
"[",
"i",
",",
"j",
"]",
"==",
"1",
":",
"points",
"[",
"i",
",",
":",
"3",
"]",
"-=",
"centers",
"[",
"j",
",",
":",
"3",
"]",
"points",
"[",
"i",
":",
"i",
"+",
"1",
",",
":",
"3",
"]",
"=",
"points",
"[",
"i",
":",
"i",
"+",
"1",
",",
":",
"3",
"]",
"@",
"rot_mat_T",
"[",
"j",
"]",
"points",
"[",
"i",
",",
":",
"3",
"]",
"+=",
"centers",
"[",
"j",
",",
":",
"3",
"]",
"points",
"[",
"i",
",",
":",
"3",
"]",
"+=",
"loc_transform",
"[",
"j",
"]",
"break"
] | [
281,
0
] | [
307,
25
] | python | en | ['en', 'en', 'en'] | True |
box3d_transform_ | (boxes, loc_transform, rot_transform, valid_mask) | Transform 3D boxes.
Args:
boxes (np.ndarray): 3D boxes to be transformed.
loc_transform (np.ndarray): Location transform to be applied.
rot_transform (np.ndarray): Rotation transform to be applied.
valid_mask (np.ndarray | None): Mask to indicate which boxes are valid.
| Transform 3D boxes. | def box3d_transform_(boxes, loc_transform, rot_transform, valid_mask):
"""Transform 3D boxes.
Args:
boxes (np.ndarray): 3D boxes to be transformed.
loc_transform (np.ndarray): Location transform to be applied.
rot_transform (np.ndarray): Rotation transform to be applied.
valid_mask (np.ndarray | None): Mask to indicate which boxes are valid.
"""
num_box = boxes.shape[0]
for i in range(num_box):
if valid_mask[i]:
boxes[i, :3] += loc_transform[i]
boxes[i, 6] += rot_transform[i] | [
"def",
"box3d_transform_",
"(",
"boxes",
",",
"loc_transform",
",",
"rot_transform",
",",
"valid_mask",
")",
":",
"num_box",
"=",
"boxes",
".",
"shape",
"[",
"0",
"]",
"for",
"i",
"in",
"range",
"(",
"num_box",
")",
":",
"if",
"valid_mask",
"[",
"i",
"]",
":",
"boxes",
"[",
"i",
",",
":",
"3",
"]",
"+=",
"loc_transform",
"[",
"i",
"]",
"boxes",
"[",
"i",
",",
"6",
"]",
"+=",
"rot_transform",
"[",
"i",
"]"
] | [
311,
0
] | [
324,
43
] | python | en | ['en', 'fr', 'en'] | True |
noise_per_object_v3_ | (gt_boxes,
points=None,
valid_mask=None,
rotation_perturb=np.pi / 4,
center_noise_std=1.0,
global_random_rot_range=np.pi / 4,
num_try=100) | Random rotate or remove each groundtruth independently. use kitti viewer
to test this function points_transform_
Args:
gt_boxes (np.ndarray): Ground truth boxes with shape (N, 7).
points (np.ndarray | None): Input point cloud with shape (M, 4).
Default: None.
valid_mask (np.ndarray | None): Mask to indicate which boxes are valid.
Default: None.
rotation_perturb (float): Rotation perturbation. Default: pi / 4.
center_noise_std (float): Center noise standard deviation.
Default: 1.0.
global_random_rot_range (float): Global random rotation range.
Default: pi/4.
num_try (int): Number of try. Default: 100.
| Random rotate or remove each groundtruth independently. use kitti viewer
to test this function points_transform_ | def noise_per_object_v3_(gt_boxes,
points=None,
valid_mask=None,
rotation_perturb=np.pi / 4,
center_noise_std=1.0,
global_random_rot_range=np.pi / 4,
num_try=100):
"""Random rotate or remove each groundtruth independently. use kitti viewer
to test this function points_transform_
Args:
gt_boxes (np.ndarray): Ground truth boxes with shape (N, 7).
points (np.ndarray | None): Input point cloud with shape (M, 4).
Default: None.
valid_mask (np.ndarray | None): Mask to indicate which boxes are valid.
Default: None.
rotation_perturb (float): Rotation perturbation. Default: pi / 4.
center_noise_std (float): Center noise standard deviation.
Default: 1.0.
global_random_rot_range (float): Global random rotation range.
Default: pi/4.
num_try (int): Number of try. Default: 100.
"""
num_boxes = gt_boxes.shape[0]
if not isinstance(rotation_perturb, (list, tuple, np.ndarray)):
rotation_perturb = [-rotation_perturb, rotation_perturb]
if not isinstance(global_random_rot_range, (list, tuple, np.ndarray)):
global_random_rot_range = [
-global_random_rot_range, global_random_rot_range
]
enable_grot = np.abs(global_random_rot_range[0] -
global_random_rot_range[1]) >= 1e-3
if not isinstance(center_noise_std, (list, tuple, np.ndarray)):
center_noise_std = [
center_noise_std, center_noise_std, center_noise_std
]
if valid_mask is None:
valid_mask = np.ones((num_boxes, ), dtype=np.bool_)
center_noise_std = np.array(center_noise_std, dtype=gt_boxes.dtype)
loc_noises = np.random.normal(
scale=center_noise_std, size=[num_boxes, num_try, 3])
rot_noises = np.random.uniform(
rotation_perturb[0], rotation_perturb[1], size=[num_boxes, num_try])
gt_grots = np.arctan2(gt_boxes[:, 0], gt_boxes[:, 1])
grot_lowers = global_random_rot_range[0] - gt_grots
grot_uppers = global_random_rot_range[1] - gt_grots
global_rot_noises = np.random.uniform(
grot_lowers[..., np.newaxis],
grot_uppers[..., np.newaxis],
size=[num_boxes, num_try])
origin = (0.5, 0.5, 0)
gt_box_corners = box_np_ops.center_to_corner_box3d(
gt_boxes[:, :3],
gt_boxes[:, 3:6],
gt_boxes[:, 6],
origin=origin,
axis=2)
# TODO: rewrite this noise box function?
if not enable_grot:
selected_noise = noise_per_box(gt_boxes[:, [0, 1, 3, 4, 6]],
valid_mask, loc_noises, rot_noises)
else:
selected_noise = noise_per_box_v2_(gt_boxes[:, [0, 1, 3, 4, 6]],
valid_mask, loc_noises, rot_noises,
global_rot_noises)
loc_transforms = _select_transform(loc_noises, selected_noise)
rot_transforms = _select_transform(rot_noises, selected_noise)
surfaces = box_np_ops.corner_to_surfaces_3d_jit(gt_box_corners)
if points is not None:
# TODO: replace this points_in_convex function by my tools?
point_masks = box_np_ops.points_in_convex_polygon_3d_jit(
points[:, :3], surfaces)
points_transform_(points, gt_boxes[:, :3], point_masks, loc_transforms,
rot_transforms, valid_mask)
box3d_transform_(gt_boxes, loc_transforms, rot_transforms, valid_mask) | [
"def",
"noise_per_object_v3_",
"(",
"gt_boxes",
",",
"points",
"=",
"None",
",",
"valid_mask",
"=",
"None",
",",
"rotation_perturb",
"=",
"np",
".",
"pi",
"/",
"4",
",",
"center_noise_std",
"=",
"1.0",
",",
"global_random_rot_range",
"=",
"np",
".",
"pi",
"/",
"4",
",",
"num_try",
"=",
"100",
")",
":",
"num_boxes",
"=",
"gt_boxes",
".",
"shape",
"[",
"0",
"]",
"if",
"not",
"isinstance",
"(",
"rotation_perturb",
",",
"(",
"list",
",",
"tuple",
",",
"np",
".",
"ndarray",
")",
")",
":",
"rotation_perturb",
"=",
"[",
"-",
"rotation_perturb",
",",
"rotation_perturb",
"]",
"if",
"not",
"isinstance",
"(",
"global_random_rot_range",
",",
"(",
"list",
",",
"tuple",
",",
"np",
".",
"ndarray",
")",
")",
":",
"global_random_rot_range",
"=",
"[",
"-",
"global_random_rot_range",
",",
"global_random_rot_range",
"]",
"enable_grot",
"=",
"np",
".",
"abs",
"(",
"global_random_rot_range",
"[",
"0",
"]",
"-",
"global_random_rot_range",
"[",
"1",
"]",
")",
">=",
"1e-3",
"if",
"not",
"isinstance",
"(",
"center_noise_std",
",",
"(",
"list",
",",
"tuple",
",",
"np",
".",
"ndarray",
")",
")",
":",
"center_noise_std",
"=",
"[",
"center_noise_std",
",",
"center_noise_std",
",",
"center_noise_std",
"]",
"if",
"valid_mask",
"is",
"None",
":",
"valid_mask",
"=",
"np",
".",
"ones",
"(",
"(",
"num_boxes",
",",
")",
",",
"dtype",
"=",
"np",
".",
"bool_",
")",
"center_noise_std",
"=",
"np",
".",
"array",
"(",
"center_noise_std",
",",
"dtype",
"=",
"gt_boxes",
".",
"dtype",
")",
"loc_noises",
"=",
"np",
".",
"random",
".",
"normal",
"(",
"scale",
"=",
"center_noise_std",
",",
"size",
"=",
"[",
"num_boxes",
",",
"num_try",
",",
"3",
"]",
")",
"rot_noises",
"=",
"np",
".",
"random",
".",
"uniform",
"(",
"rotation_perturb",
"[",
"0",
"]",
",",
"rotation_perturb",
"[",
"1",
"]",
",",
"size",
"=",
"[",
"num_boxes",
",",
"num_try",
"]",
")",
"gt_grots",
"=",
"np",
".",
"arctan2",
"(",
"gt_boxes",
"[",
":",
",",
"0",
"]",
",",
"gt_boxes",
"[",
":",
",",
"1",
"]",
")",
"grot_lowers",
"=",
"global_random_rot_range",
"[",
"0",
"]",
"-",
"gt_grots",
"grot_uppers",
"=",
"global_random_rot_range",
"[",
"1",
"]",
"-",
"gt_grots",
"global_rot_noises",
"=",
"np",
".",
"random",
".",
"uniform",
"(",
"grot_lowers",
"[",
"...",
",",
"np",
".",
"newaxis",
"]",
",",
"grot_uppers",
"[",
"...",
",",
"np",
".",
"newaxis",
"]",
",",
"size",
"=",
"[",
"num_boxes",
",",
"num_try",
"]",
")",
"origin",
"=",
"(",
"0.5",
",",
"0.5",
",",
"0",
")",
"gt_box_corners",
"=",
"box_np_ops",
".",
"center_to_corner_box3d",
"(",
"gt_boxes",
"[",
":",
",",
":",
"3",
"]",
",",
"gt_boxes",
"[",
":",
",",
"3",
":",
"6",
"]",
",",
"gt_boxes",
"[",
":",
",",
"6",
"]",
",",
"origin",
"=",
"origin",
",",
"axis",
"=",
"2",
")",
"# TODO: rewrite this noise box function?",
"if",
"not",
"enable_grot",
":",
"selected_noise",
"=",
"noise_per_box",
"(",
"gt_boxes",
"[",
":",
",",
"[",
"0",
",",
"1",
",",
"3",
",",
"4",
",",
"6",
"]",
"]",
",",
"valid_mask",
",",
"loc_noises",
",",
"rot_noises",
")",
"else",
":",
"selected_noise",
"=",
"noise_per_box_v2_",
"(",
"gt_boxes",
"[",
":",
",",
"[",
"0",
",",
"1",
",",
"3",
",",
"4",
",",
"6",
"]",
"]",
",",
"valid_mask",
",",
"loc_noises",
",",
"rot_noises",
",",
"global_rot_noises",
")",
"loc_transforms",
"=",
"_select_transform",
"(",
"loc_noises",
",",
"selected_noise",
")",
"rot_transforms",
"=",
"_select_transform",
"(",
"rot_noises",
",",
"selected_noise",
")",
"surfaces",
"=",
"box_np_ops",
".",
"corner_to_surfaces_3d_jit",
"(",
"gt_box_corners",
")",
"if",
"points",
"is",
"not",
"None",
":",
"# TODO: replace this points_in_convex function by my tools?",
"point_masks",
"=",
"box_np_ops",
".",
"points_in_convex_polygon_3d_jit",
"(",
"points",
"[",
":",
",",
":",
"3",
"]",
",",
"surfaces",
")",
"points_transform_",
"(",
"points",
",",
"gt_boxes",
"[",
":",
",",
":",
"3",
"]",
",",
"point_masks",
",",
"loc_transforms",
",",
"rot_transforms",
",",
"valid_mask",
")",
"box3d_transform_",
"(",
"gt_boxes",
",",
"loc_transforms",
",",
"rot_transforms",
",",
"valid_mask",
")"
] | [
327,
0
] | [
407,
74
] | python | en | ['en', 'en', 'en'] | True |
create_3D_rotations | (axis, angle) |
Create rotation matrices from a list of axes and angles. Code from wikipedia on quaternions
:param axis: float32[N, 3]
:param angle: float32[N,]
:return: float32[N, 3, 3]
|
Create rotation matrices from a list of axes and angles. Code from wikipedia on quaternions
:param axis: float32[N, 3]
:param angle: float32[N,]
:return: float32[N, 3, 3]
| def create_3D_rotations(axis, angle):
"""
Create rotation matrices from a list of axes and angles. Code from wikipedia on quaternions
:param axis: float32[N, 3]
:param angle: float32[N,]
:return: float32[N, 3, 3]
"""
t1 = np.cos(angle)
t2 = 1 - t1
t3 = axis[:, 0] * axis[:, 0]
t6 = t2 * axis[:, 0]
t7 = t6 * axis[:, 1]
t8 = np.sin(angle)
t9 = t8 * axis[:, 2]
t11 = t6 * axis[:, 2]
t12 = t8 * axis[:, 1]
t15 = axis[:, 1] * axis[:, 1]
t19 = t2 * axis[:, 1] * axis[:, 2]
t20 = t8 * axis[:, 0]
t24 = axis[:, 2] * axis[:, 2]
R = np.stack([t1 + t2 * t3,
t7 - t9,
t11 + t12,
t7 + t9,
t1 + t2 * t15,
t19 - t20,
t11 - t12,
t19 + t20,
t1 + t2 * t24], axis=1)
return np.reshape(R, (-1, 3, 3)) | [
"def",
"create_3D_rotations",
"(",
"axis",
",",
"angle",
")",
":",
"t1",
"=",
"np",
".",
"cos",
"(",
"angle",
")",
"t2",
"=",
"1",
"-",
"t1",
"t3",
"=",
"axis",
"[",
":",
",",
"0",
"]",
"*",
"axis",
"[",
":",
",",
"0",
"]",
"t6",
"=",
"t2",
"*",
"axis",
"[",
":",
",",
"0",
"]",
"t7",
"=",
"t6",
"*",
"axis",
"[",
":",
",",
"1",
"]",
"t8",
"=",
"np",
".",
"sin",
"(",
"angle",
")",
"t9",
"=",
"t8",
"*",
"axis",
"[",
":",
",",
"2",
"]",
"t11",
"=",
"t6",
"*",
"axis",
"[",
":",
",",
"2",
"]",
"t12",
"=",
"t8",
"*",
"axis",
"[",
":",
",",
"1",
"]",
"t15",
"=",
"axis",
"[",
":",
",",
"1",
"]",
"*",
"axis",
"[",
":",
",",
"1",
"]",
"t19",
"=",
"t2",
"*",
"axis",
"[",
":",
",",
"1",
"]",
"*",
"axis",
"[",
":",
",",
"2",
"]",
"t20",
"=",
"t8",
"*",
"axis",
"[",
":",
",",
"0",
"]",
"t24",
"=",
"axis",
"[",
":",
",",
"2",
"]",
"*",
"axis",
"[",
":",
",",
"2",
"]",
"R",
"=",
"np",
".",
"stack",
"(",
"[",
"t1",
"+",
"t2",
"*",
"t3",
",",
"t7",
"-",
"t9",
",",
"t11",
"+",
"t12",
",",
"t7",
"+",
"t9",
",",
"t1",
"+",
"t2",
"*",
"t15",
",",
"t19",
"-",
"t20",
",",
"t11",
"-",
"t12",
",",
"t19",
"+",
"t20",
",",
"t1",
"+",
"t2",
"*",
"t24",
"]",
",",
"axis",
"=",
"1",
")",
"return",
"np",
".",
"reshape",
"(",
"R",
",",
"(",
"-",
"1",
",",
"3",
",",
"3",
")",
")"
] | [
43,
0
] | [
74,
36
] | python | en | ['en', 'error', 'th'] | False |
spherical_Lloyd | (radius, num_cells, dimension=3, fixed='center', approximation='monte-carlo',
approx_n=5000, max_iter=500, momentum=0.9, verbose=0) |
Creation of kernel point via Lloyd algorithm. We use an approximation of the algorithm, and compute the Voronoi
cell centers with discretization of space. The exact formula is not trivial with part of the sphere as sides.
:param radius: Radius of the kernels
:param num_cells: Number of cell (kernel points) in the Voronoi diagram.
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param approximation: Approximation method for Lloyd's algorithm ('discretization', 'monte-carlo')
:param approx_n: Number of point used for approximation.
:param max_iter: Maximum nu;ber of iteration for the algorithm.
:param momentum: Momentum of the low pass filter smoothing kernel point positions
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
|
Creation of kernel point via Lloyd algorithm. We use an approximation of the algorithm, and compute the Voronoi
cell centers with discretization of space. The exact formula is not trivial with part of the sphere as sides.
:param radius: Radius of the kernels
:param num_cells: Number of cell (kernel points) in the Voronoi diagram.
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param approximation: Approximation method for Lloyd's algorithm ('discretization', 'monte-carlo')
:param approx_n: Number of point used for approximation.
:param max_iter: Maximum nu;ber of iteration for the algorithm.
:param momentum: Momentum of the low pass filter smoothing kernel point positions
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
| def spherical_Lloyd(radius, num_cells, dimension=3, fixed='center', approximation='monte-carlo',
approx_n=5000, max_iter=500, momentum=0.9, verbose=0):
"""
Creation of kernel point via Lloyd algorithm. We use an approximation of the algorithm, and compute the Voronoi
cell centers with discretization of space. The exact formula is not trivial with part of the sphere as sides.
:param radius: Radius of the kernels
:param num_cells: Number of cell (kernel points) in the Voronoi diagram.
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param approximation: Approximation method for Lloyd's algorithm ('discretization', 'monte-carlo')
:param approx_n: Number of point used for approximation.
:param max_iter: Maximum nu;ber of iteration for the algorithm.
:param momentum: Momentum of the low pass filter smoothing kernel point positions
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
"""
#######################
# Parameters definition
#######################
# Radius used for optimization (points are rescaled afterwards)
radius0 = 1.0
#######################
# Kernel initialization
#######################
# Random kernel points (Uniform distribution in a sphere)
kernel_points = np.zeros((0, dimension))
while kernel_points.shape[0] < num_cells:
new_points = np.random.rand(num_cells, dimension) * 2 * radius0 - radius0
kernel_points = np.vstack((kernel_points, new_points))
d2 = np.sum(np.power(kernel_points, 2), axis=1)
kernel_points = kernel_points[np.logical_and(d2 < radius0 ** 2, (0.9 * radius0) ** 2 < d2), :]
kernel_points = kernel_points[:num_cells, :].reshape((num_cells, -1))
# Optional fixing
if fixed == 'center':
kernel_points[0, :] *= 0
if fixed == 'verticals':
kernel_points[:3, :] *= 0
kernel_points[1, -1] += 2 * radius0 / 3
kernel_points[2, -1] -= 2 * radius0 / 3
##############################
# Approximation initialization
##############################
# Initialize figure
if verbose > 1:
fig = plt.figure()
# Initialize discretization in this method is chosen
if approximation == 'discretization':
side_n = int(np.floor(approx_n ** (1. / dimension)))
dl = 2 * radius0 / side_n
coords = np.arange(-radius0 + dl/2, radius0, dl)
if dimension == 2:
x, y = np.meshgrid(coords, coords)
X = np.vstack((np.ravel(x), np.ravel(y))).T
elif dimension == 3:
x, y, z = np.meshgrid(coords, coords, coords)
X = np.vstack((np.ravel(x), np.ravel(y), np.ravel(z))).T
elif dimension == 4:
x, y, z, t = np.meshgrid(coords, coords, coords, coords)
X = np.vstack((np.ravel(x), np.ravel(y), np.ravel(z), np.ravel(t))).T
else:
raise ValueError('Unsupported dimension (max is 4)')
elif approximation == 'monte-carlo':
X = np.zeros((0, dimension))
else:
raise ValueError('Wrong approximation method chosen: "{:s}"'.format(approximation))
# Only points inside the sphere are used
d2 = np.sum(np.power(X, 2), axis=1)
X = X[d2 < radius0 * radius0, :]
#####################
# Kernel optimization
#####################
# Warning if at least one kernel point has no cell
warning = False
# moving vectors of kernel points saved to detect convergence
max_moves = np.zeros((0,))
for iter in range(max_iter):
# In the case of monte-carlo, renew the sampled points
if approximation == 'monte-carlo':
X = np.random.rand(approx_n, dimension) * 2 * radius0 - radius0
d2 = np.sum(np.power(X, 2), axis=1)
X = X[d2 < radius0 * radius0, :]
# Get the distances matrix [n_approx, K, dim]
differences = np.expand_dims(X, 1) - kernel_points
sq_distances = np.sum(np.square(differences), axis=2)
# Compute cell centers
cell_inds = np.argmin(sq_distances, axis=1)
centers = []
for c in range(num_cells):
bool_c = (cell_inds == c)
num_c = np.sum(bool_c.astype(np.int32))
if num_c > 0:
centers.append(np.sum(X[bool_c, :], axis=0) / num_c)
else:
warning = True
centers.append(kernel_points[c])
# Update kernel points with low pass filter to smooth mote carlo
centers = np.vstack(centers)
moves = (1 - momentum) * (centers - kernel_points)
kernel_points += moves
# Check moves for convergence
max_moves = np.append(max_moves, np.max(np.linalg.norm(moves, axis=1)))
# Optional fixing
if fixed == 'center':
kernel_points[0, :] *= 0
if fixed == 'verticals':
kernel_points[0, :] *= 0
kernel_points[:3, :-1] *= 0
if verbose:
print('iter {:5d} / max move = {:f}'.format(iter, np.max(np.linalg.norm(moves, axis=1))))
if warning:
print('{:}WARNING: at least one point has no cell{:}'.format(bcolors.WARNING, bcolors.ENDC))
if verbose > 1:
plt.clf()
plt.scatter(X[:, 0], X[:, 1], c=cell_inds, s=20.0,
marker='.', cmap=plt.get_cmap('tab20'))
#plt.scatter(kernel_points[:, 0], kernel_points[:, 1], c=np.arange(num_cells), s=100.0,
# marker='+', cmap=plt.get_cmap('tab20'))
plt.plot(kernel_points[:, 0], kernel_points[:, 1], 'k+')
circle = plt.Circle((0, 0), radius0, color='r', fill=False)
fig.axes[0].add_artist(circle)
fig.axes[0].set_xlim((-radius0 * 1.1, radius0 * 1.1))
fig.axes[0].set_ylim((-radius0 * 1.1, radius0 * 1.1))
fig.axes[0].set_aspect('equal')
plt.draw()
plt.pause(0.001)
plt.show(block=False)
###################
# User verification
###################
# Show the convergence to ask user if this kernel is correct
if verbose:
if dimension == 2:
fig, (ax1, ax2) = plt.subplots(1, 2, figsize=[10.4, 4.8])
ax1.plot(max_moves)
ax2.scatter(X[:, 0], X[:, 1], c=cell_inds, s=20.0,
marker='.', cmap=plt.get_cmap('tab20'))
# plt.scatter(kernel_points[:, 0], kernel_points[:, 1], c=np.arange(num_cells), s=100.0,
# marker='+', cmap=plt.get_cmap('tab20'))
ax2.plot(kernel_points[:, 0], kernel_points[:, 1], 'k+')
circle = plt.Circle((0, 0), radius0, color='r', fill=False)
ax2.add_artist(circle)
ax2.set_xlim((-radius0 * 1.1, radius0 * 1.1))
ax2.set_ylim((-radius0 * 1.1, radius0 * 1.1))
ax2.set_aspect('equal')
plt.title('Check if kernel is correct.')
plt.draw()
plt.show()
if dimension > 2:
plt.figure()
plt.plot(max_moves)
plt.title('Check if kernel is correct.')
plt.show()
# Rescale kernels with real radius
return kernel_points * radius | [
"def",
"spherical_Lloyd",
"(",
"radius",
",",
"num_cells",
",",
"dimension",
"=",
"3",
",",
"fixed",
"=",
"'center'",
",",
"approximation",
"=",
"'monte-carlo'",
",",
"approx_n",
"=",
"5000",
",",
"max_iter",
"=",
"500",
",",
"momentum",
"=",
"0.9",
",",
"verbose",
"=",
"0",
")",
":",
"#######################",
"# Parameters definition",
"#######################",
"# Radius used for optimization (points are rescaled afterwards)",
"radius0",
"=",
"1.0",
"#######################",
"# Kernel initialization",
"#######################",
"# Random kernel points (Uniform distribution in a sphere)",
"kernel_points",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"dimension",
")",
")",
"while",
"kernel_points",
".",
"shape",
"[",
"0",
"]",
"<",
"num_cells",
":",
"new_points",
"=",
"np",
".",
"random",
".",
"rand",
"(",
"num_cells",
",",
"dimension",
")",
"*",
"2",
"*",
"radius0",
"-",
"radius0",
"kernel_points",
"=",
"np",
".",
"vstack",
"(",
"(",
"kernel_points",
",",
"new_points",
")",
")",
"d2",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"kernel_points",
",",
"2",
")",
",",
"axis",
"=",
"1",
")",
"kernel_points",
"=",
"kernel_points",
"[",
"np",
".",
"logical_and",
"(",
"d2",
"<",
"radius0",
"**",
"2",
",",
"(",
"0.9",
"*",
"radius0",
")",
"**",
"2",
"<",
"d2",
")",
",",
":",
"]",
"kernel_points",
"=",
"kernel_points",
"[",
":",
"num_cells",
",",
":",
"]",
".",
"reshape",
"(",
"(",
"num_cells",
",",
"-",
"1",
")",
")",
"# Optional fixing",
"if",
"fixed",
"==",
"'center'",
":",
"kernel_points",
"[",
"0",
",",
":",
"]",
"*=",
"0",
"if",
"fixed",
"==",
"'verticals'",
":",
"kernel_points",
"[",
":",
"3",
",",
":",
"]",
"*=",
"0",
"kernel_points",
"[",
"1",
",",
"-",
"1",
"]",
"+=",
"2",
"*",
"radius0",
"/",
"3",
"kernel_points",
"[",
"2",
",",
"-",
"1",
"]",
"-=",
"2",
"*",
"radius0",
"/",
"3",
"##############################",
"# Approximation initialization",
"##############################",
"# Initialize figure",
"if",
"verbose",
">",
"1",
":",
"fig",
"=",
"plt",
".",
"figure",
"(",
")",
"# Initialize discretization in this method is chosen",
"if",
"approximation",
"==",
"'discretization'",
":",
"side_n",
"=",
"int",
"(",
"np",
".",
"floor",
"(",
"approx_n",
"**",
"(",
"1.",
"/",
"dimension",
")",
")",
")",
"dl",
"=",
"2",
"*",
"radius0",
"/",
"side_n",
"coords",
"=",
"np",
".",
"arange",
"(",
"-",
"radius0",
"+",
"dl",
"/",
"2",
",",
"radius0",
",",
"dl",
")",
"if",
"dimension",
"==",
"2",
":",
"x",
",",
"y",
"=",
"np",
".",
"meshgrid",
"(",
"coords",
",",
"coords",
")",
"X",
"=",
"np",
".",
"vstack",
"(",
"(",
"np",
".",
"ravel",
"(",
"x",
")",
",",
"np",
".",
"ravel",
"(",
"y",
")",
")",
")",
".",
"T",
"elif",
"dimension",
"==",
"3",
":",
"x",
",",
"y",
",",
"z",
"=",
"np",
".",
"meshgrid",
"(",
"coords",
",",
"coords",
",",
"coords",
")",
"X",
"=",
"np",
".",
"vstack",
"(",
"(",
"np",
".",
"ravel",
"(",
"x",
")",
",",
"np",
".",
"ravel",
"(",
"y",
")",
",",
"np",
".",
"ravel",
"(",
"z",
")",
")",
")",
".",
"T",
"elif",
"dimension",
"==",
"4",
":",
"x",
",",
"y",
",",
"z",
",",
"t",
"=",
"np",
".",
"meshgrid",
"(",
"coords",
",",
"coords",
",",
"coords",
",",
"coords",
")",
"X",
"=",
"np",
".",
"vstack",
"(",
"(",
"np",
".",
"ravel",
"(",
"x",
")",
",",
"np",
".",
"ravel",
"(",
"y",
")",
",",
"np",
".",
"ravel",
"(",
"z",
")",
",",
"np",
".",
"ravel",
"(",
"t",
")",
")",
")",
".",
"T",
"else",
":",
"raise",
"ValueError",
"(",
"'Unsupported dimension (max is 4)'",
")",
"elif",
"approximation",
"==",
"'monte-carlo'",
":",
"X",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
"dimension",
")",
")",
"else",
":",
"raise",
"ValueError",
"(",
"'Wrong approximation method chosen: \"{:s}\"'",
".",
"format",
"(",
"approximation",
")",
")",
"# Only points inside the sphere are used",
"d2",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"X",
",",
"2",
")",
",",
"axis",
"=",
"1",
")",
"X",
"=",
"X",
"[",
"d2",
"<",
"radius0",
"*",
"radius0",
",",
":",
"]",
"#####################",
"# Kernel optimization",
"#####################",
"# Warning if at least one kernel point has no cell",
"warning",
"=",
"False",
"# moving vectors of kernel points saved to detect convergence",
"max_moves",
"=",
"np",
".",
"zeros",
"(",
"(",
"0",
",",
")",
")",
"for",
"iter",
"in",
"range",
"(",
"max_iter",
")",
":",
"# In the case of monte-carlo, renew the sampled points",
"if",
"approximation",
"==",
"'monte-carlo'",
":",
"X",
"=",
"np",
".",
"random",
".",
"rand",
"(",
"approx_n",
",",
"dimension",
")",
"*",
"2",
"*",
"radius0",
"-",
"radius0",
"d2",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"X",
",",
"2",
")",
",",
"axis",
"=",
"1",
")",
"X",
"=",
"X",
"[",
"d2",
"<",
"radius0",
"*",
"radius0",
",",
":",
"]",
"# Get the distances matrix [n_approx, K, dim]",
"differences",
"=",
"np",
".",
"expand_dims",
"(",
"X",
",",
"1",
")",
"-",
"kernel_points",
"sq_distances",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"square",
"(",
"differences",
")",
",",
"axis",
"=",
"2",
")",
"# Compute cell centers",
"cell_inds",
"=",
"np",
".",
"argmin",
"(",
"sq_distances",
",",
"axis",
"=",
"1",
")",
"centers",
"=",
"[",
"]",
"for",
"c",
"in",
"range",
"(",
"num_cells",
")",
":",
"bool_c",
"=",
"(",
"cell_inds",
"==",
"c",
")",
"num_c",
"=",
"np",
".",
"sum",
"(",
"bool_c",
".",
"astype",
"(",
"np",
".",
"int32",
")",
")",
"if",
"num_c",
">",
"0",
":",
"centers",
".",
"append",
"(",
"np",
".",
"sum",
"(",
"X",
"[",
"bool_c",
",",
":",
"]",
",",
"axis",
"=",
"0",
")",
"/",
"num_c",
")",
"else",
":",
"warning",
"=",
"True",
"centers",
".",
"append",
"(",
"kernel_points",
"[",
"c",
"]",
")",
"# Update kernel points with low pass filter to smooth mote carlo",
"centers",
"=",
"np",
".",
"vstack",
"(",
"centers",
")",
"moves",
"=",
"(",
"1",
"-",
"momentum",
")",
"*",
"(",
"centers",
"-",
"kernel_points",
")",
"kernel_points",
"+=",
"moves",
"# Check moves for convergence",
"max_moves",
"=",
"np",
".",
"append",
"(",
"max_moves",
",",
"np",
".",
"max",
"(",
"np",
".",
"linalg",
".",
"norm",
"(",
"moves",
",",
"axis",
"=",
"1",
")",
")",
")",
"# Optional fixing",
"if",
"fixed",
"==",
"'center'",
":",
"kernel_points",
"[",
"0",
",",
":",
"]",
"*=",
"0",
"if",
"fixed",
"==",
"'verticals'",
":",
"kernel_points",
"[",
"0",
",",
":",
"]",
"*=",
"0",
"kernel_points",
"[",
":",
"3",
",",
":",
"-",
"1",
"]",
"*=",
"0",
"if",
"verbose",
":",
"print",
"(",
"'iter {:5d} / max move = {:f}'",
".",
"format",
"(",
"iter",
",",
"np",
".",
"max",
"(",
"np",
".",
"linalg",
".",
"norm",
"(",
"moves",
",",
"axis",
"=",
"1",
")",
")",
")",
")",
"if",
"warning",
":",
"print",
"(",
"'{:}WARNING: at least one point has no cell{:}'",
".",
"format",
"(",
"bcolors",
".",
"WARNING",
",",
"bcolors",
".",
"ENDC",
")",
")",
"if",
"verbose",
">",
"1",
":",
"plt",
".",
"clf",
"(",
")",
"plt",
".",
"scatter",
"(",
"X",
"[",
":",
",",
"0",
"]",
",",
"X",
"[",
":",
",",
"1",
"]",
",",
"c",
"=",
"cell_inds",
",",
"s",
"=",
"20.0",
",",
"marker",
"=",
"'.'",
",",
"cmap",
"=",
"plt",
".",
"get_cmap",
"(",
"'tab20'",
")",
")",
"#plt.scatter(kernel_points[:, 0], kernel_points[:, 1], c=np.arange(num_cells), s=100.0,",
"# marker='+', cmap=plt.get_cmap('tab20'))",
"plt",
".",
"plot",
"(",
"kernel_points",
"[",
":",
",",
"0",
"]",
",",
"kernel_points",
"[",
":",
",",
"1",
"]",
",",
"'k+'",
")",
"circle",
"=",
"plt",
".",
"Circle",
"(",
"(",
"0",
",",
"0",
")",
",",
"radius0",
",",
"color",
"=",
"'r'",
",",
"fill",
"=",
"False",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"add_artist",
"(",
"circle",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_xlim",
"(",
"(",
"-",
"radius0",
"*",
"1.1",
",",
"radius0",
"*",
"1.1",
")",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_ylim",
"(",
"(",
"-",
"radius0",
"*",
"1.1",
",",
"radius0",
"*",
"1.1",
")",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_aspect",
"(",
"'equal'",
")",
"plt",
".",
"draw",
"(",
")",
"plt",
".",
"pause",
"(",
"0.001",
")",
"plt",
".",
"show",
"(",
"block",
"=",
"False",
")",
"###################",
"# User verification",
"###################",
"# Show the convergence to ask user if this kernel is correct",
"if",
"verbose",
":",
"if",
"dimension",
"==",
"2",
":",
"fig",
",",
"(",
"ax1",
",",
"ax2",
")",
"=",
"plt",
".",
"subplots",
"(",
"1",
",",
"2",
",",
"figsize",
"=",
"[",
"10.4",
",",
"4.8",
"]",
")",
"ax1",
".",
"plot",
"(",
"max_moves",
")",
"ax2",
".",
"scatter",
"(",
"X",
"[",
":",
",",
"0",
"]",
",",
"X",
"[",
":",
",",
"1",
"]",
",",
"c",
"=",
"cell_inds",
",",
"s",
"=",
"20.0",
",",
"marker",
"=",
"'.'",
",",
"cmap",
"=",
"plt",
".",
"get_cmap",
"(",
"'tab20'",
")",
")",
"# plt.scatter(kernel_points[:, 0], kernel_points[:, 1], c=np.arange(num_cells), s=100.0,",
"# marker='+', cmap=plt.get_cmap('tab20'))",
"ax2",
".",
"plot",
"(",
"kernel_points",
"[",
":",
",",
"0",
"]",
",",
"kernel_points",
"[",
":",
",",
"1",
"]",
",",
"'k+'",
")",
"circle",
"=",
"plt",
".",
"Circle",
"(",
"(",
"0",
",",
"0",
")",
",",
"radius0",
",",
"color",
"=",
"'r'",
",",
"fill",
"=",
"False",
")",
"ax2",
".",
"add_artist",
"(",
"circle",
")",
"ax2",
".",
"set_xlim",
"(",
"(",
"-",
"radius0",
"*",
"1.1",
",",
"radius0",
"*",
"1.1",
")",
")",
"ax2",
".",
"set_ylim",
"(",
"(",
"-",
"radius0",
"*",
"1.1",
",",
"radius0",
"*",
"1.1",
")",
")",
"ax2",
".",
"set_aspect",
"(",
"'equal'",
")",
"plt",
".",
"title",
"(",
"'Check if kernel is correct.'",
")",
"plt",
".",
"draw",
"(",
")",
"plt",
".",
"show",
"(",
")",
"if",
"dimension",
">",
"2",
":",
"plt",
".",
"figure",
"(",
")",
"plt",
".",
"plot",
"(",
"max_moves",
")",
"plt",
".",
"title",
"(",
"'Check if kernel is correct.'",
")",
"plt",
".",
"show",
"(",
")",
"# Rescale kernels with real radius",
"return",
"kernel_points",
"*",
"radius"
] | [
77,
0
] | [
254,
33
] | python | en | ['en', 'error', 'th'] | False |
kernel_point_optimization_debug | (radius, num_points, num_kernels=1, dimension=3,
fixed='center', ratio=0.66, verbose=0) |
Creation of kernel point via optimization of potentials.
:param radius: Radius of the kernels
:param num_points: points composing kernels
:param num_kernels: number of wanted kernels
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param ratio: ratio of the radius where you want the kernels points to be placed
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
|
Creation of kernel point via optimization of potentials.
:param radius: Radius of the kernels
:param num_points: points composing kernels
:param num_kernels: number of wanted kernels
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param ratio: ratio of the radius where you want the kernels points to be placed
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
| def kernel_point_optimization_debug(radius, num_points, num_kernels=1, dimension=3,
fixed='center', ratio=0.66, verbose=0):
"""
Creation of kernel point via optimization of potentials.
:param radius: Radius of the kernels
:param num_points: points composing kernels
:param num_kernels: number of wanted kernels
:param dimension: dimension of the space
:param fixed: fix position of certain kernel points ('none', 'center' or 'verticals')
:param ratio: ratio of the radius where you want the kernels points to be placed
:param verbose: display option
:return: points [num_kernels, num_points, dimension]
"""
#######################
# Parameters definition
#######################
# Radius used for optimization (points are rescaled afterwards)
radius0 = 1
diameter0 = 2
# Factor multiplicating gradients for moving points (~learning rate)
moving_factor = 1e-2
continuous_moving_decay = 0.9995
# Gradient threshold to stop optimization
thresh = 1e-5
# Gradient clipping value
clip = 0.05 * radius0
#######################
# Kernel initialization
#######################
# Random kernel points
kernel_points = np.random.rand(num_kernels * num_points - 1, dimension) * diameter0 - radius0
while (kernel_points.shape[0] < num_kernels * num_points):
new_points = np.random.rand(num_kernels * num_points - 1, dimension) * diameter0 - radius0
kernel_points = np.vstack((kernel_points, new_points))
d2 = np.sum(np.power(kernel_points, 2), axis=1)
kernel_points = kernel_points[d2 < 0.5 * radius0 * radius0, :]
kernel_points = kernel_points[:num_kernels * num_points, :].reshape((num_kernels, num_points, -1))
# Optionnal fixing
if fixed == 'center':
kernel_points[:, 0, :] *= 0
if fixed == 'verticals':
kernel_points[:, :3, :] *= 0
kernel_points[:, 1, -1] += 2 * radius0 / 3
kernel_points[:, 2, -1] -= 2 * radius0 / 3
#####################
# Kernel optimization
#####################
# Initialize figure
if verbose>1:
fig = plt.figure()
saved_gradient_norms = np.zeros((10000, num_kernels))
old_gradient_norms = np.zeros((num_kernels, num_points))
step = -1
while step < 10000:
# Increment
step += 1
# Compute gradients
# *****************
# Derivative of the sum of potentials of all points
A = np.expand_dims(kernel_points, axis=2)
B = np.expand_dims(kernel_points, axis=1)
interd2 = np.sum(np.power(A - B, 2), axis=-1)
inter_grads = (A - B) / (np.power(np.expand_dims(interd2, -1), 3/2) + 1e-6)
inter_grads = np.sum(inter_grads, axis=1)
# Derivative of the radius potential
circle_grads = 10*kernel_points
# All gradients
gradients = inter_grads + circle_grads
if fixed == 'verticals':
gradients[:, 1:3, :-1] = 0
# Stop condition
# **************
# Compute norm of gradients
gradients_norms = np.sqrt(np.sum(np.power(gradients, 2), axis=-1))
saved_gradient_norms[step, :] = np.max(gradients_norms, axis=1)
# Stop if all moving points are gradients fixed (low gradients diff)
if fixed == 'center' and np.max(np.abs(old_gradient_norms[:, 1:] - gradients_norms[:, 1:])) < thresh:
break
elif fixed == 'verticals' and np.max(np.abs(old_gradient_norms[:, 3:] - gradients_norms[:, 3:])) < thresh:
break
elif np.max(np.abs(old_gradient_norms - gradients_norms)) < thresh:
break
old_gradient_norms = gradients_norms
# Move points
# ***********
# Clip gradient to get moving dists
moving_dists = np.minimum(moving_factor * gradients_norms, clip)
# Fix central point
if fixed == 'center':
moving_dists[:, 0] = 0
if fixed == 'verticals':
moving_dists[:, 0] = 0
# Move points
kernel_points -= np.expand_dims(moving_dists, -1) * gradients / np.expand_dims(gradients_norms + 1e-6, -1)
if verbose:
print('step {:5d} / max grad = {:f}'.format(step, np.max(gradients_norms[:, 3:])))
if verbose > 1:
plt.clf()
plt.plot(kernel_points[0, :, 0], kernel_points[0, :, 1], '.')
circle = plt.Circle((0, 0), radius, color='r', fill=False)
fig.axes[0].add_artist(circle)
fig.axes[0].set_xlim((-radius*1.1, radius*1.1))
fig.axes[0].set_ylim((-radius*1.1, radius*1.1))
fig.axes[0].set_aspect('equal')
plt.draw()
plt.pause(0.001)
plt.show(block=False)
print(moving_factor)
# moving factor decay
moving_factor *= continuous_moving_decay
# Remove unused lines in the saved gradients
if step < 10000:
saved_gradient_norms = saved_gradient_norms[:step+1, :]
# Rescale radius to fit the wanted ratio of radius
r = np.sqrt(np.sum(np.power(kernel_points, 2), axis=-1))
kernel_points *= ratio / np.mean(r[:, 1:])
# Rescale kernels with real radius
return kernel_points * radius, saved_gradient_norms | [
"def",
"kernel_point_optimization_debug",
"(",
"radius",
",",
"num_points",
",",
"num_kernels",
"=",
"1",
",",
"dimension",
"=",
"3",
",",
"fixed",
"=",
"'center'",
",",
"ratio",
"=",
"0.66",
",",
"verbose",
"=",
"0",
")",
":",
"#######################",
"# Parameters definition",
"#######################",
"# Radius used for optimization (points are rescaled afterwards)",
"radius0",
"=",
"1",
"diameter0",
"=",
"2",
"# Factor multiplicating gradients for moving points (~learning rate)",
"moving_factor",
"=",
"1e-2",
"continuous_moving_decay",
"=",
"0.9995",
"# Gradient threshold to stop optimization",
"thresh",
"=",
"1e-5",
"# Gradient clipping value",
"clip",
"=",
"0.05",
"*",
"radius0",
"#######################",
"# Kernel initialization",
"#######################",
"# Random kernel points",
"kernel_points",
"=",
"np",
".",
"random",
".",
"rand",
"(",
"num_kernels",
"*",
"num_points",
"-",
"1",
",",
"dimension",
")",
"*",
"diameter0",
"-",
"radius0",
"while",
"(",
"kernel_points",
".",
"shape",
"[",
"0",
"]",
"<",
"num_kernels",
"*",
"num_points",
")",
":",
"new_points",
"=",
"np",
".",
"random",
".",
"rand",
"(",
"num_kernels",
"*",
"num_points",
"-",
"1",
",",
"dimension",
")",
"*",
"diameter0",
"-",
"radius0",
"kernel_points",
"=",
"np",
".",
"vstack",
"(",
"(",
"kernel_points",
",",
"new_points",
")",
")",
"d2",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"kernel_points",
",",
"2",
")",
",",
"axis",
"=",
"1",
")",
"kernel_points",
"=",
"kernel_points",
"[",
"d2",
"<",
"0.5",
"*",
"radius0",
"*",
"radius0",
",",
":",
"]",
"kernel_points",
"=",
"kernel_points",
"[",
":",
"num_kernels",
"*",
"num_points",
",",
":",
"]",
".",
"reshape",
"(",
"(",
"num_kernels",
",",
"num_points",
",",
"-",
"1",
")",
")",
"# Optionnal fixing",
"if",
"fixed",
"==",
"'center'",
":",
"kernel_points",
"[",
":",
",",
"0",
",",
":",
"]",
"*=",
"0",
"if",
"fixed",
"==",
"'verticals'",
":",
"kernel_points",
"[",
":",
",",
":",
"3",
",",
":",
"]",
"*=",
"0",
"kernel_points",
"[",
":",
",",
"1",
",",
"-",
"1",
"]",
"+=",
"2",
"*",
"radius0",
"/",
"3",
"kernel_points",
"[",
":",
",",
"2",
",",
"-",
"1",
"]",
"-=",
"2",
"*",
"radius0",
"/",
"3",
"#####################",
"# Kernel optimization",
"#####################",
"# Initialize figure",
"if",
"verbose",
">",
"1",
":",
"fig",
"=",
"plt",
".",
"figure",
"(",
")",
"saved_gradient_norms",
"=",
"np",
".",
"zeros",
"(",
"(",
"10000",
",",
"num_kernels",
")",
")",
"old_gradient_norms",
"=",
"np",
".",
"zeros",
"(",
"(",
"num_kernels",
",",
"num_points",
")",
")",
"step",
"=",
"-",
"1",
"while",
"step",
"<",
"10000",
":",
"# Increment",
"step",
"+=",
"1",
"# Compute gradients",
"# *****************",
"# Derivative of the sum of potentials of all points",
"A",
"=",
"np",
".",
"expand_dims",
"(",
"kernel_points",
",",
"axis",
"=",
"2",
")",
"B",
"=",
"np",
".",
"expand_dims",
"(",
"kernel_points",
",",
"axis",
"=",
"1",
")",
"interd2",
"=",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"A",
"-",
"B",
",",
"2",
")",
",",
"axis",
"=",
"-",
"1",
")",
"inter_grads",
"=",
"(",
"A",
"-",
"B",
")",
"/",
"(",
"np",
".",
"power",
"(",
"np",
".",
"expand_dims",
"(",
"interd2",
",",
"-",
"1",
")",
",",
"3",
"/",
"2",
")",
"+",
"1e-6",
")",
"inter_grads",
"=",
"np",
".",
"sum",
"(",
"inter_grads",
",",
"axis",
"=",
"1",
")",
"# Derivative of the radius potential",
"circle_grads",
"=",
"10",
"*",
"kernel_points",
"# All gradients",
"gradients",
"=",
"inter_grads",
"+",
"circle_grads",
"if",
"fixed",
"==",
"'verticals'",
":",
"gradients",
"[",
":",
",",
"1",
":",
"3",
",",
":",
"-",
"1",
"]",
"=",
"0",
"# Stop condition",
"# **************",
"# Compute norm of gradients",
"gradients_norms",
"=",
"np",
".",
"sqrt",
"(",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"gradients",
",",
"2",
")",
",",
"axis",
"=",
"-",
"1",
")",
")",
"saved_gradient_norms",
"[",
"step",
",",
":",
"]",
"=",
"np",
".",
"max",
"(",
"gradients_norms",
",",
"axis",
"=",
"1",
")",
"# Stop if all moving points are gradients fixed (low gradients diff)",
"if",
"fixed",
"==",
"'center'",
"and",
"np",
".",
"max",
"(",
"np",
".",
"abs",
"(",
"old_gradient_norms",
"[",
":",
",",
"1",
":",
"]",
"-",
"gradients_norms",
"[",
":",
",",
"1",
":",
"]",
")",
")",
"<",
"thresh",
":",
"break",
"elif",
"fixed",
"==",
"'verticals'",
"and",
"np",
".",
"max",
"(",
"np",
".",
"abs",
"(",
"old_gradient_norms",
"[",
":",
",",
"3",
":",
"]",
"-",
"gradients_norms",
"[",
":",
",",
"3",
":",
"]",
")",
")",
"<",
"thresh",
":",
"break",
"elif",
"np",
".",
"max",
"(",
"np",
".",
"abs",
"(",
"old_gradient_norms",
"-",
"gradients_norms",
")",
")",
"<",
"thresh",
":",
"break",
"old_gradient_norms",
"=",
"gradients_norms",
"# Move points",
"# ***********",
"# Clip gradient to get moving dists",
"moving_dists",
"=",
"np",
".",
"minimum",
"(",
"moving_factor",
"*",
"gradients_norms",
",",
"clip",
")",
"# Fix central point",
"if",
"fixed",
"==",
"'center'",
":",
"moving_dists",
"[",
":",
",",
"0",
"]",
"=",
"0",
"if",
"fixed",
"==",
"'verticals'",
":",
"moving_dists",
"[",
":",
",",
"0",
"]",
"=",
"0",
"# Move points",
"kernel_points",
"-=",
"np",
".",
"expand_dims",
"(",
"moving_dists",
",",
"-",
"1",
")",
"*",
"gradients",
"/",
"np",
".",
"expand_dims",
"(",
"gradients_norms",
"+",
"1e-6",
",",
"-",
"1",
")",
"if",
"verbose",
":",
"print",
"(",
"'step {:5d} / max grad = {:f}'",
".",
"format",
"(",
"step",
",",
"np",
".",
"max",
"(",
"gradients_norms",
"[",
":",
",",
"3",
":",
"]",
")",
")",
")",
"if",
"verbose",
">",
"1",
":",
"plt",
".",
"clf",
"(",
")",
"plt",
".",
"plot",
"(",
"kernel_points",
"[",
"0",
",",
":",
",",
"0",
"]",
",",
"kernel_points",
"[",
"0",
",",
":",
",",
"1",
"]",
",",
"'.'",
")",
"circle",
"=",
"plt",
".",
"Circle",
"(",
"(",
"0",
",",
"0",
")",
",",
"radius",
",",
"color",
"=",
"'r'",
",",
"fill",
"=",
"False",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"add_artist",
"(",
"circle",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_xlim",
"(",
"(",
"-",
"radius",
"*",
"1.1",
",",
"radius",
"*",
"1.1",
")",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_ylim",
"(",
"(",
"-",
"radius",
"*",
"1.1",
",",
"radius",
"*",
"1.1",
")",
")",
"fig",
".",
"axes",
"[",
"0",
"]",
".",
"set_aspect",
"(",
"'equal'",
")",
"plt",
".",
"draw",
"(",
")",
"plt",
".",
"pause",
"(",
"0.001",
")",
"plt",
".",
"show",
"(",
"block",
"=",
"False",
")",
"print",
"(",
"moving_factor",
")",
"# moving factor decay",
"moving_factor",
"*=",
"continuous_moving_decay",
"# Remove unused lines in the saved gradients",
"if",
"step",
"<",
"10000",
":",
"saved_gradient_norms",
"=",
"saved_gradient_norms",
"[",
":",
"step",
"+",
"1",
",",
":",
"]",
"# Rescale radius to fit the wanted ratio of radius",
"r",
"=",
"np",
".",
"sqrt",
"(",
"np",
".",
"sum",
"(",
"np",
".",
"power",
"(",
"kernel_points",
",",
"2",
")",
",",
"axis",
"=",
"-",
"1",
")",
")",
"kernel_points",
"*=",
"ratio",
"/",
"np",
".",
"mean",
"(",
"r",
"[",
":",
",",
"1",
":",
"]",
")",
"# Rescale kernels with real radius",
"return",
"kernel_points",
"*",
"radius",
",",
"saved_gradient_norms"
] | [
257,
0
] | [
404,
55
] | python | en | ['en', 'error', 'th'] | False |
test_restarter_can_initialize_after_pool_restart | (txnPoolNodeSet) |
1. Add restart schedule message to ActionLog
2. Add start restart message to ActionLog
3. Check that Restarter can be create (emulate case after node restart).
|
1. Add restart schedule message to ActionLog
2. Add start restart message to ActionLog
3. Check that Restarter can be create (emulate case after node restart).
| def test_restarter_can_initialize_after_pool_restart(txnPoolNodeSet):
'''
1. Add restart schedule message to ActionLog
2. Add start restart message to ActionLog
3. Check that Restarter can be create (emulate case after node restart).
'''
unow = datetime.utcnow().replace(tzinfo=dateutil.tz.tzutc())
restarted_node = txnPoolNodeSet[-1]
ev_data = RestartLogData(unow)
restarted_node.restarter._actionLog.append_scheduled(ev_data)
restarted_node.restarter._actionLog.append_started(ev_data)
Restarter(restarted_node.id,
restarted_node.name,
restarted_node.dataLocation,
restarted_node.config,
actionLog=restarted_node.restarter._actionLog) | [
"def",
"test_restarter_can_initialize_after_pool_restart",
"(",
"txnPoolNodeSet",
")",
":",
"unow",
"=",
"datetime",
".",
"utcnow",
"(",
")",
".",
"replace",
"(",
"tzinfo",
"=",
"dateutil",
".",
"tz",
".",
"tzutc",
"(",
")",
")",
"restarted_node",
"=",
"txnPoolNodeSet",
"[",
"-",
"1",
"]",
"ev_data",
"=",
"RestartLogData",
"(",
"unow",
")",
"restarted_node",
".",
"restarter",
".",
"_actionLog",
".",
"append_scheduled",
"(",
"ev_data",
")",
"restarted_node",
".",
"restarter",
".",
"_actionLog",
".",
"append_started",
"(",
"ev_data",
")",
"Restarter",
"(",
"restarted_node",
".",
"id",
",",
"restarted_node",
".",
"name",
",",
"restarted_node",
".",
"dataLocation",
",",
"restarted_node",
".",
"config",
",",
"actionLog",
"=",
"restarted_node",
".",
"restarter",
".",
"_actionLog",
")"
] | [
40,
0
] | [
55,
60
] | 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.histogram2dcontour.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.histogram2dcontour.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.histogram2dcontour.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.histogram2dcontour.Stream
constructor must be a dict or
an instance of :class:`plotly.graph_objs.histogram2dcontour.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.histogram2dcontour.Stream \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.histogram2dcontour.Stream`\"\"\"",
")",
"# Handle skip_invalid",
"# -------------------",
"self",
".",
"_skip_invalid",
"=",
"kwargs",
".",
"pop",
"(",
"\"skip_invalid\"",
",",
"False",
")",
"self",
".",
"_validate",
"=",
"kwargs",
".",
"pop",
"(",
"\"_validate\"",
",",
"True",
")",
"# Populate data dict with properties",
"# ----------------------------------",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"maxpoints\"",
",",
"None",
")",
"_v",
"=",
"maxpoints",
"if",
"maxpoints",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"maxpoints\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"token\"",
",",
"None",
")",
"_v",
"=",
"token",
"if",
"token",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"token\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
72,
4
] | [
140,
34
] | python | en | ['en', 'error', 'th'] | False |
cmdparser | (raw_string, cmdset, caller, match_index=None) |
This function is called by the cmdhandler once it has
gathered and merged all valid cmdsets valid for this particular parsing.
Args:
raw_string (str): The unparsed text entered by the caller.
cmdset (CmdSet): The merged, currently valid cmdset
caller (Session, Account or Object): The caller triggering this parsing.
match_index (int, optional): Index to pick a given match in a
list of same-named command matches. If this is given, it suggests
this is not the first time this function was called: normally
the first run resulted in a multimatch, and the index is given
to select between the results for the second run.
Notes:
The cmdparser understand the following command combinations (where
[] marks optional parts.
```
[cmdname[ cmdname2 cmdname3 ...] [the rest]
```
A command may consist of any number of space-separated words of any
length, and contain any character. It may also be empty.
The parser makes use of the cmdset to find command candidates. The
parser return a list of matches. Each match is a tuple with its
first three elements being the parsed cmdname (lower case),
the remaining arguments, and the matched cmdobject from the cmdset.
|
This function is called by the cmdhandler once it has
gathered and merged all valid cmdsets valid for this particular parsing. | def cmdparser(raw_string, cmdset, caller, match_index=None):
"""
This function is called by the cmdhandler once it has
gathered and merged all valid cmdsets valid for this particular parsing.
Args:
raw_string (str): The unparsed text entered by the caller.
cmdset (CmdSet): The merged, currently valid cmdset
caller (Session, Account or Object): The caller triggering this parsing.
match_index (int, optional): Index to pick a given match in a
list of same-named command matches. If this is given, it suggests
this is not the first time this function was called: normally
the first run resulted in a multimatch, and the index is given
to select between the results for the second run.
Notes:
The cmdparser understand the following command combinations (where
[] marks optional parts.
```
[cmdname[ cmdname2 cmdname3 ...] [the rest]
```
A command may consist of any number of space-separated words of any
length, and contain any character. It may also be empty.
The parser makes use of the cmdset to find command candidates. The
parser return a list of matches. Each match is a tuple with its
first three elements being the parsed cmdname (lower case),
the remaining arguments, and the matched cmdobject from the cmdset.
"""
def create_match(cmdname, string, cmdobj, raw_cmdname):
"""
Builds a command match by splitting the incoming string and
evaluating the quality of the match.
Args:
cmdname (str): Name of command to check for.
string (str): The string to match against.
cmdobj (str): The full Command instance.
raw_cmdname (str, optional): If CMD_IGNORE_PREFIX is set and the cmdname starts with
one of the prefixes to ignore, this contains the raw, unstripped cmdname,
otherwise it is None.
Returns:
match (tuple): This is on the form (cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname), where
`cmdname` is the command's name and `args` the rest of the incoming string,
without said command name. `cmdobj` is the Command instance, the cmdlen is
the same as len(cmdname) and mratio is a measure of how big a part of the
full input string the cmdname takes up - an exact match would be 1.0. Finally,
the `raw_cmdname` is the cmdname unmodified by eventual prefix-stripping.
"""
cmdlen, strlen = len(unicode(cmdname)), len(unicode(string))
mratio = 1 - (strlen - cmdlen) / (1.0 * strlen)
args = string[cmdlen:]
return (cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname)
def build_matches(raw_string, include_prefixes=False):
l_raw_string = raw_string.lower()
matches = []
try:
if include_prefixes:
# use the cmdname as-is
for cmd in cmdset:
matches.extend([create_match(cmdname, raw_string, cmd, cmdname)
for cmdname in [cmd.key] + cmd.aliases
if cmdname and l_raw_string.startswith(cmdname.lower()) and
(not cmd.arg_regex or
cmd.arg_regex.match(l_raw_string[len(cmdname):]))])
else:
# strip prefixes set in settings
for cmd in cmdset:
for raw_cmdname in [cmd.key] + cmd.aliases:
cmdname = raw_cmdname.lstrip(_CMD_IGNORE_PREFIXES) if len(raw_cmdname) > 1 else raw_cmdname
if cmdname and l_raw_string.startswith(cmdname.lower()) and \
(not cmd.arg_regex or cmd.arg_regex.match(l_raw_string[len(cmdname):])):
matches.append(create_match(cmdname, raw_string, cmd, raw_cmdname))
except Exception:
log_trace("cmdhandler error. raw_input:%s" % raw_string)
return matches
def try_num_prefixes(raw_string):
if not matches:
# no matches found
num_ref_match = _MULTIMATCH_REGEX.match(raw_string)
if num_ref_match:
# the user might be trying to identify the command
# with a #num-command style syntax. We expect the regex to
# contain the groups "number" and "name".
mindex, new_raw_string = num_ref_match.group("number"), num_ref_match.group("name")
return mindex, new_raw_string
return None, None
if not raw_string:
return []
# find mathces, first using the full name
matches = build_matches(raw_string, include_prefixes=True)
if not matches:
# try to match a number 1-cmdname, 2-cmdname etc
mindex, new_raw_string = try_num_prefixes(raw_string)
if mindex is not None:
return cmdparser(new_raw_string, cmdset, caller, match_index=int(mindex))
if _CMD_IGNORE_PREFIXES:
# still no match. Try to strip prefixes
raw_string = raw_string.lstrip(_CMD_IGNORE_PREFIXES) if len(raw_string) > 1 else raw_string
matches = build_matches(raw_string, include_prefixes=False)
# only select command matches we are actually allowed to call.
matches = [match for match in matches if match[2].access(caller, 'cmd')]
# try to bring the number of matches down to 1
if len(matches) > 1:
# See if it helps to analyze the match with preserved case but only if
# it leaves at least one match.
trimmed = [match for match in matches
if raw_string.startswith(match[0])]
if trimmed:
matches = trimmed
if len(matches) > 1:
# we still have multiple matches. Sort them by count quality.
matches = sorted(matches, key=lambda m: m[3])
# only pick the matches with highest count quality
quality = [mat[3] for mat in matches]
matches = matches[-quality.count(quality[-1]):]
if len(matches) > 1:
# still multiple matches. Fall back to ratio-based quality.
matches = sorted(matches, key=lambda m: m[4])
# only pick the highest rated ratio match
quality = [mat[4] for mat in matches]
matches = matches[-quality.count(quality[-1]):]
if len(matches) > 1 and match_index is not None and 0 < match_index <= len(matches):
# We couldn't separate match by quality, but we have an
# index argument to tell us which match to use.
matches = [matches[match_index - 1]]
# no matter what we have at this point, we have to return it.
return matches | [
"def",
"cmdparser",
"(",
"raw_string",
",",
"cmdset",
",",
"caller",
",",
"match_index",
"=",
"None",
")",
":",
"def",
"create_match",
"(",
"cmdname",
",",
"string",
",",
"cmdobj",
",",
"raw_cmdname",
")",
":",
"\"\"\"\n Builds a command match by splitting the incoming string and\n evaluating the quality of the match.\n\n Args:\n cmdname (str): Name of command to check for.\n string (str): The string to match against.\n cmdobj (str): The full Command instance.\n raw_cmdname (str, optional): If CMD_IGNORE_PREFIX is set and the cmdname starts with\n one of the prefixes to ignore, this contains the raw, unstripped cmdname,\n otherwise it is None.\n\n Returns:\n match (tuple): This is on the form (cmdname, args, cmdobj, cmdlen, mratio, raw_cmdname), where\n `cmdname` is the command's name and `args` the rest of the incoming string,\n without said command name. `cmdobj` is the Command instance, the cmdlen is\n the same as len(cmdname) and mratio is a measure of how big a part of the\n full input string the cmdname takes up - an exact match would be 1.0. Finally,\n the `raw_cmdname` is the cmdname unmodified by eventual prefix-stripping.\n\n \"\"\"",
"cmdlen",
",",
"strlen",
"=",
"len",
"(",
"unicode",
"(",
"cmdname",
")",
")",
",",
"len",
"(",
"unicode",
"(",
"string",
")",
")",
"mratio",
"=",
"1",
"-",
"(",
"strlen",
"-",
"cmdlen",
")",
"/",
"(",
"1.0",
"*",
"strlen",
")",
"args",
"=",
"string",
"[",
"cmdlen",
":",
"]",
"return",
"(",
"cmdname",
",",
"args",
",",
"cmdobj",
",",
"cmdlen",
",",
"mratio",
",",
"raw_cmdname",
")",
"def",
"build_matches",
"(",
"raw_string",
",",
"include_prefixes",
"=",
"False",
")",
":",
"l_raw_string",
"=",
"raw_string",
".",
"lower",
"(",
")",
"matches",
"=",
"[",
"]",
"try",
":",
"if",
"include_prefixes",
":",
"# use the cmdname as-is",
"for",
"cmd",
"in",
"cmdset",
":",
"matches",
".",
"extend",
"(",
"[",
"create_match",
"(",
"cmdname",
",",
"raw_string",
",",
"cmd",
",",
"cmdname",
")",
"for",
"cmdname",
"in",
"[",
"cmd",
".",
"key",
"]",
"+",
"cmd",
".",
"aliases",
"if",
"cmdname",
"and",
"l_raw_string",
".",
"startswith",
"(",
"cmdname",
".",
"lower",
"(",
")",
")",
"and",
"(",
"not",
"cmd",
".",
"arg_regex",
"or",
"cmd",
".",
"arg_regex",
".",
"match",
"(",
"l_raw_string",
"[",
"len",
"(",
"cmdname",
")",
":",
"]",
")",
")",
"]",
")",
"else",
":",
"# strip prefixes set in settings",
"for",
"cmd",
"in",
"cmdset",
":",
"for",
"raw_cmdname",
"in",
"[",
"cmd",
".",
"key",
"]",
"+",
"cmd",
".",
"aliases",
":",
"cmdname",
"=",
"raw_cmdname",
".",
"lstrip",
"(",
"_CMD_IGNORE_PREFIXES",
")",
"if",
"len",
"(",
"raw_cmdname",
")",
">",
"1",
"else",
"raw_cmdname",
"if",
"cmdname",
"and",
"l_raw_string",
".",
"startswith",
"(",
"cmdname",
".",
"lower",
"(",
")",
")",
"and",
"(",
"not",
"cmd",
".",
"arg_regex",
"or",
"cmd",
".",
"arg_regex",
".",
"match",
"(",
"l_raw_string",
"[",
"len",
"(",
"cmdname",
")",
":",
"]",
")",
")",
":",
"matches",
".",
"append",
"(",
"create_match",
"(",
"cmdname",
",",
"raw_string",
",",
"cmd",
",",
"raw_cmdname",
")",
")",
"except",
"Exception",
":",
"log_trace",
"(",
"\"cmdhandler error. raw_input:%s\"",
"%",
"raw_string",
")",
"return",
"matches",
"def",
"try_num_prefixes",
"(",
"raw_string",
")",
":",
"if",
"not",
"matches",
":",
"# no matches found",
"num_ref_match",
"=",
"_MULTIMATCH_REGEX",
".",
"match",
"(",
"raw_string",
")",
"if",
"num_ref_match",
":",
"# the user might be trying to identify the command",
"# with a #num-command style syntax. We expect the regex to",
"# contain the groups \"number\" and \"name\".",
"mindex",
",",
"new_raw_string",
"=",
"num_ref_match",
".",
"group",
"(",
"\"number\"",
")",
",",
"num_ref_match",
".",
"group",
"(",
"\"name\"",
")",
"return",
"mindex",
",",
"new_raw_string",
"return",
"None",
",",
"None",
"if",
"not",
"raw_string",
":",
"return",
"[",
"]",
"# find mathces, first using the full name",
"matches",
"=",
"build_matches",
"(",
"raw_string",
",",
"include_prefixes",
"=",
"True",
")",
"if",
"not",
"matches",
":",
"# try to match a number 1-cmdname, 2-cmdname etc",
"mindex",
",",
"new_raw_string",
"=",
"try_num_prefixes",
"(",
"raw_string",
")",
"if",
"mindex",
"is",
"not",
"None",
":",
"return",
"cmdparser",
"(",
"new_raw_string",
",",
"cmdset",
",",
"caller",
",",
"match_index",
"=",
"int",
"(",
"mindex",
")",
")",
"if",
"_CMD_IGNORE_PREFIXES",
":",
"# still no match. Try to strip prefixes",
"raw_string",
"=",
"raw_string",
".",
"lstrip",
"(",
"_CMD_IGNORE_PREFIXES",
")",
"if",
"len",
"(",
"raw_string",
")",
">",
"1",
"else",
"raw_string",
"matches",
"=",
"build_matches",
"(",
"raw_string",
",",
"include_prefixes",
"=",
"False",
")",
"# only select command matches we are actually allowed to call.",
"matches",
"=",
"[",
"match",
"for",
"match",
"in",
"matches",
"if",
"match",
"[",
"2",
"]",
".",
"access",
"(",
"caller",
",",
"'cmd'",
")",
"]",
"# try to bring the number of matches down to 1",
"if",
"len",
"(",
"matches",
")",
">",
"1",
":",
"# See if it helps to analyze the match with preserved case but only if",
"# it leaves at least one match.",
"trimmed",
"=",
"[",
"match",
"for",
"match",
"in",
"matches",
"if",
"raw_string",
".",
"startswith",
"(",
"match",
"[",
"0",
"]",
")",
"]",
"if",
"trimmed",
":",
"matches",
"=",
"trimmed",
"if",
"len",
"(",
"matches",
")",
">",
"1",
":",
"# we still have multiple matches. Sort them by count quality.",
"matches",
"=",
"sorted",
"(",
"matches",
",",
"key",
"=",
"lambda",
"m",
":",
"m",
"[",
"3",
"]",
")",
"# only pick the matches with highest count quality",
"quality",
"=",
"[",
"mat",
"[",
"3",
"]",
"for",
"mat",
"in",
"matches",
"]",
"matches",
"=",
"matches",
"[",
"-",
"quality",
".",
"count",
"(",
"quality",
"[",
"-",
"1",
"]",
")",
":",
"]",
"if",
"len",
"(",
"matches",
")",
">",
"1",
":",
"# still multiple matches. Fall back to ratio-based quality.",
"matches",
"=",
"sorted",
"(",
"matches",
",",
"key",
"=",
"lambda",
"m",
":",
"m",
"[",
"4",
"]",
")",
"# only pick the highest rated ratio match",
"quality",
"=",
"[",
"mat",
"[",
"4",
"]",
"for",
"mat",
"in",
"matches",
"]",
"matches",
"=",
"matches",
"[",
"-",
"quality",
".",
"count",
"(",
"quality",
"[",
"-",
"1",
"]",
")",
":",
"]",
"if",
"len",
"(",
"matches",
")",
">",
"1",
"and",
"match_index",
"is",
"not",
"None",
"and",
"0",
"<",
"match_index",
"<=",
"len",
"(",
"matches",
")",
":",
"# We couldn't separate match by quality, but we have an",
"# index argument to tell us which match to use.",
"matches",
"=",
"[",
"matches",
"[",
"match_index",
"-",
"1",
"]",
"]",
"# no matter what we have at this point, we have to return it.",
"return",
"matches"
] | [
17,
0
] | [
160,
18
] | python | en | ['en', 'error', 'th'] | False |
Domain.column | (self) |
If there is a layout grid, use the domain for this column in
the grid for this sankey trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
|
If there is a layout grid, use the domain for this column in
the grid for this sankey trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def column(self):
"""
If there is a layout grid, use the domain for this column in
the grid for this sankey trace .
The 'column' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
"""
return self["column"] | [
"def",
"column",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"column\"",
"]"
] | [
15,
4
] | [
28,
29
] | python | en | ['en', 'error', 'th'] | False |
Domain.row | (self) |
If there is a layout grid, use the domain for this row in the
grid for this sankey trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
|
If there is a layout grid, use the domain for this row in the
grid for this sankey trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def row(self):
"""
If there is a layout grid, use the domain for this row in the
grid for this sankey trace .
The 'row' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
"""
return self["row"] | [
"def",
"row",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"row\"",
"]"
] | [
37,
4
] | [
50,
26
] | python | en | ['en', 'error', 'th'] | False |
Domain.x | (self) |
Sets the horizontal domain of this sankey trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'x[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
list
|
Sets the horizontal domain of this sankey trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'x[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def x(self):
"""
Sets the horizontal domain of this sankey trace (in plot
fraction).
The 'x' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'x[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'x[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
list
"""
return self["x"] | [
"def",
"x",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"x\"",
"]"
] | [
59,
4
] | [
76,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.y | (self) |
Sets the vertical domain of this sankey trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'y[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
list
|
Sets the vertical domain of this sankey trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'y[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def y(self):
"""
Sets the vertical domain of this sankey trace (in plot
fraction).
The 'y' property is an info array that may be specified as:
* a list or tuple of 2 elements where:
(0) The 'y[0]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
(1) The 'y[1]' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
list
"""
return self["y"] | [
"def",
"y",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"y\"",
"]"
] | [
85,
4
] | [
102,
24
] | python | en | ['en', 'error', 'th'] | False |
Domain.__init__ | (self, arg=None, column=None, row=None, x=None, y=None, **kwargs) |
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sankey.Domain`
column
If there is a layout grid, use the domain for this
column in the grid for this sankey trace .
row
If there is a layout grid, use the domain for this row
in the grid for this sankey trace .
x
Sets the horizontal domain of this sankey trace (in
plot fraction).
y
Sets the vertical domain of this sankey trace (in plot
fraction).
Returns
-------
Domain
|
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sankey.Domain`
column
If there is a layout grid, use the domain for this
column in the grid for this sankey trace .
row
If there is a layout grid, use the domain for this row
in the grid for this sankey trace .
x
Sets the horizontal domain of this sankey trace (in
plot fraction).
y
Sets the vertical domain of this sankey trace (in plot
fraction). | def __init__(self, arg=None, column=None, row=None, x=None, y=None, **kwargs):
"""
Construct a new Domain object
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.sankey.Domain`
column
If there is a layout grid, use the domain for this
column in the grid for this sankey trace .
row
If there is a layout grid, use the domain for this row
in the grid for this sankey trace .
x
Sets the horizontal domain of this sankey trace (in
plot fraction).
y
Sets the vertical domain of this sankey trace (in plot
fraction).
Returns
-------
Domain
"""
super(Domain, self).__init__("domain")
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.sankey.Domain
constructor must be a dict or
an instance of :class:`plotly.graph_objs.sankey.Domain`"""
)
# 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("column", None)
_v = column if column is not None else _v
if _v is not None:
self["column"] = _v
_v = arg.pop("row", None)
_v = row if row is not None else _v
if _v is not None:
self["row"] = _v
_v = arg.pop("x", None)
_v = x if x is not None else _v
if _v is not None:
self["x"] = _v
_v = arg.pop("y", None)
_v = y if y is not None else _v
if _v is not None:
self["y"] = _v
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"column",
"=",
"None",
",",
"row",
"=",
"None",
",",
"x",
"=",
"None",
",",
"y",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Domain",
",",
"self",
")",
".",
"__init__",
"(",
"\"domain\"",
")",
"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.sankey.Domain \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.sankey.Domain`\"\"\"",
")",
"# 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",
"(",
"\"column\"",
",",
"None",
")",
"_v",
"=",
"column",
"if",
"column",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"column\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"row\"",
",",
"None",
")",
"_v",
"=",
"row",
"if",
"row",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"row\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"x\"",
",",
"None",
")",
"_v",
"=",
"x",
"if",
"x",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"x\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"y\"",
",",
"None",
")",
"_v",
"=",
"y",
"if",
"y",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"y\"",
"]",
"=",
"_v",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
127,
4
] | [
205,
34
] | python | en | ['en', 'error', 'th'] | False |
DefaultContextBuilder.build | (self) | Build the new injection context. | Build the new injection context. | async def build(self) -> InjectionContext:
"""Build the new injection context."""
context = InjectionContext(settings=self.settings)
context.settings.set_default("default_label", "Aries Cloud Agent")
if context.settings.get("timing.enabled"):
timing_log = context.settings.get("timing.log_file")
collector = Collector(log_path=timing_log)
context.injector.bind_instance(Collector, collector)
# Shared in-memory cache
context.injector.bind_instance(BaseCache, BasicCache())
# Global protocol registry
context.injector.bind_instance(ProtocolRegistry, ProtocolRegistry())
await self.bind_providers(context)
await self.load_plugins(context)
return context | [
"async",
"def",
"build",
"(",
"self",
")",
"->",
"InjectionContext",
":",
"context",
"=",
"InjectionContext",
"(",
"settings",
"=",
"self",
".",
"settings",
")",
"context",
".",
"settings",
".",
"set_default",
"(",
"\"default_label\"",
",",
"\"Aries Cloud Agent\"",
")",
"if",
"context",
".",
"settings",
".",
"get",
"(",
"\"timing.enabled\"",
")",
":",
"timing_log",
"=",
"context",
".",
"settings",
".",
"get",
"(",
"\"timing.log_file\"",
")",
"collector",
"=",
"Collector",
"(",
"log_path",
"=",
"timing_log",
")",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"Collector",
",",
"collector",
")",
"# Shared in-memory cache",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"BaseCache",
",",
"BasicCache",
"(",
")",
")",
"# Global protocol registry",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"ProtocolRegistry",
",",
"ProtocolRegistry",
"(",
")",
")",
"await",
"self",
".",
"bind_providers",
"(",
"context",
")",
"await",
"self",
".",
"load_plugins",
"(",
"context",
")",
"return",
"context"
] | [
31,
4
] | [
50,
22
] | python | en | ['en', 'en', 'en'] | True |
DefaultContextBuilder.bind_providers | (self, context: InjectionContext) | Bind various class providers. | Bind various class providers. | async def bind_providers(self, context: InjectionContext):
"""Bind various class providers."""
context.injector.bind_provider(
BaseStorage,
CachedProvider(
StatsProvider(
StorageProvider(), ("add_record", "get_record", "search_records")
)
),
)
context.injector.bind_provider(
BaseWallet,
CachedProvider(
StatsProvider(
WalletProvider(),
(
"create",
"open",
"sign_message",
"verify_message",
"encrypt_message",
"decrypt_message",
"pack_message",
"unpack_message",
"get_local_did",
),
)
),
)
context.injector.bind_provider(
BaseLedger,
CachedProvider(
StatsProvider(
LedgerProvider(),
(
"get_credential_definition",
"get_schema",
"send_credential_definition",
"send_schema",
),
)
),
)
context.injector.bind_provider(
BaseIssuer,
StatsProvider(
ClassProvider(
"aries_cloudagent.issuer.indy.IndyIssuer",
ClassProvider.Inject(BaseWallet),
),
("create_credential_offer", "create_credential"),
),
)
context.injector.bind_provider(
BaseHolder,
StatsProvider(
ClassProvider(
"aries_cloudagent.holder.indy.IndyHolder",
ClassProvider.Inject(BaseWallet),
),
("get_credential", "store_credential", "create_credential_request"),
),
)
context.injector.bind_provider(
BaseVerifier,
ClassProvider(
"aries_cloudagent.verifier.indy.IndyVerifier",
ClassProvider.Inject(BaseWallet),
),
)
# Register default pack format
context.injector.bind_provider(
BaseWireFormat,
CachedProvider(
StatsProvider(
ClassProvider(PackWireFormat), ("encode_message", "parse_message"),
)
),
)
# Allow action menu to be provided by driver
context.injector.bind_instance(BaseMenuService, DriverMenuService(context))
context.injector.bind_instance(
BaseIntroductionService, DemoIntroductionService(context)
) | [
"async",
"def",
"bind_providers",
"(",
"self",
",",
"context",
":",
"InjectionContext",
")",
":",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseStorage",
",",
"CachedProvider",
"(",
"StatsProvider",
"(",
"StorageProvider",
"(",
")",
",",
"(",
"\"add_record\"",
",",
"\"get_record\"",
",",
"\"search_records\"",
")",
")",
")",
",",
")",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseWallet",
",",
"CachedProvider",
"(",
"StatsProvider",
"(",
"WalletProvider",
"(",
")",
",",
"(",
"\"create\"",
",",
"\"open\"",
",",
"\"sign_message\"",
",",
"\"verify_message\"",
",",
"\"encrypt_message\"",
",",
"\"decrypt_message\"",
",",
"\"pack_message\"",
",",
"\"unpack_message\"",
",",
"\"get_local_did\"",
",",
")",
",",
")",
")",
",",
")",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseLedger",
",",
"CachedProvider",
"(",
"StatsProvider",
"(",
"LedgerProvider",
"(",
")",
",",
"(",
"\"get_credential_definition\"",
",",
"\"get_schema\"",
",",
"\"send_credential_definition\"",
",",
"\"send_schema\"",
",",
")",
",",
")",
")",
",",
")",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseIssuer",
",",
"StatsProvider",
"(",
"ClassProvider",
"(",
"\"aries_cloudagent.issuer.indy.IndyIssuer\"",
",",
"ClassProvider",
".",
"Inject",
"(",
"BaseWallet",
")",
",",
")",
",",
"(",
"\"create_credential_offer\"",
",",
"\"create_credential\"",
")",
",",
")",
",",
")",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseHolder",
",",
"StatsProvider",
"(",
"ClassProvider",
"(",
"\"aries_cloudagent.holder.indy.IndyHolder\"",
",",
"ClassProvider",
".",
"Inject",
"(",
"BaseWallet",
")",
",",
")",
",",
"(",
"\"get_credential\"",
",",
"\"store_credential\"",
",",
"\"create_credential_request\"",
")",
",",
")",
",",
")",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseVerifier",
",",
"ClassProvider",
"(",
"\"aries_cloudagent.verifier.indy.IndyVerifier\"",
",",
"ClassProvider",
".",
"Inject",
"(",
"BaseWallet",
")",
",",
")",
",",
")",
"# Register default pack format",
"context",
".",
"injector",
".",
"bind_provider",
"(",
"BaseWireFormat",
",",
"CachedProvider",
"(",
"StatsProvider",
"(",
"ClassProvider",
"(",
"PackWireFormat",
")",
",",
"(",
"\"encode_message\"",
",",
"\"parse_message\"",
")",
",",
")",
")",
",",
")",
"# Allow action menu to be provided by driver",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"BaseMenuService",
",",
"DriverMenuService",
"(",
"context",
")",
")",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"BaseIntroductionService",
",",
"DemoIntroductionService",
"(",
"context",
")",
")"
] | [
52,
4
] | [
139,
9
] | python | en | ['en', 'en', 'en'] | True |
DefaultContextBuilder.load_plugins | (self, context: InjectionContext) | Set up plugin registry and load plugins. | Set up plugin registry and load plugins. | async def load_plugins(self, context: InjectionContext):
"""Set up plugin registry and load plugins."""
plugin_registry = PluginRegistry()
context.injector.bind_instance(PluginRegistry, plugin_registry)
# Register standard protocol plugins
plugin_registry.register_package("aries_cloudagent.protocols")
# Currently providing admin routes only
plugin_registry.register_plugin("aries_cloudagent.ledger")
plugin_registry.register_plugin(
"aries_cloudagent.messaging.credential_definitions"
)
plugin_registry.register_plugin("aries_cloudagent.messaging.schemas")
plugin_registry.register_plugin("aries_cloudagent.wallet")
# Register external plugins
for plugin_path in self.settings.get("external_plugins", []):
plugin_registry.register_plugin(plugin_path)
# Register message protocols
await plugin_registry.init_context(context) | [
"async",
"def",
"load_plugins",
"(",
"self",
",",
"context",
":",
"InjectionContext",
")",
":",
"plugin_registry",
"=",
"PluginRegistry",
"(",
")",
"context",
".",
"injector",
".",
"bind_instance",
"(",
"PluginRegistry",
",",
"plugin_registry",
")",
"# Register standard protocol plugins",
"plugin_registry",
".",
"register_package",
"(",
"\"aries_cloudagent.protocols\"",
")",
"# Currently providing admin routes only",
"plugin_registry",
".",
"register_plugin",
"(",
"\"aries_cloudagent.ledger\"",
")",
"plugin_registry",
".",
"register_plugin",
"(",
"\"aries_cloudagent.messaging.credential_definitions\"",
")",
"plugin_registry",
".",
"register_plugin",
"(",
"\"aries_cloudagent.messaging.schemas\"",
")",
"plugin_registry",
".",
"register_plugin",
"(",
"\"aries_cloudagent.wallet\"",
")",
"# Register external plugins",
"for",
"plugin_path",
"in",
"self",
".",
"settings",
".",
"get",
"(",
"\"external_plugins\"",
",",
"[",
"]",
")",
":",
"plugin_registry",
".",
"register_plugin",
"(",
"plugin_path",
")",
"# Register message protocols",
"await",
"plugin_registry",
".",
"init_context",
"(",
"context",
")"
] | [
141,
4
] | [
163,
51
] | python | en | ['en', 'da', 'en'] | True |
Densitymapbox.autocolorscale | (self) |
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False) | def autocolorscale(self):
"""
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be chosen
according to whether numbers in the `color` array are all
positive, all negative or mixed.
The 'autocolorscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["autocolorscale"] | [
"def",
"autocolorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"autocolorscale\"",
"]"
] | [
60,
4
] | [
76,
37
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.below | (self) |
Determines if the densitymapbox trace will be inserted before
the layer with the specified ID. By default, densitymapbox
traces are placed below the first layer of type symbol If set
to '', the layer will be inserted above every existing layer.
The 'below' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Determines if the densitymapbox trace will be inserted before
the layer with the specified ID. By default, densitymapbox
traces are placed below the first layer of type symbol If set
to '', the layer will be inserted above every existing layer.
The 'below' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def below(self):
"""
Determines if the densitymapbox trace will be inserted before
the layer with the specified ID. By default, densitymapbox
traces are placed below the first layer of type symbol If set
to '', the layer will be inserted above every existing layer.
The 'below' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["below"] | [
"def",
"below",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"below\"",
"]"
] | [
85,
4
] | [
100,
28
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.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\"",
"]"
] | [
109,
4
] | [
127,
32
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.colorbar | (self) |
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.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.density
mapbox.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.densitymapbox.colorbar.tickformatstopdefaults
), sets the default property values to use for
elements of
densitymapbox.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.densitymapbox.colo
rbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
densitymapbox.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
densitymapbox.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.densitymapbox.ColorBar
|
The 'colorbar' property is an instance of ColorBar
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.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.density
mapbox.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.densitymapbox.colorbar.tickformatstopdefaults
), sets the default property values to use for
elements of
densitymapbox.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.densitymapbox.colo
rbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
densitymapbox.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
densitymapbox.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.densitymapbox.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.density
mapbox.colorbar.Tickformatstop` instances or
dicts with compatible properties
tickformatstopdefaults
When used in a template (as layout.template.dat
a.densitymapbox.colorbar.tickformatstopdefaults
), sets the default property values to use for
elements of
densitymapbox.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.densitymapbox.colo
rbar.Title` instance or dict with compatible
properties
titlefont
Deprecated: Please use
densitymapbox.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
densitymapbox.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.densitymapbox.ColorBar
"""
return self["colorbar"] | [
"def",
"colorbar",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorbar\"",
"]"
] | [
136,
4
] | [
363,
31
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.colorscale | (self) |
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
|
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it. | def colorscale(self):
"""
Sets the colorscale. The colorscale must be an array containing
arrays mapping a normalized value to an rgb, rgba, hex, hsl,
hsv, or named color string. At minimum, a mapping for the
lowest (0) and highest (1) values are required. For example,
`[[0, 'rgb(0,0,255)'], [1, 'rgb(255,0,0)']]`. To control the
bounds of the colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name string of the
following list: Greys,YlGnBu,Greens,YlOrRd,Bluered,RdBu,Reds,Bl
ues,Picnic,Rainbow,Portland,Jet,Hot,Blackbody,Earth,Electric,Vi
ridis,Cividis.
The 'colorscale' property is a colorscale and may be
specified as:
- A list of colors that will be spaced evenly to create the colorscale.
Many predefined colorscale lists are included in the sequential, diverging,
and cyclical modules in the plotly.colors package.
- A list of 2-element lists where the first element is the
normalized color level value (starting at 0 and ending at 1),
and the second item is a valid color string.
(e.g. [[0, 'green'], [0.5, 'red'], [1.0, 'rgb(0, 0, 255)']])
- One of the following named colorscales:
['aggrnyl', 'agsunset', 'algae', 'amp', 'armyrose', 'balance',
'blackbody', 'bluered', 'blues', 'blugrn', 'bluyl', 'brbg',
'brwnyl', 'bugn', 'bupu', 'burg', 'burgyl', 'cividis', 'curl',
'darkmint', 'deep', 'delta', 'dense', 'earth', 'edge', 'electric',
'emrld', 'fall', 'geyser', 'gnbu', 'gray', 'greens', 'greys',
'haline', 'hot', 'hsv', 'ice', 'icefire', 'inferno', 'jet',
'magenta', 'magma', 'matter', 'mint', 'mrybm', 'mygbm', 'oranges',
'orrd', 'oryel', 'peach', 'phase', 'picnic', 'pinkyl', 'piyg',
'plasma', 'plotly3', 'portland', 'prgn', 'pubu', 'pubugn', 'puor',
'purd', 'purp', 'purples', 'purpor', 'rainbow', 'rdbu', 'rdgy',
'rdpu', 'rdylbu', 'rdylgn', 'redor', 'reds', 'solar', 'spectral',
'speed', 'sunset', 'sunsetdark', 'teal', 'tealgrn', 'tealrose',
'tempo', 'temps', 'thermal', 'tropic', 'turbid', 'twilight',
'viridis', 'ylgn', 'ylgnbu', 'ylorbr', 'ylorrd'].
Appending '_r' to a named colorscale reverses it.
Returns
-------
str
"""
return self["colorscale"] | [
"def",
"colorscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"colorscale\"",
"]"
] | [
372,
4
] | [
415,
33
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.customdata | (self) |
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def customdata(self):
"""
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note that,
"scatter" traces also appends customdata items in the markers
DOM elements
The 'customdata' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["customdata"] | [
"def",
"customdata",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdata\"",
"]"
] | [
424,
4
] | [
438,
33
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.customdatasrc | (self) |
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def customdatasrc(self):
"""
Sets the source reference on Chart Studio Cloud for customdata
.
The 'customdatasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["customdatasrc"] | [
"def",
"customdatasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"customdatasrc\"",
"]"
] | [
447,
4
] | [
459,
36
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hoverinfo | (self) |
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lon', 'lat', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'lon+lat')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
|
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lon', 'lat', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'lon+lat')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above | def hoverinfo(self):
"""
Determines which trace information appear on hover. If `none`
or `skip` are set, no information is displayed upon hovering.
But, if `none` is set, click and hover events are still fired.
The 'hoverinfo' property is a flaglist and may be specified
as a string containing:
- Any combination of ['lon', 'lat', 'z', 'text', 'name'] joined with '+' characters
(e.g. 'lon+lat')
OR exactly one of ['all', 'none', 'skip'] (e.g. 'skip')
- A list or array of the above
Returns
-------
Any|numpy.ndarray
"""
return self["hoverinfo"] | [
"def",
"hoverinfo",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfo\"",
"]"
] | [
468,
4
] | [
485,
32
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hoverinfosrc | (self) |
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hoverinfosrc(self):
"""
Sets the source reference on Chart Studio Cloud for hoverinfo
.
The 'hoverinfosrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hoverinfosrc"] | [
"def",
"hoverinfosrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverinfosrc\"",
"]"
] | [
494,
4
] | [
506,
35
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hoverlabel | (self) |
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength .
Returns
-------
plotly.graph_objs.densitymapbox.Hoverlabel
|
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength . | def hoverlabel(self):
"""
The 'hoverlabel' property is an instance of Hoverlabel
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Hoverlabel`
- A dict of string/value properties that will be passed
to the Hoverlabel constructor
Supported dict properties:
align
Sets the horizontal alignment of the text
content within hover label box. Has an effect
only if the hover label text spans more two or
more lines
alignsrc
Sets the source reference on Chart Studio Cloud
for align .
bgcolor
Sets the background color of the hover labels
for this trace
bgcolorsrc
Sets the source reference on Chart Studio Cloud
for bgcolor .
bordercolor
Sets the border color of the hover labels for
this trace.
bordercolorsrc
Sets the source reference on Chart Studio Cloud
for bordercolor .
font
Sets the font used in hover labels.
namelength
Sets the default length (in number of
characters) of the trace name in the hover
labels for all traces. -1 shows the whole name
regardless of length. 0-3 shows the first 0-3
characters, and an integer >3 will show the
whole name if it is less than that many
characters, but if it is longer, will truncate
to `namelength - 3` characters and add an
ellipsis.
namelengthsrc
Sets the source reference on Chart Studio Cloud
for namelength .
Returns
-------
plotly.graph_objs.densitymapbox.Hoverlabel
"""
return self["hoverlabel"] | [
"def",
"hoverlabel",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hoverlabel\"",
"]"
] | [
515,
4
] | [
565,
33
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hovertemplate | (self) |
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def hovertemplate(self):
"""
Template string used for rendering the information that appear
on hover box. Note that this will override `hoverinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for details on
the formatting syntax. Dates are formatted using d3-time-
format's syntax %{variable|d3-time-format}, for example "Day:
%{2019-01-01|%A}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for details on
the date formatting syntax. The variables available in
`hovertemplate` are the ones emitted as event data described at
this link https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Anything contained in tag `<extra>` is displayed in the
secondary box, for example "<extra>{fullData.name}</extra>". To
hide the secondary box completely, use an empty tag
`<extra></extra>`.
The 'hovertemplate' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["hovertemplate"] | [
"def",
"hovertemplate",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplate\"",
"]"
] | [
574,
4
] | [
606,
36
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hovertemplatesrc | (self) |
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertemplatesrc(self):
"""
Sets the source reference on Chart Studio Cloud for
hovertemplate .
The 'hovertemplatesrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertemplatesrc"] | [
"def",
"hovertemplatesrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertemplatesrc\"",
"]"
] | [
615,
4
] | [
627,
39
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hovertext | (self) |
Sets hover text elements associated with each (lon,lat) pair If
a single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Sets hover text elements associated with each (lon,lat) pair If
a single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def hovertext(self):
"""
Sets hover text elements associated with each (lon,lat) pair If
a single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. To be seen, trace
`hoverinfo` must contain a "text" flag.
The 'hovertext' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["hovertext"] | [
"def",
"hovertext",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertext\"",
"]"
] | [
636,
4
] | [
653,
32
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.hovertextsrc | (self) |
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def hovertextsrc(self):
"""
Sets the source reference on Chart Studio Cloud for hovertext
.
The 'hovertextsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["hovertextsrc"] | [
"def",
"hovertextsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"hovertextsrc\"",
"]"
] | [
662,
4
] | [
674,
35
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.ids | (self) |
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def ids(self):
"""
Assigns id labels to each datum. These ids for object constancy
of data points during animation. Should be an array of strings,
not numbers or any other type.
The 'ids' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["ids"] | [
"def",
"ids",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ids\"",
"]"
] | [
683,
4
] | [
696,
26
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.idssrc | (self) |
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def idssrc(self):
"""
Sets the source reference on Chart Studio Cloud for ids .
The 'idssrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["idssrc"] | [
"def",
"idssrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"idssrc\"",
"]"
] | [
705,
4
] | [
716,
29
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.lat | (self) |
Sets the latitude coordinates (in degrees North).
The 'lat' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the latitude coordinates (in degrees North).
The 'lat' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def lat(self):
"""
Sets the latitude coordinates (in degrees North).
The 'lat' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["lat"] | [
"def",
"lat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lat\"",
"]"
] | [
725,
4
] | [
736,
26
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.latsrc | (self) |
Sets the source reference on Chart Studio Cloud for lat .
The 'latsrc' 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 lat .
The 'latsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def latsrc(self):
"""
Sets the source reference on Chart Studio Cloud for lat .
The 'latsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["latsrc"] | [
"def",
"latsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"latsrc\"",
"]"
] | [
745,
4
] | [
756,
29
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.legendgroup | (self) |
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def legendgroup(self):
"""
Sets the legend group for this trace. Traces part of the same
legend group hide/show at the same time when toggling legend
items.
The 'legendgroup' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["legendgroup"] | [
"def",
"legendgroup",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"legendgroup\"",
"]"
] | [
765,
4
] | [
779,
34
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.lon | (self) |
Sets the longitude coordinates (in degrees East).
The 'lon' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the longitude coordinates (in degrees East).
The 'lon' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def lon(self):
"""
Sets the longitude coordinates (in degrees East).
The 'lon' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["lon"] | [
"def",
"lon",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lon\"",
"]"
] | [
788,
4
] | [
799,
26
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.lonsrc | (self) |
Sets the source reference on Chart Studio Cloud for lon .
The 'lonsrc' 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 lon .
The 'lonsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def lonsrc(self):
"""
Sets the source reference on Chart Studio Cloud for lon .
The 'lonsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["lonsrc"] | [
"def",
"lonsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lonsrc\"",
"]"
] | [
808,
4
] | [
819,
29
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.meta | (self) |
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
|
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type | def meta(self):
"""
Assigns extra meta information associated with this trace that
can be used in various text attributes. Attributes such as
trace `name`, graph, axis and colorbar `title.text`, annotation
`text` `rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta` values in
an attribute in the same trace, simply use `%{meta[i]}` where
`i` is the index or key of the `meta` item in question. To
access trace `meta` in layout attributes, use
`%{data[n[.meta[i]}` where `i` is the index or key of the
`meta` and `n` is the trace index.
The 'meta' property accepts values of any type
Returns
-------
Any|numpy.ndarray
"""
return self["meta"] | [
"def",
"meta",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"meta\"",
"]"
] | [
828,
4
] | [
847,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.metasrc | (self) |
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def metasrc(self):
"""
Sets the source reference on Chart Studio Cloud for meta .
The 'metasrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["metasrc"] | [
"def",
"metasrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"metasrc\"",
"]"
] | [
856,
4
] | [
867,
30
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.name | (self) |
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def name(self):
"""
Sets the trace name. The trace name appear as the legend item
and on hover.
The 'name' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["name"] | [
"def",
"name",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"name\"",
"]"
] | [
876,
4
] | [
889,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.opacity | (self) |
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
|
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1] | def opacity(self):
"""
Sets the opacity of the trace.
The 'opacity' property is a number and may be specified as:
- An int or float in the interval [0, 1]
Returns
-------
int|float
"""
return self["opacity"] | [
"def",
"opacity",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"opacity\"",
"]"
] | [
898,
4
] | [
909,
30
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.radius | (self) |
Sets the radius of influence of one `lon` / `lat` point in
pixels. Increasing the value makes the densitymapbox trace
smoother, but less detailed.
The 'radius' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
|
Sets the radius of influence of one `lon` / `lat` point in
pixels. Increasing the value makes the densitymapbox trace
smoother, but less detailed.
The 'radius' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above | def radius(self):
"""
Sets the radius of influence of one `lon` / `lat` point in
pixels. Increasing the value makes the densitymapbox trace
smoother, but less detailed.
The 'radius' property is a number and may be specified as:
- An int or float in the interval [1, inf]
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
int|float|numpy.ndarray
"""
return self["radius"] | [
"def",
"radius",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"radius\"",
"]"
] | [
918,
4
] | [
932,
29
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.radiussrc | (self) |
Sets the source reference on Chart Studio Cloud for radius .
The 'radiussrc' 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 radius .
The 'radiussrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def radiussrc(self):
"""
Sets the source reference on Chart Studio Cloud for radius .
The 'radiussrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["radiussrc"] | [
"def",
"radiussrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"radiussrc\"",
"]"
] | [
941,
4
] | [
952,
32
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.reversescale | (self) |
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False) | def reversescale(self):
"""
Reverses the color mapping if true. If true, `zmin` will
correspond to the last color in the array and `zmax` will
correspond to the first color.
The 'reversescale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["reversescale"] | [
"def",
"reversescale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"reversescale\"",
"]"
] | [
961,
4
] | [
974,
35
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.showlegend | (self) |
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False) | def showlegend(self):
"""
Determines whether or not an item corresponding to this trace
is shown in the legend.
The 'showlegend' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showlegend"] | [
"def",
"showlegend",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showlegend\"",
"]"
] | [
983,
4
] | [
995,
33
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.showscale | (self) |
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False) | def showscale(self):
"""
Determines whether or not a colorbar is displayed for this
trace.
The 'showscale' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showscale"] | [
"def",
"showscale",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showscale\"",
"]"
] | [
1004,
4
] | [
1016,
32
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.stream | (self) |
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.densitymapbox.Stream
|
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details. | def stream(self):
"""
The 'stream' property is an instance of Stream
that may be specified as:
- An instance of :class:`plotly.graph_objs.densitymapbox.Stream`
- A dict of string/value properties that will be passed
to the Stream constructor
Supported dict properties:
maxpoints
Sets the maximum number of points to keep on
the plots from an incoming stream. If
`maxpoints` is set to 50, only the newest 50
points will be displayed on the plot.
token
The stream id number links a data trace on a
plot with a stream. See https://chart-
studio.plotly.com/settings for more details.
Returns
-------
plotly.graph_objs.densitymapbox.Stream
"""
return self["stream"] | [
"def",
"stream",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"stream\"",
"]"
] | [
1025,
4
] | [
1049,
29
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.subplot | (self) |
Sets a reference between this trace's data coordinates and a
mapbox subplot. If "mapbox" (the default value), the data refer
to `layout.mapbox`. If "mapbox2", the data refer to
`layout.mapbox2`, and so on.
The 'subplot' property is an identifier of a particular
subplot, of type 'mapbox', that may be specified as the string 'mapbox'
optionally followed by an integer >= 1
(e.g. 'mapbox', 'mapbox1', 'mapbox2', 'mapbox3', etc.)
Returns
-------
str
|
Sets a reference between this trace's data coordinates and a
mapbox subplot. If "mapbox" (the default value), the data refer
to `layout.mapbox`. If "mapbox2", the data refer to
`layout.mapbox2`, and so on.
The 'subplot' property is an identifier of a particular
subplot, of type 'mapbox', that may be specified as the string 'mapbox'
optionally followed by an integer >= 1
(e.g. 'mapbox', 'mapbox1', 'mapbox2', 'mapbox3', etc.) | def subplot(self):
"""
Sets a reference between this trace's data coordinates and a
mapbox subplot. If "mapbox" (the default value), the data refer
to `layout.mapbox`. If "mapbox2", the data refer to
`layout.mapbox2`, and so on.
The 'subplot' property is an identifier of a particular
subplot, of type 'mapbox', that may be specified as the string 'mapbox'
optionally followed by an integer >= 1
(e.g. 'mapbox', 'mapbox1', 'mapbox2', 'mapbox3', etc.)
Returns
-------
str
"""
return self["subplot"] | [
"def",
"subplot",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"subplot\"",
"]"
] | [
1058,
4
] | [
1074,
30
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.text | (self) |
Sets text elements associated with each (lon,lat) pair If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. If trace `hoverinfo`
contains a "text" flag and "hovertext" is not set, these
elements will be seen in the hover labels.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
|
Sets text elements associated with each (lon,lat) pair If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. If trace `hoverinfo`
contains a "text" flag and "hovertext" is not set, these
elements will be seen in the hover labels.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above | def text(self):
"""
Sets text elements associated with each (lon,lat) pair If a
single string, the same string appears over all the data
points. If an array of string, the items are mapped in order to
the this trace's (lon,lat) coordinates. If trace `hoverinfo`
contains a "text" flag and "hovertext" is not set, these
elements will be seen in the hover labels.
The 'text' property is a string and must be specified as:
- A string
- A number that will be converted to a string
- A tuple, list, or one-dimensional numpy array of the above
Returns
-------
str|numpy.ndarray
"""
return self["text"] | [
"def",
"text",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"text\"",
"]"
] | [
1083,
4
] | [
1101,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.textsrc | (self) |
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def textsrc(self):
"""
Sets the source reference on Chart Studio Cloud for text .
The 'textsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["textsrc"] | [
"def",
"textsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"textsrc\"",
"]"
] | [
1110,
4
] | [
1121,
30
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.uid | (self) |
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def uid(self):
"""
Assign an id to this trace, Use this to provide object
constancy between traces during animations and transitions.
The 'uid' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["uid"] | [
"def",
"uid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uid\"",
"]"
] | [
1130,
4
] | [
1143,
26
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.uirevision | (self) |
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type
Returns
-------
Any
|
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type | def uirevision(self):
"""
Controls persistence of some user-driven changes to the trace:
`constraintrange` in `parcoords` traces, as well as some
`editable: true` modifications such as `name` and
`colorbar.title`. Defaults to `layout.uirevision`. Note that
other user-driven trace attribute changes are controlled by
`layout` attributes: `trace.visible` is controlled by
`layout.legend.uirevision`, `selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)` (accessible
with `config: {editable: true}`) is controlled by
`layout.editrevision`. Trace changes are tracked by `uid`,
which only falls back on trace index if no `uid` is provided.
So if your app can add/remove traces before the end of the
`data` array, such that the same trace has a different index,
you can still preserve user-driven changes if you give each
trace a `uid` that stays with it as it moves.
The 'uirevision' property accepts values of any type
Returns
-------
Any
"""
return self["uirevision"] | [
"def",
"uirevision",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"uirevision\"",
"]"
] | [
1152,
4
] | [
1176,
33
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.visible | (self) |
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly']
Returns
-------
Any
|
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly'] | def visible(self):
"""
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as a
legend item (provided that the legend itself is visible).
The 'visible' property is an enumeration that may be specified as:
- One of the following enumeration values:
[True, False, 'legendonly']
Returns
-------
Any
"""
return self["visible"] | [
"def",
"visible",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"visible\"",
"]"
] | [
1185,
4
] | [
1199,
30
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.z | (self) |
Sets the points' weight. For example, a value of 10 would be
equivalent to having 10 points of weight 1 in the same spot
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
|
Sets the points' weight. For example, a value of 10 would be
equivalent to having 10 points of weight 1 in the same spot
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series | def z(self):
"""
Sets the points' weight. For example, a value of 10 would be
equivalent to having 10 points of weight 1 in the same spot
The 'z' property is an array that may be specified as a tuple,
list, numpy array, or pandas Series
Returns
-------
numpy.ndarray
"""
return self["z"] | [
"def",
"z",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"z\"",
"]"
] | [
1208,
4
] | [
1220,
24
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.zauto | (self) |
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False) | def zauto(self):
"""
Determines whether or not the color domain is computed with
respect to the input data (here in `z`) or the bounds set in
`zmin` and `zmax` Defaults to `false` when `zmin` and `zmax`
are set by the user.
The 'zauto' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["zauto"] | [
"def",
"zauto",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zauto\"",
"]"
] | [
1229,
4
] | [
1243,
28
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.zmax | (self) |
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float | def zmax(self):
"""
Sets the upper bound of the color domain. Value should have the
same units as in `z` and if set, `zmin` must be set as well.
The 'zmax' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmax"] | [
"def",
"zmax",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmax\"",
"]"
] | [
1252,
4
] | [
1264,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.zmid | (self) |
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float | def zmid(self):
"""
Sets the mid-point of the color domain by scaling `zmin` and/or
`zmax` to be equidistant to this point. Value should have the
same units as in `z`. Has no effect when `zauto` is `false`.
The 'zmid' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmid"] | [
"def",
"zmid",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmid\"",
"]"
] | [
1273,
4
] | [
1286,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.zmin | (self) |
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
|
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float | def zmin(self):
"""
Sets the lower bound of the color domain. Value should have the
same units as in `z` and if set, `zmax` must be set as well.
The 'zmin' property is a number and may be specified as:
- An int or float
Returns
-------
int|float
"""
return self["zmin"] | [
"def",
"zmin",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zmin\"",
"]"
] | [
1295,
4
] | [
1307,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.zsrc | (self) |
Sets the source reference on Chart Studio Cloud for z .
The 'zsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
|
Sets the source reference on Chart Studio Cloud for z .
The 'zsrc' property must be specified as a string or
as a plotly.grid_objs.Column object | def zsrc(self):
"""
Sets the source reference on Chart Studio Cloud for z .
The 'zsrc' property must be specified as a string or
as a plotly.grid_objs.Column object
Returns
-------
str
"""
return self["zsrc"] | [
"def",
"zsrc",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"zsrc\"",
"]"
] | [
1316,
4
] | [
1327,
27
] | python | en | ['en', 'error', 'th'] | False |
Densitymapbox.__init__ | (
self,
arg=None,
autocolorscale=None,
below=None,
coloraxis=None,
colorbar=None,
colorscale=None,
customdata=None,
customdatasrc=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovertext=None,
hovertextsrc=None,
ids=None,
idssrc=None,
lat=None,
latsrc=None,
legendgroup=None,
lon=None,
lonsrc=None,
meta=None,
metasrc=None,
name=None,
opacity=None,
radius=None,
radiussrc=None,
reversescale=None,
showlegend=None,
showscale=None,
stream=None,
subplot=None,
text=None,
textsrc=None,
uid=None,
uirevision=None,
visible=None,
z=None,
zauto=None,
zmax=None,
zmid=None,
zmin=None,
zsrc=None,
**kwargs
) |
Construct a new Densitymapbox object
Draws a bivariate kernel density estimation with a Gaussian
kernel from `lon` and `lat` coordinates and optional `z` values
using a colorscale.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Densitymapbox`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color`
array are all positive, all negative or mixed.
below
Determines if the densitymapbox trace will be inserted
before the layer with the specified ID. By default,
densitymapbox traces are placed below the first layer
of type symbol If set to '', the layer will be inserted
above every existing layer.
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.densitymapbox.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. The colorscale must be an array
containing arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At minimum,
a mapping for the lowest (0) and highest (1) values are
required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the
colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
customdata
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note
that, "scatter" traces also appends customdata items in
the markers DOM elements
customdatasrc
Sets the source reference on Chart Studio Cloud for
customdata .
hoverinfo
Determines which trace information appear on hover. If
`none` or `skip` are set, no information is displayed
upon hovering. But, if `none` is set, click and hover
events are still fired.
hoverinfosrc
Sets the source reference on Chart Studio Cloud for
hoverinfo .
hoverlabel
:class:`plotly.graph_objects.densitymapbox.Hoverlabel`
instance or dict with compatible properties
hovertemplate
Template string used for rendering the information that
appear on hover box. Note that this will override
`hoverinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
"Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for
details on the formatting syntax. Dates are formatted
using d3-time-format's syntax %{variable|d3-time-
format}, for example "Day: %{2019-01-01|%A}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for
details on the date formatting syntax. The variables
available in `hovertemplate` are the ones emitted as
event data described at this link
https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Anything contained in tag `<extra>` is
displayed in the secondary box, for example
"<extra>{fullData.name}</extra>". To hide the secondary
box completely, use an empty tag `<extra></extra>`.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
hovertemplate .
hovertext
Sets hover text elements associated with each (lon,lat)
pair If a single string, the same string appears over
all the data points. If an array of string, the items
are mapped in order to the this trace's (lon,lat)
coordinates. To be seen, trace `hoverinfo` must contain
a "text" flag.
hovertextsrc
Sets the source reference on Chart Studio Cloud for
hovertext .
ids
Assigns id labels to each datum. These ids for object
constancy of data points during animation. Should be an
array of strings, not numbers or any other type.
idssrc
Sets the source reference on Chart Studio Cloud for
ids .
lat
Sets the latitude coordinates (in degrees North).
latsrc
Sets the source reference on Chart Studio Cloud for
lat .
legendgroup
Sets the legend group for this trace. Traces part of
the same legend group hide/show at the same time when
toggling legend items.
lon
Sets the longitude coordinates (in degrees East).
lonsrc
Sets the source reference on Chart Studio Cloud for
lon .
meta
Assigns extra meta information associated with this
trace that can be used in various text attributes.
Attributes such as trace `name`, graph, axis and
colorbar `title.text`, annotation `text`
`rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta`
values in an attribute in the same trace, simply use
`%{meta[i]}` where `i` is the index or key of the
`meta` item in question. To access trace `meta` in
layout attributes, use `%{data[n[.meta[i]}` where `i`
is the index or key of the `meta` and `n` is the trace
index.
metasrc
Sets the source reference on Chart Studio Cloud for
meta .
name
Sets the trace name. The trace name appear as the
legend item and on hover.
opacity
Sets the opacity of the trace.
radius
Sets the radius of influence of one `lon` / `lat` point
in pixels. Increasing the value makes the densitymapbox
trace smoother, but less detailed.
radiussrc
Sets the source reference on Chart Studio Cloud for
radius .
reversescale
Reverses the color mapping if true. If true, `zmin`
will correspond to the last color in the array and
`zmax` will correspond to the first color.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
showscale
Determines whether or not a colorbar is displayed for
this trace.
stream
:class:`plotly.graph_objects.densitymapbox.Stream`
instance or dict with compatible properties
subplot
Sets a reference between this trace's data coordinates
and a mapbox subplot. If "mapbox" (the default value),
the data refer to `layout.mapbox`. If "mapbox2", the
data refer to `layout.mapbox2`, and so on.
text
Sets text elements associated with each (lon,lat) pair
If a single string, the same string appears over all
the data points. If an array of string, the items are
mapped in order to the this trace's (lon,lat)
coordinates. If trace `hoverinfo` contains a "text"
flag and "hovertext" is not set, these elements will be
seen in the hover labels.
textsrc
Sets the source reference on Chart Studio Cloud for
text .
uid
Assign an id to this trace, Use this to provide object
constancy between traces during animations and
transitions.
uirevision
Controls persistence of some user-driven changes to the
trace: `constraintrange` in `parcoords` traces, as well
as some `editable: true` modifications such as `name`
and `colorbar.title`. Defaults to `layout.uirevision`.
Note that other user-driven trace attribute changes are
controlled by `layout` attributes: `trace.visible` is
controlled by `layout.legend.uirevision`,
`selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)`
(accessible with `config: {editable: true}`) is
controlled by `layout.editrevision`. Trace changes are
tracked by `uid`, which only falls back on trace index
if no `uid` is provided. So if your app can add/remove
traces before the end of the `data` array, such that
the same trace has a different index, you can still
preserve user-driven changes if you give each trace a
`uid` that stays with it as it moves.
visible
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as
a legend item (provided that the legend itself is
visible).
z
Sets the points' weight. For example, a value of 10
would be equivalent to having 10 points of weight 1 in
the same spot
zauto
Determines whether or not the color domain is computed
with respect to the input data (here in `z`) or the
bounds set in `zmin` and `zmax` Defaults to `false`
when `zmin` and `zmax` are set by the user.
zmax
Sets the upper bound of the color domain. Value should
have the same units as in `z` and if set, `zmin` must
be set as well.
zmid
Sets the mid-point of the color domain by scaling
`zmin` and/or `zmax` to be equidistant to this point.
Value should have the same units as in `z`. Has no
effect when `zauto` is `false`.
zmin
Sets the lower bound of the color domain. Value should
have the same units as in `z` and if set, `zmax` must
be set as well.
zsrc
Sets the source reference on Chart Studio Cloud for z
.
Returns
-------
Densitymapbox
|
Construct a new Densitymapbox object
Draws a bivariate kernel density estimation with a Gaussian
kernel from `lon` and `lat` coordinates and optional `z` values
using a colorscale. | def __init__(
self,
arg=None,
autocolorscale=None,
below=None,
coloraxis=None,
colorbar=None,
colorscale=None,
customdata=None,
customdatasrc=None,
hoverinfo=None,
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatesrc=None,
hovertext=None,
hovertextsrc=None,
ids=None,
idssrc=None,
lat=None,
latsrc=None,
legendgroup=None,
lon=None,
lonsrc=None,
meta=None,
metasrc=None,
name=None,
opacity=None,
radius=None,
radiussrc=None,
reversescale=None,
showlegend=None,
showscale=None,
stream=None,
subplot=None,
text=None,
textsrc=None,
uid=None,
uirevision=None,
visible=None,
z=None,
zauto=None,
zmax=None,
zmid=None,
zmin=None,
zsrc=None,
**kwargs
):
"""
Construct a new Densitymapbox object
Draws a bivariate kernel density estimation with a Gaussian
kernel from `lon` and `lat` coordinates and optional `z` values
using a colorscale.
Parameters
----------
arg
dict of properties compatible with this constructor or
an instance of :class:`plotly.graph_objs.Densitymapbox`
autocolorscale
Determines whether the colorscale is a default palette
(`autocolorscale: true`) or the palette determined by
`colorscale`. In case `colorscale` is unspecified or
`autocolorscale` is true, the default palette will be
chosen according to whether numbers in the `color`
array are all positive, all negative or mixed.
below
Determines if the densitymapbox trace will be inserted
before the layer with the specified ID. By default,
densitymapbox traces are placed below the first layer
of type symbol If set to '', the layer will be inserted
above every existing layer.
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.densitymapbox.ColorBar`
instance or dict with compatible properties
colorscale
Sets the colorscale. The colorscale must be an array
containing arrays mapping a normalized value to an rgb,
rgba, hex, hsl, hsv, or named color string. At minimum,
a mapping for the lowest (0) and highest (1) values are
required. For example, `[[0, 'rgb(0,0,255)'], [1,
'rgb(255,0,0)']]`. To control the bounds of the
colorscale in color space, use`zmin` and `zmax`.
Alternatively, `colorscale` may be a palette name
string of the following list: Greys,YlGnBu,Greens,YlOrR
d,Bluered,RdBu,Reds,Blues,Picnic,Rainbow,Portland,Jet,H
ot,Blackbody,Earth,Electric,Viridis,Cividis.
customdata
Assigns extra data each datum. This may be useful when
listening to hover, click and selection events. Note
that, "scatter" traces also appends customdata items in
the markers DOM elements
customdatasrc
Sets the source reference on Chart Studio Cloud for
customdata .
hoverinfo
Determines which trace information appear on hover. If
`none` or `skip` are set, no information is displayed
upon hovering. But, if `none` is set, click and hover
events are still fired.
hoverinfosrc
Sets the source reference on Chart Studio Cloud for
hoverinfo .
hoverlabel
:class:`plotly.graph_objects.densitymapbox.Hoverlabel`
instance or dict with compatible properties
hovertemplate
Template string used for rendering the information that
appear on hover box. Note that this will override
`hoverinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
"Price: %{y:$.2f}". https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format for
details on the formatting syntax. Dates are formatted
using d3-time-format's syntax %{variable|d3-time-
format}, for example "Day: %{2019-01-01|%A}".
https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format for
details on the date formatting syntax. The variables
available in `hovertemplate` are the ones emitted as
event data described at this link
https://plotly.com/javascript/plotlyjs-events/#event-
data. Additionally, every attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Anything contained in tag `<extra>` is
displayed in the secondary box, for example
"<extra>{fullData.name}</extra>". To hide the secondary
box completely, use an empty tag `<extra></extra>`.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
hovertemplate .
hovertext
Sets hover text elements associated with each (lon,lat)
pair If a single string, the same string appears over
all the data points. If an array of string, the items
are mapped in order to the this trace's (lon,lat)
coordinates. To be seen, trace `hoverinfo` must contain
a "text" flag.
hovertextsrc
Sets the source reference on Chart Studio Cloud for
hovertext .
ids
Assigns id labels to each datum. These ids for object
constancy of data points during animation. Should be an
array of strings, not numbers or any other type.
idssrc
Sets the source reference on Chart Studio Cloud for
ids .
lat
Sets the latitude coordinates (in degrees North).
latsrc
Sets the source reference on Chart Studio Cloud for
lat .
legendgroup
Sets the legend group for this trace. Traces part of
the same legend group hide/show at the same time when
toggling legend items.
lon
Sets the longitude coordinates (in degrees East).
lonsrc
Sets the source reference on Chart Studio Cloud for
lon .
meta
Assigns extra meta information associated with this
trace that can be used in various text attributes.
Attributes such as trace `name`, graph, axis and
colorbar `title.text`, annotation `text`
`rangeselector`, `updatemenues` and `sliders` `label`
text all support `meta`. To access the trace `meta`
values in an attribute in the same trace, simply use
`%{meta[i]}` where `i` is the index or key of the
`meta` item in question. To access trace `meta` in
layout attributes, use `%{data[n[.meta[i]}` where `i`
is the index or key of the `meta` and `n` is the trace
index.
metasrc
Sets the source reference on Chart Studio Cloud for
meta .
name
Sets the trace name. The trace name appear as the
legend item and on hover.
opacity
Sets the opacity of the trace.
radius
Sets the radius of influence of one `lon` / `lat` point
in pixels. Increasing the value makes the densitymapbox
trace smoother, but less detailed.
radiussrc
Sets the source reference on Chart Studio Cloud for
radius .
reversescale
Reverses the color mapping if true. If true, `zmin`
will correspond to the last color in the array and
`zmax` will correspond to the first color.
showlegend
Determines whether or not an item corresponding to this
trace is shown in the legend.
showscale
Determines whether or not a colorbar is displayed for
this trace.
stream
:class:`plotly.graph_objects.densitymapbox.Stream`
instance or dict with compatible properties
subplot
Sets a reference between this trace's data coordinates
and a mapbox subplot. If "mapbox" (the default value),
the data refer to `layout.mapbox`. If "mapbox2", the
data refer to `layout.mapbox2`, and so on.
text
Sets text elements associated with each (lon,lat) pair
If a single string, the same string appears over all
the data points. If an array of string, the items are
mapped in order to the this trace's (lon,lat)
coordinates. If trace `hoverinfo` contains a "text"
flag and "hovertext" is not set, these elements will be
seen in the hover labels.
textsrc
Sets the source reference on Chart Studio Cloud for
text .
uid
Assign an id to this trace, Use this to provide object
constancy between traces during animations and
transitions.
uirevision
Controls persistence of some user-driven changes to the
trace: `constraintrange` in `parcoords` traces, as well
as some `editable: true` modifications such as `name`
and `colorbar.title`. Defaults to `layout.uirevision`.
Note that other user-driven trace attribute changes are
controlled by `layout` attributes: `trace.visible` is
controlled by `layout.legend.uirevision`,
`selectedpoints` is controlled by
`layout.selectionrevision`, and `colorbar.(x|y)`
(accessible with `config: {editable: true}`) is
controlled by `layout.editrevision`. Trace changes are
tracked by `uid`, which only falls back on trace index
if no `uid` is provided. So if your app can add/remove
traces before the end of the `data` array, such that
the same trace has a different index, you can still
preserve user-driven changes if you give each trace a
`uid` that stays with it as it moves.
visible
Determines whether or not this trace is visible. If
"legendonly", the trace is not drawn, but can appear as
a legend item (provided that the legend itself is
visible).
z
Sets the points' weight. For example, a value of 10
would be equivalent to having 10 points of weight 1 in
the same spot
zauto
Determines whether or not the color domain is computed
with respect to the input data (here in `z`) or the
bounds set in `zmin` and `zmax` Defaults to `false`
when `zmin` and `zmax` are set by the user.
zmax
Sets the upper bound of the color domain. Value should
have the same units as in `z` and if set, `zmin` must
be set as well.
zmid
Sets the mid-point of the color domain by scaling
`zmin` and/or `zmax` to be equidistant to this point.
Value should have the same units as in `z`. Has no
effect when `zauto` is `false`.
zmin
Sets the lower bound of the color domain. Value should
have the same units as in `z` and if set, `zmax` must
be set as well.
zsrc
Sets the source reference on Chart Studio Cloud for z
.
Returns
-------
Densitymapbox
"""
super(Densitymapbox, self).__init__("densitymapbox")
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.Densitymapbox
constructor must be a dict or
an instance of :class:`plotly.graph_objs.Densitymapbox`"""
)
# 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("below", None)
_v = below if below is not None else _v
if _v is not None:
self["below"] = _v
_v = arg.pop("coloraxis", None)
_v = coloraxis if coloraxis is not None else _v
if _v is not None:
self["coloraxis"] = _v
_v = arg.pop("colorbar", None)
_v = colorbar if colorbar is not None else _v
if _v is not None:
self["colorbar"] = _v
_v = arg.pop("colorscale", None)
_v = colorscale if colorscale is not None else _v
if _v is not None:
self["colorscale"] = _v
_v = arg.pop("customdata", None)
_v = customdata if customdata is not None else _v
if _v is not None:
self["customdata"] = _v
_v = arg.pop("customdatasrc", None)
_v = customdatasrc if customdatasrc is not None else _v
if _v is not None:
self["customdatasrc"] = _v
_v = arg.pop("hoverinfo", None)
_v = hoverinfo if hoverinfo is not None else _v
if _v is not None:
self["hoverinfo"] = _v
_v = arg.pop("hoverinfosrc", None)
_v = hoverinfosrc if hoverinfosrc is not None else _v
if _v is not None:
self["hoverinfosrc"] = _v
_v = arg.pop("hoverlabel", None)
_v = hoverlabel if hoverlabel is not None else _v
if _v is not None:
self["hoverlabel"] = _v
_v = arg.pop("hovertemplate", None)
_v = hovertemplate if hovertemplate is not None else _v
if _v is not None:
self["hovertemplate"] = _v
_v = arg.pop("hovertemplatesrc", None)
_v = hovertemplatesrc if hovertemplatesrc is not None else _v
if _v is not None:
self["hovertemplatesrc"] = _v
_v = arg.pop("hovertext", None)
_v = hovertext if hovertext is not None else _v
if _v is not None:
self["hovertext"] = _v
_v = arg.pop("hovertextsrc", None)
_v = hovertextsrc if hovertextsrc is not None else _v
if _v is not None:
self["hovertextsrc"] = _v
_v = arg.pop("ids", None)
_v = ids if ids is not None else _v
if _v is not None:
self["ids"] = _v
_v = arg.pop("idssrc", None)
_v = idssrc if idssrc is not None else _v
if _v is not None:
self["idssrc"] = _v
_v = arg.pop("lat", None)
_v = lat if lat is not None else _v
if _v is not None:
self["lat"] = _v
_v = arg.pop("latsrc", None)
_v = latsrc if latsrc is not None else _v
if _v is not None:
self["latsrc"] = _v
_v = arg.pop("legendgroup", None)
_v = legendgroup if legendgroup is not None else _v
if _v is not None:
self["legendgroup"] = _v
_v = arg.pop("lon", None)
_v = lon if lon is not None else _v
if _v is not None:
self["lon"] = _v
_v = arg.pop("lonsrc", None)
_v = lonsrc if lonsrc is not None else _v
if _v is not None:
self["lonsrc"] = _v
_v = arg.pop("meta", None)
_v = meta if meta is not None else _v
if _v is not None:
self["meta"] = _v
_v = arg.pop("metasrc", None)
_v = metasrc if metasrc is not None else _v
if _v is not None:
self["metasrc"] = _v
_v = arg.pop("name", None)
_v = name if name is not None else _v
if _v is not None:
self["name"] = _v
_v = arg.pop("opacity", None)
_v = opacity if opacity is not None else _v
if _v is not None:
self["opacity"] = _v
_v = arg.pop("radius", None)
_v = radius if radius is not None else _v
if _v is not None:
self["radius"] = _v
_v = arg.pop("radiussrc", None)
_v = radiussrc if radiussrc is not None else _v
if _v is not None:
self["radiussrc"] = _v
_v = arg.pop("reversescale", None)
_v = reversescale if reversescale is not None else _v
if _v is not None:
self["reversescale"] = _v
_v = arg.pop("showlegend", None)
_v = showlegend if showlegend is not None else _v
if _v is not None:
self["showlegend"] = _v
_v = arg.pop("showscale", None)
_v = showscale if showscale is not None else _v
if _v is not None:
self["showscale"] = _v
_v = arg.pop("stream", None)
_v = stream if stream is not None else _v
if _v is not None:
self["stream"] = _v
_v = arg.pop("subplot", None)
_v = subplot if subplot is not None else _v
if _v is not None:
self["subplot"] = _v
_v = arg.pop("text", None)
_v = text if text is not None else _v
if _v is not None:
self["text"] = _v
_v = arg.pop("textsrc", None)
_v = textsrc if textsrc is not None else _v
if _v is not None:
self["textsrc"] = _v
_v = arg.pop("uid", None)
_v = uid if uid is not None else _v
if _v is not None:
self["uid"] = _v
_v = arg.pop("uirevision", None)
_v = uirevision if uirevision is not None else _v
if _v is not None:
self["uirevision"] = _v
_v = arg.pop("visible", None)
_v = visible if visible is not None else _v
if _v is not None:
self["visible"] = _v
_v = arg.pop("z", None)
_v = z if z is not None else _v
if _v is not None:
self["z"] = _v
_v = arg.pop("zauto", None)
_v = zauto if zauto is not None else _v
if _v is not None:
self["zauto"] = _v
_v = arg.pop("zmax", None)
_v = zmax if zmax is not None else _v
if _v is not None:
self["zmax"] = _v
_v = arg.pop("zmid", None)
_v = zmid if zmid is not None else _v
if _v is not None:
self["zmid"] = _v
_v = arg.pop("zmin", None)
_v = zmin if zmin is not None else _v
if _v is not None:
self["zmin"] = _v
_v = arg.pop("zsrc", None)
_v = zsrc if zsrc is not None else _v
if _v is not None:
self["zsrc"] = _v
# Read-only literals
# ------------------
self._props["type"] = "densitymapbox"
arg.pop("type", None)
# Process unknown kwargs
# ----------------------
self._process_kwargs(**dict(arg, **kwargs))
# Reset skip_invalid
# ------------------
self._skip_invalid = False | [
"def",
"__init__",
"(",
"self",
",",
"arg",
"=",
"None",
",",
"autocolorscale",
"=",
"None",
",",
"below",
"=",
"None",
",",
"coloraxis",
"=",
"None",
",",
"colorbar",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"customdata",
"=",
"None",
",",
"customdatasrc",
"=",
"None",
",",
"hoverinfo",
"=",
"None",
",",
"hoverinfosrc",
"=",
"None",
",",
"hoverlabel",
"=",
"None",
",",
"hovertemplate",
"=",
"None",
",",
"hovertemplatesrc",
"=",
"None",
",",
"hovertext",
"=",
"None",
",",
"hovertextsrc",
"=",
"None",
",",
"ids",
"=",
"None",
",",
"idssrc",
"=",
"None",
",",
"lat",
"=",
"None",
",",
"latsrc",
"=",
"None",
",",
"legendgroup",
"=",
"None",
",",
"lon",
"=",
"None",
",",
"lonsrc",
"=",
"None",
",",
"meta",
"=",
"None",
",",
"metasrc",
"=",
"None",
",",
"name",
"=",
"None",
",",
"opacity",
"=",
"None",
",",
"radius",
"=",
"None",
",",
"radiussrc",
"=",
"None",
",",
"reversescale",
"=",
"None",
",",
"showlegend",
"=",
"None",
",",
"showscale",
"=",
"None",
",",
"stream",
"=",
"None",
",",
"subplot",
"=",
"None",
",",
"text",
"=",
"None",
",",
"textsrc",
"=",
"None",
",",
"uid",
"=",
"None",
",",
"uirevision",
"=",
"None",
",",
"visible",
"=",
"None",
",",
"z",
"=",
"None",
",",
"zauto",
"=",
"None",
",",
"zmax",
"=",
"None",
",",
"zmid",
"=",
"None",
",",
"zmin",
"=",
"None",
",",
"zsrc",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"super",
"(",
"Densitymapbox",
",",
"self",
")",
".",
"__init__",
"(",
"\"densitymapbox\"",
")",
"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.Densitymapbox \nconstructor must be a dict or \nan instance of :class:`plotly.graph_objs.Densitymapbox`\"\"\"",
")",
"# 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",
"(",
"\"below\"",
",",
"None",
")",
"_v",
"=",
"below",
"if",
"below",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"below\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"coloraxis\"",
",",
"None",
")",
"_v",
"=",
"coloraxis",
"if",
"coloraxis",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"coloraxis\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorbar\"",
",",
"None",
")",
"_v",
"=",
"colorbar",
"if",
"colorbar",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorbar\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"colorscale\"",
",",
"None",
")",
"_v",
"=",
"colorscale",
"if",
"colorscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"colorscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"customdata\"",
",",
"None",
")",
"_v",
"=",
"customdata",
"if",
"customdata",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"customdata\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"customdatasrc\"",
",",
"None",
")",
"_v",
"=",
"customdatasrc",
"if",
"customdatasrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"customdatasrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverinfo\"",
",",
"None",
")",
"_v",
"=",
"hoverinfo",
"if",
"hoverinfo",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverinfo\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverinfosrc\"",
",",
"None",
")",
"_v",
"=",
"hoverinfosrc",
"if",
"hoverinfosrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverinfosrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hoverlabel\"",
",",
"None",
")",
"_v",
"=",
"hoverlabel",
"if",
"hoverlabel",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hoverlabel\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertemplate\"",
",",
"None",
")",
"_v",
"=",
"hovertemplate",
"if",
"hovertemplate",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertemplate\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertemplatesrc\"",
",",
"None",
")",
"_v",
"=",
"hovertemplatesrc",
"if",
"hovertemplatesrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertemplatesrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertext\"",
",",
"None",
")",
"_v",
"=",
"hovertext",
"if",
"hovertext",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertext\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"hovertextsrc\"",
",",
"None",
")",
"_v",
"=",
"hovertextsrc",
"if",
"hovertextsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"hovertextsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"ids\"",
",",
"None",
")",
"_v",
"=",
"ids",
"if",
"ids",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"ids\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"idssrc\"",
",",
"None",
")",
"_v",
"=",
"idssrc",
"if",
"idssrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"idssrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"lat\"",
",",
"None",
")",
"_v",
"=",
"lat",
"if",
"lat",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"lat\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"latsrc\"",
",",
"None",
")",
"_v",
"=",
"latsrc",
"if",
"latsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"latsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"legendgroup\"",
",",
"None",
")",
"_v",
"=",
"legendgroup",
"if",
"legendgroup",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"legendgroup\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"lon\"",
",",
"None",
")",
"_v",
"=",
"lon",
"if",
"lon",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"lon\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"lonsrc\"",
",",
"None",
")",
"_v",
"=",
"lonsrc",
"if",
"lonsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"lonsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"meta\"",
",",
"None",
")",
"_v",
"=",
"meta",
"if",
"meta",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"meta\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"metasrc\"",
",",
"None",
")",
"_v",
"=",
"metasrc",
"if",
"metasrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"metasrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"name\"",
",",
"None",
")",
"_v",
"=",
"name",
"if",
"name",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"name\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"opacity\"",
",",
"None",
")",
"_v",
"=",
"opacity",
"if",
"opacity",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"opacity\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"radius\"",
",",
"None",
")",
"_v",
"=",
"radius",
"if",
"radius",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"radius\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"radiussrc\"",
",",
"None",
")",
"_v",
"=",
"radiussrc",
"if",
"radiussrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"radiussrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"reversescale\"",
",",
"None",
")",
"_v",
"=",
"reversescale",
"if",
"reversescale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"reversescale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showlegend\"",
",",
"None",
")",
"_v",
"=",
"showlegend",
"if",
"showlegend",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showlegend\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"showscale\"",
",",
"None",
")",
"_v",
"=",
"showscale",
"if",
"showscale",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"showscale\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"stream\"",
",",
"None",
")",
"_v",
"=",
"stream",
"if",
"stream",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"stream\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"subplot\"",
",",
"None",
")",
"_v",
"=",
"subplot",
"if",
"subplot",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"subplot\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"text\"",
",",
"None",
")",
"_v",
"=",
"text",
"if",
"text",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"text\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"textsrc\"",
",",
"None",
")",
"_v",
"=",
"textsrc",
"if",
"textsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"textsrc\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"uid\"",
",",
"None",
")",
"_v",
"=",
"uid",
"if",
"uid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"uid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"uirevision\"",
",",
"None",
")",
"_v",
"=",
"uirevision",
"if",
"uirevision",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"uirevision\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"visible\"",
",",
"None",
")",
"_v",
"=",
"visible",
"if",
"visible",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"visible\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"z\"",
",",
"None",
")",
"_v",
"=",
"z",
"if",
"z",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"z\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zauto\"",
",",
"None",
")",
"_v",
"=",
"zauto",
"if",
"zauto",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zauto\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmax\"",
",",
"None",
")",
"_v",
"=",
"zmax",
"if",
"zmax",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmax\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmid\"",
",",
"None",
")",
"_v",
"=",
"zmid",
"if",
"zmid",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmid\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zmin\"",
",",
"None",
")",
"_v",
"=",
"zmin",
"if",
"zmin",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zmin\"",
"]",
"=",
"_v",
"_v",
"=",
"arg",
".",
"pop",
"(",
"\"zsrc\"",
",",
"None",
")",
"_v",
"=",
"zsrc",
"if",
"zsrc",
"is",
"not",
"None",
"else",
"_v",
"if",
"_v",
"is",
"not",
"None",
":",
"self",
"[",
"\"zsrc\"",
"]",
"=",
"_v",
"# Read-only literals",
"# ------------------",
"self",
".",
"_props",
"[",
"\"type\"",
"]",
"=",
"\"densitymapbox\"",
"arg",
".",
"pop",
"(",
"\"type\"",
",",
"None",
")",
"# Process unknown kwargs",
"# ----------------------",
"self",
".",
"_process_kwargs",
"(",
"*",
"*",
"dict",
"(",
"arg",
",",
"*",
"*",
"kwargs",
")",
")",
"# Reset skip_invalid",
"# ------------------",
"self",
".",
"_skip_invalid",
"=",
"False"
] | [
1566,
4
] | [
2065,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.bgcolor | (self) |
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def bgcolor(self):
"""
Sets the color of padded area.
The 'bgcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bgcolor"] | [
"def",
"bgcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bgcolor\"",
"]"
] | [
59,
4
] | [
109,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.bordercolor | (self) |
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def bordercolor(self):
"""
Sets the axis line color.
The 'bordercolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["bordercolor"] | [
"def",
"bordercolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"bordercolor\"",
"]"
] | [
118,
4
] | [
168,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.borderwidth | (self) |
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def borderwidth(self):
"""
Sets the width (in px) or the border enclosing this color bar.
The 'borderwidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["borderwidth"] | [
"def",
"borderwidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"borderwidth\"",
"]"
] | [
177,
4
] | [
188,
34
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.dtick | (self) |
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example, to set a tick mark at 1, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type
Returns
-------
Any
|
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example, to set a tick mark at 1, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type | def dtick(self):
"""
Sets the step in-between ticks on this axis. Use with `tick0`.
Must be a positive number, or special strings available to
"log" and "date" axes. If the axis `type` is "log", then ticks
are set every 10^(n*dtick) where n is the tick number. For
example, to set a tick mark at 1, 10, 100, 1000, ... set dtick
to 1. To set tick marks at 1, 100, 10000, ... set dtick to 2.
To set tick marks at 1, 5, 25, 125, 625, 3125, ... set dtick to
log_10(5), or 0.69897000433. "log" has several special values;
"L<f>", where `f` is a positive number, gives ticks linearly
spaced in value (but not position). For example `tick0` = 0.1,
`dtick` = "L0.5" will put ticks at 0.1, 0.6, 1.1, 1.6 etc. To
show powers of 10 plus small digits between, use "D1" (all
digits) or "D2" (only 2 and 5). `tick0` is ignored for "D1" and
"D2". If the axis `type` is "date", then you must convert the
time to milliseconds. For example, to set the interval between
ticks to one day, set `dtick` to 86400000.0. "date" also has
special values "M<n>" gives ticks spaced by a number of months.
`n` must be a positive integer. To set ticks on the 15th of
every third month, set `tick0` to "2000-01-15" and `dtick` to
"M3". To set ticks every 4 years, set `dtick` to "M48"
The 'dtick' property accepts values of any type
Returns
-------
Any
"""
return self["dtick"] | [
"def",
"dtick",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"dtick\"",
"]"
] | [
197,
4
] | [
226,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.exponentformat | (self) |
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
The 'exponentformat' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B']
Returns
-------
Any
|
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
The 'exponentformat' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B'] | def exponentformat(self):
"""
Determines a formatting rule for the tick exponents. For
example, consider the number 1,000,000,000. If "none", it
appears as 1,000,000,000. If "e", 1e+9. If "E", 1E+9. If
"power", 1x10^9 (with 9 in a super script). If "SI", 1G. If
"B", 1B.
The 'exponentformat' property is an enumeration that may be specified as:
- One of the following enumeration values:
['none', 'e', 'E', 'power', 'SI', 'B']
Returns
-------
Any
"""
return self["exponentformat"] | [
"def",
"exponentformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"exponentformat\"",
"]"
] | [
235,
4
] | [
251,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.len | (self) |
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.
The 'len' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
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.
The 'len' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def len(self):
"""
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.
The 'len' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["len"] | [
"def",
"len",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"len\"",
"]"
] | [
260,
4
] | [
273,
26
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.lenmode | (self) |
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.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
|
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.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels'] | def lenmode(self):
"""
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.
The 'lenmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
"""
return self["lenmode"] | [
"def",
"lenmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"lenmode\"",
"]"
] | [
282,
4
] | [
296,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.nticks | (self) |
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
|
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807] | def nticks(self):
"""
Specifies the maximum number of ticks for the particular axis.
The actual number of ticks will be chosen automatically to be
less than or equal to `nticks`. Has an effect only if
`tickmode` is set to "auto".
The 'nticks' property is a integer and may be specified as:
- An int (or float that will be cast to an int)
in the interval [0, 9223372036854775807]
Returns
-------
int
"""
return self["nticks"] | [
"def",
"nticks",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"nticks\"",
"]"
] | [
305,
4
] | [
320,
29
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.outlinecolor | (self) |
Sets the axis line color.
The 'outlinecolor' 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 axis line color.
The 'outlinecolor' 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 outlinecolor(self):
"""
Sets the axis line color.
The 'outlinecolor' 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["outlinecolor"] | [
"def",
"outlinecolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outlinecolor\"",
"]"
] | [
329,
4
] | [
379,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.outlinewidth | (self) |
Sets the width (in px) of the axis line.
The 'outlinewidth' 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 axis line.
The 'outlinewidth' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def outlinewidth(self):
"""
Sets the width (in px) of the axis line.
The 'outlinewidth' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["outlinewidth"] | [
"def",
"outlinewidth",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"outlinewidth\"",
"]"
] | [
388,
4
] | [
399,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.separatethousands | (self) |
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False) | def separatethousands(self):
"""
If "true", even 4-digit integers are separated
The 'separatethousands' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["separatethousands"] | [
"def",
"separatethousands",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"separatethousands\"",
"]"
] | [
408,
4
] | [
419,
40
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showexponent | (self) |
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showexponent(self):
"""
If "all", all exponents are shown besides their significands.
If "first", only the exponent of the first tick is shown. If
"last", only the exponent of the last tick is shown. If "none",
no exponents appear.
The 'showexponent' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showexponent"] | [
"def",
"showexponent",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showexponent\"",
"]"
] | [
428,
4
] | [
443,
35
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showticklabels | (self) |
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
|
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False) | def showticklabels(self):
"""
Determines whether or not the tick labels are drawn.
The 'showticklabels' property must be specified as a bool
(either True, or False)
Returns
-------
bool
"""
return self["showticklabels"] | [
"def",
"showticklabels",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticklabels\"",
"]"
] | [
452,
4
] | [
463,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showtickprefix | (self) |
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showtickprefix(self):
"""
If "all", all tick labels are displayed with a prefix. If
"first", only the first tick is displayed with a prefix. If
"last", only the last tick is displayed with a suffix. If
"none", tick prefixes are hidden.
The 'showtickprefix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showtickprefix"] | [
"def",
"showtickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showtickprefix\"",
"]"
] | [
472,
4
] | [
487,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.showticksuffix | (self) |
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
|
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none'] | def showticksuffix(self):
"""
Same as `showtickprefix` but for tick suffixes.
The 'showticksuffix' property is an enumeration that may be specified as:
- One of the following enumeration values:
['all', 'first', 'last', 'none']
Returns
-------
Any
"""
return self["showticksuffix"] | [
"def",
"showticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"showticksuffix\"",
"]"
] | [
496,
4
] | [
508,
37
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.thickness | (self) |
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def thickness(self):
"""
Sets the thickness of the color bar This measure excludes the
size of the padding, ticks and labels.
The 'thickness' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["thickness"] | [
"def",
"thickness",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thickness\"",
"]"
] | [
517,
4
] | [
529,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.thicknessmode | (self) |
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.
The 'thicknessmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
|
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.
The 'thicknessmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels'] | def thicknessmode(self):
"""
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.
The 'thicknessmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['fraction', 'pixels']
Returns
-------
Any
"""
return self["thicknessmode"] | [
"def",
"thicknessmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"thicknessmode\"",
"]"
] | [
538,
4
] | [
552,
36
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tick0 | (self) |
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
|
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type | def tick0(self):
"""
Sets the placement of the first tick on this axis. Use with
`dtick`. If the axis `type` is "log", then you must take the
log of your starting tick (e.g. to set the starting tick to
100, set the `tick0` to 2) except when `dtick`=*L<f>* (see
`dtick` for more info). If the axis `type` is "date", it should
be a date string, like date data. If the axis `type` is
"category", it should be a number, using the scale where each
category is assigned a serial number from zero in the order it
appears.
The 'tick0' property accepts values of any type
Returns
-------
Any
"""
return self["tick0"] | [
"def",
"tick0",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tick0\"",
"]"
] | [
561,
4
] | [
579,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickangle | (self) |
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
|
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90). | def tickangle(self):
"""
Sets the angle of the tick labels with respect to the
horizontal. For example, a `tickangle` of -90 draws the tick
labels vertically.
The 'tickangle' property is a angle (in degrees) that may be
specified as a number between -180 and 180. Numeric values outside this
range are converted to the equivalent value
(e.g. 270 is converted to -90).
Returns
-------
int|float
"""
return self["tickangle"] | [
"def",
"tickangle",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickangle\"",
"]"
] | [
588,
4
] | [
603,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickcolor | (self) |
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
|
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen | def tickcolor(self):
"""
Sets the tick color.
The 'tickcolor' property is a color and may be specified as:
- A hex string (e.g. '#ff0000')
- An rgb/rgba string (e.g. 'rgb(255,0,0)')
- An hsl/hsla string (e.g. 'hsl(0,100%,50%)')
- An hsv/hsva string (e.g. 'hsv(0,100%,100%)')
- A named CSS color:
aliceblue, antiquewhite, aqua, aquamarine, azure,
beige, bisque, black, blanchedalmond, blue,
blueviolet, brown, burlywood, cadetblue,
chartreuse, chocolate, coral, cornflowerblue,
cornsilk, crimson, cyan, darkblue, darkcyan,
darkgoldenrod, darkgray, darkgrey, darkgreen,
darkkhaki, darkmagenta, darkolivegreen, darkorange,
darkorchid, darkred, darksalmon, darkseagreen,
darkslateblue, darkslategray, darkslategrey,
darkturquoise, darkviolet, deeppink, deepskyblue,
dimgray, dimgrey, dodgerblue, firebrick,
floralwhite, forestgreen, fuchsia, gainsboro,
ghostwhite, gold, goldenrod, gray, grey, green,
greenyellow, honeydew, hotpink, indianred, indigo,
ivory, khaki, lavender, lavenderblush, lawngreen,
lemonchiffon, lightblue, lightcoral, lightcyan,
lightgoldenrodyellow, lightgray, lightgrey,
lightgreen, lightpink, lightsalmon, lightseagreen,
lightskyblue, lightslategray, lightslategrey,
lightsteelblue, lightyellow, lime, limegreen,
linen, magenta, maroon, mediumaquamarine,
mediumblue, mediumorchid, mediumpurple,
mediumseagreen, mediumslateblue, mediumspringgreen,
mediumturquoise, mediumvioletred, midnightblue,
mintcream, mistyrose, moccasin, navajowhite, navy,
oldlace, olive, olivedrab, orange, orangered,
orchid, palegoldenrod, palegreen, paleturquoise,
palevioletred, papayawhip, peachpuff, peru, pink,
plum, powderblue, purple, red, rosybrown,
royalblue, rebeccapurple, saddlebrown, salmon,
sandybrown, seagreen, seashell, sienna, silver,
skyblue, slateblue, slategray, slategrey, snow,
springgreen, steelblue, tan, teal, thistle, tomato,
turquoise, violet, wheat, white, whitesmoke,
yellow, yellowgreen
Returns
-------
str
"""
return self["tickcolor"] | [
"def",
"tickcolor",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickcolor\"",
"]"
] | [
612,
4
] | [
662,
32
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickfont | (self) |
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.scatter3d.line.colorbar.Tickfont
|
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size | def tickfont(self):
"""
Sets the color bar's tick label font
The 'tickfont' property is an instance of Tickfont
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickfont`
- A dict of string/value properties that will be passed
to the Tickfont constructor
Supported dict properties:
color
family
HTML font family - the typeface that will be
applied by the web browser. The web browser
will only be able to apply a font if it is
available on the system which it operates.
Provide multiple font families, separated by
commas, to indicate the preference in which to
apply fonts if they aren't available on the
system. The Chart Studio Cloud (at
https://chart-studio.plotly.com or on-premise)
generates images on a server, where only a
select number of fonts are installed and
supported. These include "Arial", "Balto",
"Courier New", "Droid Sans",, "Droid Serif",
"Droid Sans Mono", "Gravitas One", "Old
Standard TT", "Open Sans", "Overpass", "PT Sans
Narrow", "Raleway", "Times New Roman".
size
Returns
-------
plotly.graph_objs.scatter3d.line.colorbar.Tickfont
"""
return self["tickfont"] | [
"def",
"tickfont",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickfont\"",
"]"
] | [
671,
4
] | [
708,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformat | (self) |
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def tickformat(self):
"""
Sets the tick label formatting rule using d3 formatting mini-
languages which are very similar to those in Python. For
numbers, see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Formatting.md#d3_format And for dates
see: https://github.com/d3/d3-3.x-api-
reference/blob/master/Time-Formatting.md#format We add one item
to d3's date formatter: "%{n}f" for fractional seconds with n
digits. For example, *2016-10-13 09:15:23.456* with tickformat
"%H~%M~%S.%2f" would display "09~15~23.46"
The 'tickformat' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickformat"] | [
"def",
"tickformat",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformat\"",
"]"
] | [
717,
4
] | [
737,
33
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformatstops | (self) |
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop]
|
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat" | def tickformatstops(self):
"""
The 'tickformatstops' property is a tuple of instances of
Tickformatstop that may be specified as:
- A list or tuple of instances of plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop
- A list or tuple of dicts of string/value properties that
will be passed to the Tickformatstop constructor
Supported dict properties:
dtickrange
range [*min*, *max*], where "min", "max" -
dtick values which describe some zoom level, it
is possible to omit "min" or "max" value by
passing "null"
enabled
Determines whether or not this stop is used. If
`false`, this stop is ignored even within its
`dtickrange`.
name
When used in a template, named items are
created in the output figure in addition to any
items the figure already has in this array. You
can modify these items in the output figure by
making your own item with `templateitemname`
matching this `name` alongside your
modifications (including `visible: false` or
`enabled: false` to hide it). Has no effect
outside of a template.
templateitemname
Used to refer to a named item in this array in
the template. Named items from the template
will be created even without a matching item in
the input figure, but you can modify one by
making an item with `templateitemname` matching
its `name`, alongside your modifications
(including `visible: false` or `enabled: false`
to hide it). If there is no template or no
matching item, this item will be hidden unless
you explicitly show it with `visible: true`.
value
string - dtickformat for described zoom level,
the same as "tickformat"
Returns
-------
tuple[plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop]
"""
return self["tickformatstops"] | [
"def",
"tickformatstops",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstops\"",
"]"
] | [
746,
4
] | [
794,
38
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickformatstopdefaults | (self) |
When used in a template (as layout.template.data.scatter3d.line
.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
scatter3d.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop
|
When used in a template (as layout.template.data.scatter3d.line
.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
scatter3d.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties: | def tickformatstopdefaults(self):
"""
When used in a template (as layout.template.data.scatter3d.line
.colorbar.tickformatstopdefaults), sets the default property
values to use for elements of
scatter3d.line.colorbar.tickformatstops
The 'tickformatstopdefaults' property is an instance of Tickformatstop
that may be specified as:
- An instance of :class:`plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop`
- A dict of string/value properties that will be passed
to the Tickformatstop constructor
Supported dict properties:
Returns
-------
plotly.graph_objs.scatter3d.line.colorbar.Tickformatstop
"""
return self["tickformatstopdefaults"] | [
"def",
"tickformatstopdefaults",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickformatstopdefaults\"",
"]"
] | [
803,
4
] | [
822,
45
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticklen | (self) |
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
|
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf] | def ticklen(self):
"""
Sets the tick length (in px).
The 'ticklen' property is a number and may be specified as:
- An int or float in the interval [0, inf]
Returns
-------
int|float
"""
return self["ticklen"] | [
"def",
"ticklen",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticklen\"",
"]"
] | [
831,
4
] | [
842,
30
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickmode | (self) |
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
|
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array'] | def tickmode(self):
"""
Sets the tick mode for this axis. If "auto", the number of
ticks is set via `nticks`. If "linear", the placement of the
ticks is determined by a starting position `tick0` and a tick
step `dtick` ("linear" is the default value if `tick0` and
`dtick` are provided). If "array", the placement of the ticks
is set via `tickvals` and the tick text is `ticktext`. ("array"
is the default value if `tickvals` is provided).
The 'tickmode' property is an enumeration that may be specified as:
- One of the following enumeration values:
['auto', 'linear', 'array']
Returns
-------
Any
"""
return self["tickmode"] | [
"def",
"tickmode",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickmode\"",
"]"
] | [
851,
4
] | [
869,
31
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.tickprefix | (self) |
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def tickprefix(self):
"""
Sets a tick label prefix.
The 'tickprefix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["tickprefix"] | [
"def",
"tickprefix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"tickprefix\"",
"]"
] | [
878,
4
] | [
890,
33
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticks | (self) |
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', '']
Returns
-------
Any
|
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', ''] | def ticks(self):
"""
Determines whether ticks are drawn or not. If "", this axis'
ticks are not drawn. If "outside" ("inside"), this axis' are
drawn outside (inside) the axis lines.
The 'ticks' property is an enumeration that may be specified as:
- One of the following enumeration values:
['outside', 'inside', '']
Returns
-------
Any
"""
return self["ticks"] | [
"def",
"ticks",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticks\"",
"]"
] | [
899,
4
] | [
913,
28
] | python | en | ['en', 'error', 'th'] | False |
ColorBar.ticksuffix | (self) |
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
|
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string | def ticksuffix(self):
"""
Sets a tick label suffix.
The 'ticksuffix' property is a string and must be specified as:
- A string
- A number that will be converted to a string
Returns
-------
str
"""
return self["ticksuffix"] | [
"def",
"ticksuffix",
"(",
"self",
")",
":",
"return",
"self",
"[",
"\"ticksuffix\"",
"]"
] | [
922,
4
] | [
934,
33
] | 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.