code: def decorate(svg, node, metadata):
      
      if not metadata:
          return node
      xlink = metadata.get('xlink')
      if xlink:
          if not isinstance(xlink, dict):
              xlink = {'href': xlink, 'target': '_blank'}
          node = svg.node(node, 'a', **xlink)
          svg.node(
              node, 'desc', class_='xlink'
          ).text = to_unicode(xlink.get('href'))
  
      if 'tooltip' in metadata:
          svg.node(node, 'title').text = to_unicode(metadata['tooltip'])
  
      if 'color' in metadata:
          color = metadata.pop('color')
          node.attrib['style'] = 'fill: %s; stroke: %s' % (color, color)
  
      if 'style' in metadata:
          node.attrib['style'] = metadata.pop('style')
  
      if 'label' in metadata and metadata['label']:
          svg.node(
              node, 'desc', class_='label'
          ).text = to_unicode(metadata['label'])
      return node
docs: Add metedata next to a node