plotly.pyi 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. """Stub file for reflex/components/plotly/plotly.py"""
  2. # ------------------- DO NOT EDIT ----------------------
  3. # This file was generated by `reflex/utils/pyi_generator.py`!
  4. # ------------------------------------------------------
  5. from typing import Any, Callable, Dict, Optional, Union, overload
  6. from reflex.base import Base
  7. from reflex.components.component import NoSSRComponent
  8. from reflex.event import EventHandler, EventSpec
  9. from reflex.ivars.base import ImmutableVar
  10. from reflex.style import Style
  11. from reflex.utils import console
  12. from reflex.vars import Var
  13. try:
  14. from plotly.graph_objects import Figure, layout
  15. Template = layout.Template
  16. except ImportError:
  17. console.warn("Plotly is not installed. Please run `pip install plotly`.")
  18. Figure = Any
  19. Template = Any
  20. class _ButtonClickData(Base):
  21. menu: Any
  22. button: Any
  23. active: Any
  24. class Plotly(NoSSRComponent):
  25. def add_imports(self) -> dict[str, str]: ...
  26. def add_custom_code(self) -> list[str]: ...
  27. @overload
  28. @classmethod
  29. def create( # type: ignore
  30. cls,
  31. *children,
  32. data: Optional[Union[Var[Figure], Figure]] = None, # type: ignore
  33. layout: Optional[Union[Var[Dict], Dict]] = None,
  34. template: Optional[Union[Var[Template], Template]] = None, # type: ignore
  35. config: Optional[Union[Var[Dict], Dict]] = None,
  36. use_resize_handler: Optional[Union[Var[bool], bool]] = None,
  37. style: Optional[Style] = None,
  38. key: Optional[Any] = None,
  39. id: Optional[Any] = None,
  40. class_name: Optional[Any] = None,
  41. autofocus: Optional[bool] = None,
  42. custom_attrs: Optional[Dict[str, Union[ImmutableVar, str]]] = None,
  43. on_after_plot: Optional[
  44. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  45. ] = None,
  46. on_animated: Optional[
  47. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  48. ] = None,
  49. on_animating_frame: Optional[
  50. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  51. ] = None,
  52. on_animation_interrupted: Optional[
  53. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  54. ] = None,
  55. on_autosize: Optional[
  56. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  57. ] = None,
  58. on_before_hover: Optional[
  59. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  60. ] = None,
  61. on_blur: Optional[
  62. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  63. ] = None,
  64. on_button_clicked: Optional[
  65. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  66. ] = None,
  67. on_click: Optional[
  68. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  69. ] = None,
  70. on_context_menu: Optional[
  71. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  72. ] = None,
  73. on_deselect: Optional[
  74. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  75. ] = None,
  76. on_double_click: Optional[
  77. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  78. ] = None,
  79. on_focus: Optional[
  80. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  81. ] = None,
  82. on_hover: Optional[
  83. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  84. ] = None,
  85. on_mount: Optional[
  86. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  87. ] = None,
  88. on_mouse_down: Optional[
  89. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  90. ] = None,
  91. on_mouse_enter: Optional[
  92. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  93. ] = None,
  94. on_mouse_leave: Optional[
  95. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  96. ] = None,
  97. on_mouse_move: Optional[
  98. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  99. ] = None,
  100. on_mouse_out: Optional[
  101. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  102. ] = None,
  103. on_mouse_over: Optional[
  104. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  105. ] = None,
  106. on_mouse_up: Optional[
  107. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  108. ] = None,
  109. on_redraw: Optional[
  110. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  111. ] = None,
  112. on_relayout: Optional[
  113. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  114. ] = None,
  115. on_relayouting: Optional[
  116. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  117. ] = None,
  118. on_restyle: Optional[
  119. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  120. ] = None,
  121. on_scroll: Optional[
  122. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  123. ] = None,
  124. on_selected: Optional[
  125. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  126. ] = None,
  127. on_selecting: Optional[
  128. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  129. ] = None,
  130. on_transition_interrupted: Optional[
  131. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  132. ] = None,
  133. on_transitioning: Optional[
  134. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  135. ] = None,
  136. on_unhover: Optional[
  137. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  138. ] = None,
  139. on_unmount: Optional[
  140. Union[EventHandler, EventSpec, list, Callable, ImmutableVar]
  141. ] = None,
  142. **props,
  143. ) -> "Plotly":
  144. """Create the Plotly component.
  145. Args:
  146. *children: The children of the component.
  147. data: The figure to display. This can be a plotly figure or a plotly data json.
  148. layout: The layout of the graph.
  149. template: The template for visual appearance of the graph.
  150. config: The config of the graph.
  151. use_resize_handler: If true, the graph will resize when the window is resized.
  152. style: The style of the component.
  153. key: A unique key for the component.
  154. id: The id for the component.
  155. class_name: The class name for the component.
  156. autofocus: Whether the component should take the focus once the page is loaded
  157. custom_attrs: custom attribute
  158. **props: The properties of the component.
  159. Returns:
  160. The Plotly component.
  161. """
  162. ...