def download_btn_pack(): """Button group for selecting type of download""" kwargs = {"outline": True, "color": "dark", "size": "lg"} img_btn = custom_button( text="image", icon_classname="far fa-file-image fa-lg", tooltip="Download csdf of all spectra lines", id="download-img", active=True, **kwargs, ) csdf_btn = custom_button( text="csdf", icon_classname="far fa-file-archive fa-lg", tooltip="Download csdf of all spectra lines", id="download-csdf", **kwargs, ) html_btn = custom_button( text="html", icon_classname="far fa-file-code fa-lg", tooltip="Download plot as interactive html file", id="download-html", **kwargs, ) return html.Div(dbc.ButtonGroup([img_btn, csdf_btn, html_btn]), className="center")
def get_nav_buttons(prev_icon, prev_url, next_icon, next_url, page_no): buttons = [] if prev_icon: buttons.append( dcc.Link(dbc.Button(html.Span(className=f"oi {prev_icon}", title="Prev"), outline=True, color="light", size="sm"), id="prev-page", href=prev_url)) if page_no: buttons.append( html.Div(f"{page_no}/11", style={ "padding-left": "4px", "padding-right": "4px", "padding-top": "2px" })) if next_icon: buttons.append( dcc.Link(dbc.Button(html.Span(className=f"oi {next_icon}", title="Next"), outline=True, color="primary", size="sm"), id="next-page", href=next_url)) return dbc.ButtonGroup(buttons) if len(buttons) > 0 else ""
def get_body(client="", project=''): page = html.Div( [ header("Hoofdpagina FttX"), dbc.Jumbotron( [ html.H1("FttX", className="display-3"), html.Hr(className="my-2"), html.P(""" Op deze pagina komt een totaal overzicht voor de verschillende projecten binnen FttX. Gebruik de knoppen hier onder om naar specifieke projecten te gaan. """), html.P(dbc.ButtonGroup([ dbc.Button(page_config['name'], href=page_config['link'][0], style={'background-color': colors['vwt_blue']}) for page_id, page_config in config_pages.items() if "/" not in page_config['link'] ], size="lg"), className="lead"), ] ) ], id="mainContainer", style={"display": "flex", "flex-direction": "column"}, ) return page
def get_selected_layer_buttons(): button_group_style = {"padding": "4px", "width": "90%", "margin": "auto"} button_group = dbc.ButtonGroup( [ dbc.Button( "Voter precincts", id="precinct-button", active=True, className="mr-1", color="light", outline=True, ), dbc.Button( "Neighborhoods / Municipalities", id="neighborhood-button", className="mr-1", color="light", outline=True, ), dbc.Button( "ZIP Codes", id="zip-button", className="mr-1", color="light", outline=True, ), ], size="md", # className="mr-1", id="select-layer", style=button_group_style, ) return button_group
def get_links(sTicker: STicker, moneycontrol_url): return dbc.ButtonGroup([ dbc.Button("Company", color="link", href=sTicker.get_company_link(), external_link=True, className='fas fa-link'), dbc.Button("Screener", color="link", href=sTicker.get_screener_link(), external_link=True, className='fas fa-link'), dbc.Button("Moneycontrol", color="link", href=moneycontrol_url, external_link=True, className='fas fa-link'), dbc.Button(["NSE"], color="link", href=sTicker.get_nse_link(), external_link=True, className='fas fa-link'), dbc.Button("BSE", color="link", href=sTicker.get_bse_link(), external_link=True, className='fas fa-link') ])
def add_arrow_buttons(level): """adds two buttons intended to drive the display of the intensities on the left side in both z-directions""" return dbc.ButtonGroup([ dbc.Button('\u25B2', id='{}-cranial'.format(level), size='sm'), dbc.Button('\u25BC', id='{}-ventral'.format(level), size='sm') ])
def graph_tool_pack(): """Normalize to one and spectral decompose buttons""" kwargs = dict( outline=True, color="dark", style={"zIndex": 0}, size="md", ) normalize_button = custom_switch( # text="Normalize", icon_classname="fas fa-arrows-alt-v", id="normalize_amp", # size="sm", tooltip="Scale maximum amplitude to one.", **kwargs, ) decompose_button = custom_switch( # text="Decompose", icon_classname="fac fa-decompose", id="decompose", # size="sm", tooltip="Decompose spectrum from individual spin systems.", **kwargs, ) return dbc.ButtonGroup([normalize_button, decompose_button])
def getButtonGroup(): buttonGroup = dbc.ButtonGroup([ dbc.Button("Short Intro", id="intro", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("The Monologue", id="mon", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("About the Data", id="dat", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("The ML Model", id="mod", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("Visualization Dashboard", id="viz", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("The Good Side", id="gd", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("The Dark Side", id="bd", size="lg", outline=True, color="dark", className="mr-1"), dbc.Button("Final Note", id="cnc", size="lg", outline=True, color="dark", className="mr-1"), ], vertical=True, style={ "margin-top": "10%", "width": "90%" }) return buttonGroup
def __create_button_groups(self): button_groups = dbc.ButtonGroup( [ dbc.Button("Total", active=True, id="rp_btn_total"), dbc.Button("New", id="rp_btn_new"), ], size="md", className="mr-1", ) return button_groups
def __create_button_groups(self): button_groups = dbc.ButtonGroup( [ dbc.Button("Confirmed", active=True, id="wm_confirmed"), dbc.Button("Death", id="wm_death"), dbc.Button("Recovered", id="wm_recovered"), ], size="md", className="mr-1", ) return button_groups
def __init__(self): global app self.url = dcc.Location(id="url") self.icons = [ 'fa fa-home fa-1x', 'fa fa-cog fa-1x', 'fa fa-tachometer-alt fa-1x', 'fa fa-file fa-1x', ] self.icon_text = ['Home', 'Settings', 'Score', 'Info'] self.formated_icons = self.format_icons() self.nav1 = dbc.ButtonGroup(self.formated_icons[:-1], vertical=True) self.nav2 = dbc.ButtonGroup(self.formated_icons[-1], vertical=True) self.layout = dbc.Nav(className="navbar bg-dark", style={ 'width': '4rem', 'height': '98vh', 'padding': "0" }, vertical=True, pills=True, children=[self.nav1, self.nav2]) self.layout_insitu = html.Div( className="", style={'height': '100vh'}, children=[ self.url, dbc.Col([ dbc.Row( dbc.Nav(className="navbar bg-dark", style={ 'width': '100%', 'height': '2vh' })), dbc.Row([ self.layout, dbc.Col(id='page-content', style={'padding': '0'}) ]) ]) ])
def time_buttons(): return html.Div([ dbc.ButtonGroup([ dbc.Button("24h", id="1d"), dbc.Button("7d", id="7d"), dbc.Button("14d", id="14d"), dbc.Button("30d", id="30d", active=True), dbc.Button("90d", id="90d"), dbc.Button("180d", id="180d"), dbc.Button("360d", id="360d"), ]) ])
def make_interval_button_group(self): button_group = dbc.ButtonGroup( [ dbc.Button(btn.create_interval.name, id=btn.create_interval.id, n_clicks=0, className="btn btn-primary"), dbc.Button(btn.find_intervals.name, id=btn.find_intervals.id, n_clicks=0, className="btn btn-primary"), dbc.Button(btn.delete_intervals.name, id=btn.delete_intervals.id, n_clicks=0, className="btn btn-primary") ], size="sm", className="mr-1", ) return button_group
def get_social_links(data: dict): buttons = [] if data['links']['twitter_screen_name'] != "": buttons += [ dbc.Button( 'twitter', href= f"https://twitter.com/{data['links']['twitter_screen_name']}", className='fab fa-twitter', style={"backgroundColor": '#1C9CEA'}) ] if data['links']['facebook_username'] != "": buttons += [ dbc.Button( 'facebook', href= f"https://facebook.com/{data['links']['facebook_username']}", className='fab fa-facebook', style={'backgroundColor': '#3F64AB'}) ] if data['links']['subreddit_url'] != "": buttons += [ dbc.Button('reddit', href=data['links']['subreddit_url'], className='fab fa-reddit', style={'backgroundColor': '#F54300'}) ] if data['links']['chat_url'][0] != "": buttons += [ dbc.Button('discord', href=data['links']['chat_url'][0], className='fab fa-discord', style={'backgroundColor': '#7289DA'}) ] if data['links']['telegram_channel_identifier'] != "": buttons += [ dbc.Button( 'telegram', href= f"https://t.me/{data['links']['telegram_channel_identifier']}", className='fab fa-telegram-plane', style={"backgroundColor": '#30A5D7'}) ] if data['links']['announcement_url'][0] != "": buttons += [ dbc.Button('medium', href=data['links']['announcement_url'][0], className='fab fa-medium', style={'backgroundColor': '#000000'}) ] return dbc.ButtonGroup(children=buttons)
def get_extra_buttons() -> dbc.ButtonGroup: return dbc.ButtonGroup([ dbc.Button( 'Dodaj wiersz', id='button-add-row', color='info', ), dbc.Button( 'Importuj .csv', id='button-import', color='info', outline=True, ), ])
def make_item(available_indicators, top_4): ''' Function to create the Accordion to click to show/hide the dropdown menù of the countries ''' return dbc.Card([ dbc.CardHeader( dbc.Button("Hide/Show Bar", color="primary", id="temp_prova_accordion", block=True, active=True), ), dbc.Collapse( dbc.CardBody([ html.Div([ dbc.ButtonGroup([ dbc.Button( "World Map", href="#worldMap", external_link=True), dbc.Button("World Stats", href="#worldStats", external_link=True), dbc.Button("Countries Stats", href="#countriesStats", external_link=True), ], ), ], className='text-center d-md-none'), html.H4(children='Add or remove countries to compare', style={}, className='text-center my-2'), dcc.Dropdown( id='demo-dropdown', options=[{ 'label': i, 'value': i } for i in available_indicators], multi=True, value=top_4, placeholder= 'Select countries to plot - Default to top 4 countries by confirmed cases' ), ], className="py-1"), id="temp_prova_collapse", ), ], className="my-2 shadow", style={"overflow": "visible"})
def get_links(data: dict): return dbc.ButtonGroup([ dbc.Button('Description', id='description-modal-open', className="fas fa-expand-alt"), dbc.DropdownMenu([ dbc.DropdownMenuItem(urlparse(explorer).netloc, href=explorer) for explorer in data['links']['blockchain_site'] if explorer != "" ], label="Explorers"), dbc.DropdownMenu([ dbc.DropdownMenuItem(repo, href=repo) for repo in data['links']['repos_url']['github'] if repo != "" ], label="Github Repos") ])
def getLayout(): layout = \ dbc.Container([ html.H3("Distribution of messages over time", className="mb-2 p-2"), dbc.Row([ dbc.ButtonGroup([ dbc.Col([ dbc.DropdownMenu([ dbc.DropdownMenuItem("Days", id="report-dropdownlist-days"), dbc.DropdownMenuItem("Weeks", id="report-dropdownlist-weeks"), dbc.DropdownMenuItem("Years", id="report-dropdownlist-years"), dbc.DropdownMenuItem("All-time", id="report-dropdownlist-all"), ], id="report-dropdownlist'", label="Graphing Mode", color="primary", bs_size="lg", direction="right", className="mr-3 pr-2 mb-1"), html.Div( dbc.Button( "Generate Plot", size="lg", color="primary", id="report-msgsOverTimeGraph-generate", ), hidden=True, ) ], width=3, className="mr-0 mt-1"), ], size="lg", vertical=True), ], justify="between", no_gutters=True, className="mb-3"), dbc.Row( dbc.Col([ dcc.Graph( id="report-msgsOverTimeGraph-plot", config={"displaylogo": False, 'modeBarButtonsToRemove': ['pan2d', 'lasso2d'], "editable": True}, className="mt-1" ), ]), no_gutters=True ) ], className="mt-3 pt-3" ) return layout
def draw_words(dataframe): """Card with most relevant words for each topic""" return dbc.Card([ dbc.CardBody([ html.H4('Most important words for each topic'), ]), dbc.ButtonGroup([ dbc.Button('Topic 1', id='btn-0', outline=True, color="success"), dbc.Button('Topic 2', id='btn-1', outline=True, color="success"), dbc.Button('Topic 3', id='btn-2', outline=True, color="success"), dbc.Button('Topic 4', id='btn-3', outline=True, color="success"), dbc.Button('Topic 5', id='btn-4', outline=True, color="success") ]), dbc.CardBody([ dcc.Graph(id='top_words') ]) ])
def buttons(): """Static user interface buttons""" kwargs = {"outline": True, "color": "dark", "size": "md"} sim = custom_button( text="Sim", icon_classname="fac fa-spectrum fa-lg", id="sim-button", tooltip="Simulate spectrum with current parameters", **kwargs ) fit = custom_button( text="Fit", icon_classname="fac fa-chi-squared fa-lg", id="fit-button", tooltip="Run a least-squared fitting analysis", **kwargs ) return dbc.ButtonGroup([sim, fit])
def render(self): default_hostname = data["base_url"] return html.Div( style=dict(display="flex", justifyContent="flex-start", alignItems="center"), children=[ html.P( "Yarn Host", style=dict(height="30px", width="100px", margin="10px"), ), dcc.Input( style=dict(width="700px"), id="yarn-hostname", type="text", debounce=True, value=default_hostname, ), dbc.Alert( id="hostname-alert", is_open=False, style=dict(margin="15px"), color="danger", ), dbc.ButtonGroup( id="host-accept-buttons", style=dict(margin="10px", display="block"), children=[ dbc.Button( "✓", outline=True, color="success", id="host-confirm-btn", ), dbc.Button( "✕", outline=True, color="danger", id="host-reject-btn", ), ], ), ], )
def country_buttons(): """Generates the country buttons for the layout TODO(@[email protected]) Fix to use this one instead of the dropdown menu Returns: dbcButtonGroup -- A button group of all countries """ countries = [{'label': '🇸🇪 Sweden', 'value': 'Sweden' }, { 'label': '🇫🇮 Finland', 'value': 'Finland' }, { 'label': '🇳🇴 Norway', 'value': 'Norway' }, { 'label': '🇩🇰 Denmark', 'value': 'Denmark' }, { 'label': '🇮🇸 Iceland', 'value': 'Iceland' }] button_style = { 'padding': '.25rem .5rem', 'font-size': '10px', 'line-height': '1', 'border-radius': '10px', 'height': '25px', 'align-items': 'center', 'justify-content': 'center', } buttons = [] for country in countries: buttons.append(dbc.Button( country['label'], id=country['value'], style=button_style)) return dbc.ButtonGroup(buttons, id="country_buttons")
def create_btn_grid(disable_all=False, disable_sample=True): btn1 = dbc.Button("All models", id='btn-all', color='info', outline=True, n_clicks=0, disabled=disable_all) btn2 = dbc.Button("Random samples", id='btn-sample', color='info', outline=True, n_clicks=0, disabled=disable_sample) group = dbc.ButtonGroup([btn1, btn2], size='sm', id='btn-group-grid', vertical=True) return group
def header(): """Report title""" kwargs = {"outline": True, "color": "dark", "size": "md"} report_btn = custom_button( text="Full Report", icon_classname="fas fa-file-pdf fa-lg", id="download-fit-report-btn", tooltip="Download the full fit report as a pdf", **kwargs, ) values_btn = custom_button( text="Values", icon_classname="fas fa-file-download fa-lg", id="download-fit-values-btn", tooltip="Download the full fit report as a pdf", **kwargs, ) return html.Div( children=dbc.ButtonGroup([report_btn, values_btn]), className="card-header", )
def make_interval_button_group(): button_group = dbc.ButtonGroup( [ dbc.Button('Create Interval', id='create_interval', n_clicks=0, className="btn btn-primary"), dbc.Button('Find Intervals', id='find_intervals', n_clicks=0, className="btn btn-primary"), dbc.Button('Delete Intervals', id='delete_intervals', n_clicks=0, className="btn btn-primary") ], size="sm", className="mr-1", ) return button_group
def card_download(data): """ Card containing a button to download object data """ pdf = extract_properties(data, ['i:objectId']) objectid = pdf['i:objectId'].values[0] card = dbc.Card([ dbc.ButtonGroup([ dbc.Button(html.A('Download Object Data', id="download-link", download="{}.csv".format(objectid), href=generate_download_link(data), target="_blank", style={"color": "white"}), id='download', target="_blank", href="") ]) ], className="mt-3", body=True) return card
def create_buttons(self): rows = [] for number in range(7, -2, -1): row = dbc.Row( [ dbc.ButtonGroup( [ dbc.Button( f"{number}", color="info", className="mr-2"), dbc.Button("STOP", id=self.get_id(f'stop_{number}'), color="success", className="mr-1"), dbc.Button("UP", id=self.get_id(f'up_{number}'), color="success", className="mr-1"), dbc.Button("DOWN", id=self.get_id(f'down_{number}'), color="success", className="mr-1") ], # size="sm", className="mr-1", ) ], className="m-2", justify='center') rows.append(row) return dbc.Container(rows, style={ "margin": "auto", "borderStyle": "solid", "border-radius": "5px", "maxWidth": "280px", "backgroundColor": "#DFDEDC" })
def graph_zone(self): graph_selector = dbc.ButtonGroup([], ) config = { 'scrollZoom': True, 'doubleClick': 'reset', 'displayModeBar': False, 'displaylogo': False } graph = dcc.Loading( dcc.Graph( id='graph', config=config, responsive=True, ), type='circle', ) return dbc.Col( dbc.Collapse([ graph, graph_selector, ], id='show-graph'), )
def create_btn_gen_scatter(disable_cluster=True, disable_view=False, disable_like=False): btn1 = dbc.Button("Clusters", id='btn-cluster', color='info', outline=True, n_clicks=0, disabled=disable_cluster) btn2 = dbc.Button("Views", id='btn-view', color='info', outline=True, n_clicks=0, disabled=disable_view) btn3 = dbc.Button("Likes", id='btn-like', color='info', outline=True, n_clicks=0, disabled=disable_like) group = dbc.ButtonGroup([btn1, btn2, btn3], size='sm', id='btn-group-gen') return group
dbc.CardBody([ dcc.Graph( id="graph", figure=fig, config={"modeBarButtonsToAdd": ["drawrect", "eraseshape"]}, ) ]), dbc.CardFooter([ dcc.Markdown( "To annotate the above image, select an appropriate label on the right and then draw a " "rectangle with your cursor around the area of the image you wish to annotate.\n\n" "**Choose a different image to annotate**:"), dbc.ButtonGroup( [ dbc.Button("Previous image", id="previous", outline=True), dbc.Button("Next image", id="next", outline=True), ], size="lg", style={"width": "100%"}, ), ]), ], ) annotated_data_card = dbc.Card( [ dbc.CardHeader(html.H2("Annotated data")), dbc.CardBody([ dbc.Row(dbc.Col(html.H3("Coordinates of annotations"))), dbc.Row( dbc.Col([ dash_table.DataTable(