docs: def move_item_into_viewport(self, item):
          """Causes the `item` to be moved into the viewport
  
          The zoom factor and the position of the viewport are updated to move the `item` into the viewport. If `item`
          is not a `StateView`, the parental `StateView` is moved into the viewport.
  
          :param StateView | ConnectionView | PortView item: The item to be moved into the viewport
          """
          if not item:
              return
          HORIZONTAL = 0
          VERTICAL = 1
          if not isinstance(item, Item):
              state_v = item.parent
          elif not isinstance(item, StateView):
              state_v = self.canvas.get_parent(item)
          else:
              state_v = item
          viewport_size = self.view.editor.get_allocation().width, self.view.editor.get_allocation().height
          state_size = self.view.editor.get_matrix_i2v(state_v).transform_distance(state_v.width, state_v.height)
          min_relative_size = min(viewport_size[i] / state_size[i] for i in [HORIZONTAL, VERTICAL])
  
          if min_relative_size != 1:
              # Allow margin around state
              margin_relative = 1. / gui_constants.BORDER_WIDTH_STATE_SIZE_FACTOR
              zoom_factor = min_relative_size * (1 - margin_relative)
              if zoom_factor > 1:
                  zoom_base = 4
                  zoom_factor = max(1, math.log(zoom_factor*zoom_base, zoom_base))
              self.view.editor.zoom(zoom_factor)
              # The zoom operation must be performed before the pan operation to work on updated GtkAdjustments (scroll
              # bars)
              self.canvas.wait_for_update()
  
          state_pos = self.view.editor.get_matrix_i2v(state_v).transform_point(0, 0)
          state_size = self.view.editor.get_matrix_i2v(state_v).transform_distance(state_v.width, state_v.height)
          viewport_size = self.view.editor.get_allocation().width, self.view.editor.get_allocation().height
  
          # Calculate offset around state so that the state is centered in the viewport
          padding_offset_horizontal = (viewport_size[HORIZONTAL] - state_size[HORIZONTAL]) / 2.
          padding_offset_vertical = (viewport_size[VERTICAL] - state_size[VERTICAL]) / 2.
          self.view.editor.hadjustment.set_value(state_pos[HORIZONTAL] - padding_offset_horizontal)
          self.view.editor.vadjustment.set_value(state_pos[VERTICAL] - padding_offset_vertical)