File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,6 @@ dependencies = [
2323 " xarray>=2023.1.0" ,
2424 " plotly>=5.0.0" ,
2525 " pandas>=1.5.0" ,
26- " xarray-plotly-stubs>=0.1.0" ,
2726]
2827
2928[project .urls ]
Load diff This file was deleted.
Load diff This file was deleted.
Load diff This file was deleted.
Original file line number Diff line number Diff line change 2727
2828from importlib .metadata import version
2929
30- from xarray import register_dataarray_accessor
30+ from xarray import DataArray , register_dataarray_accessor
3131
3232from xarray_plotly .accessor import DataArrayPlotlyAccessor
3333from xarray_plotly .common import SLOT_ORDERS , auto
3636 "DataArrayPlotlyAccessor" ,
3737 "SLOT_ORDERS" ,
3838 "auto" ,
39+ "xpx" ,
3940]
4041
42+
43+ def xpx (da : DataArray ) -> DataArrayPlotlyAccessor :
44+ """
45+ Get the plotly accessor for a DataArray with full IDE code completion.
46+
47+ This is an alternative to `da.plotly` that provides proper type hints
48+ and code completion in IDEs.
49+
50+ Parameters
51+ ----------
52+ da : DataArray
53+ The DataArray to plot.
54+
55+ Returns
56+ -------
57+ DataArrayPlotlyAccessor
58+ The accessor with plotting methods.
59+
60+ Examples
61+ --------
62+ >>> from xarray_plotly import xpx
63+ >>> fig = xpx(da).line() # Full code completion works here
64+ """
65+ return DataArrayPlotlyAccessor (da )
66+
67+
4168__version__ = version ("xarray_plotly" )
4269
4370# Register the accessor
You can’t perform that action at this time.
0 commit comments