plots.interactive.charts ======================== .. py:module:: plots.interactive.charts Attributes ---------- .. autoapisummary:: plots.interactive.charts.DEFAULT_LAYOUT Classes ------- .. autoapisummary:: plots.interactive.charts.Chart Module Contents --------------- .. py:class:: Chart(rows=None, columns=None, **kwargs) A class for creating and managing multi-subplot interactive charts using Plotly. :param rows: Number of rows in the chart grid. Default is 1. :type rows: int, optional :param columns: Number of columns in the chart grid. Default is 1. :type columns: int, optional :param \*\*kwargs: Additional arguments passed to `plotly.subplots.make_subplots`. :type \*\*kwargs: dict .. py:method:: add_trace(*args, **kwargs) Adds a trace to the chart at the appropriate location. :param \*args: Positional arguments passed to `plotly.graph_objects.Figure.add_trace`. :type \*args: tuple :param \*\*kwargs: Keyword arguments passed to `plotly.graph_objects.Figure.add_trace`. :type \*\*kwargs: dict .. py:method:: bar(*args, **kwargs) Adds a bar plot to the chart. :param data: The data to be plotted. :type data: array-like or earthkit.data.FieldList :param \*args: Positional arguments passed to the bar plot generation function. :type \*args: tuple :param \*\*kwargs: Additional options for customizing the bar plot. :type \*\*kwargs: dict .. rubric:: Notes Bar plots are added as individual traces to each subplot. Titles are inferred from data attributes if not provided. .. py:method:: box(*args, **kwargs) Generate a set of box plot traces based on the provided data and quantiles. :param data: The data to be plotted. :type data: array-like or earthkit.data.FieldList :param \*args: Positional arguments passed to the plotly `go.Box` constructors. :type \*args: tuple :param quantiles: A list of quantiles to calculate for the data. The default is [0.05, 0.25, 0.5, 0.75, 0.95]. Note that any number of quantiles can be provided, but the default is based on the standard five-point box plot. :type quantiles: list of float, optional :param time_axis: The axis along which to calculate the quantiles. The default is 0. :type time_axis: int, optional :param \*\*kwargs: Additional keyword arguments passed to the `go.Box` constructor. :type \*\*kwargs: dict :rtype: list of plotly.graph_objects.Box .. rubric:: Notes - The width of the box plots is scaled based on the x-axis spacing. - Extra boxes are added for quantiles beyond the standard five-point box plot. - Hover information is included for quantile scatter points, showing the quantile value and percentage. .. py:property:: columns The number of columns in the chart grid. .. py:property:: fig The Plotly figure object representing the chart. .. py:method:: line(*args, **kwargs) Adds a line plot to the chart. :param data: The data to be plotted. :type data: array-like or earthkit.data.FieldList :param \*args: Positional arguments passed to the line plot generation function. :type \*args: tuple :param \*\*kwargs: Additional options for customizing the line plot. :type \*\*kwargs: dict .. rubric:: Notes Line plots are added as individual traces to each subplot. Titles are inferred from data attributes if not provided. .. py:property:: rows The number of rows in the chart grid. .. py:method:: set_subplot_titles() .. py:method:: show(*args, **kwargs) Display the chart. :param \*args: Additional arguments for `plotly.graph_objects.Figure.show`. :type \*args: tuple :param renderer: The renderer to use for displaying the chart. The default is "browser". For static plots, use "png". :type renderer: str, optional :param \*\*kwargs: Additional options for rendering the chart. :type \*\*kwargs: dict :rtype: None .. py:method:: title(title) Set the overall chart title. :param title: The title to display at the top of the chart. :type title: str .. py:data:: DEFAULT_LAYOUT