10

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?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Chirag
  • 101
  • 1
  • 6

2 Answers2

7

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

Hossein Torabi
  • 694
  • 1
  • 7
  • 18
  • @Mahesh I did this on superset 0.34! what is your problem rendering HTML or wrong url? – Hossein Torabi May 13 '20 at 21:23
  • I wrote query to get a string like this Google and when used in table, it is showing the actual string but not as url. I am on version 0.999.0 dev – Mahesh May 17 '20 at 14:13
  • Try to explore it! I will edit my answer that may help you – Hossein Torabi May 17 '20 at 15:28
  • 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. – Mahesh May 29 '20 at 06:42
-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.

TylerH
  • 20,799
  • 66
  • 75
  • 101