plotly sunburst + datapane : bug with markers shape

42 Views Asked by At

I have sunburst figure made with plotly that I'd like to include into a datapane report. However, some of the levels are hatched, and the hatching is not displayed in datapane (works fine in a standard html file with the figure only). I joined a code example for allow testing, taken from plotly doc

#!/usr/bin/env python

import plotly.graph_objects as go
import datapane as dp

# Figure code taken here : https://plotly.com/python/sunburst-charts/
fig = go.Figure(
    go.Sunburst(
        labels=["Eve", "Cain", "Seth", "Enos", "Noam", "Abel", "Awan", "Enoch", "Azura"],
        parents=["", "Eve", "Eve", "Seth", "Seth", "Eve", "Eve", "Awan", "Eve"],
        values=[65, 14, 12, 10, 2, 6, 6, 4, 4],
        branchvalues="total",
        textfont_size=16,
        marker=dict(
            pattern=dict(
                shape=["", "/", "/", ".", ".", "/", "/", ".", "/"], solidity=0.9
            )
        ),
    )
)

fig.update_layout(margin=dict(t=0, l=0, r=0, b=0))
fig.write_html("sunburst_test.html") # Hatching works fine

view = dp.Blocks(dp.Plot(fig))

dp.save_report(view, path="sunburst_test_dp.html") # Hatching is not displayed
0

There are 0 best solutions below