class_docstr: Svg related methods
class_docstr_tok: ["Svg","related","methods"]
docstr: Make a new svg node
docstr_tok: ["Make","a","new","svg","node"]
code: def node(self, parent=None, tag="g", attrib=None, **extras):
      """Make a new svg node"""
      if parent is None:
          parent = self.root
      attrib = attrib or {}
      attrib.update(extras)
  
      def in_attrib_and_number(key):
          return key in attrib and isinstance(attrib[key], Number)
  
      for pos, dim in (("x", "width"), ("y", "height")):
          if in_attrib_and_number(dim) and attrib[dim] < 0:
              attrib[dim] = -attrib[dim]
              if in_attrib_and_number(pos):
                  attrib[pos] = attrib[pos] - attrib[dim]
  
      for key, value in dict(attrib).items():
          if value is None:
              del attrib[key]
  
          attrib[key] = str(value)
          if key.endswith("_"):
              attrib[key.rstrip("_")] = attrib[key]
              del attrib[key]
          elif key == "href":
              attrib[
                  etree.QName("http://www.w3.org/1999/xlink", key)
              ] = attrib[key]
              del attrib[key]
      return etree.SubElement(parent, tag, attrib)
  
imports: from __future__ import division
  import io
  import json
  import os
  from datetime import date, datetime
  from math import pi
  from numbers import Number
  from urllib.parse import quote_plus
  from pygal import __version__
  from pygal.etree import etree
  from pygal.util import coord_abs_project, coord_diff, coord_dual, coord_format, coord_project, minify_css, template
label_desc: Use image node_id 4 for calling the Svg obj's underlying member method code with example usage: obj.node(parent, tag, attrib) and returns: etree, unknown