docs: def to_dict(self, depth=-1, **kwargs):
          """Returns a dict representation of the object."""
          out = super(Figure, self).to_dict(depth=depth, **kwargs)
          out['header'] = self.header.to_dict(depth=depth-1, **kwargs)
          out['html'] = self.html.to_dict(depth=depth-1, **kwargs)
          out['script'] = self.script.to_dict(depth=depth-1, **kwargs)
          return out