Adding URL links in table charts
Asked Answered
I

2

11

We have a Superset table that displays data based on an SQL query. Currently, all the data is rendered in HTML div/span tags.

We need to open a link in a new tab on click of one of the columns. If we send the raw link in anchor tag, it displays <a href={{link}}></a>, because the superset code wraps all the contents in a div/span tag.

Is there any way this can be done?

Indre answered 17/12, 2018 at 6:49 Comment(0)
S
9

As far as superset use df.to_html to render the pandas data frames to Html on Dahsoborads Explore Tabs, you can use HTML tags and other on your queries. For example, I developed this simple query that generates a simple table of charts with CSV download links. Check This out:

  1. Write The query like this:

enter image description here

  1. Try to explore it(click on the explore button!):

enter image description here

Saskatoon answered 6/1, 2020 at 11:29 Comment(4)
@Mahesh I did this on superset 0.34! what is your problem rendering HTML or wrong url?Saskatoon
I wrote query to get a string like this <a href="google.com">Google</a> and when used in table, it is showing the actual string but not as url. I am on version 0.999.0 devFawcett
Try to explore it! I will edit my answer that may help youSaskatoon
Thankyou it works. Initially I created a chart and edited my query and that dint work. When I create the query from SQLLab and explore it works!! Not sure what was the difference. Will explore sometime and update the answer here.Fawcett
F
-2

As far as I know, you can't. All visualization on superset is based on d3. You might want to look for custom visualizations on their site.

Flagellum answered 26/7, 2019 at 5:21 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.