class_docstr: Treemap graph class
code: def _binary_tree(self, data, total, x, y, w, h, parent=None):
      if total == 0:
          return
      if len(data) == 1:
          if parent:
              i, datum = data[0]
              serie, serie_node, rects = parent
              self._rect(serie, serie_node, rects, datum, x, y, w, h, i)
          else:
              datum = data[0]
              serie_node = self.svg.serie(datum)
              self._binary_tree(
                  list(enumerate(datum.values)),
                  total,
                  x,
                  y,
                  w,
                  h,
                  (
                      datum,
                      serie_node,
                      self.svg.node(serie_node["plot"], class_="rects"),
                  ),
              )
          return
  
      midpoint = total / 2
      pivot_index = 1
      running_sum = 0
      for i, elt in enumerate(data):
          if running_sum >= midpoint:
              pivot_index = i
              break
  
          running_sum += elt[1] if parent else sum(elt.values)
  
      half1 = data[:pivot_index]
      half2 = data[pivot_index:]
  
      if parent:
          half1_sum = sum(cut(half1, 1))
          half2_sum = sum(cut(half2, 1))
      else:
          half1_sum = sum(map(sum, map(lambda x: x.values, half1)))
          half2_sum = sum(map(sum, map(lambda x: x.values, half2)))
      pivot_pct = half1_sum / total
  
      if h > w:
          y_pivot = pivot_pct * h
          self._binary_tree(half1, half1_sum, x, y, w, y_pivot, parent)
          self._binary_tree(
              half2, half2_sum, x, y + y_pivot, w, h - y_pivot, parent
          )
      else:
          x_pivot = pivot_pct * w
          self._binary_tree(half1, half1_sum, x, y, x_pivot, h, parent)
          self._binary_tree(
              half2, half2_sum, x + x_pivot, y, w - x_pivot, h, parent
          )
  
file_path: pygal/pygal/graph/treemap.py
imports: from pygal.adapters import none_to_zero, positive
  from pygal.graph.graph import Graph
  from pygal.util import alter, cut, decorate
label_desc: Use image node_id 2 for calling the Treemap obj's underlying member method code with example usage: obj._binary_tree(data, total, x, y, w, h, parent) without return types