diff --git a/daqviewer/daqviewer.py b/daqviewer/daqviewer.py index d59cc1a..10adf9d 100644 --- a/daqviewer/daqviewer.py +++ b/daqviewer/daqviewer.py @@ -191,43 +191,40 @@ def read_json_data(json_data): } # Add table - table_energy = dash_table.DataTable( - id='datatable-row-ids', - columns=[{ - 'name': [val, key], - 'id': key - } for key, val in variables.items()], - data=stats.to_dict('records'), - editable=False, - sort_action='native', - sort_mode='multi', - row_selectable='multi', - row_deletable=False, - selected_rows=np.arange(stats.shape[0]), - style_as_list_view=True, - fill_width=False, - style_cell={ - 'minWidth': '100px', - 'width': '100px', - 'maxWidth': '100px', - }, - ) - if info['instrument type'] == 'WP': - elements = html.Div([ - graph_timeseries, - html.Div([ - html.Div([graph_energy], className='six columns'), - html.Div([table_energy], className='six columns') - ]), - html.Div(id='datatable-row-ids-container') - ]) - + table_energy = dash_table.DataTable( + id='datatable-row-ids', + columns=[{ + 'name': [val, key], + 'id': key + } for key, val in variables.items()], + data=stats.to_dict('records'), + editable=False, + sort_action='native', + sort_mode='multi', + row_selectable='multi', + row_deletable=False, + selected_rows=np.arange(stats.shape[0]), + style_as_list_view=True, + fill_width=False, + style_cell={ + 'minWidth': '100px', + 'width': '100px', + 'maxWidth': '100px', + }, + ) else: - # Don't include spectral data for non-wave instruments - elements = html.Div( - [graph_timeseries, - html.Div(id='datatable-row-ids-container')]) + # Return blank table + table_energy = dash_table.DataTable() + + elements = html.Div([ + graph_timeseries, + html.Div([ + html.Div([graph_energy], className='six columns'), + html.Div([table_energy], className='six columns') + ]), + html.Div(id='datatable-row-ids-container') + ]) return elements