Skip to content

Commit

Permalink
Revert "fix: unified graph captions. (tier4#410)"
Browse files Browse the repository at this point in the history
This reverts commit b2a3eda.
  • Loading branch information
isp-uetsuki committed Dec 27, 2023
1 parent f099f87 commit beab859
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
3 changes: 1 addition & 2 deletions src/caret_analyze/plot/visualize_lib/bokeh/bokeh.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ def histogram(
raise NotImplementedError()

plot: Figure = Figure(
title=f'Histogram of {data_type}'
if case is None else f'Histogram of {data_type} --- {case} case ---',
title=data_type if case is None else f'{data_type} --- {case} case ---',
x_axis_label=x_label, y_axis_label='Probability', width=800
)

Expand Down
6 changes: 2 additions & 4 deletions src/caret_analyze/plot/visualize_lib/bokeh/stacked_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,10 @@ def create_figure(self) -> Figure:
# # get stacked bar data
data: dict[str, list[int | float]]
y_labels: list[str] = []
caption = 'latency'
y_axis_label = caption + ' [ms]'
y_axis_label = 'latency [ms]'
target_objects = self._metrics.target_objects
data, y_labels = self._metrics.to_stacked_bar_data()
path_name = target_objects.path_name
title: str = f'Stacked bar of response_time of {path_name} --- {self._case} case ---'
title: str = f"Stacked bar of '{getattr(target_objects, 'path_name')}'"

fig = init_figure(title, self._ywheel_zoom, self._xaxis_type, y_axis_label)
frame_min = data['start time'][0]
Expand Down
11 changes: 8 additions & 3 deletions src/caret_analyze/plot/visualize_lib/bokeh/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def create_figure(self) -> Figure:

# Initialize figure
y_axis_label = timeseries_records_list[0].columns[1]
data_type = y_axis_label
if y_axis_label == 'frequency':
y_axis_label = y_axis_label + ' [Hz]'
elif y_axis_label in ['period', 'latency']:
Expand All @@ -62,8 +61,14 @@ def create_figure(self) -> Figure:
y_axis_label = 'Response time' + ' [ms]'
else:
raise NotImplementedError()
title: str = f'Timeseries of {data_type} --- {self._case} case --- \
'if data_type == 'response_time' else f'Timeseries of {data_type}'
if isinstance(target_objects[0], CallbackBase):
title = f'Time-line of callbacks {y_axis_label}'
elif isinstance(target_objects[0], Communication):
title = f'Time-line of communications {y_axis_label}'
elif isinstance(target_objects[0], Path):
title = f'Time-line of Paths {y_axis_label} --- {self._case} case ---'
else:
title = f'Time-line of publishes/subscribes {y_axis_label}'
fig = init_figure(title, self._ywheel_zoom, self._xaxis_type, y_axis_label)

# Apply xaxis offset
Expand Down

0 comments on commit beab859

Please sign in to comment.