plotly.pyi 6.1 KB

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