Skip to content

Commit

Permalink
Merge pull request #457 from OpenTrafficCam/task/4299-thicker-lines-f…
Browse files Browse the repository at this point in the history
…or-bounding-boxes

task/4299-thicker-lines-for-bounding-boxes
  • Loading branch information
briemla committed Feb 13, 2024
2 parents 61be7ab + ec1f58e commit b53a8e2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions OTAnalytics/plugin_prototypes/track_visualization/track_viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -740,11 +740,13 @@ def __init__(
color_palette_provider: ColorPaletteProvider,
track_view_state: TrackViewState,
alpha: float = 0.5,
linewidth: float = 1.0,
) -> None:
self._data_provider = data_provider
self._color_palette_provider = color_palette_provider
self._track_view_state = track_view_state
self._alpha = alpha
self._linewidth = linewidth

def plot(self, axes: Axes) -> None:
data = self._data_provider.get_data()
Expand Down Expand Up @@ -773,9 +775,9 @@ def _plot_dataframe(self, track_df: DataFrame, axes: Axes) -> None:
width=width,
height=height,
fc="none",
linewidth=0.5,
linewidth=self._linewidth,
color=color,
alpha=0.5,
alpha=self._alpha,
)
)

Expand All @@ -788,10 +790,12 @@ def __init__(
data_provider: PandasDataFrameProvider,
color_palette_provider: ColorPaletteProvider,
alpha: float = 0.5,
markersize: float = 3.0,
) -> None:
self._data_provider = data_provider
self._color_palette_provider = color_palette_provider
self._alpha = alpha
self._markersize = markersize

def plot(self, axes: Axes) -> None:
data = self._data_provider.get_data()
Expand All @@ -813,7 +817,9 @@ def _plot_dataframe(self, track_df: DataFrame, axes: Axes) -> None:
row[X],
row[Y],
marker="o",
markersize=self._markersize,
color=color,
alpha=self._alpha,
)


Expand Down
6 changes: 5 additions & 1 deletion OTAnalytics/plugin_ui/visualization/visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
second=0,
tzinfo=timezone.utc,
)
ALPHA_BOUNDING_BOX = 0.5
ALPHA_BOUNDING_BOX = 0.7
LINEWIDTH_BOUNDING_BOX = 1.5
MARKERSIZE_TRACK_POINT = 6


class FilterEndDateProvider(VisualizationTimeProvider):
Expand Down Expand Up @@ -707,6 +709,7 @@ def _create_track_bounding_box_plotter(
self._color_palette_provider,
self._track_view_state,
alpha=ALPHA_BOUNDING_BOX,
linewidth=LINEWIDTH_BOUNDING_BOX,
),
)
return PlotterPrototype(self._track_view_state, track_plotter)
Expand All @@ -723,6 +726,7 @@ def _create_track_point_plotter(self) -> Plotter:
),
self._color_palette_provider,
alpha=ALPHA_BOUNDING_BOX,
markersize=MARKERSIZE_TRACK_POINT,
),
)
return PlotterPrototype(self._track_view_state, track_plotter)

0 comments on commit b53a8e2

Please sign in to comment.