class_docstr: **Bases:** :class:`GraphicsObject <pyqtgraph.GraphicsObject>`
  
  Used for marking a horizontal or vertical region in plots.
  The region can be dragged and is bounded by lines which can be dragged individually.
  
  ===============================  =============================================================================
  **Signals:**
  sigRegionChangeFinished(self)    Emitted when the user has finished dragging the region (or one of its lines)
                                   and when the region is changed programatically.
  sigRegionChanged(self)           Emitted while the user is dragging the region (or one of its lines)
                                   and when the region is changed programatically.
  ===============================  =============================================================================
docstr: Create a new LinearRegionItem.
  
  ==============  =====================================================================
  **Arguments:**
  values          A list of the positions of the lines in the region. These are not
                  limits; limits can be set by specifying bounds.
  orientation     Options are 'vertical' or 'horizontal'
                  The default is 'vertical', indicating that the region is bounded
                  by vertical lines.
  brush           Defines the brush that fills the region. Can be any arguments that
                  are valid for :func:`mkBrush <pyqtgraph.mkBrush>`. Default is
                  transparent blue.
  pen             The pen to use when drawing the lines that bound the region.
  hoverBrush      The brush to use when the mouse is hovering over the region.
  hoverPen        The pen to use when the mouse is hovering over the region.
  movable         If True, the region and individual lines are movable by the user; if
                  False, they are static.
  bounds          Optional [min, max] bounding values for the region
  span            Optional [min, max] giving the range over the view to draw
                  the region. For example, with a vertical line, use
                  ``span=(0.5, 1)`` to draw only on the top half of the
                  view.
  swapMode        Sets the behavior of the region when the lines are moved such that
                  their order reverses:
  
                    * "block" means the user cannot drag one line past the other
                    * "push" causes both lines to be moved if one would cross the other
                    * "sort" means that lines may trade places, but the output of
                      getRegion always gives the line positions in ascending order.
                    * None means that no attempt is made to handle swapped line
                      positions.
  
                  The default is "sort".
  clipItem        An item whose bounds will be used to limit the region bounds.
                  This is useful when a LinearRegionItem is added on top of an
                  :class:`~pyqtgraph.ImageItem` or
                  :class:`~pyqtgraph.PlotDataItem` and the visual region should
                  not extend beyond its range. This overrides ``bounds``.
  ==============  =====================================================================
