Plotly Icicle/Treemap/Sunburst - Negative values

Hi folks,

I am trying to plot some categorical/hierarchical data with Icicle chart. I have positive and negative values in profit column that I would like to use as a value parameter.

Does it make sense to have both positive and negative value in Icicle chart? When I leave negative values, chart does not work!


import pandas as pd
import as px

df = pd.read_table('')

df = df.assign(profit_derived=lambda x: x['Profit'].str.replace(',', '.').astype('float'))

df = (df[[
        'Ship Mode',

df = df.query(expr="profit_derived > 0")

df_grouped = df.groupby(by=['Segment', 'Region', 'Ship Mode', 'City']).sum().reset_index()

fig = px.icicle(dff, path=['Region', 'Ship Mode', 'City'], values='profit_derived')
fig.update_layout(margin=dict(t=50, l=25, r=25, b=25))