class_docstr: Widget for proportionally dividing its internal area into a grid.
  
  This widget will automatically set the position and size of child widgets
  according to provided constraints.
  
  Parameters
  ----------
  spacing : int
      Spacing between widgets.
  **kwargs : dict
      Keyword arguments to pass to `Widget`.
code: def _update_child_widget_dim(self):
      # think in terms of (x, y). (row, col) makes code harder to read
      ymax, xmax = self.grid_size
      if ymax <= 0 or xmax <= 0:
          return
  
      rect = self.rect  # .padded(self.padding + self.margin)
      if rect.width <= 0 or rect.height <= 0:
          return
      if self._need_solver_recreate:
          self._need_solver_recreate = False
          self._recreate_solver()
  
      # we only need to remove and add the height and width constraints of
      # the solver if they are not the same as the current value
      h_changed = abs(rect.height - self._var_h.value()) > 1e-4
      w_changed = abs(rect.width - self._var_w.value()) > 1e-4
      if h_changed:
          self._solver.suggestValue(self._var_h, rect.height)
  
      if w_changed:
          self._solver.suggestValue(self._var_w, rect.width)
      if h_changed or w_changed:
          self._solver.updateVariables()
  
      value_vectorized = np.vectorize(lambda x: x.value())
  
      for _, val in self._grid_widgets.items():
          (row, col, rspan, cspan, widget) = val
  
          width = np.sum(
              value_vectorized(self._width_grid[row][col : col + cspan])
          )
          height = np.sum(
              value_vectorized(
                  self._height_grid[col][row : row + rspan]
              )
          )
          if col == 0:
              x = 0
          else:
              x = np.sum(value_vectorized(self._width_grid[row][0:col]))
  
          if row == 0:
              y = 0
          else:
              y = np.sum(
                  value_vectorized(self._height_grid[col][0:row])
              )
  
          if isinstance(widget, ViewBox):
              widget.rect = Rect(x, y, width, height)
          else:
              widget.size = (width, height)
              widget.pos = (x, y)
  
imports: from __future__ import division
  import numpy
  from vispy.geometry import Rect
  from .widget import Widget
  from .viewbox import ViewBox
  from kiwisolver import Solver, Variable, UnsatisfiableConstraint
label_desc: Use image node_id 20 for calling the Grid obj's underlying member method code with example usage: obj._update_child_widget_dim() without return types