plotly.pyi 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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, Optional, Union, overload
  6. from reflex.base import Base
  7. from reflex.components.component import NoSSRComponent
  8. from reflex.event import BASE_STATE, EventType
  9. from reflex.style import Style
  10. from reflex.utils import console
  11. from reflex.vars.base 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[Figure, Var[Figure]]] = None, # type: ignore
  32. layout: Optional[Union[Dict, Var[Dict]]] = None,
  33. template: Optional[Union[Template, Var[Template]]] = None, # type: ignore
  34. config: Optional[Union[Dict, Var[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[EventType[..., BASE_STATE]] = None,
  43. on_animated: Optional[EventType[..., BASE_STATE]] = None,
  44. on_animating_frame: Optional[EventType[..., BASE_STATE]] = None,
  45. on_animation_interrupted: Optional[EventType[..., BASE_STATE]] = None,
  46. on_autosize: Optional[EventType[..., BASE_STATE]] = None,
  47. on_before_hover: Optional[EventType[..., BASE_STATE]] = None,
  48. on_blur: Optional[EventType[[], BASE_STATE]] = None,
  49. on_button_clicked: Optional[EventType[..., BASE_STATE]] = None,
  50. on_click: Optional[EventType[..., BASE_STATE]] = None,
  51. on_context_menu: Optional[EventType[[], BASE_STATE]] = None,
  52. on_deselect: Optional[EventType[..., BASE_STATE]] = None,
  53. on_double_click: Optional[EventType[..., BASE_STATE]] = None,
  54. on_focus: Optional[EventType[[], BASE_STATE]] = None,
  55. on_hover: Optional[EventType[..., BASE_STATE]] = None,
  56. on_mount: Optional[EventType[[], BASE_STATE]] = None,
  57. on_mouse_down: Optional[EventType[[], BASE_STATE]] = None,
  58. on_mouse_enter: Optional[EventType[[], BASE_STATE]] = None,
  59. on_mouse_leave: Optional[EventType[[], BASE_STATE]] = None,
  60. on_mouse_move: Optional[EventType[[], BASE_STATE]] = None,
  61. on_mouse_out: Optional[EventType[[], BASE_STATE]] = None,
  62. on_mouse_over: Optional[EventType[[], BASE_STATE]] = None,
  63. on_mouse_up: Optional[EventType[[], BASE_STATE]] = None,
  64. on_redraw: Optional[EventType[..., BASE_STATE]] = None,
  65. on_relayout: Optional[EventType[..., BASE_STATE]] = None,
  66. on_relayouting: Optional[EventType[..., BASE_STATE]] = None,
  67. on_restyle: Optional[EventType[..., BASE_STATE]] = None,
  68. on_scroll: Optional[EventType[[], BASE_STATE]] = None,
  69. on_selected: Optional[EventType[..., BASE_STATE]] = None,
  70. on_selecting: Optional[EventType[..., BASE_STATE]] = None,
  71. on_transition_interrupted: Optional[EventType[..., BASE_STATE]] = None,
  72. on_transitioning: Optional[EventType[..., BASE_STATE]] = None,
  73. on_unhover: Optional[EventType[..., BASE_STATE]] = None,
  74. on_unmount: Optional[EventType[[], BASE_STATE]] = None,
  75. **props,
  76. ) -> "Plotly":
  77. """Create the Plotly component.
  78. Args:
  79. *children: The children of the component.
  80. data: The figure to display. This can be a plotly figure or a plotly data json.
  81. layout: The layout of the graph.
  82. template: The template for visual appearance of the graph.
  83. config: The config of the graph.
  84. use_resize_handler: If true, the graph will resize when the window is resized.
  85. on_after_plot: Fired after the plot is redrawn.
  86. on_animated: Fired after the plot was animated.
  87. on_animating_frame: Fired while animating a single frame (does not currently pass data through).
  88. on_animation_interrupted: Fired when an animation is interrupted (to start a new animation for example).
  89. on_autosize: Fired when the plot is responsively sized.
  90. on_before_hover: Fired whenever mouse moves over a plot.
  91. on_button_clicked: Fired when a plotly UI button is clicked.
  92. on_click: Fired when the plot is clicked.
  93. on_deselect: Fired when a selection is cleared (via double click).
  94. on_double_click: Fired when the plot is double clicked.
  95. on_hover: Fired when a plot element is hovered over.
  96. on_relayout: Fired after the plot is layed out (zoom, pan, etc).
  97. on_relayouting: Fired while the plot is being layed out.
  98. on_restyle: Fired after the plot style is changed.
  99. on_redraw: Fired after the plot is redrawn.
  100. on_selected: Fired after selecting plot elements.
  101. on_selecting: Fired while dragging a selection.
  102. on_transitioning: Fired while an animation is occuring.
  103. on_transition_interrupted: Fired when a transition is stopped early.
  104. on_unhover: Fired when a hovered element is no longer hovered.
  105. style: The style of the component.
  106. key: A unique key for the component.
  107. id: The id for the component.
  108. class_name: The class name for the component.
  109. autofocus: Whether the component should take the focus once the page is loaded
  110. custom_attrs: custom attribute
  111. **props: The properties of the component.
  112. Returns:
  113. The Plotly component.
  114. """
  115. ...