This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.layout = html.Div([ | |
html.Div(dcc.Graph(id='Graph',figure=fig)), | |
html.Div(className='row', children=[ | |
html.Div([html.H2('Overall Data'), | |
html.P('Num of nodes: ' + str(len(G.nodes))), | |
html.P('Num of edges: ' + str(len(G.edges)))], | |
className='three columns'), | |
html.Div([ | |
html.H2('Selected Data'), | |
html.Div(id='selected-data'), | |
], className='six columns') | |
]) | |
]) | |
@app.callback( | |
Output('selected-data', 'children'), | |
[Input('Graph','selectedData')]) | |
def display_selected_data(selectedData): | |
num_of_nodes = len(selectedData['points']) | |
text = [html.P('Num of nodes selected: '+str(num_of_nodes))] | |
for x in selectedData['points']: | |
material = int(x['text'].split('<br>')[0][10:]) | |
text.append(html.P(str(material))) | |
return text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment