1from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType 2import copy as _copy 3 4 5class Hoverlabel(_BaseTraceHierarchyType): 6 7 # class properties 8 # -------------------- 9 _parent_path_str = "volume" 10 _path_str = "volume.hoverlabel" 11 _valid_props = { 12 "align", 13 "alignsrc", 14 "bgcolor", 15 "bgcolorsrc", 16 "bordercolor", 17 "bordercolorsrc", 18 "font", 19 "namelength", 20 "namelengthsrc", 21 } 22 23 # align 24 # ----- 25 @property 26 def align(self): 27 """ 28 Sets the horizontal alignment of the text content within hover 29 label box. Has an effect only if the hover label text spans 30 more two or more lines 31 32 The 'align' property is an enumeration that may be specified as: 33 - One of the following enumeration values: 34 ['left', 'right', 'auto'] 35 - A tuple, list, or one-dimensional numpy array of the above 36 37 Returns 38 ------- 39 Any|numpy.ndarray 40 """ 41 return self["align"] 42 43 @align.setter 44 def align(self, val): 45 self["align"] = val 46 47 # alignsrc 48 # -------- 49 @property 50 def alignsrc(self): 51 """ 52 Sets the source reference on Chart Studio Cloud for align . 53 54 The 'alignsrc' property must be specified as a string or 55 as a plotly.grid_objs.Column object 56 57 Returns 58 ------- 59 str 60 """ 61 return self["alignsrc"] 62 63 @alignsrc.setter 64 def alignsrc(self, val): 65 self["alignsrc"] = val 66 67 # bgcolor 68 # ------- 69 @property 70 def bgcolor(self): 71 """ 72 Sets the background color of the hover labels for this trace 73 74 The 'bgcolor' property is a color and may be specified as: 75 - A hex string (e.g. '#ff0000') 76 - An rgb/rgba string (e.g. 'rgb(255,0,0)') 77 - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') 78 - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') 79 - A named CSS color: 80 aliceblue, antiquewhite, aqua, aquamarine, azure, 81 beige, bisque, black, blanchedalmond, blue, 82 blueviolet, brown, burlywood, cadetblue, 83 chartreuse, chocolate, coral, cornflowerblue, 84 cornsilk, crimson, cyan, darkblue, darkcyan, 85 darkgoldenrod, darkgray, darkgrey, darkgreen, 86 darkkhaki, darkmagenta, darkolivegreen, darkorange, 87 darkorchid, darkred, darksalmon, darkseagreen, 88 darkslateblue, darkslategray, darkslategrey, 89 darkturquoise, darkviolet, deeppink, deepskyblue, 90 dimgray, dimgrey, dodgerblue, firebrick, 91 floralwhite, forestgreen, fuchsia, gainsboro, 92 ghostwhite, gold, goldenrod, gray, grey, green, 93 greenyellow, honeydew, hotpink, indianred, indigo, 94 ivory, khaki, lavender, lavenderblush, lawngreen, 95 lemonchiffon, lightblue, lightcoral, lightcyan, 96 lightgoldenrodyellow, lightgray, lightgrey, 97 lightgreen, lightpink, lightsalmon, lightseagreen, 98 lightskyblue, lightslategray, lightslategrey, 99 lightsteelblue, lightyellow, lime, limegreen, 100 linen, magenta, maroon, mediumaquamarine, 101 mediumblue, mediumorchid, mediumpurple, 102 mediumseagreen, mediumslateblue, mediumspringgreen, 103 mediumturquoise, mediumvioletred, midnightblue, 104 mintcream, mistyrose, moccasin, navajowhite, navy, 105 oldlace, olive, olivedrab, orange, orangered, 106 orchid, palegoldenrod, palegreen, paleturquoise, 107 palevioletred, papayawhip, peachpuff, peru, pink, 108 plum, powderblue, purple, red, rosybrown, 109 royalblue, rebeccapurple, saddlebrown, salmon, 110 sandybrown, seagreen, seashell, sienna, silver, 111 skyblue, slateblue, slategray, slategrey, snow, 112 springgreen, steelblue, tan, teal, thistle, tomato, 113 turquoise, violet, wheat, white, whitesmoke, 114 yellow, yellowgreen 115 - A list or array of any of the above 116 117 Returns 118 ------- 119 str|numpy.ndarray 120 """ 121 return self["bgcolor"] 122 123 @bgcolor.setter 124 def bgcolor(self, val): 125 self["bgcolor"] = val 126 127 # bgcolorsrc 128 # ---------- 129 @property 130 def bgcolorsrc(self): 131 """ 132 Sets the source reference on Chart Studio Cloud for bgcolor . 133 134 The 'bgcolorsrc' property must be specified as a string or 135 as a plotly.grid_objs.Column object 136 137 Returns 138 ------- 139 str 140 """ 141 return self["bgcolorsrc"] 142 143 @bgcolorsrc.setter 144 def bgcolorsrc(self, val): 145 self["bgcolorsrc"] = val 146 147 # bordercolor 148 # ----------- 149 @property 150 def bordercolor(self): 151 """ 152 Sets the border color of the hover labels for this trace. 153 154 The 'bordercolor' property is a color and may be specified as: 155 - A hex string (e.g. '#ff0000') 156 - An rgb/rgba string (e.g. 'rgb(255,0,0)') 157 - An hsl/hsla string (e.g. 'hsl(0,100%,50%)') 158 - An hsv/hsva string (e.g. 'hsv(0,100%,100%)') 159 - A named CSS color: 160 aliceblue, antiquewhite, aqua, aquamarine, azure, 161 beige, bisque, black, blanchedalmond, blue, 162 blueviolet, brown, burlywood, cadetblue, 163 chartreuse, chocolate, coral, cornflowerblue, 164 cornsilk, crimson, cyan, darkblue, darkcyan, 165 darkgoldenrod, darkgray, darkgrey, darkgreen, 166 darkkhaki, darkmagenta, darkolivegreen, darkorange, 167 darkorchid, darkred, darksalmon, darkseagreen, 168 darkslateblue, darkslategray, darkslategrey, 169 darkturquoise, darkviolet, deeppink, deepskyblue, 170 dimgray, dimgrey, dodgerblue, firebrick, 171 floralwhite, forestgreen, fuchsia, gainsboro, 172 ghostwhite, gold, goldenrod, gray, grey, green, 173 greenyellow, honeydew, hotpink, indianred, indigo, 174 ivory, khaki, lavender, lavenderblush, lawngreen, 175 lemonchiffon, lightblue, lightcoral, lightcyan, 176 lightgoldenrodyellow, lightgray, lightgrey, 177 lightgreen, lightpink, lightsalmon, lightseagreen, 178 lightskyblue, lightslategray, lightslategrey, 179 lightsteelblue, lightyellow, lime, limegreen, 180 linen, magenta, maroon, mediumaquamarine, 181 mediumblue, mediumorchid, mediumpurple, 182 mediumseagreen, mediumslateblue, mediumspringgreen, 183 mediumturquoise, mediumvioletred, midnightblue, 184 mintcream, mistyrose, moccasin, navajowhite, navy, 185 oldlace, olive, olivedrab, orange, orangered, 186 orchid, palegoldenrod, palegreen, paleturquoise, 187 palevioletred, papayawhip, peachpuff, peru, pink, 188 plum, powderblue, purple, red, rosybrown, 189 royalblue, rebeccapurple, saddlebrown, salmon, 190 sandybrown, seagreen, seashell, sienna, silver, 191 skyblue, slateblue, slategray, slategrey, snow, 192 springgreen, steelblue, tan, teal, thistle, tomato, 193 turquoise, violet, wheat, white, whitesmoke, 194 yellow, yellowgreen 195 - A list or array of any of the above 196 197 Returns 198 ------- 199 str|numpy.ndarray 200 """ 201 return self["bordercolor"] 202 203 @bordercolor.setter 204 def bordercolor(self, val): 205 self["bordercolor"] = val 206 207 # bordercolorsrc 208 # -------------- 209 @property 210 def bordercolorsrc(self): 211 """ 212 Sets the source reference on Chart Studio Cloud for 213 bordercolor . 214 215 The 'bordercolorsrc' property must be specified as a string or 216 as a plotly.grid_objs.Column object 217 218 Returns 219 ------- 220 str 221 """ 222 return self["bordercolorsrc"] 223 224 @bordercolorsrc.setter 225 def bordercolorsrc(self, val): 226 self["bordercolorsrc"] = val 227 228 # font 229 # ---- 230 @property 231 def font(self): 232 """ 233 Sets the font used in hover labels. 234 235 The 'font' property is an instance of Font 236 that may be specified as: 237 - An instance of :class:`plotly.graph_objs.volume.hoverlabel.Font` 238 - A dict of string/value properties that will be passed 239 to the Font constructor 240 241 Supported dict properties: 242 243 color 244 245 colorsrc 246 Sets the source reference on Chart Studio Cloud 247 for color . 248 family 249 HTML font family - the typeface that will be 250 applied by the web browser. The web browser 251 will only be able to apply a font if it is 252 available on the system which it operates. 253 Provide multiple font families, separated by 254 commas, to indicate the preference in which to 255 apply fonts if they aren't available on the 256 system. The Chart Studio Cloud (at 257 https://chart-studio.plotly.com or on-premise) 258 generates images on a server, where only a 259 select number of fonts are installed and 260 supported. These include "Arial", "Balto", 261 "Courier New", "Droid Sans",, "Droid Serif", 262 "Droid Sans Mono", "Gravitas One", "Old 263 Standard TT", "Open Sans", "Overpass", "PT Sans 264 Narrow", "Raleway", "Times New Roman". 265 familysrc 266 Sets the source reference on Chart Studio Cloud 267 for family . 268 size 269 270 sizesrc 271 Sets the source reference on Chart Studio Cloud 272 for size . 273 274 Returns 275 ------- 276 plotly.graph_objs.volume.hoverlabel.Font 277 """ 278 return self["font"] 279 280 @font.setter 281 def font(self, val): 282 self["font"] = val 283 284 # namelength 285 # ---------- 286 @property 287 def namelength(self): 288 """ 289 Sets the default length (in number of characters) of the trace 290 name in the hover labels for all traces. -1 shows the whole 291 name regardless of length. 0-3 shows the first 0-3 characters, 292 and an integer >3 will show the whole name if it is less than 293 that many characters, but if it is longer, will truncate to 294 `namelength - 3` characters and add an ellipsis. 295 296 The 'namelength' property is a integer and may be specified as: 297 - An int (or float that will be cast to an int) 298 in the interval [-1, 9223372036854775807] 299 - A tuple, list, or one-dimensional numpy array of the above 300 301 Returns 302 ------- 303 int|numpy.ndarray 304 """ 305 return self["namelength"] 306 307 @namelength.setter 308 def namelength(self, val): 309 self["namelength"] = val 310 311 # namelengthsrc 312 # ------------- 313 @property 314 def namelengthsrc(self): 315 """ 316 Sets the source reference on Chart Studio Cloud for namelength 317 . 318 319 The 'namelengthsrc' property must be specified as a string or 320 as a plotly.grid_objs.Column object 321 322 Returns 323 ------- 324 str 325 """ 326 return self["namelengthsrc"] 327 328 @namelengthsrc.setter 329 def namelengthsrc(self, val): 330 self["namelengthsrc"] = val 331 332 # Self properties description 333 # --------------------------- 334 @property 335 def _prop_descriptions(self): 336 return """\ 337 align 338 Sets the horizontal alignment of the text content 339 within hover label box. Has an effect only if the hover 340 label text spans more two or more lines 341 alignsrc 342 Sets the source reference on Chart Studio Cloud for 343 align . 344 bgcolor 345 Sets the background color of the hover labels for this 346 trace 347 bgcolorsrc 348 Sets the source reference on Chart Studio Cloud for 349 bgcolor . 350 bordercolor 351 Sets the border color of the hover labels for this 352 trace. 353 bordercolorsrc 354 Sets the source reference on Chart Studio Cloud for 355 bordercolor . 356 font 357 Sets the font used in hover labels. 358 namelength 359 Sets the default length (in number of characters) of 360 the trace name in the hover labels for all traces. -1 361 shows the whole name regardless of length. 0-3 shows 362 the first 0-3 characters, and an integer >3 will show 363 the whole name if it is less than that many characters, 364 but if it is longer, will truncate to `namelength - 3` 365 characters and add an ellipsis. 366 namelengthsrc 367 Sets the source reference on Chart Studio Cloud for 368 namelength . 369 """ 370 371 def __init__( 372 self, 373 arg=None, 374 align=None, 375 alignsrc=None, 376 bgcolor=None, 377 bgcolorsrc=None, 378 bordercolor=None, 379 bordercolorsrc=None, 380 font=None, 381 namelength=None, 382 namelengthsrc=None, 383 **kwargs 384 ): 385 """ 386 Construct a new Hoverlabel object 387 388 Parameters 389 ---------- 390 arg 391 dict of properties compatible with this constructor or 392 an instance of 393 :class:`plotly.graph_objs.volume.Hoverlabel` 394 align 395 Sets the horizontal alignment of the text content 396 within hover label box. Has an effect only if the hover 397 label text spans more two or more lines 398 alignsrc 399 Sets the source reference on Chart Studio Cloud for 400 align . 401 bgcolor 402 Sets the background color of the hover labels for this 403 trace 404 bgcolorsrc 405 Sets the source reference on Chart Studio Cloud for 406 bgcolor . 407 bordercolor 408 Sets the border color of the hover labels for this 409 trace. 410 bordercolorsrc 411 Sets the source reference on Chart Studio Cloud for 412 bordercolor . 413 font 414 Sets the font used in hover labels. 415 namelength 416 Sets the default length (in number of characters) of 417 the trace name in the hover labels for all traces. -1 418 shows the whole name regardless of length. 0-3 shows 419 the first 0-3 characters, and an integer >3 will show 420 the whole name if it is less than that many characters, 421 but if it is longer, will truncate to `namelength - 3` 422 characters and add an ellipsis. 423 namelengthsrc 424 Sets the source reference on Chart Studio Cloud for 425 namelength . 426 427 Returns 428 ------- 429 Hoverlabel 430 """ 431 super(Hoverlabel, self).__init__("hoverlabel") 432 433 if "_parent" in kwargs: 434 self._parent = kwargs["_parent"] 435 return 436 437 # Validate arg 438 # ------------ 439 if arg is None: 440 arg = {} 441 elif isinstance(arg, self.__class__): 442 arg = arg.to_plotly_json() 443 elif isinstance(arg, dict): 444 arg = _copy.copy(arg) 445 else: 446 raise ValueError( 447 """\ 448The first argument to the plotly.graph_objs.volume.Hoverlabel 449constructor must be a dict or 450an instance of :class:`plotly.graph_objs.volume.Hoverlabel`""" 451 ) 452 453 # Handle skip_invalid 454 # ------------------- 455 self._skip_invalid = kwargs.pop("skip_invalid", False) 456 self._validate = kwargs.pop("_validate", True) 457 458 # Populate data dict with properties 459 # ---------------------------------- 460 _v = arg.pop("align", None) 461 _v = align if align is not None else _v 462 if _v is not None: 463 self["align"] = _v 464 _v = arg.pop("alignsrc", None) 465 _v = alignsrc if alignsrc is not None else _v 466 if _v is not None: 467 self["alignsrc"] = _v 468 _v = arg.pop("bgcolor", None) 469 _v = bgcolor if bgcolor is not None else _v 470 if _v is not None: 471 self["bgcolor"] = _v 472 _v = arg.pop("bgcolorsrc", None) 473 _v = bgcolorsrc if bgcolorsrc is not None else _v 474 if _v is not None: 475 self["bgcolorsrc"] = _v 476 _v = arg.pop("bordercolor", None) 477 _v = bordercolor if bordercolor is not None else _v 478 if _v is not None: 479 self["bordercolor"] = _v 480 _v = arg.pop("bordercolorsrc", None) 481 _v = bordercolorsrc if bordercolorsrc is not None else _v 482 if _v is not None: 483 self["bordercolorsrc"] = _v 484 _v = arg.pop("font", None) 485 _v = font if font is not None else _v 486 if _v is not None: 487 self["font"] = _v 488 _v = arg.pop("namelength", None) 489 _v = namelength if namelength is not None else _v 490 if _v is not None: 491 self["namelength"] = _v 492 _v = arg.pop("namelengthsrc", None) 493 _v = namelengthsrc if namelengthsrc is not None else _v 494 if _v is not None: 495 self["namelengthsrc"] = _v 496 497 # Process unknown kwargs 498 # ---------------------- 499 self._process_kwargs(**dict(arg, **kwargs)) 500 501 # Reset skip_invalid 502 # ------------------ 503 self._skip_invalid = False 504