예제 #1
0
def update_header_menu(library, children, _, layout_children):
    """Updates the header menu with buttons for adding and removing fields."""
    selected_library = library
    selected_input = dash.callback_context.triggered[0]['value']
    if selected_input in model.get_registered_libraries():
        layout_children[2]['props']['children']  = []
        add_field_button = visuals.generate_add_field_button()
        remove_field_button = visuals.generate_remove_field_button()
        add_row_button = visuals.generate_add_row_button()
        remove_row_button = visuals.generate_remove_row_button()
        children = [children[0], add_field_button, remove_field_button,
                   add_row_button, remove_row_button]
        layout_children[1]['props']['className'] = 'dynamic-header-menu-container2'
        return [layout_children, children, json.dumps(selected_library)]    
    layout_children[1]['props']['className'] = 'dynamic-header-menu-container1'
    children=[children[0]]
    return [layout_children, children, json.dumps(selected_library)]
예제 #2
0
             children="Analyze the performance of rocm math libraries",
             className="header-description",
         ),
     ],
     className="header",
 ),
               style={'background-color': '#262b2f'},
               fluid=True),
 html.Div(dbc.Row(id='dynamic-header-menu-container',
                  children=[
                      html.Div(dcc.Dropdown(
                          id='libraries-dropdown',
                          options=[{
                              'label': i,
                              'value': i
                          } for i in model.get_registered_libraries()],
                          placeholder='Select Library',
                          clearable=False,
                          className='library-dropdown'),
                               id='library-id'),
                  ],
                  no_gutters=True),
          className='dynamic-header-menu-container1'),
 html.Div(id={
     'type': 'dynamic-menu-output-container',
     'index': 1
 },
          children=[],
          className='menu-rows-container'),
 html.Div(
     id='intermediate-library-value', style={'display': 'none'}