Hello,
In the code below, is it possible to change the href behaviour to opening the URL in a new browser window/tab?
import altair as alt
from vega_datasets import data
from urllib.parse import urlencode
def make_google_query(name):
return "https://www.google.com/search?" + urlencode({'q': '"{0}"'.format(name)})
cars = data.cars()
cars['url'] = cars['Name'].apply(make_google_query)
alt.Chart(cars).mark_circle(size=60).encode(
x='Horsepower',
y='Miles_per_Gallon',
color='Origin',
href='url',
tooltip=['Name', 'url']
)
No, there's no way to do this, unfortumately. See https://github.com/vega/vega-lite/issues/3795
Most helpful comment
No, there's no way to do this, unfortumately. See https://github.com/vega/vega-lite/issues/3795