Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with link in label #4947

Open
humtn opened this issue Dec 18, 2024 · 1 comment
Open

issue with link in label #4947

humtn opened this issue Dec 18, 2024 · 1 comment
Labels
bug something broken P3 backlog

Comments

@humtn
Copy link

humtn commented Dec 18, 2024

Hi all,

I am doing a sankey plot and I'd like each of my nodes to have a label that can be clickable and redirects to some link.

fig = go.Figure( 
        data=[
            go.Sankey(
                arrangement='fixed',
                node=dict(label=labels, color=label_colors),
                link=dict(
                    source=links["source"],
                    target=links["target"],
                    value=links["value"],
                    color=links["link_c"],
                ),
            )
        ]
    )

However, when exporting the plotly file to html, the link tag appears but the href doesnt, but when further inspecting it appears in "data-unformatted" part of the code below:

<text class="node-label" style="cursor: default; font-family: Helvetica; font-size: 12px; fill: rgb(42, 63, 95); fill-opacity: 1; white-space: pre; pointer-events: all; text-shadow: white 1px 1px 1px, white -1px -1px 1px, white 1px -1px 1px, white -1px 1px 1px;" data-notex="1" data-unformatted="<a href='google.com'>test</a>" data-math="N" x="0" y="0" text-anchor="start" transform="translate(23.25,4.449999999999999)"><a style="cursor:pointer">test</a></text>

Is there any way I can get this to work (I'd want <a href='google.com'>test</a> instead of the <a style="cursor:pointer">test</a>)

Thanks!

@gvwilson
Copy link
Contributor

Thanks for the bug report @humtn. We won't be able to put anyone on this for quite some time, but for "how-to" questions and workarounds, you can post in our community forum https://community.plotly.com/. Thank you - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug something broken P3 backlog
Projects
None yet
Development

No branches or pull requests

2 participants