Open ed-rhilbert opened 5 months ago
def _data_and_points_to_plot( self, train: int, eco_or_base: str, points_to_show: str, ) -> tuple[list, dict]:
data = []
for i, train_id in enumerate(self.trains):
t = [
record['time']
for record in self._head_position(i, eco_or_base)
]
offset = [
self.offset_in_path_of_train(
Point(
id='',
track_section=record['track_section'],
type='record',
position=record['offset']
),
train_id #bug correction #instead of train
)
for record in self._head_position(i)
]
data.append({"x": t, "y": offset, "label": train_id})