jimmybow / visdcc

Dash Core Components for Visualization.
MIT License
144 stars 18 forks source link

Is_click is limited and cannot render a hyperlink #7

Closed PujanMotiwala closed 5 years ago

PujanMotiwala commented 5 years ago

The render() method cannot be set in the given package. I would like to see more features of Ant.design on the table front of the package which are not working properly.

jimmybow commented 5 years ago

maybe you can use webbrowser to open hyperlink

app.layout = html.Div([
    html.Button('click', id = 'button'),
    html.Div(id = 'result')
])

@app.callback(
    Output('result', 'children'),
    [Input('button', 'n_clicks')])
def update_figure(n_clicks):
    if n_clicks: webbrowser.open('http://yahoo.com', new=0, autoraise=True)

if __name__ == '__main__':
    app.run_server(debug=True)
jimmybow commented 5 years ago

webbrowser.open() only work on the server ... @@

jimmybow commented 5 years ago

the component is update, using visdcc.Run_js to run your javascript https://github.com/jimmybow/visdcc/blob/master/example/Run_js/Open_url_on_new_window.py