docstr_tok: ["Create","a","new","LinearRegionItem",".","==============","=====================================================================","*","*","Arguments",":","*","*","values","A","list","of","the","positions","of","the","lines","in","the","region",".","These","are","not","limits",";","limits","can","be","set","by","specifying","bounds",".","orientation","Options","are","'vertical","'","or","'horizontal'","The","default","is","'vertical","'",",","indicating","that","the","region","is","bounded","by","vertical","lines",".","brush","Defines","the","brush","that","fills","the","region",".","Can","be","any","arguments","that","are","valid","for",":","func",":","`","mkBrush","<","pyqtgraph.mkBrush",">","`",".","Default","is","transparent","blue",".","pen","The","pen","to","use","when","drawing","the","lines","that","bound","the","region",".","hoverBrush","The","brush","to","use","when","the","mouse","is","hovering","over","the","region",".","hoverPen","The","pen","to","use","when","the","mouse","is","hovering","over","the","region",".","movable","If","True",",","the","region","and","individual","lines","are","movable","by","the","user",";","if","False",",","they","are","static",".","bounds","Optional","[","min",",","max","]","bounding","values","for","the","region","span","Optional","[","min",",","max","]","giving","the","range","over","the","view","to","draw","the","region",".","For","example",",","with","a","vertical","line",",","use","``","span=","(","0.5",",","1",")","``","to","draw","only","on","the","top","half","of","the","view",".","swapMode","Sets","the","behavior","of","the","region","when","the","lines","are","moved","such","that","their","order","reverses",":","*","``","block","''","means","the","user","can","not","drag","one","line","past","the","other","*","``","push","''","causes","both","lines","to","be","moved","if","one","would","cross","the","other","*","``","sort","''","means","that","lines","may","trade","places",",","but","the","output","of","getRegion","always","gives","the","line","positions","in","ascending","order",".","*","None","means","that","no","attempt","is","made","to","handle","swapped","line","positions",".","The","default","is","``","sort","''",".","clipItem","An","item","whose","bounds","will","be","used","to","limit","the","region","bounds",".","This","is","useful","when","a","LinearRegionItem","is","added","on","top","of","an",":","class",":","`","~pyqtgraph.ImageItem","`","or",":","class",":","`","~pyqtgraph.PlotDataItem","`","and","the","visual","region","should","not","extend","beyond","its","range",".","This","overrides","``","bounds","``",".","==============","====================================================================="]
code: def __init__(
      self,
      values=(0, 1),
      orientation="vertical",
      brush=None,
      pen=None,
      hoverBrush=None,
      hoverPen=None,
      movable=True,
      bounds=None,
      span=(0, 1),
      swapMode="sort",
      clipItem=None,
  ):
      """Create a new LinearRegionItem.
  
      ==============  =====================================================================
      **Arguments:**
      values          A list of the positions of the lines in the region. These are not
                      limits; limits can be set by specifying bounds.
      orientation     Options are 'vertical' or 'horizontal'
                      The default is 'vertical', indicating that the region is bounded
                      by vertical lines.
      brush           Defines the brush that fills the region. Can be any arguments that
                      are valid for :func:`mkBrush <pyqtgraph.mkBrush>`. Default is
                      transparent blue.
      pen             The pen to use when drawing the lines that bound the region.
      hoverBrush      The brush to use when the mouse is hovering over the region.
      hoverPen        The pen to use when the mouse is hovering over the region.
      movable         If True, the region and individual lines are movable by the user; if
                      False, they are static.
      bounds          Optional [min, max] bounding values for the region
      span            Optional [min, max] giving the range over the view to draw
                      the region. For example, with a vertical line, use
                      ``span=(0.5, 1)`` to draw only on the top half of the
                      view.
      swapMode        Sets the behavior of the region when the lines are moved such that
                      their order reverses:
  
                        * "block" means the user cannot drag one line past the other
                        * "push" causes both lines to be moved if one would cross the other
                        * "sort" means that lines may trade places, but the output of
                          getRegion always gives the line positions in ascending order.
                        * None means that no attempt is made to handle swapped line
                          positions.
  
                      The default is "sort".
      clipItem        An item whose bounds will be used to limit the region bounds.
                      This is useful when a LinearRegionItem is added on top of an
                      :class:`~pyqtgraph.ImageItem` or
                      :class:`~pyqtgraph.PlotDataItem` and the visual region should
                      not extend beyond its range. This overrides ``bounds``.
      ==============  =====================================================================
      """
  
      GraphicsObject.__init__(self)
      self.orientation = orientation
      self.blockLineSignal = False
      self.moving = False
      self.mouseHovering = False
      self.span = span
      self.swapMode = swapMode
      self.clipItem = clipItem
  
      self._boundingRectCache = None
      self._clipItemBoundsCache = None
  
      # note LinearRegionItem.Horizontal and LinearRegionItem.Vertical
      # are kept for backward compatibility.
      lineKwds = dict(
          movable=movable,
          bounds=bounds,
          span=span,
          pen=pen,
          hoverPen=hoverPen,
      )
  
      if orientation in ("horizontal", LinearRegionItem.Horizontal):
          self.lines = [
              # rotate lines to 180 to preserve expected line orientation
              # with respect to region. This ensures that placing a '<|'
              # marker on lines[0] causes it to point left in vertical mode
              # and down in horizontal mode.
              InfiniteLine(
                  QtCore.QPointF(0, values[0]), angle=0, **lineKwds
              ),
              InfiniteLine(
                  QtCore.QPointF(0, values[1]), angle=0, **lineKwds
              ),
          ]
          tr = QtGui.QTransform.fromScale(1, -1)
          self.lines[0].setTransform(tr, True)
          self.lines[1].setTransform(tr, True)
      elif orientation in ("vertical", LinearRegionItem.Vertical):
          self.lines = [
              InfiniteLine(
                  QtCore.QPointF(values[0], 0), angle=90, **lineKwds
              ),
              InfiniteLine(
                  QtCore.QPointF(values[1], 0), angle=90, **lineKwds
              ),
          ]
      else:
          raise Exception(
              "Orientation must be 'vertical' or 'horizontal'."
          )
  
      for l in self.lines:
          l.setParentItem(self)
          l.sigPositionChangeFinished.connect(self.lineMoveFinished)
      self.lines[0].sigPositionChanged.connect(self._line0Moved)
      self.lines[1].sigPositionChanged.connect(self._line1Moved)
  
      if brush is None:
          brush = QtGui.QBrush(QtGui.QColor(0, 0, 255, 50))
      self.setBrush(brush)
  
      if hoverBrush is None:
          c = self.brush.color()
          c.setAlpha(min(c.alpha() * 2, 255))
          hoverBrush = fn.mkBrush(c)
      self.setHoverBrush(hoverBrush)
  
      self.setMovable(movable)
  
imports: from ..None import debug
  from ..None import functions
  from ..Qt import QtCore, QtGui
  from .GraphicsObject import GraphicsObject
  from .InfiniteLine import InfiniteLine
label_desc: Use image node_id 1 to create a new LinearRegionItem object from inherited base classes: GraphicsObject with example: obj = LinearRegionItem(values, orientation, brush, pen, hoverBrush, hoverPen, movable, bounds, span, swapMode, clipItem)