I wanted to use a treemap in PlotlyJS. There is no method like this, so I create that by hand.
fieldsa = Dict{Symbol,Any}(:type => "treemap",
:labels => ["a", "A"],
:parents => ["", ""],
:values => [1, 10],
:textinfo => "label+value+percent entry")
fieldsb = Dict{Symbol,Any}(:type => "treemap",
:labels => ["b", "B"],
:parents => ["", ""],
:values => [5, 3],
:textinfo => "label+value+percent entry")
I would like to have a layout with 2 rows - to plot the 2 treemaps one below the other.
So I tried this:
p1 = PlotlyJS.plot([ GenericTrace("treemap", fieldsa) ], Layout())
p2 = PlotlyJS.plot([ GenericTrace("treemap", fieldsb) ], Layout())
p = [p1; p2]
No luck, only one treemap is displayed.
Also this one shows only one treemap. But it looks like there is a empty row…
layout = Layout(grid=attr(rows=2, columns=1))
plot([ GenericTrace("treemap", fieldsa), GenericTrace("treemap", fieldsb) ], layout)
Any idea why how to make it work? I suspect that it doesn’t work because the treemap is not known to PlotlyJS package…
Thanks a lot!
Note that it works with e.g. scatter
p1 = PlotlyJS.plot([scatter(x = [1, 2], y = [10, 20])], Layout())
p2 = PlotlyJS.plot([scatter(x = [1, 2], y = [5, 18])], Layout())
p = [p1; p2] # shows 2 plots in one pane