Hi all,
I have created a treemap constructor using express. It work like a charm - indeed, with the help of @Emmanuelle here: Change hovertext fields of a treemap in plotly express
I have built a function as a treemap builder which takes the values from a dictionary
def maparbol(df):
subfig = px.treemap(df, path=['type','name'], values = datosgraficos[busqueda]['values'],
width=datosgraficos[busqueda]['tamaño horizontal'], height=datosgraficos[busqueda]['tamaño vertical'],
title=datosgraficos[busqueda]['titulo'],
)
return subfig
when I call it like fig = maparbol(df)
it works like a charm
however, when I try to insert two of them in the same plot, using subplots, like so:
fig = make_subplots(rows=1, cols=2)
fig.add_trace(maparbol(df),row=1,col=1)
it returns a value error, like
ValueError:
Invalid element(s) received for the 'data' property of
Invalid elements include: [Figure({
'data': [{'branchvalues': 'total',
'domain': {'x': [0.0, 1.0], 'y': [0.0, 1.0]},
'hovertemplate':
I have read all this thread and its derived links: https://github.com/plotly/plotly_express/issues/83
But I haven’t figure out what do I have to do in order to show two treemaps generated with express, side by side
What do I have to do in order to (convert?) a px figure into a go one for using subplots?
thanks in advance