I’m new to Dash - I am working on quite a simple graph visualisation project.
I am having issues in passing the callback to an html.A() call: the correct url is printed but the hyperlink is not, in fact the home page is kept as the redirecting address. I have tried to both leave the
href field blank and to use the
id name like in the snippet below.
Here is a snippet of my code to exemplify it:
html.Label(['Figure/Data: ', html.A(href='url', id='url', target="_blank")]) @app.callback( dash.dependencies.Output('url', 'children'), [dash.dependencies.Input('my-graph', 'clickData')]) def display_link_data(clickData): try: text = clickData['points']['hovertext'].split('<br>') link = text[-1].split(': ')[-1] except: link='/' return json.dumps(link, indent=2)
My question is how to have the returned callback value used in the
href= input of the
Thanks in advance for the help!