Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Stylize markdown using a callback function

$
0
0

Hi

I am trying to stylize markdown using a callback.

I want the output to be in bold. However, when I run this code I get it like this

import dash
import dash_html_components as html
import dash_core_components as dcc
from datetime import datetime as dt

# initialize the application
app = dash.Dash()

# define the layout of the app
app.layout = html.Div([

    # add a date range selector
    dcc.DatePickerRange(
        id = 'my-date-picker-range',
        min_date_allowed = dt(2010,1,4),
        max_date_allowed = dt(2020, 12, 31),
        initial_visible_month = dt(2020, 5, 23)
    ),

    html.Div(id = 'output-container-date-picker-range'),
])

@app.callback(
    dash.dependencies.Output('output-container-date-picker-range', 'children'),
    [dash.dependencies.Input('my-date-picker-range', 'start_date'),
     dash.dependencies.Input('my-date-picker-range', 'end_date')])
def update_output_div(start_date, end_date):
    return f"**This report covers the time period spanning {start_date} to {end_date}**"

app.run_server(debug = False)

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images