<i id='PP9UU'><tr id='PP9UU'><dt id='PP9UU'><q id='PP9UU'><span id='PP9UU'><b id='PP9UU'><form id='PP9UU'><ins id='PP9UU'></ins><ul id='PP9UU'></ul><sub id='PP9UU'></sub></form><legend id='PP9UU'></legend><bdo id='PP9UU'><pre id='PP9UU'><center id='PP9UU'></center></pre></bdo></b><th id='PP9UU'></th></span></q></dt></tr></i><div id='PP9UU'><tfoot id='PP9UU'></tfoot><dl id='PP9UU'><fieldset id='PP9UU'></fieldset></dl></div>

        <small id='PP9UU'></small><noframes id='PP9UU'>

          <bdo id='PP9UU'></bdo><ul id='PP9UU'></ul>

        <legend id='PP9UU'><style id='PP9UU'><dir id='PP9UU'><q id='PP9UU'></q></dir></style></legend>

      1. <tfoot id='PP9UU'></tfoot>
      2. Plotly:带有“href"的树形图元素不工作

        时间:2023-09-28
      3. <tfoot id='0BUy4'></tfoot>

        <small id='0BUy4'></small><noframes id='0BUy4'>

            <tbody id='0BUy4'></tbody>

          • <bdo id='0BUy4'></bdo><ul id='0BUy4'></ul>
            <legend id='0BUy4'><style id='0BUy4'><dir id='0BUy4'><q id='0BUy4'></q></dir></style></legend>

                <i id='0BUy4'><tr id='0BUy4'><dt id='0BUy4'><q id='0BUy4'><span id='0BUy4'><b id='0BUy4'><form id='0BUy4'><ins id='0BUy4'></ins><ul id='0BUy4'></ul><sub id='0BUy4'></sub></form><legend id='0BUy4'></legend><bdo id='0BUy4'><pre id='0BUy4'><center id='0BUy4'></center></pre></bdo></b><th id='0BUy4'></th></span></q></dt></tr></i><div id='0BUy4'><tfoot id='0BUy4'></tfoot><dl id='0BUy4'><fieldset id='0BUy4'></fieldset></dl></div>

                  本文介绍了Plotly:带有“href"的树形图元素不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  I have simple table whin href link inside the text. But clicking on it doesn't open the page. is there any easy way to do that?

                  import plotly.express as px
                  df = px.data.gapminder().query("year == 2007")
                  
                  link_ref = '<a xlink:href="http://google.com" style="cursor: pointer" target="_blank" rel="noopener noreferrer">{}</a>'
                  df['country'] = df['country'].apply(lambda item: link_ref.format(item, "{}"))
                  
                  fig = px.treemap(df, path=[ 'continent', 'country'], values='pop',
                                    color='lifeExp', hover_data=['iso_alpha'])
                  fig.show()
                  

                  解决方案

                  You just need to get rid of xlink: The following should work

                  import plotly.express as px
                  df = px.data.gapminder().query("year == 2007")
                  
                  link_ref = '<a href="http://google.com" style="cursor: pointer" target="_blank" rel="noopener noreferrer">{}</a>'
                  df['country'] = df['country'].apply(lambda item: link_ref.format(item, "{}"))
                  
                  fig = px.treemap(df,
                                   path=[ 'continent', 'country'],
                                   values='pop',
                                   color='lifeExp',
                                   hover_data=['iso_alpha'])
                  
                  fig.show()
                  

                  这篇关于Plotly:带有“href"的树形图元素不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:Plotly:如何使用 plotly 和 plotly express 绘制回归线? 下一篇:剧情传奇标题

                  相关文章

                1. <tfoot id='GsGI8'></tfoot>

                    <bdo id='GsGI8'></bdo><ul id='GsGI8'></ul>

                  <i id='GsGI8'><tr id='GsGI8'><dt id='GsGI8'><q id='GsGI8'><span id='GsGI8'><b id='GsGI8'><form id='GsGI8'><ins id='GsGI8'></ins><ul id='GsGI8'></ul><sub id='GsGI8'></sub></form><legend id='GsGI8'></legend><bdo id='GsGI8'><pre id='GsGI8'><center id='GsGI8'></center></pre></bdo></b><th id='GsGI8'></th></span></q></dt></tr></i><div id='GsGI8'><tfoot id='GsGI8'></tfoot><dl id='GsGI8'><fieldset id='GsGI8'></fieldset></dl></div>

                  <small id='GsGI8'></small><noframes id='GsGI8'>

                      <legend id='GsGI8'><style id='GsGI8'><dir id='GsGI8'><q id='GsGI8'></q></dir></style></legend>