plotly.pyi 6.6 KB

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