serial_dashboard.parsers.data_to_dicts

serial_dashboard.parsers.data_to_dicts(data, max_cols, time_col, time_units, starting_time_ind)

Take in data as a list of lists and converts to a list of dictionaries that can be used to stream into the ColumnDataSources.

Parameters
  • data (list of lists) – Data to be converted into a dictionary.

  • max_cols (int) – Maximum number of columns present in data set. This is usually the maximum length of a one of the lists in data. If any of the lists are longer than max_cols, the data in the list is truncated.

  • time_col (int or "none") – Which column contains time data.

  • time_units (str) – Units of time. If “µs”, the time column is divided by a million. If “ms”, the time column is divided by a thousand.

  • starting_time_ind (int) – Only active if time_col == “none”. The time column is indices in this case, and they start with starting_time_ind.

Returns

output – A list of dicts, each with keys “t” and “y”, representing the time and y-data to be updated in a plot.

Return type

list of dicts