Skip to content

Commit 08e46a1

Browse files
committed
Fix imports
1 parent 48ebd3d commit 08e46a1

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

xarray_plotly/accessor.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from __future__ import annotations
66

7-
from typing import TYPE_CHECKING, Any
7+
from typing import TYPE_CHECKING, Any, ClassVar
88

99
from xarray_plotly import plotting
1010
from xarray_plotly.common import SlotValue, auto
@@ -32,13 +32,15 @@ class DataArrayPlotlyAccessor:
3232
>>> fig.update_layout(title="My Plot")
3333
"""
3434

35-
_da: DataArray
36-
37-
__slots__ = ("_da",)
35+
__all__: ClassVar = ["line", "bar", "area", "scatter", "box", "imshow"]
3836

3937
def __init__(self, darray: DataArray) -> None:
4038
self._da = darray
4139

40+
def __dir__(self) -> list[str]:
41+
"""List available plot methods."""
42+
return list(self.__all__) + list(super().__dir__())
43+
4244
def line(
4345
self,
4446
*,

0 commit comments

Comments
 (0)