Produces incorrect JSON representation. The xaxis1 and yaxis1 attributes of the layout are empty. The titles on the axes therefore don't show up when the figure is rendered.
Here's the invalid JSON that gets produced in v0.4.0:
The reason why it happens is that each trace gets its own instance of the Layout.XAxis(uid: 1) assigned to the xAxis property. The Figure constructors does a little "dance" and collects these properties from all traces and adds them to the layout.
This way the layout ends up with multiple XAxis objects that don't have unique uid. When the entire figure gets encoded to JSON, the encoder keeps overwriting the value for the xaxis1 key over and over the value that is acually visible is the one that happens to be stored the last.
The following code snippet:
Produces incorrect JSON representation. The
xaxis1
andyaxis1
attributes of thelayout
are empty. The titles on the axes therefore don't show up when the figure is rendered.Here's the invalid JSON that gets produced in
v0.4.0
:The reason why it happens is that each trace gets its own instance of the
Layout.XAxis(uid: 1)
assigned to thexAxis
property. TheFigure
constructors does a little "dance" and collects these properties from all traces and adds them to thelayout
.This way the layout ends up with multiple
XAxis
objects that don't have uniqueuid
. When the entire figure gets encoded to JSON, the encoder keeps overwriting the value for thexaxis1
key over and over the value that is acually visible is the one that happens to be stored the last.