@@ -503,7 +503,7 @@ def on_scatter_toolbar_table_click(self):
503503 statName = self .myTableWidget .item (row ,0 ).text ()
504504 self .signalUpdateStat .emit (self ._id , statName )
505505
506- class ScatterPlotWidget (QtWidgets .QWidget ):
506+ class ScatterPlotWidget_ (QtWidgets .QWidget ):
507507 """Plot x/y statistics as a scatter.
508508
509509 Get stat names and variables from sanpy.bAnalysisUtil.getStatList()
@@ -721,8 +721,7 @@ def getfilteredDFWithIndexList(self, filterStr, filterColumn) -> pd.DataFrame:
721721 return df , indexList
722722
723723 def getFilteredIndexList (self , filterDF ):
724- """
725- Calculate the new list of indexes after hue filtering DF
724+ """Calculate the new list of indexes after hue filtering DF.
726725 """
727726 hueColumn = self .dict ["hueColumn" ]
728727 currentHueID = float (self .dict ["currentHueID" ])
@@ -756,7 +755,7 @@ def setScatterPlot(self, xStat, yStat, xyStatIndex):
756755 myColorMap .append ("white" )
757756 else :
758757 if hueColumn != "None" :
759- logger .info (f" hueColumn { hueColumn } id:{ id } " )
758+ logger .info (f' hueColumn: " { hueColumn } " id:{ id } ' )
760759 hueId = self ._df [hueColumn ].iloc [id ]
761760 myColorMap .append (self .color [hueId ])
762761
@@ -1222,39 +1221,28 @@ def _switchScatter(self):
12221221 self .myHighlighter .resetHighlighter (self .axScatter , np .array ([]), np .array ([]), np .array ([]))
12231222
12241223 # IMPORTANT SIGNAL-SLOT CONNECTION (outside wrapper -> inside)
1225- def selectHighlighterPoints (self , rowIndexes ):
1224+ def selectHighlighterPoints (self , rowIndexes : List [ int ] ):
12261225 """ Select Data in Highlighter Class
12271226
12281227 This function needs to be connected within wrapper class.
12291228 Outside selection emits signal to this function to update highlighter plot
12301229 Args:
12311230 rowIndexes: indexes of rows that need to be selected within highlighter plot
12321231 """
1233-
1234- # If nothing is selected empty highlighter plot
1235- if rowIndexes == None :
1232+ if rowIndexes is None or rowIndexes == []:
12361233 self .myHighlighter ._setData ([], [])
12371234 else :
1238- # Otherwise get the appropriate values and plot
12391235 columnNameX = self .xPlotWidget .getCurrentStat ()
12401236 columnNameY = self .yPlotWidget .getCurrentStat ()
1241-
1242- # Get column values into respective lists
1243- xFilteredVals = self ._df [columnNameX ].tolist ()
1244- yFilteredVals = self ._df [columnNameY ].tolist ()
1245- # logger.info(f"rowIndexes {rowIndexes}")
1246- # logger.info(f"xFilteredVals {xFilteredVals}")
1247- # logger.info(f"yFilteredVals {yFilteredVals}")
12481237
1249- # Acquire only selected rowIndexes from the lists
1250- xDFStat = [xFilteredVals [i ] for i in rowIndexes ]
1251- yDFStat = [yFilteredVals [i ] for i in rowIndexes ]
1252- self .myHighlighter ._setData (xDFStat , yDFStat )
1238+ # pull x/y values from selected row(s)
1239+ xSelectValues = self ._df .loc [rowIndexes , columnNameX ].tolist ()
1240+ ySelectValues = self ._df .loc [rowIndexes , columnNameY ].tolist ()
1241+
1242+ self .myHighlighter ._setData (xSelectValues , ySelectValues )
12531243
12541244 # Store selected rows for later use
12551245 self .storedRowIdx = rowIndexes
1256- logger .info (f"self.storedRowIdx { self .storedRowIdx } " )
1257- logger .info ("select Highlighter Points called" )
12581246
12591247 def getHighlightedIndexes (self ):
12601248 return self .storedRowIdx
0 commit comments