✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🐇 Announcing Dash VTK for 3d simulation graphics. Check out the March webinar.

Open url when a point on a graph is clicked

What I am trying to do is basically the same as in the issue here: Open url in new tab when chart is clicked on, but instead of using JavaScript I would like to do this using Python inside of a Dash app. Has anyone gotten something like this to work in Python?

1 Like

I don’t think this is possible with the existing components. dcc.Location can be used to edit the existing page’s location but it can’t be used to create a new tab. Your options are:
Option 1 - Create your own component that wraps window.open (https://dash.plot.ly/plugins)
Option 2 - Embed the page you want to open as an html.Iframe and update the src property of that Iframe whenever the dcc.Graph.clickData property changes
Option 3 - Fork the dcc.Graph component and add a custom click handler

1 Like

Option 4 - Add text annotations to points of interest: Time series plot with links to points of interest

1 Like

Has this been added in the meantime?

it has not, but it’s still a good idea!