def display_data(value): """Displaying the head for the selected file.""" db_value = db.get("file") if value is None and db_value is None: return "" elif value is None and not db_value is None: value = db_value format = FileUtils.file_format(value) if format == 'csv' or format == 'txt': path = FileUtils.path('raw', value) head = DataUtils.read_text_head(path) table_col = [ html.Col(style={'width': "10%"}), html.Col(style={'width': "90%"}) ] table_header = [ html.Thead(html.Tr([html.Th("Row No"), html.Th("Data")])) ] rows = [] for i in range(len(head)): row = html.Tr([html.Td(i + 1), html.Td(head[i])]) rows.append(row) table_body = [html.Tbody(rows)] table = dbc.Table(table_col + table_header + table_body, bordered=True, style=common.table_style) div = [ common.msg("Selected File: " + value), common.msg("Selected Format: " + format), table, html.Br(), csv_properties_div ] elif format == 'xls' or format == 'xlsx': path = FileUtils.path('raw', value) xls = pd.ExcelFile(path) sheets = xls.sheet_names div = [ common.msg("Selected File: " + value), common.msg("Selected Format: " + format), common.msg("Select Sheet:"), html.Div([ dcc.Dropdown(id='xls-file-sheet', options=[{ 'label': sheet, 'value': sheet } for sheet in sheets], value=None, multi=False) ], style={ 'margin': '10px', 'width': '50%' }), html.Div([], id="display-xls-file") ] else: div = "Format Not Supported!!" db.put("file", value) db.put("format", format) return div
def display_data(value): """Displaying the head for the selected file.""" db_value = db.get("file") if value is None and db_value is None: return "" elif value is None and not db_value is None: value = db_value elif not value == db_value: db.reset() format = FileUtils.file_format(value) if format == 'csv' or format == 'txt': path = FileUtils.path('raw', value) head = DataUtils.read_text_head(path) table_col = [html.Col(style = {'width':"10%"}), html.Col(style = {'width':"90%"})] table_header = [html.Thead(html.Tr([html.Th("Row No"), html.Th("Data")]))] rows = [] for i in range(len(head)): row = html.Tr([html.Td(i+1), html.Td(head[i])]) rows.append(row) table_body = [html.Tbody(rows)] table = dbc.Table(table_col+ table_header + table_body, bordered=True, style = common.table_style) div = [common.msg("Selected File: " + value), common.msg("Selected Format: " + format), table, html.Br(), csv_properties_div] elif format == 'jpeg' or format == 'jpg' or format == 'gif': div = [common.msg("Selected File: " + value), common.msg("Selected Format: " + format)] else: div = "Format Not Supported!!" db.put("file", value) db.put("format", format) return div
], style={'height': f'{row_heights[0]}px'}, className='six columns pretty_container', id="indicator-div"), html.Div( children=[ html.Div(children=[ html.Button("Clear All Selections", id='clear-all', className='reset-button'), ]), html.H4([ "Options", ], className="container_title"), html.Table([ html.Col(style={'width': '180'}), html.Col(), html.Col(), html.Tr([ html.Td(html.Div("GPU Acceleration"), className="config-label"), html.Td( html.Div([ daq.DarkThemeProvider( daq.BooleanSwitch( on=True, color='#00cc96', id='gpu-toggle', )), dbc.Tooltip( "Caution: Using CPU compute for more than 50 million points is not recommended.",
style={'height': row_heights[0]}, ), html.Div(children=[ html.Button("Clear All Selections", id='clear-all', className='reset-button'), ]), ], className='six columns pretty_container', id="indicator-div"), html.Div(children=[ html.H4([ "Configuration", ], className="container_title"), html.Table([ html.Col(style={'width': '100px'}), html.Col(), html.Col(), html.Tr([ html.Td(html.Div("GPU"), className="config-label"), html.Td( daq.DarkThemeProvider( daq.BooleanSwitch( on=True, color='#00cc96', id='gpu-toggle', ))), html.Td( html.Button("Reset GPU", id='reset-gpu', style={'width': '100%'})),
style={'display':'inline-block', 'border-style':'solid', 'border-width':2, 'border-color':'rgb(120,120,120)'}), html.Div(id='table-container',children= [ html.Table( [ html.Thead([ html.Tr(html.Th('Parameters',colSpan=2,style={'font-size':13, 'background-color':'rgb(220,220,220)', 'textAlign':'center', 'padding':5})) ], style={'height':'20px'}), html.Colgroup([ html.Col(style={'backgroundColor':'rgb(220,220,220)','width':100}), html.Col(style={'width':100}) ]), html.Tbody([ html.Tr([html.Th('RSI',style=th_style), html.Td(id='rsi-output',style=td_style)]), html.Tr([html.Th('Dose',style=th_style), html.Td(id='dose-output',style=td_style)]), html.Tr([html.Th('RxRSI',style=th_style),html.Td(id='rxdose-output',style=td_style)]), html.Tr([html.Th('GARD (Tx)',style=th_style),html.Td(id='gard-output',style=td_style)]), html.Tr(html.Th('Normal Tissue Doses',style={'textAlign':'center','fontSize':13,'padding':5},colSpan=2)), html.Tr([html.Th('Heart',style=th_style), html.Td(id='heart-dose-output',style=td_style)]), html.Tr([html.Th('Lung',style=th_style), html.Td(id='lung-dose-output',style=td_style)]), html.Tr([html.Th('Esophagus',style=th_style), html.Td(id='esoph-dose-output',style=td_style)]), html.Tr(html.Th('Outcomes',style={'textAlign':'center','fontSize':13,'padding':5},colSpan=2)),
from app import app player_df = pd.read_csv( 'https://raw.githubusercontent.com/JimKing100/NFL-Live/master/data/players_full1.csv' ) player_df = player_df.sort_values(by=['last']) weeks = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] players = player_df['name'].values.tolist() style = {'padding': '1em'} layout = html.Div([ html.Table( [ html.Col(style={'width': '400px'}), html.Col(style={'width': '100px'}), html.Col(style={'width': '400px'}), html.Thead(), # Row 1 - Header html.Tr(), html.Th(dcc.Markdown(""" #### Select a Week """), colSpan='3'), html.Tbody(), # Row 2 - Week html.Tr(), html.Td(), html.Td( dcc.Dropdown(id='week_no',