Skip to content

Instantly share code, notes, and snippets.

@spchamp
Created December 4, 2023 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spchamp/23b11492fa13a632d25b27795e02c416 to your computer and use it in GitHub Desktop.
Save spchamp/23b11492fa13a632d25b27795e02c416 to your computer and use it in GitHub Desktop.
Type Hints Prototype, pyqtgraph.graphicsItems.PlotItem.PlotItem
from numbers import Real
from typing import Optional
from typing_extensions import TypeAlias
from ...Qt import QtCore
from ..GraphicsWidget import GraphicsWidget
# from .PlotAxis import AxisName, AxisPosition, PlotAxisInfo
RangeTuple: TypeAlias = tuple[Real, Real]
class PlotItem(GraphicsWidget):
#
# methods onto the ViewBox attr, also in PlotWidget
#
def setXRange(self, min: Real, max: Real,
padding: Optional[Real] = None, update: bool = True): ...
def setYRange(self, min: Real, max: Real,
padding: Optional[Real] = None, update: bool = True): ...
def setRange(self, rect: Optional[QtCore.QRectF] = None,
xRange: Optional[RangeTuple] = None,
yRange: Optional[RangeTuple] = None,
padding: Optional[Real] = None,
update: bool = True,
disableAutoRange: bool = True
): ...
def autoRange(self, padding=None, items=None, item=None): ...
def setXLink(self, view): ...
def setYLink(self, view): ...
def viewRect(self): ...
def setMouseEnabled(self, x=None, y=None): ...
def enableAutoRange(self, axis=None, enable=True, x=None, y=None): ...
def disableAutoRange(self, axis=None): ...
def setAspectLocked(self, lock=True, ratio=1): ...
def setLimits(self, **kwds): ...
def register(self, name): ...
def unregister(self): ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment