dbc.CardBody([ dcc.Location(id='url', refresh=False), html.Div(id='version', children="Version - 0.1"), html.Br(), html.H3(children='GNPS Task Selection'), dbc.Input(className="mb-3", id='gnps_task', placeholder="Enter GNPS FBMN Task ID"), html.Br(), html.H3(children='Metadata Selection'), dcc.Dropdown(id="metadata_columns", options=[{ "label": "Default", "value": "Default" }], multi=False), html.Br(), html.H3(children='Term Selection'), dcc.Dropdown(id="metadata_terms", options=[{ "label": "Default", "value": "Default" }], multi=True), html.Br(), html.H3(children='Intensity Threshold'), dbc.Input(className="mb-3", id='intensity_threshold', placeholder="Intensity Threshold for Presence/Abscence", value=1000), html.Br(), html.H3(children='Plots'), dcc.Loading( id="upset_plot", children=[html.Div([html.Div(id="loading-output-4")])], type="default", ) ])
import dash_bootstrap_components as dbc import dash_html_components as html # Recall app import app card_camilo = dbc.Card( [ dbc.CardImg(src="/assets/camilo.jpg", top=True), dbc.CardBody([ html.H5("Camilo Gutiérrez Ramírez", className="card-title"), html.P( "Front End Developer", className="card-text", ), dbc.Button( "Contact me", className="mr-1", href="https://www.linkedin.com/in/cagutierrezra/", target="_blank", ), ]), ], style={ "width": "18rem", "textAlign": "center" }, ) card_diana = dbc.Card( [
#defining the quality support sector card_main = dbc.Card( [ dbc.CardBody([ html.Div( de.Lottie(options=options, width="50%", height="50%", url=url)), html.H4( "Check the customer review by our service with free of charge", className="card-title"), html.H6("Response", className="card-subtitle"), html.P( "Give your reaction to our service if you don't mind!", className="card-text", ), dcc.Dropdown(id='user_choice', options=[{ 'label': i, 'value': i } for i in df.overall.unique()], value=5, clearable=False, style={"color": "#000000"}), ]), ], color="success", inverse=True, # change color of text (black or white) outline= False, # True = remove the block colors from the background and header
liste_art=[] for row in total : liste_art.append({'label':row[1],'value': row[0]}) import dash_bootstrap_components as dbc import dash_html_components as html card = dbc.Card( [ dbc.CardImg(src="", top=True), dbc.CardBody( [ html.H4("Card title", className="card-title"), html.P( "Some quick example text to build on the card title and " "make up the bulk of the card's content.", className="card-text", ), dbc.Button("Go somewhere", color="primary"), ] ), ], style={"width": "18rem"}, ) layout = html.Div([ html.H3('Articles'), dcc.Dropdown( id='article-dropdown', options=liste_art ),
value='sch-map', className='checklist-selected-style', ), ), dbc.Collapse(dbc.Card(dbc.CardBody( [ dcc.Dropdown(id='cho-map-drop', options=[ {"label": "Cropland density", "value": 'crop'}, {"label": "Water delivered", "value": 'water'}, {"label": "Energy demand", "value": 'energy'}, ], value='crop', placeholder='Select variable...', clearable=False, style={'marginBottom': '1em'} ), dcc.Dropdown(id='cho-map-filter', options=[ {"label": "Governorate", "value": 'gov'}, {"label": "Water basin", "value": 'basin'}, ], value='crop', placeholder='Filter by...', clearable=False ), ])), id="cho-map-collapse", ), ], className='options'
dbc.CardBody([ html.H4("Background"), html.Hr(), dcc.Markdown( "Early on April 3rd, 2021 approximately 553 million Facebook accounts were leaked online." " Accounts from around the globe are effected in this breach," " along with 32 million from the United States. The dataset includes phone number," " date of birth, first name, last name, location (city, state), email address, employer, and gender" " with varying degrees of completion based on the corresponding Facebook page." ), dcc.Markdown( "In September 2019, [Motherboard](https://www.vice.com/en/article/xgz7bd/facebook-phone-numbers-bot-telegram) reported" " on a Telegram bot that takes a phone number as input and looks the corresponding Facebook profile." " This was discovered as a vulnerability by Facebook, fixing the vulnerability by" " early Aug 2019. The data's legitimacy was also confirmed by Motherboard in the same report." ), dcc.Markdown( "While the exact source of the vulnerability cannot be determined, it is likely tied" " to a [similar vulnerability](https://www.forbes.com/sites/zakdoffman/2019/09/12/new-instagram-hack-exclusive-facebook-confirms-user-accounts-and-phone-numbers-at-risk/?sh=7b2f5b482200)," " first identified by @ZHacker13 (ZH), targeting Instagram account creation and contact syncing." " It should be noted that Facebook owns Instagram." " ZH notified Facebook of the vulnerability in early August 2019 and Facebook confirmed" " the existence of the vulnerability but deemed it low risk. A month later Facebook changed" " their stance, deeming it a serious security flaw. At the time, it seemed there" " had been no serious data leakage due to the vulnerability." ), dcc.Markdown( "Alon Gal, a respected figure head in the Twitter Security Community," " posted [screen shots](https://twitter.com/UnderTheBreach/status/1349671417625931778?ref_src=twsrc%5Etfw%7Ctwcamp%5Etweetembed%7Ctwterm%5E1349671417625931778%7Ctwgr%5E%7Ctwcon%5Es1_c10&ref_url=https%3A%2F%2Fwww.theverge.com%2F2021%2F1%2F25%2F22249571%2Ffacebook-phone-number-hack-telegram-bot)" " in early January 2021 detailing a breach of approximately 553 million Facebook accounts" " with similar fields that were extracted in the Instagram vulnerability." "Now, the previously 553 million payment protected" " records are available for free. The accompanying data revolves only around the 32 million US accounts." ) ])
'https://codepen.io/chriddyp/pen/bWLwgP.css', dbc.themes.DARKLY] SESSION_ID = 0 app = dash.Dash(__name__, external_stylesheets=external_stylesheets) app.title = "DIF" card1 = dbc.Card( [ dbc.CardImg(id='img1', top=True), dbc.CardBody([ dbc.Row(html.P(id='filename-1'), justify="center"), dbc.Button('DELETE', color="danger", size='lg', id="button1", n_clicks=0,) ]), ], style={"width": "auto"}, ) card2 = dbc.Card( [ dbc.CardImg(id='img2', top=True), dbc.CardBody([ dbc.Row(html.P(id='filename-2'), justify="center"), dbc.Button('DELETE',
dbc.CardBody([ dbc.Col([ dbc.Row([ dbc.Col([ dcc.Graph(id='context_minj_graph', style={ "height": "300px", "width": "auto", 'margin': 5, 'border': '1px solid', 'border-radius': 0, 'border-color': 'rgb(51,102,204,1)' }), ]), dbc.Col([ dcc.Graph(id='top_crimes', style={ "height": "300px", "width": "auto", 'margin': 5, 'border': '1px solid', 'border-radius': 0, 'border-color': 'rgb(51,102,204,1)' }), ]), ]), dcc.Graph(id='parallel_graph', style={ "height": "400px", "width": "auto", 'margin': 5, 'border': '1px solid', 'border-radius': 0, 'border-color': 'rgb(51,102,204,1)' }) ]) ]),
className="font-xl inline-block padding8") ], className="font-xl inline-block padding8"), ]) ], className="top8 text-center") collase_buttons = html.Div([ dbc.Button("Customize", color="primary", id="collapse-button", className="mr-1 bold font-md"), dbc.Collapse(dbc.Card( dbc.CardBody([ city_values("Select your location: "), get_div_children( "Set Indoor temperature and humidity for higher precision."), ])), className="top32", id="collapse", is_open=False), ], className="boxed font-md") # Starting the structure of the APP app.layout = html.Div([ navbar, ex.GeolocatorComponent(id="Geolocator"), html.Div(id="GeoOut"), # Container with the content dbc.Container([
import dash_bootstrap_components as dbc from dash.dependencies import Input, Output card = dbc.Card( [ dbc.CardHeader( dbc.Tabs( [ dbc.Tab(label="Tab 1", tab_id="tab-1"), dbc.Tab(label="Tab 2", tab_id="tab-2"), ], id="card-tabs", card=True, active_tab="tab-1", ) ), dbc.CardBody(dbc.CardText(id="card-content")), ] ) @app.callback( Output("card-content", "children"), [Input("card-tabs", "active_tab")] ) def tab_content(active_tab): return "This is tab {}".format(active_tab)
def cargar_contenido_reporte_individual(escuelas, cct): """ Función que carga el contenido de un reporte individual. Args: escuelas (:obj: `OrderedDict`): diccionario ordenado con los datos de las escuelas del reporte. cct (str): cct de la escuela a generar el reporte individual. Returns: Layout del reporte individual para mostrarlo en la plantilla del reporte. """ # Gráficas del reporte scatterplot = GeneradorDeGraficas.generar_scatterplot( {cct: escuelas[cct]}, show_legend=False, title=u"Proyección de matrícula de %s" % (cct)) boxplot = GeneradorDeGraficas.generar_boxplot( {cct: escuelas[cct]}, show_legend=False, title=u"Medidas de tendencia central (matrícula)") tabla_metricas = GeneradorDeGraficas.generar_tabla_metricas( {cct: escuelas[cct]}, links_requeridos=False) tabla_matricula = GeneradorDeGraficas.generar_tabla_matricula( {cct: escuelas[cct]}, links_requeridos=False) correlograma_acf = GeneradorDeGraficas.generar_correlograma( escuelas[cct]['matricula'], cct=cct, es_acf=True) # Nota (26/01/2021): # El cálculo del PACF implica tener control sobre el número de lags que tiene # la serie de tiempo. Se comentó el siguiente bloque de código para evitar # errores de ejecución. """ correlograma_pacf = GeneradorDeGraficas.generar_correlograma( escuelas[cct]['matricula'], cct = cct, es_acf = False ) """ mapa = GeneradorDeGraficas.generar_mapa({cct: escuelas[cct]}, titulo=u'Ubicación de %s' % (cct)) # Crear layout de la página layout_reporte_individual = dbc.Container( [ # Renglón de las tarjetas dbc.Row( [ # Layout del nombre de la escuela dbc.Col(dbc.Card(dbc.CardBody( dbc.Container( dbc.Row([ dbc.Col([ html.H6(u"Nombre de la escuela", className="card-title", style={"font-weight": "bold"}), html.P(escuelas[cct]["nombre"], className="card-text") ], width=10, style={ "margin": "0", "padding": "0" }), dbc.Col( html.I(className="fas fa-user-circle"), width=2, style={ "margin": "0", "padding": "0", "margin-top": "auto", "margin-bottom": "auto", "font-size": "2rem" }, className="d-flex justify-content-center") ]))), style={"margin-top": "1rem"}), md=3), # Layout de la clave del centro de trabajo dbc.Col(dbc.Card(dbc.CardBody( dbc.Container( dbc.Row([ dbc.Col([ html.H6(u"Clave del centro de trabajo", className="card-title", style={"font-weight": "bold"}), html.P(cct, className="card-text") ], width=10, style={ "margin": "0", "padding": "0" }), dbc.Col( html.I(className="fas fa-graduation-cap"), width=2, style={ "margin": "0", "padding": "0", "margin-top": "auto", "margin-bottom": "auto", "font-size": "2rem" }, className="d-flex justify-content-center") ]))), style={"margin-top": "1rem"}), md=4), # Layout del municipio dbc.Col(dbc.Card(dbc.CardBody( dbc.Container( dbc.Row([ dbc.Col([ html.H6(u"Municipio", className="card-title", style={"font-weight": "bold"}), html.P(escuelas[cct]["mun"], className="card-text") ], width=10, style={ "margin": "0", "padding": "0" }), dbc.Col( html.I(className="fas fa-map-marker-alt"), width=2, style={ "margin": "0", "padding": "0", "margin-top": "auto", "margin-bottom": "auto", "font-size": "2rem" }, className="d-flex justify-content-center") ]))), style={"margin-top": "1rem"}), md=3), # Layout del nivel dbc.Col(dbc.Card(dbc.CardBody( dbc.Container( dbc.Row([ dbc.Col([ html.H6(u"Nivel", className="card-title", style={"font-weight": "bold"}), html.P(escuelas[cct]["nivel"], className="card-text") ], width=10, style={ "margin": "0", "padding": "0" }), dbc.Col( html.I(className="fas fa-book-reader"), width=2, style={ "margin": "0", "padding": "0", "margin-top": "auto", "margin-bottom": "auto", "font-size": "2rem" }, className="d-flex justify-content-center") ]))), style={"margin-top": "1rem"}), md=2) ], ), # Renglón del scatterplot dbc.Row( dbc.Col([ dcc.Graph(figure=scatterplot), html.P(u"* Proyección realizada utilizando %s" % (METODOS[escuelas[cct]['metodo']]), className="text-secondary", style={ "font-size": "0.5rem", "margin": "0 0 0 4rem", "padding": "0" }), html.P(u"* Fuente: estadística 911", className="text-secondary", style={ "font-size": "0.5rem", "margin": "0 0 0 4rem", "padding": "0" }) ], md=12)), # Renglón del boxplot y el mapa dbc.Row([ # Layout del boxplot dbc.Col(dcc.Graph(figure=boxplot), md=6), # Layout del mapa dbc.Col([dcc.Graph(figure=mapa)], md=6) ]), # Renglón con el correlograma dbc.Row(dbc.Col(dcc.Graph(figure=correlograma_acf), md=12)), # Renglón de las tablas de métricas y matrícula dbc.Row( [ # Layout de la tabla de matrícula dbc.Col( [ dbc.Container( dbc.Row([ html.H4(u"Matrícula por ciclo escolar"), dbc.Button( [ u"Descargar csv ", html.I( className= "far fa-arrow-alt-circle-down") ], color="info", style={ "padding": "0.2rem", "margin": "0 0.2rem 0.2rem 0.2rem", "background": "#1199EE" }, id={ 'type': 'boton-descargar-csv-individual', 'index': cct }), Download( id={ 'type': 'descargar-csv-individual', 'index': cct }) ])), tabla_matricula ], md=6, ), # Layout de la tabla de métricas dbc.Col( [ html.H4(u"Métricas de la proyección"), tabla_metricas ], md=6, ) ], ) ], # Estilos del layout general style={"background": "#FFFFFF"}, fluid=True) return layout_reporte_individual
dbc.CardBody( [ dbc.FormGroup( [ dbc.Label("Временной период", style={'text-align': 'center', 'font-size': '100%', 'font-family': 'Proxima Nova Regular', 'text-transform': 'uppercase'}), dcc.Slider( id='slider-day', min=1, max=100, step=10, value=100, marks={i: i for i in slider_day_values} ), ], style={'text-align': 'center'} ), dbc.FormGroup( [ dbc.Label("Количество пивоварен", style={'text-align': 'center', 'font-size': '100%', 'font-family': 'Proxima Nova Regular', 'text-transform': 'uppercase', }), dcc.Slider( id='slider-top-breweries', min=5, max=200, step=5, value=200, marks={i: i for i in slider_top_breweries_values} ), ], style={'text-align': 'center'} ), ], )
tempCardBody = [] options = [] for var_id in df_vars[df_vars['group_id'] == gr]['var_id']: options.append({ 'label': ' ' + list(df_vars[df_vars['var_id'] == str(var_id)]['label'])[0], 'value': str(var_id) }) tempCardBody.append( dbc.CardBody([ dcc.RadioItems(id=f"stats_checklist_{gr}", options=options, value="", style={"font-size": "small"}), html.Div(id=f"stats_checklist_{gr}_output", style={'display': 'none'}) ], style={ 'height': '200px', 'overflowY': 'auto' })) cardBody.insert(gr, tempCardBody) def make_item(i): # we use this function to make the example items to avoid code duplication return dbc.Card([ dbc.CardHeader( html.H6( dbc.Button( list(df_vars[df_vars['group_id'] == i]['group'].unique())
dbc.CardBody( [ dbc.FormGroup( [ dbc.Label("Company Id"), dbc.Input( type='text', id="company", ), ] ), dbc.FormGroup( [ dbc.Label("Job Type"), dcc.Dropdown( options=[{"label": col, "value": col} for col in list(set(train_df['jobType']))], id="jobtype", ), ] ), dbc.FormGroup( [ dbc.Label("Degree"), dcc.Dropdown( options=[{"label": col, "value": col} for col in list(set(train_df['degree']))], id="degree", ), ] ), dbc.FormGroup( [ dbc.Label("major"), dcc.Dropdown( options=[{"label": col, "value": col} for col in list(set(train_df['major']))], id="major", ), ] ), dbc.FormGroup( [ dbc.Label("industry"), dcc.Dropdown( options=[{"label": col, "value": col} for col in list(set(train_df['industry']))], id="industry", ), ] ), dbc.FormGroup( [ dbc.Label("Required Years of Experience"), dbc.Input( type='number', id="yoe", ), ] ), dbc.FormGroup( [ dbc.Label("Miles from Metropolis"), dbc.Input( type='number', id="distance", ), ] ), dbc.Button("Submit", outline=True, color="primary", className="mr-1", n_clicks=0, id='submit-button'), html.Div(id="number-output"), ], style={"marginTop": 0, "marginBottom": 0}, ),
dbc.Collapse(dbc.CardBody( html.Div([ html.Label("Database"), dcc.Dropdown( id="amcs_database_dropdown", clearable=False, ), html.Br(), html.Label("Collection"), dcc.Dropdown( id="amcs_collection_dropdown", clearable=False, ), html.Br(), html.Label("Field"), html.Br(), dcc.Input(id="amcs_field_input", value="{}"), html.Br(), html.Br(), html.Label("Projections"), html.Br(), dcc.Input(id="amcs_projections_input", value="{}"), html.Br(), html.Br(), html.Label("Limit"), html.Br(), dcc.Input(id="amcs_limit_input", type="number", value=0), html.Br(), html.Br(), html.Label("Skip"), html.Br(), dcc.Input(id="amcs_skip_input", type="number", value=0), html.Br(), html.Br(), dbc.Button("Generate Graph", id="amcs_generate_button"), ], ), ),
Survey_Response_Topics = [ dbc.CardHeader(html.H5("Survey Response Topics")), dbc.CardBody( [ dcc.Graph(id='Class Frequency', figure={ 'data': [ dict(name='Class Frequency', x=classes, y=class_counts, type='bar') ], 'layout': dict( yaxis={'title': '% Survey Responses'}, margin={ 'l': 80, 'b': 80, 't': 30, 'r': 60 }, hovermode='closest', ) }), ], style={ "marginTop": 0, "marginBottom": 0 }, ), ]
], ), ], brand="Option App", brand_href="#", sticky="top", ) KeyLog = dbc.Card( dbc.CardBody([ html.H4('Eikon key', className="card-title"), dbc.Row([ dbc.Col( dbc.Input(id='input-box0', placeholder='Enter a key...', type='text', size=180, value='b62c1ab67f2d457980440a42dbe099dd868d6a29')), dbc.Col(dbc.Button('Submit', id='button0', color="primary")), ]), dbc.Col(html.P(id='output-container-key', children='Enter a Chain')) ], className="w-80 mb-1"), color="dark", inverse=True, # style={"w": "120rem", # "b":"15rem"}, style={ "height": "140px", "width": "770px" }, )
],className='col-12'), ],style={'height':'0px'}), html.Div( dcc.Slider(min=0,max=no_days,step=1,value=no_days, id='date_slider',updatemode='mouseup',marks=slider_marks, className='pl-0') ,className='position-relative',style={'left':'3vw','bottom':'-2vh', 'width':'94vw', 'height':'0px'}), dbc.Card([ dbc.CardHeader( html.H2("", id='stat_card_header', className='m-0', style={'color':'#508caf'}) ,style={'backgroundColor': 'rgba(255,255,255,0.5)'}), dbc.CardBody([ html.H4("",id='lbl_cases',style={'color':'#666666'}), html.Pre('', id='lbl_cases_per_capita', style={'color':'#666666'}), html.H4('',id='lbl_deaths',style={'color':'#666666'}), html.Pre('', id='lbl_deaths_rate', className='m-0', style={'color':'#666666'}), ],style={'backgroundColor': 'rgba(255,255,255,0.5)','padding':'10px 5px 10px 20px'}) ], style={'backgroundColor': 'rgba(255,255,255,0.5)','left':'3vw','top':'-25vh','width':'242px'}), ], fluid=True, id='map_section', style={'height':'90vh'}) timeline_section=dbc.Container([ dbc.Card([ dbc.CardHeader([ html.H4('TIMELINE', className='d-inline' ), dbc.Button(html.I('info', className='material-icons md-24 logoColor'),color='link',id='info1', className='float-right p-0'), dbc.Modal([ dbc.ModalHeader("INFORMATION"), dbc.ModalBody([
import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output, State fade = html.Div([ dbc.Button("Toggle fade", id="fade-button", className="mb-3"), dbc.Fade( dbc.Card( dbc.CardBody( html.P("This content fades in and out", className="card-text"))), id="fade", is_in=True, appear=False, ), ]) @app.callback( Output("fade", "is_in"), [Input("fade-button", "n_clicks")], [State("fade", "is_in")], ) def toggle_fade(n, is_in): if not n: # Button has never been clicked return True return not is_in
def tab3content(): content = html.Div([ html.Center(html.H2("Portfolio")), #API key text are and button dbc.Row([ dbc.Col([],width=1), dbc.Col( [dbc.Input(id="apiField", placeholder="API KEY", type="text")], width=5 ), dbc.Col( [dbc.Button("Enter API", id="apiButton")], width=1 ) ]), #Meta card: # Displays API key used (when valid entered), total sell value, total buy value dbc.Spinner([ dbc.Card([ dbc.CardBody([ dbc.Col([], id="valid_api_div", style={'font-size': '16px'}), dbc.Col([], id="total-out", style={'font-size': '16px'}) ]) ], outline=True), ]), html.Br(), html.Div( id = "personal-div", style={'display':'none'}, children = [ dbc.CardDeck([ dbc.Card([ dbc.CardBody( id='personal-kits', className= 'card-text', children=[dbc.Label("")], )], style={"min-width": "870px"}, color="success", outline=True ), dbc.Card([ dbc.CardBody( id='personal-dyes', children=[dbc.Label("")], )], style={"min-width": "700px"}, color="success", outline=True ) ], ) ] ), #Invalid key toast dbc.Toast( "Check your key", id="invalid-toast", className="mb-0", header="Invalid API key", is_open=False, dismissable=True, icon="danger", style={"position": "fixed", "top": 66, "right": 10, "width": 350}, duration=3000, ) ]) return content
def create_gene_browser_layout(gene): gene_int, gene_id, gene_name = standardize_gene(gene) if gene_int is None: return None first_row = dbc.Row([ dbc.Col([ dbc.Jumbotron([ html.H1(gene_name, id='gene_name'), html.P(gene_int, id='gene_int', hidden=True), dcc.Markdown(id='gene_contents', children=get_gene_info_markdown(gene_int)) ], className='p-4 m-0 h-100') ], width=12, lg=6), dbc.Col([ dbc.Card([ dbc.CardHeader('Gene - Cell Type Box Plot'), dbc.CardBody([ dbc.Form([ dbc.FormGroup([ dbc.Label('Select Cell Type Level', className='mr-3'), dcc.Dropdown(id='box-plot-level-dropdown', options=[{ 'label': 'CellClass', 'value': 'CellClass' }, { 'label': 'MajorType', 'value': 'MajorType' }, { 'label': 'SubType', 'value': 'SubType' }], value='MajorType', clearable=False, style={'width': '250px'}) ]) ], inline=True), dcc.Loading([ dcc.Graph(id='gene-box-plot', config={'displayModeBar': False}) ]) ]) ], className='h-100') ], width=12, lg=6) ], className='w-100') control_form = dbc.Form([ dbc.FormGroup([ dbc.Label('Coordinates', html_for='coords-dropdown'), dcc.Dropdown(id='coords-dropdown', options=[{ 'label': name, 'value': name } for name in dataset.coord_names], value='L1UMAP', clearable=False), dbc.FormText('Coordinates of both scatter plots.') ]), dbc.FormGroup([ dbc.Label('Cell Metadata', html_for="cell-meta-dropdown"), dcc.Dropdown(options=[{ 'label': VAR_NAME_MAP[name], 'value': name } for name in CONTINUOUS_VAR + CATEGORICAL_VAR], value='MajorType', id="cell-meta-dropdown", clearable=False), dbc.FormText('Color of the left scatter plot.') ]), html.Hr(className='my-2'), dbc.FormGroup([ dbc.Label('Gene Body mC Type', html_for='mc-type-dropdown'), dcc.Dropdown(id='mc-type-dropdown', options=[{ 'label': 'Norm. mCH / CH', 'value': 'CHN' }, { 'label': 'Norm. mCG / CG', 'value': 'CGN' }], value='CHN', clearable=False), dbc.FormText( 'Color of the right scatter plot, ' 'using per cell normalized mCH or mCG fraction of the gene body.' ) ]), dbc.FormGroup([ dbc.Label('Gene Color Scale', html_for='mc-range-slider'), dcc.RangeSlider(min=0, max=3, step=0.1, marks={ 0: '0', 0.5: '0.5', 1: '1', 1.5: '1.5', 2: '2', 2.5: '2.5', 3: '3' }, value=[0.5, 1.5], id='mc-range-slider', className="dcc_control"), dbc.FormText('Color scale of the right scatter plot.') ]), html.Hr(className='my-2'), dcc.Markdown(id='gene-browser-pair-scatter-markdown') ]) second_row = dbc.Row([ dbc.Col([ dbc.Card([ dbc.CardHeader('Scatter Control'), dbc.CardBody([control_form]) ], className='h-100') ], width=12, xl=2), dbc.Col([ dbc.Card([ dbc.CardHeader('Cell Metadata Scatter'), dbc.CardBody([ dcc.Loading([ dcc.Graph(id='cell-meta-scatter-plot', style={ "height": "65vh", "width": "auto" }) ]), ]) ], className='h-100') ], width=12, xl=5), dbc.Col([ dbc.Card([ dbc.CardHeader('Gene Scatter'), dbc.CardBody([ dcc.Loading([ dcc.Graph(id='gene-scatter-plot', style={ "height": "65vh", "width": "auto" }) ]) ]) ], className='h-100') ], width=12, xl=5) ], className='my-4') clusters_with_track = [ c for c in dataset.cell_type_table.index if c in dataset.cell_type_to_annoj_track_id ] cell_counts = dataset.get_variables('MajorType').value_counts().to_dict() cell_counts.update( dataset.get_variables('SubType').value_counts().to_dict()) third_row = dbc.Card( [ dbc.CardHeader('Genome Browser'), dbc.CardBody([ dbc.Row([ dbc.Col([ html.H5('View Genome Tracks in The AnnoJ Browser', className='card-title'), html. P('Control the browser layout and active tracks below, ' 'then click the button on the right to view the AnnoJ browser' ) ]), dbc.Col( [ dbc.Button('Update Browser Here', id='update-browser', className='mx-5'), dbc.Button( 'Open In A New Tab', id='whole-page-link', target= '_blank', # open whole page in a new browser tab ) ], className='h-100 p-3 m-auto') ]), html.Hr(className='mb-2'), dbc.Row([ dbc.Col([ dbc.Form([ dbc.FormGroup([ dbc.Label('Track mC Type'), dcc.Dropdown(id='browser-mc-type-dropdown', options=[{ 'label': 'mCH / CH', 'value': 'CH' }, { 'label': 'mCG / CG', 'value': 'CG' }, { 'label': 'Coverage', 'value': 'cov' }], value='CH', clearable=False), dbc.FormText('Display mCH or mCG tracks of ' 'each selected cell type.') ]) ]) ], width=12, lg=2), dbc.Col([ dbc.Form([ dbc.FormGroup([ dbc.Label('Browser Layout'), dbc.Checklist( id='browser-layout-checklist', options=[{ 'label': 'Color By Cell Type', 'value': 'cell_type_color' }, { 'label': 'Hide Sidebar', 'value': 'sidebar' }, { 'label': 'Hide Toolbar', 'value': 'toolbar' }], value=['cell_type_color', 'sidebar']) ]) ]) ], width=12, lg=2), dbc.Col([ dbc.Row([ dbc.Form([ dbc.FormGroup([ dbc.Label('Select Tracks'), dcc.Dropdown( id='cell-type-track-dropdown', options=[{ 'label': f'{ct} ({cell_counts[ct]} cells)', 'value': ct } for ct in clusters_with_track], multi=True, value=[], ), dbc.FormText( 'Select tracks to view their methylation ' 'level around this gene.') ]) ], className='w-100') ]), dbc.Collapse(dbc.Row([ html. P('Warning: Loading too many tracks will be quite slow.', className='text-danger my-auto') ], className='my-3'), id='too-much-tracks'), dbc.Row([ html.H6('Load multiple MajorType tracks:', className='my-auto'), dbc.ButtonGroup([ dbc.Button( f'ALL ({CELL_TYPE_COUNTS["MajorType"]})', id='btn-major-tracks'), dbc.Button(f'Exc ({CELL_TYPE_COUNTS["Exc"]})', id='btn-major-exc-tracks'), dbc.Button(f'Inh ({CELL_TYPE_COUNTS["Inh"]})', id='btn-major-inh-tracks'), dbc.Button( f'NonN ({CELL_TYPE_COUNTS["NonN"]})', id='btn-major-non-tracks'), ], size='sm', className='align-middle ml-4') ]), dbc.Row([ html.H6('Load multiple SubType tracks:', className='my-auto'), dbc.ButtonGroup([ dbc.Button( f'Exc ({CELL_TYPE_COUNTS["Sub-Exc"]})', id='btn-sub-exc-tracks'), dbc.Button( f'Inh ({CELL_TYPE_COUNTS["Sub-Inh"]})', id='btn-sub-inh-tracks'), dbc.Button( f'NonN ({CELL_TYPE_COUNTS["Sub-NonN"]})', id='btn-sub-non-tracks'), ], size='sm', className='align-middle mx-4') ], className='my-3') ], width=12, lg=8) ], form=True), html.P('', id='iframe-url', hidden=True), dbc.Collapse([ html.Hr(className='mb-3'), html.Iframe(id='annoj-iframe', style={ 'width': '100%', 'height': '85vh' }) ], className='w-100 m-0 p-0', id='browser_collapse') ]) ], className='mt-4', style={'margin-bottom': '300px'}) layout = html.Div(children=[ # first row is gene info and violin plot first_row, # second row is control panel and gene scatter second_row, # third row is annoj browser control third_row ]) return layout
opts=opts) return 'Real-Time Analysis is over.' ################################## CODEBLOCK ################################## ################################## DASHBOARD ################################## O = {} O['T,0,0'] = dcc.Graph(figure=fig) O['T,0,1'] = dcc.Markdown(description) O['T,1,0'] = None O['T,1,1'] = None C = { } # color code : primary, secondary, info, success, warning, danger, light, dark C['T,0,0'] = [ dbc.Card([dbc.CardHeader('Linkedin List'), dbc.CardBody(O['T,0,0'])], color='light', inverse=False, outline=True) ] C['T,0,1'] = [ dbc.Card([dbc.CardHeader('T,0,1'), dbc.CardBody(O['T,0,1'])], color='light', inverse=False, outline=True) ] C['T,1,0'] = [ dbc.Card([dbc.CardHeader('T,1,0'), dbc.CardBody(O['T,1,0'])], color='light',
#app = dash.Dash(__name__, external_stylesheets=external_stylesheets) tab5 = dbc.Card( dbc.CardBody([ html.Div([ dbc.Container([ dbc.Row( [dbc.Col(html.H1("WMG Student Data"), className="mb-2")]), dbc.Row([ dbc.Col(dbc.Card(html.H3( children="Postgraduate Research | PGR", className="text-center text-light bg-primary"), body=True, color="primary"), className="mb-4") ]), dbc.Row([ dbc.Col(html.H5("Total PGR Students including PhD"), className="mb-4") ]), html.Label("◆ Select the calculated method:"), dcc.Dropdown(id="c-m6", options=[dict(label=i, value=i) for i in methods], value="by Headcount"), html.Div([dcc.Graph(id="research")]), #graph4 dcc.Graph(id="Pgry", figure=Pgry) ]) ]) ])) @app.callback(Output("research", "figure"), [Input("c-m6", "value")])
) ), ] ) cards = html.Div( [ html.H2("Cards"), dbc.CardDeck( [ dbc.Card( [ dbc.CardHeader("Header"), dbc.CardBody( [ dbc.CardTitle("This card has a title"), dbc.CardText("And some text"), ] ), ] ), dbc.Card( [ dbc.CardBody( [ dbc.CardTitle("This card has a title"), dbc.CardText("and some text, but no header"), ] ) ], outline=True, color="primary",
return np.array(indices_str, dtype=float) def largest_connected_component(mask): labels, _ = ndimage.label(mask) sizes = np.bincount(labels.ravel())[1:] return labels == (np.argmax(sizes) + 1) t2 = time() print("initial calculations", t2 - t1) # ------------- Define App Layout --------------------------------------------------- axial_card = dbc.Card([ dbc.CardHeader("Axial view of the lung"), dbc.CardBody([slicer1.graph, slicer1.slider, *slicer1.stores]), dbc.CardFooter([ html.H6([ "Step 1: Draw a rough outline that encompasses all ground glass occlusions across ", html.Span( "all axial slices", id="tooltip-target-1", className="tooltip-target", ), ".", ]), dbc.Tooltip( "Use the slider to scroll vertically through the image and look for the ground glass occlusions.", target="tooltip-target-1", ), ]),
import dash_bootstrap_components as dbc import dash_html_components as html from dash.dependencies import Input, Output, State fade = html.Div([ dbc.Button("Toggle fade", id="fade-button", className="mb-3"), dbc.Fade( dbc.Card(dbc.CardBody(dbc.CardText("This content fades in and out"))), id="fade", is_in=True, appear=False, ), ]) @app.callback( Output("fade", "is_in"), [Input("fade-button", "n_clicks")], [State("fade", "is_in")], ) def toggle_fade(n, is_in): if not n: # Button has never been clicked return True return not is_in
# Mitigation Risk Sliders (4) quarantine = make_slider("Quarantine", "Q_slider", "Q_slider_value", 0, 1, 0.05, 0.55) social_distance = make_slider("Social Distancing", "SD_slider", "SD_slider_value", 0, 1, 0.05, 0.65) mask_compliance = make_slider("Mask Compliance", "MC_slider", "MC_slider_value", 0, 1, 0.05, 0.75) hygiene_maint = make_slider("Hygiene Maintenance", "HM_slider", "HM_slider_value", 0, 1, 0.05, 0.60) vacc_effect = make_slider("Vaccine Effectiveness", "Vacc_slider", "Vacc_slider_value", 0, 1, 0.05, 1) # Mitigation Strategies Tab mitigation_tab = dbc.Card([ dbc.CardBody([ html.Div([quarantine, html.Div(id='quarantine_container')]), html.Div([social_distance, html.Div(id='social_distance_container')]), html.Div([mask_compliance, html.Div(id='mask_compliance_container')]), html.Div([hygiene_maint, html.Div(id='hygiene_maint_container')]), html.Div([vacc_effect, html.Div(id='vacc_effect_container')]), ], className="mt-1", id="mitigation_tab", ) ]) #Location Risk Sliders (9) genstore = make_slider("General Store", "gs_slider", "gs_slider_value", 0, 1, 0.1, 0.6) transport = make_slider("Transportation", "t_slider", "t_slider_value", 0, 1, 0.1, 0.8) school = make_slider("School", "sch_slider", "sch_slider_value", 0, 1, 0.1, 0.9) parksandrec = make_slider("Parks and Recreation", "pnr_slider", "pnr_slider_value", 0, 1, 0.1, 0.2) services = make_slider("Services", "serv_slider", "serv_slider_value", 0, 1, 0.1, 0.2) entertainment = make_slider("Entertainment", "ent_slider", "ent_slider_value", 0, 1, 0.1, 0.8) health = make_slider("Health", "health_slider", "health_slider_value", 0, 1, 0.1, 0.9) placeofworship = make_slider("Place of Worship", "poworship_slider", "poworship_slider_value", 0, 1, 0.1, 0.8)
# Load the dash bootstrap template app = dash.Dash(__name__) app.title = 'Domain Specific - NeMo ASR app NEW' navbar = dbc.NavbarSimple( brand="Domain Specific - NeMo ASR Application", sticky="top", light=True, ) # Cards declarations INSTRUCT = ([ dbc.CardBody([ html.P("""This NeMo Automatic Speech Recognition (ASR) Application enables you to train or fine-tune pre-trained (acoustic and language) ASR models with your own data. Through the steps below, we empower you to create and evaluate (on-prem) your own ASR models built on your domain specific audio data. Now you can progressively create better performing ASR models specifically built for your data."""), ], ), ]) # Data Preparation PREP_DATA = ([ dbc.CardHeader( html.H4("Step 0. Download and Preparation of Models and Datasets")), dbc.CardBody([ html. P("Download pre-trained models and pre-process the data for the example use-case." ), html.P( html.A([dbc.Button("Notebook: Preparation", color="primary")], href=get_ip(0),
# gene card dbc.Card( dbc.CardBody( [ dbc.CardImg(src=GENE_BROWSER_IMG_URL, top=True), html.H5("Gene", className="card-title m-3"), html.P(GENE_BROWSER_TEXT, className="card-text mx-3"), dbc.Row( [ dbc.Col([ dcc.Dropdown( id='gene-dropdown', placeholder='Input a gene name, e.g. Cux2', className='mr-3') ], width=10), dbc.Col( [ html.A(dbc.Button("GO", color="success"), id='gene-url', href='gene?gene=Cux2') ], width=10, lg=2 # width is 2 only on large screen ) ], className='m-3', no_gutters=True), ], className='p-0 d-flex flex-column')), # brain region card dbc.Card(
dbc.CardBody([ dbc.FormGroup([ dbc.Label("Deposit size (£ ,000)"), dbc.Input(id="deposit-size", type="number"), ]), dbc.FormGroup([ dbc.Label("Purchase price (£ ,000)"), dbc.Input(id="purchase-price", type="number"), ]), dbc.FormGroup([ dbc.Label("Offer term (years): "), dcc.Slider( id="offer-term", value=3, marks={i: f"{i}" for i in range(0, 6)}, step=1, min=0, max=5, ), ]), dbc.FormGroup([ dbc.Label("Mortgage term (years): "), dcc.Slider( id="mortgage-term", value=20, marks={i: f"{i}" for i in range(5, 41, 5)}, step=1, min=5, max=40, ), ]), dbc.FormGroup([ dbc.Label("Initial interest rate (%): "), dbc.Input( id="initial-interest-rate", value=1.05, type="number", min=0, max=100, step=0.01, ), ]), dbc.FormGroup([ dbc.Label("Interest rate (%): "), dbc.Input( id="interest-rate", value=3.00, type="number", min=0, max=100, step=0.01, ), ]), ]),