Cache scatter-plot items by hashable properties (#1560)
* Cache scatter-plot items by hashable properties * use qpainterpath boundingRect+elementCount for key
This commit is contained in:
parent
6d3de52773
commit
2e1514d711
@ -224,7 +224,14 @@ class SymbolAtlas(object):
|
||||
squareness=1.0 if n == 0 else 2 * w * h / (w**2 + h**2))
|
||||
|
||||
def _keys(self, styles):
|
||||
return [(id(symbol), size, id(pen), id(brush)) for symbol, size, pen, brush in styles]
|
||||
return [
|
||||
(
|
||||
symbol if isinstance(symbol, (str, int)) else f"{symbol.boundingRect()} + {symbol.elementCount()} elements",
|
||||
size,
|
||||
(pen.style(), pen.capStyle(), pen.joinStyle()),
|
||||
(brush.color().rgba(), brush.style())
|
||||
) for symbol, size, pen, brush in styles
|
||||
]
|
||||
|
||||
def _itemData(self, keys):
|
||||
for key in keys:
|
||||
|
Loading…
Reference in New Issue
Block a user