Allocate our internal `Axis` subtype in our `PlotItem` override
							parent
							
								
									0a3a73c35a
								
							
						
					
					
						commit
						ad8dc36493
					
				| 
						 | 
					@ -26,6 +26,8 @@ from typing import Optional
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import pyqtgraph as pg
 | 
					import pyqtgraph as pg
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					from ._axes import Axis
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def invertQTransform(tr):
 | 
					def invertQTransform(tr):
 | 
				
			||||||
    """Return a QTransform that is the inverse of *tr*.
 | 
					    """Return a QTransform that is the inverse of *tr*.
 | 
				
			||||||
| 
						 | 
					@ -62,6 +64,20 @@ class PlotItem(pg.PlotItem):
 | 
				
			||||||
    Overrides for the core plot object mostly pertaining to overlayed
 | 
					    Overrides for the core plot object mostly pertaining to overlayed
 | 
				
			||||||
    multi-view management as it relates to multi-axis managment.
 | 
					    multi-view management as it relates to multi-axis managment.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    This object is the combination of a ``ViewBox`` and multiple
 | 
				
			||||||
 | 
					    ``AxisItem``s and so far we've added additional functionality and
 | 
				
			||||||
 | 
					    APIs for:
 | 
				
			||||||
 | 
					    - removal of axes
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ---
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    From ``pyqtgraph`` super type docs:
 | 
				
			||||||
 | 
					    - Manage placement of ViewBox, AxisItems, and LabelItems
 | 
				
			||||||
 | 
					    - Create and manage a list of PlotDataItems displayed inside the
 | 
				
			||||||
 | 
					      ViewBox
 | 
				
			||||||
 | 
					    - Implement a context menu with commonly used display and analysis
 | 
				
			||||||
 | 
					      options
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
    def __init__(
 | 
					    def __init__(
 | 
				
			||||||
        self,
 | 
					        self,
 | 
				
			||||||
| 
						 | 
					@ -86,6 +102,8 @@ class PlotItem(pg.PlotItem):
 | 
				
			||||||
            enableMenu=enableMenu,
 | 
					            enableMenu=enableMenu,
 | 
				
			||||||
            kargs=kargs,
 | 
					            kargs=kargs,
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
					        self.name = name
 | 
				
			||||||
 | 
					        self.chart_widget = None
 | 
				
			||||||
        # self.setAxisItems(
 | 
					        # self.setAxisItems(
 | 
				
			||||||
        #     axisItems,
 | 
					        #     axisItems,
 | 
				
			||||||
        #     default_axes=default_axes,
 | 
					        #     default_axes=default_axes,
 | 
				
			||||||
| 
						 | 
					@ -209,7 +227,12 @@ class PlotItem(pg.PlotItem):
 | 
				
			||||||
                # adding this is without it there's some weird
 | 
					                # adding this is without it there's some weird
 | 
				
			||||||
                # ``ViewBox`` geometry bug.. where a gap for the
 | 
					                # ``ViewBox`` geometry bug.. where a gap for the
 | 
				
			||||||
                # 'bottom' axis is somehow left in?
 | 
					                # 'bottom' axis is somehow left in?
 | 
				
			||||||
                axis = pg.AxisItem(orientation=name, parent=self)
 | 
					                # axis = pg.AxisItem(orientation=name, parent=self)
 | 
				
			||||||
 | 
					                axis = Axis(
 | 
				
			||||||
 | 
					                    self,
 | 
				
			||||||
 | 
					                    orientation=name,
 | 
				
			||||||
 | 
					                    parent=self,
 | 
				
			||||||
 | 
					                )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            axis.linkToView(self.vb)
 | 
					            axis.linkToView(self.vb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue