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

How to render a list returned from callback output

$
0
0

Callback Output returns a list of strings. The question is how to render each element of the list in a different row, for example in dbc.Card:

dbc.Card(
    dbc.ListGroup(
        [
            dbc.ListGroupItem("Item 1"),
            dbc.ListGroupItem("Item 2"),
            dbc.ListGroupItem("Item 3"),
        ],
        flush=True,
    ),
    style={"width": "18rem"},
)

The callback looks like this one:

@app.callback(
    Output('hover-data', 'children'),
    Input('crossfilter-teams-scatter', 'hoverData'))
def display_hover_data(hoverData):
	t1 = hoverData.get('points')[0].get('hovertext')
	t1 = t1.split(',')
	
	return t1

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 6271

Latest Images

Trending Articles



Latest Images