Access and change sunburst label's text

After some time searching online and inspecting the ā€˜figure’ property of a Sunburst component I can’t figure out how to change the label’s texts.

Image

Just to make it clear what I mean by ā€˜inspecting the ā€˜figure’ property of a Sunburst component’, see below the output of a ā€˜print(sunburst_figure)’.

It’s easy to see how to access (and therefore how to change) the ā€˜hovertemplate’, ā€˜textinfo’, and others. But where is it the label’s texts ā€œof entryā€ and ā€œof rootā€?

Thank you,

Hi @Danilo_BR, can you please share your code and just enough data for us to reproduce your sunburst plot?

Hi @jhupiterz , sure! Sorry not to do that before. Follows below.

# Imports.
import pandas as pd
import plotly.express as px
from dash import Dash, html, dcc

# Create a simple DataFrame.
df = pd.DataFrame(
    {
        'Name': {0: 'John', 1: 'Jane'},
        'Value': {0: 4, 1: 6}
    }
)

# Creates Dash app.
app = Dash(__name__)

# Creates the layout.
app.layout=html.Div([
    dcc.Graph(
        figure=px.sunburst(
            data_frame=df, 
            path=['Name'], 
            values='Value'
        ).update_traces(textinfo='percent root+percent parent')
    )
])

# Runs the app locally.
app.run_server(debug=True, port=8050)