Show empty table for non-wave-probe instruments

master
Dan Howe 5 years ago
parent 183d2af094
commit 6cbb33842e

@ -191,43 +191,40 @@ def read_json_data(json_data):
} }
# Add table # 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': if info['instrument type'] == 'WP':
elements = html.Div([ table_energy = dash_table.DataTable(
graph_timeseries, id='datatable-row-ids',
html.Div([ columns=[{
html.Div([graph_energy], className='six columns'), 'name': [val, key],
html.Div([table_energy], className='six columns') 'id': key
]), } for key, val in variables.items()],
html.Div(id='datatable-row-ids-container') 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: else:
# Don't include spectral data for non-wave instruments # Return blank table
elements = html.Div( table_energy = dash_table.DataTable()
[graph_timeseries,
html.Div(id='datatable-row-ids-container')]) 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 return elements

Loading…
Cancel
Save