code: def pre_render(self):
          
          self.add_styles()
          self.add_scripts()
          self.root.set(
              'viewBox', '0 0 %d %d' % (self.graph.width, self.graph.height)
          )
          if self.graph.explicit_size:
              self.root.set('width', str(self.graph.width))
              self.root.set('height', str(self.graph.height))
docs: Last things to do before rendering