Altair: href opening new browser window/tab

Created on 15 Aug 2019  路  1Comment  路  Source: altair-viz/altair

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']
)
question

Most helpful comment

No, there's no way to do this, unfortumately. See https://github.com/vega/vega-lite/issues/3795

>All comments

No, there's no way to do this, unfortumately. See https://github.com/vega/vega-lite/issues/3795

Was this page helpful?
0 / 5 - 0 ratings

Related issues

floringogianu picture floringogianu  路  3Comments

DentonGentry picture DentonGentry  路  3Comments

LukeMathWalker picture LukeMathWalker  路  3Comments

bmcfee picture bmcfee  路  3Comments

dzonimn picture dzonimn  路  3Comments