Commit Graph

16 Commits

Author SHA1 Message Date
Ogi Moore
d455da9aec Use Qt6 Enum Namespace
This namespace appears to be valid in PySide2/PyQt5 5.12+ so we may as
well migrate to the newer namespace ourselves.
2021-06-08 21:23:49 -07:00
lidstrom83
6519734932
Deprecate unused/unnecessary modules (#1576)
* Deprecate ordereddict module

* Import OrderedDict from collections module instead of pgcollections

* Deprecate pgcollections module

* Deprecate lru_cache module

A simpler recipe exists from the standard library using OrderedDict.

* Deprecate pil_fix module

* Python 3.7 compatibility fix

* Avoid or suppress deprecation warnings in tests
2021-02-15 09:52:06 -08:00
lidstrom83
3af23725ca
Scatter Plot Improvements (#1420)
* Added hovering demo to ScatterPlot example

* Use Qt's serialization for SymbolAtlas.symbolMap keys

Yields significant performance improvements when updating the scatter plot's options. See e.g. the plot hover example.

* Further optimized scatter plot picking

* Fix ScatterPlot example tool tip

* Clean up while I'm here

* Compatibility

* Some simple optimizations for ScatterPlotItem

Speedups for ScatterPlotSpeedTest.py:
~50% without pxMode
~ 0% pxMode with useCache
~30% pxMode without useCache

* ~3x speedup in scatter plot speed test with pxMode

* More optimization low-hanging fruit for the scatter plot

* Removed hover example to lazily pass tests

* Avoid segfault

* Re-add hover example to ScatterPlot.py

* Switch to id-based keying for scatter plot symbol atlas

- Use cases exist where serialization-based keying is a significant bottleneck, e.g. updating without atlas invalidation when a large variety pens or brushes are present.
- To avoid a performance hit, the onus is on the user to carefully reuse pen and brush objects.

* Optimized caching in scatter plot hovering example

* Fixed and optimized scatter plot hovering example

* Minor scatter plot optimization

* Cleanup

* Store hovered points in a set for the hovering example

* Keep a limited number symbol atlas entries around for future reuse

* Added a docstring note to remind the user to reuse QPen and QBrush objects for better performance

* Tidied up hovering example

* Typo

* Avoid unnecessary atlas rebuilds

* Refactored SymbolAtlas

* Efficient appending to SymbolAtlas

* SymbolAtlas rewrite

* Cleanup and profiling

* Add randomized brushes to speed test

* Add loc indexer to ScatterPlotItem

* Profile ScatterPlotItem.paint to identify bottlenecks

* Reuse targetRect to improve paint performance

* Readability improvements (opinionated)

* Only need to set x and y of targetRect

- w and h can stay set to 0 (not entirely sure why)
- this is a bit faster than setting all of x, y, w, h

* Minor renaming

* Strip off API changes and leave to another PR

* Renaming

* Compatibility

* Use drawPixmap(x, y, pm, sx, sy, sw, sh) signature to avoid needing to update QRectFs

* Use different drawing approaches for each Qt binding for performance reasons

* Fix a bug introduced two commits ago

Incidentally, I think there is a similar bug in the main branch currently.

* Minor performance and readability improvements

* Strip out source and target QRectF stuff

* Bring source and target QRectF stuff back in a less coupled way

* Leave deprecating getSpotOpts for another PR

* Compatibility fix

* Added docstrings and use SymbolAtlas__len__ where possible

* Fix export issue

* Add missing import

* Add deprecation warnings

* Avoid using deprecated methods

* Fix and cleanup max spot size measurements

* Make creation of style opts entries explicit

* Add hovering API to ScatterPlotItem

* Compatibility

* Marshal pen and brush lists in setPen and setBrush

* Fixed platform dependent bug
2020-12-16 11:07:39 -08:00
lidstrom83
0dacc57e02
Emit event with mouse clicks for some items (#1414)
Harmonizes behavior with PlotCurveItem.
2020-10-22 11:17:59 -07:00
Luke Campagnola
ed36a0194b py3 fix for scatterplotwidget.setselectedfields 2020-06-01 18:38:50 -07:00
Luke Campagnola
cbff3a58d7 Fix scatterplotwidget label color 2018-04-25 11:10:39 -07:00
Luke Campagnola
96a3d216e2 Make it easier to track data in and out of scatterplotwidget 2018-03-15 11:59:45 -07:00
Luke Campagnola
a5276c3bd3 fix: scatterplotwidget behaves nicely when data contains infs
Add methods to make it easier to programatically configure scatterplotwidget
2018-03-08 15:09:36 -08:00
Luke Campagnola
9bff2b23fb Add a signal for detecting scatter plot point clicks in ScatterPlotWidget 2018-02-01 11:43:46 -08:00
Luke Campagnola
8e1c3856ea Added more examples to menu
Minor edits
2015-03-01 16:52:15 -05:00
Luke Campagnola
cf312e7bac updated widgets 2013-12-22 02:18:37 -05:00
Luke Campagnola
8c13a3e7e3 copy from acq4 2013-07-03 11:20:49 -04:00
Luke Campagnola
8828892e55 merged many changes from acq4 2013-03-26 13:46:26 -04:00
Luke Campagnola
cefb4f9828 merged updates from acq4 2013-03-19 16:04:46 -04:00
Luke Campagnola
6e5c5e402b merged many new features from ACQ4 2013-02-10 17:45:16 -05:00
Luke Campagnola
4c887c8f50 Merge new fixes and features from acq4 2013-02-10 14:10:30 -05:00