updateConnectors = elems => {
      const dataStorage = svgCanvas.getDataStorage()

      // Find connectors associated with selected elements
      findConnectors(elems)

      if (connections.length) {
        // Iterate through each connection to update its state
        for (const conn of connections) {
          const {
            elem,
            connector: line,
            is_start: isStart,
            start_x: startX,
            start_y: startY
          } = conn

          // Determine whether the connection starts or ends with this element
          const pre = isStart ? 'start' : 'end'

          // Update the bounding box for this element
          const bb = svgCanvas.getStrokedBBox([elem])
          bb.x = startX
          bb.y = startY
          dataStorage.put(line, `${pre}_bb`, bb)

          // Determine the opposite end ('start' or 'end') of the connection
          const altPre = isStart ? 'end' : 'start'

          // Retrieve the bounding box for the connected element at the opposite end
          const bb2 = dataStorage.get(line, `${altPre}_bb`)

          // Calculate the center point of the connected element
          const srcX = bb2?.x + bb2?.width / 2
          const srcY = bb2?.y + bb2?.height / 2

          // Update the point of the element being moved
          const pt = getBBintersect(srcX, srcY, bb, getOffset(pre, line))
          setPoint(line, isStart ? 0 : 'end', pt.x, pt.y, true)

          // Update the point of the connected element at the opposite end
          const pt2 = getBBintersect(
            pt.x,
            pt.y,
            dataStorage.get(line, `${altPre}_bb`),
            getOffset(altPre, line)
          )
          setPoint(line, isStart ? 'end' : 0, pt2.x, pt2.y, true)
        }
      }
    }
Updates the connectors based on selected elements.
@param {Element[]} [elems] - Optional array of selected elements.
@returns {void}