apache / superset

Apache Superset is a Data Visualization and Data Exploration Platform
https://superset.apache.org/
Apache License 2.0
62.09k stars 13.62k forks source link

URL link to column values #19391

Closed Narendra678 closed 1 year ago

Narendra678 commented 2 years ago

Hi Team,

I have one column with URL values, in superset it is not coming with underline. Please suggest.

Requirement: When click it should open with new tab.

Regards, Naren

srinify commented 2 years ago

Hi @Narendra678 it would be great to get more context before we can call this a bug! The community is missing a lot of context here to be able to help you resolve the issue or begin the investigate the bug!

Please include screenshots / gifs / videos, feel free to anonymize the data, gray sensitive things out, etc.

First things first -- are you enriching the URL values with HTML syntax so the browser can interpret its a URL? Max has an example here: https://images.contentful.com/ykljvmtfxwdz/2VC6yWapWjsK8RzzO95r56/fa525ccf8224639d3d7a09e5d63f608b/calculated.png from this post (https://preset.io/blog/2020-04-15-github-community-dashboard/#summing-up)

Narendra678 commented 2 years ago

Hi Srinify,

Please find below screen. image

raw data is with underline, once click it routs new tab.

Regards, Naren

srinify commented 2 years ago

Hmm sorry now I'm confused -- what's the issue? Is the failure the lack of underline or is the failure the lack of opening the URL when clicked on?

Narendra678 commented 2 years ago

When clicked on that text it should route to that URL.

EG: https://www.google.com/?safe=active&ssui=on

when click on above it should go to google search.

sfirke commented 2 years ago

In a regular table, you can use normal HTML formatting tags like Google and it will be rendered as a link. It appears this is not possible nor will it be supported in pivot tables: https://github.com/apache/superset/issues/16778.

I came here when the HTML link tag was not being rendered. I clicked around in Superset - looked at the edit view of my data source, changed the chart type to a pivot table and back - and for some reason it began rendering as clickable. Not sure what the issue was but can confirm that you can use hyperlinks in the regular "Table" chart in 2.0.0.

Sandy381 commented 1 year ago

+1

rusackas commented 1 year ago

This is not a bug... URLs to not automagically convert themselves to HTML links. In your SQL query, or a calculated column you can SELECT some HTML to make it an actual like, for example SELECT CONCAT('<a href="https://www.github.com/apache/superset/pull/', pr_id, '" target="_github">', pr_id, '</a>') as link.

If this doesn't pan out, please feel free to open a Q&A Discussion here on the repo or join us in #debug-together on Slack

raowaqasakram commented 1 year ago

yes @rusackas is right . I have write an article on this.

https://raowaqasakram.hashnode.dev/url-as-hyperlink-in-apache-superset

PenneyHuang commented 1 year ago

But I have a problem exporting Excel and exported the HTML content. May I know how to solve it

lucasprshepherd commented 8 months ago

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

rusackas commented 8 months ago

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

lucasprshepherd commented 8 months ago

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

rusackas commented 8 months ago

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

Hmm... the two easy workarounds (unless you want to talk about designing/contributing a feature) might be:

1) Use the "Text" (formerly Markdown) dashboard component to provide an index of links/resources 2) Just add a calculated column so that all metric cells provide a link to the same/relevant dashboard.

lucasprshepherd commented 8 months ago

Anyone know if it is possible to add hyperlinks to column names, opposed to values?

Not that I'm aware of, but I'm curious the use case. It might be confusing since people often expect clickable headers to adjust the sorting. This might warrant its own discussion here on Github Discussions.

I am building master dashboard of sorts. It will have various high-level metrics at the monthly granularity (pivot table) and I / my supervisors want each metric to have a link to a more specific dashboard.

Hmm... the two easy workarounds (unless you want to talk about designing/contributing a feature) might be:

  1. Use the "Text" (formerly Markdown) dashboard component to provide an index of links/resources
  2. Just add a calculated column so that all metric cells provide a link to the same/relevant dashboard.

I am currently using option 1, but now that I see that option 2 IS an option, I will definitely float the idea to my team. Thank you!

rusackas commented 8 months ago

Coincidentally, I just saw this old PR that slid under everyone's radar, if you want to take a look at that: https://github.com/apache/superset/pull/22604

lucasprshepherd commented 8 months ago

Coincidentally, I just saw this old PR that slid under everyone's radar, if you want to take a look at that: #22604

That is exactly what I am looking for! Would love to see that feature be implemented.