def card_main_value_based_measures(app): return dbc.Card( dbc.CardBody([ html.H1("Value Based Measures", className="mb-3", style={"font-size": "1.5rem"}), dbc.Tabs([ dbc.Tab(tab_contract_measures(app), label="Contract Measures"), dbc.Tab(tab_additional_measures(app), label="Additional Measures"), ]) ]), style={ "box-shadow": "0 4px 8px 0 rgba(0, 0, 0, 0.05), 0 6px 20px 0 rgba(0, 0, 0, 0.05)", "border": "none", "border-radius": "0.5rem" })
def computation_complete(hidden_data): if not hidden_data: return ui.render_page_content_empty_children() else: data = load_hidden_data(hidden_data) mime = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" mime = "application/octet-stream" with tempfile.NamedTemporaryFile() as tmpf: # df_summary, df_blast, df_haplotyping, path): write_excel(data["summary"], data["blast"], data["haplotyping"], tmpf.name) tmpf.seek(0) xlsx = base64.b64encode(tmpf.read()).decode("utf-8") return [ html.P( children=[ html.A( children=[ html.I(className="fas fa-file-excel ml-2 mr-2"), "Download XLSX", ], # href="data:text/html,<script>alert('hi');</script>", download="hlso_result.xlsx", target="_blank", href="data:%s;base64,%s" % (mime, xlsx), ) ] ), dbc.Tabs( children=[ dbc.Tab(ui.render_tab_summary(data), label="Summary", id="tab-summary"), dbc.Tab(ui.render_tab_blast(data), label="BLAST", id="tab-blast"), dbc.Tab( ui.render_tab_haplotyping(data), label="Haplotyping", id="tab-haplotyping", ), dbc.Tab( ui.render_tab_dendrograms(data), label="Dendrograms", id="tab-dendgrograms", ), ] ), ]
def get_tabs(): return dbc.Col([ dbc.Tabs([ dbc.Tab( get_tab1(), label="Positive Sentiment", tab_style=tab_styles), dbc.Tab( get_tab2(), label="Negative Sentiment", tab_style=tab_styles), dbc.Tab(get_tab3(), label="Recent Sentiment Trends", tab_style=tab_styles), dbc.Tab( get_tab4(), label="Unemployment Rates", tab_style=tab_styles) ]) ], style={ 'padding-left': "15px", 'background-color': '#E1E8ED' }, width=10)
def tools(): return html.Div([ dbc.Tabs( [ dbc.Tab(_poapangenome_tab_content, id=id_poapangenome_tab, label="PangtreeBuild", tab_style={"margin-left": "auto"}, className="tools_tab"), dbc.Tab(_pangviz_tab_content, id=id_pangviz_tab, label="PangtreeVis", label_style={"color": "#00AEF9"}, className="tools_tab"), ], className="nav-justified", id=id_tools_tabs, ) ])
def create_slide_1() -> Div: """Returns overview slide with agenda""" return dbc.Col([ H2("Tabs example", className="mb-4"), dbc.Card([ dbc.CardHeader( dbc.Tabs([ dbc.Tab(label="Tab 1", tab_id="slide1-tab-1"), dbc.Tab(label="Tab 2", tab_id="slide1-tab-2"), dbc.Tab(label="Tab 3", tab_id="slide1-tab-3"), ], id="slide1-tabs", card=True, active_tab="slide1-tab-1")), dbc.CardBody(Loading(id="slide1-tab-content"), className="mt-2") ]), ], width=12, className="p-5")
def TabsFeatures(self): tabs_list = [dbc.Tab(label='temperature', tab_id='temperature-tab'), dbc.Tab(label='apparentTemperature', tab_id='apparentTemperature-tab'), dbc.Tab(label='dewPoint', tab_id='dewPoint-tab'), dbc.Tab(label='humidity', tab_id='humidity-tab'), dbc.Tab(label='pressure', tab_id='pressure-tab'), dbc.Tab(label='windSpeed', tab_id='windSpeed-tab'), dbc.Tab(label='ozone', tab_id='ozone-tab')] return dbc.Tabs(tabs_list, id="grapher-tabs", active_tab="temperature-tab", style={"text-align": "center"})
def col_content_drilldown_bundle(app): return html.Div([ html.Div([ html.Div(card_overview_drilldown_bundle(0.03), style={ "max-height": "100rem", "padding": "1rem" }), html.Div(card_key_driver_drilldown_bundle(app)), ]), html.Div([ dbc.Row([ dbc.Col(html.Div([ html.H2("Performance Drilldown", style={"font-size": "2rem"}), html.H3("check table view for more details...", style={"font-size": "1rem"}), ], style={"padding-left": "2rem"}), width=8), dbc.Col(modal_drilldown_tableview_bundle(), width=4) ]) ], style={ "padding-bottom": "1rem", "padding-top": "2rem" }), html.Div( dbc.Tabs([ dbc.Tab(tab_patient_analysis_bundle(app), label="Patient Analysis", style={"background-color": "#fff"}, tab_style={"font-family": "NotoSans-Condensed"}), dbc.Tab(tab_physician_analysis_bundle(app), label="Physician Analysis", style={"background-color": "#fff"}, tab_style={"font-family": "NotoSans-Condensed"}), ], # id = 'tab_container' ), ) ])
def display_left_col(): x1 = "Separate w/ commas, leave blank for automatic label generation" x2 = "https://cdn.openai.com/API/logo-assets/powered-by-openai-dark.png" return [ html.H4("Tags", style={ "font-weight": "bold", "font-style": "italic" }), dbc.Input( id="label-input", placeholder=x1, type="text", ), html.Br(), html.Div(id="temp-output"), dcc.Slider(id="temp-slider", min=0, max=1, step=0.05, value=0.5), html.H4("Text", style={ "font-weight": "bold", "font-style": "italic" }), dbc.Tabs( [ dbc.Tab(label="Input", id="tab-0"), dbc.Tab(label="Upload", id="tab-1") ], id="input-tabs", active_tab="tab-0", ), html.Div(id="input-content"), dbc.Button("EXTRACT", id="extract-btn", block=True, color="primary", className="mr-1"), html.Br(), html.Img( src=x2, width=260, height=28, ), ]
def gen_header(): return html.Div( id="header", className="header", children=[ html.Div( id="header-text", children=[ html.H5("Generate My Schedule"), html. H6("Input your employee information and get an optimized schedule!" ), ], ), html.Div(id="tab-container", className="tabs", children=[ dbc.Tabs( [ dbc.Tab(label="Optimizer Input", tab_id="tab1", tab_style={"margin-left": "auto"}, className="custom-tabs"), dbc.Tab(label="Schedule Output", tab_id="tab2", label_style={"color": "#00AEF9"}, className="custom-tabs"), ], id="tabs", card=True, active_tab="tab1", ), ]), html.Div( id="header-logo", children=[ html.Img(id="logo", src=app.get_asset_url("panda.png")), ], ), ], )
def router_dash1(router_id): return html.Div([ dcc.Interval(id="update", n_intervals=0, interval=60000), dbc.Tabs(id='dash_tabs' + router_id, active_tab='dash' + router_id, children=[ dbc.Tab(label='Dashboard', tab_id='dash' + router_id, id='dash' + router_id) ]), html.Div(id='dash_contents' + router_id) ])
def get_layout(): return html.Div([ html.Br(), dbc.Container([ html.H2('Orthogonal Projection to Latent Structures'), dbc.Tabs([ dbc.Tab(dbc.Card(dbc.CardBody(get_opls_options_form())), id='opls-options-tab', label='OPLS Options'), dbc.Tab(dbc.Card(dbc.CardBody(get_load_results_form())), id='save-results-tab', label='Load/Export Results'), dbc.Tab(dbc.Card(get_results_form()), id='results-tab', label='Results') ], id='tabs') ]), html.Div('in', id='units-history', style={'display': 'none'}), html.Div(100, id='dpi-history', style={'display': 'none'}) ])
def init_dashboard(server): dash_app = dash.Dash( server=server, routes_pathname_prefix="/", external_stylesheets=[dbc.themes.SUPERHERO], ) dash_app.title = 'Covid-19 Dashboard' #lo Create Layout dash_app.layout = dbc.Container( [ html.H1("USA Covid-19 Dashboard"), html.P(children=['Last updated: ',last_update], style={'text-align': 'right'}), html.Hr(), dbc.Tabs( [ dbc.Tab(label="Overview", tab_id="tab-1"), dbc.Tab(label="Testing", tab_id="tab-3"), dbc.Tab(label="Hospitalizations", tab_id="tab-4"), dbc.Tab(label="Deaths", tab_id="tab-5"), dbc.Tab(label="Vaccination", tab_id="tab-2"), dbc.Tab(label="About", tab_id="tab-6"), ], id = 'tabs', active_tab = 'tab-1', ), html.Div(id="tab-content", className="p-4"), html.Br(), html.Div(id="drop_figure"), ] ) init_callbacks(dash_app) return dash_app.server
def __init__(self): self.dut_config_tab = dbc.Card( dbc.CardBody([ html.P("Configure the DUT", className="card-text"), dbc.Button("Save", id="dut_config_button", color="primary"), dash_table.DataTable(id='adding-rows-table', columns=[{ 'name': [ 'Voltage Source', 'Vmax (Volts)', 'Vmin (Volts', 'Von Delay (ms)' ], 'id': ['vs', 'vmax', 'vmin', 'von_delay'], 'deletable': False, 'renamable': True }], editable=True, row_deletable=True), html.Button('Add Row', id='editing-rows-button', n_clicks=0), ]), className="mt-3", ) self.test_config_tab = dbc.Card( dbc.CardBody([ html.P("This is tab 2!", className="card-text"), dbc.Button("Don't click here", color="danger"), ]), className="mt-3", ) self.tabs = dbc.Tabs([ dbc.Tab(label="1 - Configure DUT", tab_id="dut_config_tab"), dbc.Tab(label="2 - Configure Test", tab_id="test_config_tab"), dbc.Tab(label="3 - Simulate", tab_id="simulate_tab"), dbc.Tab(label="4 - Run Test", tab_id="run_test_tab"), ], id="tabs")
def serve_layout(): global cached_layout if cached_layout is None: logger.debug("Create new layout") try: figures.get_figures(trips, chargings) data_div = html.Div([dcc.RangeSlider( id='date-slider', min=min_millis, max=max_millis, step=step, marks=marks, value=[min_millis, max_millis], ), html.Div([ dbc.Tabs([ dbc.Tab(label="Summary", tab_id="summary", children=[ html.H2(id="consumption", children=figures.info), dcc.Graph(figure=figures.consumption_fig, id="consumption_fig"), dcc.Graph(figure=figures.consumption_fig_by_speed, id="consumption_fig_by_speed"), figures.consumption_graph_by_temp ]), dbc.Tab(label="Trips", tab_id="trips", id="tab_trips", children=[figures.table_fig]), dbc.Tab(label="Battery", tab_id="battery", id="tab_battery", children=[figures.battery_info]), dbc.Tab(label="Charge", tab_id="charge", id="tab_charge", children=[figures.battery_table]), dbc.Tab(label="Map", tab_id="map", children=[ dcc.Graph(figure=figures.trips_map, id="trips_map", style={"height": '90vh'})]), ], id="tabs", active_tab="summary", ), html.Div(id="tab-content", className="p-4"), ])]) except (IndexError, TypeError): logger.debug("Failed to generate figure, there is probably not enough data yet %s", traceback.format_exc()) data_div = ERROR_DIV cached_layout = dbc.Container(fluid=True, children=[html.H1('My car info'), data_div]) return cached_layout
def tab_content(active_tab): if active_tab == 'tab-1': return [ dbc.Tab(label="Количество", tab_id="tab-1", id='count-tab', labelClassName="text-success"), dbc.Tab(label="Рейтинги", tab_id="tab-2", id='rating-tab'), ] elif active_tab == 'tab-2': return [ dbc.Tab( label="Количество", tab_id="tab-1", id='count-tab', ), dbc.Tab(label="Рейтинги", tab_id="tab-2", id='rating-tab', labelClassName="text-success"), ] else: return [ dbc.Tab(label="Количество", tab_id="tab-1", id='count-tab'), dbc.Tab(label="Рейтинги", tab_id="tab-2", id='rating-tab'), ]
def _make_layout(activity: Activity, config: UserConfig = None) -> dash.Dash.layout: fig = make_figure(activity, config) page_content = html.Div([ ConfigForm().make_configuration_modal(activity, config), dcc.Graph(id='activity-main-chart', figure=fig), make_interval_input_group(), make_interval_button_group(), # dcc.Store inside the app that stores the intermediate value dcc.Store( id="current_activity", data=activity.id), # prepare_activity_for_dcc_store(activity)) dcc.Store(id="user_config", storage_type='session', data=config.to_json()) ]) activity_tab = dbc.Card(dbc.CardBody([page_content]), className="mt-3") power_tab = dbc.Card(dbc.CardBody([ html.Div([ dcc.Graph(id='activity-cp-chart', figure=CPPlotter().get_cp_fig(activity)) ]) ]), className="mt-3") tabs = dbc.Tabs([ dbc.Tab(activity_tab, label="Activity", tab_id="Activity"), dbc.Tab(power_tab, label="Power", tab_id="Power"), ], id="activity-tabs", active_tab="Activity") layout = html.Div([ ActivityHeader().make_activity_info_header(activity), tabs, ]) return layout
def tabs(components_holder: ComponentsHolder) -> dbc.Tabs: return dbc.Tabs(id="card-main", card=True, active_tab="tab-world-map", children=[ world_map_content(components_holder.worldmap), world_detail_content(components_holder.world), dbc.Tab( label="World Table", tab_id="tab-world-table", ), countries_content(components_holder.country), ])
def card_for_network_graphs(network_graph): return dbc.Card([ dbc.CardHeader( dbc.Tabs( [ dbc.Tab(label="Study Agent", tab_id="tab-0"), dbc.Tab(label="Reference Agent", tab_id="tab-1"), ], id="card-tabs", card=True, active_tab="tab-0", )), dbc.CardBody( id="card-content", children=[ dcc.Graph( id="interactive_graph", figure=network_graph, ) ], ), ])
def build_tabs(): """ Build the two tabs of the dashboard. - Tab 1: Stream connector. Pull alerts and save them on disk. You can also watch number of alerts per topic received in the previous 5 minutes. - Tab 2: Alert explorer. Display properties of each received alert. Returns --------- html.Div: Div with two chidren. """ return html.Div([ dbc.Tabs( [ dbc.Tab(label="Stream connector", tab_id="tab-1"), dbc.Tab(label="Alert explorer", tab_id="tab-2"), ], id="tabs", active_tab="tab-1", ), html.Div(id="content"), ])
def occupation_details_tab(onetsoc_code): tabs = dbc.Tabs([ dbc.Tab( label="About", className="mx-3", children=[ html.H5(get_occupation_onetsocCode_dict()[onetsoc_code]), html.P(children=[get_occupation_description(onetsoc_code)]), html.H5(children=["Tasks"]), occupation_tasks_content(onetsoc_code), html.H5(children=["Top 5 work activities"]), occupation_activities_content(onetsoc_code) ]), dbc.Tab(label="Qualification", className="mx-3", children=[ html.H5(children=["Education"]), occupation_content(onetsoc_code) ]), dbc.Tab(label="Jobs - coming soon", className="mx-3", disabled=True), ]) return tabs
def page(z): zonel = list(zone.keys()) zoner = ['all'] + zonel if z == 'all' else zone[z] t11 = 'Top: Step_1_Forecast Quantity' t12 = 'X = Ton | Y = Year | Size = Average Transaction Size' t21 = 'Bottom: Step_2_Forecast Price' t22 = 'X = Ton | Y = Price | Size = Number of Transactions' t31 = 'Color: Year' t32 = 'Darker = Newer' return html.Div([ dbc.Tabs([dbc.Tab(label=s, tab_id=s) for s in zoner], id=f'{z}-input'), dbc.Row([ dbc.Col([ html.P(t11, style={ 'font-size': 'small', 'font-weight': 'bold' }), html.P(t12, style={ 'font-size': 'small', 'font-weight': 'bold' }) ]), dbc.Col([ html.P(t21, style={ 'font-size': 'small', 'font-weight': 'bold' }), html.P(t22, style={ 'font-size': 'small', 'font-weight': 'bold' }) ]), dbc.Col([ html.P(t31, style={ 'font-size': 'small', 'font-weight': 'bold' }), html.P(t32, style={ 'font-size': 'small', 'font-weight': 'bold' }) ]) ]), dbc.Row([dbc.Col(id=f'{z}-wdsm')]) ])
def create_layout(app): # load_data() return html.Div( [ html.Div([Header_contract(app, False, False, True, False)], style={"height": "6rem"}, className="sticky-top navbar-expand-lg"), html.A(id="top"), html.Div( [ dbc.Tabs([ dbc.Tab( tab_setup(app), label="Contract Simulation Setup", style={"background-color": "#fff"}, tab_style={"font-family": "NotoSans-Condensed"}), dbc.Tab( tab_result(app), label="Result", style={"background-color": "#fff"}, tab_style={"font-family": "NotoSans-Condensed"}), ], id='bundle-tab-container') ], className="mb-3", style={ "padding-left": "3rem", "padding-right": "3rem" }, ), # hidden div inside the app to store the temp data html.Div(id='bundle-temp-data', style={'display': 'none'}), html.Div(id='bundle-temp-result', style={'display': 'none'}), dcc.Store(id='bundle-store', storage_type='session') ], style={"background-color": "#f5f5f5"}, )
def tabs_zone(self): return dbc.Col([ dbc.Tabs([ dbc.Tab(self.about_tab(), label="About", tab_id='about'), dbc.Tab(self.project_tab(), label="Project", tab_id='project'), dbc.Tab(self.data_tab(), label="Data", tab_id='data', id='data-tab'), dbc.Tab(self.graph_tab(), label="Graph", tab_id='graph', id='graph-tab'), dbc.Tab(self.processing_tab(), label="Processing", tab_id='processing', id='processing-tab') ], active_tab='project'), ], width=4, id='scpy-control-tabs', className='control-tabs')
def main_view(): return dbc.Tabs([ dbc.Tab(tab1_content(), label="Word Distribution"), dbc.Tab(tab2_content(), label="Cost and Rating"), dbc.Tab(tab3_content(), label="Cuisines Distribution"), dbc.Tab(tab4_content(), label="Restaurants Information"), dbc.Tab(tab5_content(), label="Dashboard"), ]) @app.callback(Output("content", "children"), [Input("tabs", "active_tab")]) def switch_tab(at): if at == "tab-1": return tab1_content elif at == "tab-2": return tab2_content elif at == "tab-3": return tab3_content elif at == "tab-4": return tab4_content elif at == "tab-5": return tab5_content return html.P("This shouldn't ever be displayed...")
def equity_component(): """ The main equity panel :return: """ title = "Equity Markets" output_row = dbc.Row( dbc.Tabs(id="equity-tab-selector", active_tab="intraday", children=[ dbc.Tab(label="Intraday", tab_id="intraday", children=[subpanel.intraday_plot()]), dbc.Tab(label="Historical", tab_id="historical", children=[subpanel.historical_plot()]) ])) obj = panel_template(title, output_row) return obj
def get_layout(): return html.Div([ html.Br(), dbc.Container([ html.H2('Principal Component Analysis'), dbc.Tabs([ dbc.Tab(get_pca_options_form(), id='pca-options-tab', label='PCA Options'), dbc.Tab(get_plot_options_form(), id='plot-options-tab', label='Plot Options'), dbc.Tab(get_save_results_form(), id='save-tab', label='Save Results'), dbc.Tab( get_plot_display_form(), id='plot-tab', label='View Plots') ], id='main-tabs') ]), html.Div('in', id='units-history', style={'display': 'none'}), html.Div(100, id='dpi-history', style={'display': 'none'}) ])
def generate_dashboard_tabs(cell,children): if cell: router_id=get_router_id(cell['row']) #print(children) if get_tab_child(router_id) not in children: children.append(dbc.Tab(label='ROUTER '+router_id.replace('_','.'),id=router_id,tab_id=router_id)) return children,router_id else: raise PreventUpdate
def HighlightedSource(py_source, r_source, jl_source, className="px-3"): return dbc.Tabs( [ dbc.Tab( dcc.Markdown(f"```{lang}\n{source}\n```", className="m-3"), label=lang.capitalize(), className="example-source", ) for lang, source in [ ("python", py_source), ("r", r_source), ("julia", jl_source), ] if source is not None ], className=className, )
def wrapper(*args) -> dbc.Tab: rows_of_column_divs = function(*args) return dbc.Tab( label=label, tab_id=f"{tab_id}", children=html.Div( className="container", children=[ html.Div(className="card p-3 text-body", children=[ html.Div(className="row align-text-top", children=row) for row in rows_of_column_divs ]) ]))
def render_schematics_content(): basin_schematic_tabs = [] for code, name in BASINS.items(): basin_schematic_tabs.append(dbc.Tab(label=name, tab_id=code)) return html.Div([ dbc.Tabs(id="schematics-tabs", active_tab='stn', children=basin_schematic_tabs), html.Div( id='schematics-content', children=[html.Div('test')], ) ], style={"width": "100%"})