Skip to content

Commit

Permalink
swith mapbox to map
Browse files Browse the repository at this point in the history
  • Loading branch information
figuetbe committed Dec 18, 2024
1 parent 5d5208e commit 339371b
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions src/traffic/core/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -2999,15 +2999,15 @@ def line_geo(self, **kwargs: Any) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def line_map(
self, mapbox_style: str = "carto-positron", **kwargs: Any
self, map_style: str = "carto-positron", **kwargs: Any
) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def scatter_geo(self, **kwargs: Any) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def scatter_map(
self, mapbox_style: str = "carto-positron", **kwargs: Any
self, map_style: str = "carto-positron", **kwargs: Any
) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

Expand Down Expand Up @@ -3145,7 +3145,7 @@ def from_file(cls, filename: Union[Path, str], **kwargs: Any) -> Self:
def patch_plotly() -> None:
from ..visualize.plotly import (
Scattergeo,
Scattermapbox,
Scattermap,
line_geo,
line_map,
scatter_geo,
Expand All @@ -3154,7 +3154,7 @@ def patch_plotly() -> None:

Flight.line_map = line_map # type: ignore
Flight.scatter_map = scatter_map # type: ignore
Flight.Scattermapbox = Scattermapbox # type: ignore
Flight.Scattermap = Scattermap # type: ignore
Flight.line_geo = line_geo # type: ignore
Flight.scatter_geo = scatter_geo # type: ignore
Flight.Scattergeo = Scattergeo # type: ignore
Expand Down
8 changes: 4 additions & 4 deletions src/traffic/core/traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,15 +1092,15 @@ def line_geo(self, **kwargs: Any) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def line_map(
self, mapbox_style: str = "carto-positron", **kwargs: Any
self, map_style: str = "carto-positron", **kwargs: Any
) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def scatter_geo(self, **kwargs: Any) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

def scatter_map(
self, mapbox_style: str = "carto-positron", **kwargs: Any
self, map_style: str = "carto-positron", **kwargs: Any
) -> "go.Figure":
raise ImportError("Install plotly or traffic with the plotly extension")

Expand Down Expand Up @@ -1527,7 +1527,7 @@ def centroid(
def patch_plotly() -> None:
from ..visualize.plotly import (
Scattergeo,
Scattermapbox,
Scattermap,
line_geo,
line_map,
scatter_geo,
Expand All @@ -1536,7 +1536,7 @@ def patch_plotly() -> None:

Traffic.line_map = line_map # type: ignore
Traffic.scatter_map = scatter_map # type: ignore
Traffic.Scattermapbox = Scattermapbox # type: ignore
Traffic.Scattermap = Scattermap # type: ignore
Traffic.line_geo = line_geo # type: ignore
Traffic.scatter_geo = scatter_geo # type: ignore
Traffic.Scattergeo = Scattergeo # type: ignore
Expand Down
16 changes: 8 additions & 8 deletions src/traffic/visualize/plotly.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def line_map(
self: Any,
mapbox_style: str = "carto-positron",
map_style: str = "carto-positron",
**kwargs: Any,
) -> go.Figure:
"""Create a line plot with Plotly.
Expand All @@ -21,13 +21,13 @@ def line_map(
self.data,
lat="latitude",
lon="longitude",
mapbox_style=mapbox_style,
map_style=map_style,
**kwargs,
)


def scatter_map(
self: Any, mapbox_style: str = "carto-positron", **kwargs: Any
self: Any, map_style: str = "carto-positron", **kwargs: Any
) -> go.Figure:
"""Create a scatter plot with Plotly.
Expand All @@ -41,17 +41,17 @@ def scatter_map(
self.data,
lat="latitude",
lon="longitude",
mapbox_style=mapbox_style,
map_style=map_style,
**kwargs,
)


def Scattermapbox(self: Any, **kwargs: Any) -> go.Scattermapbox:
"""Create a Scattermapbox with Plotly.
def Scattermap(self: Any, **kwargs: Any) -> go.Scattermap:
"""Create a Scattermap with Plotly.
Requires the plotly package (optional dependency).
"""
return go.Scattermapbox(
return go.Scattermap(
lat=self.data.latitude,
lon=self.data.longitude,
**kwargs,
Expand Down Expand Up @@ -93,7 +93,7 @@ def scatter_geo(self: Any, **kwargs: Any) -> go.Figure:


def Scattergeo(self: Any, **kwargs: Any) -> go.Scattergeo:
"""Create a Scattermapbox with Plotly.
"""Create a Scattergeo with Plotly.
Requires the plotly package (optional dependency).
"""
Expand Down

0 comments on commit 339371b

Please sign in to comment.