The official description about this chart code says : " If a color argument is passed, the color of a node is computed as the average of the color values of its children, weighted by their values. " But i need the color to be the sum of the childrens, not the average. Is it possible ?
import plotly.express as px
import numpy as np
df = px.data.gapminder().query("year == 2007")
fig = px.sunburst(df, path=['continent', 'country'], values='pop',
color='lifeExp', hover_data=['iso_alpha'],
color_continuous_scale='RdBu',
color_continuous_midpoint=np.average(df['lifeExp'], weights=df['pop']))
fig.show()