Skip to content

Commit

Permalink
Pygfx histogram v2 (#105)
Browse files Browse the repository at this point in the history
* First cut: PyGFX histogram

Many things still don't work. But some things do!

* Pure-PyGFX histogram

* Actually use the data maximum for the y-axis tick

Was previously using the bounding box maximum which was the height of
the clims :(

* Add histogram pan/zoom

* Dynamically resize canvas

* Add WxWgpuCanvas

* Update src/ndv/views/_pygfx/_histogram.py

* add basic test

* skip for non qt

* fix wx app reuse

* refactor

* pin numpy too

* skip histogram test on windows 3.12 with pyside/pygfx

* change skip logic

---------

Co-authored-by: Talley Lambert <[email protected]>
  • Loading branch information
gselzer and tlambert03 authored Jan 22, 2025
1 parent 133f7c1 commit 796588a
Show file tree
Hide file tree
Showing 5 changed files with 614 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pyside = [
"superqt[iconify,pyside6] >=0.7.1",
# https://github.com/pyapp-kit/ndv/issues/59
"pyside6 ==6.6.3; sys_platform == 'win32'",
"numpy <2; sys_platform == 'win32'", # needed for pyside6.6
"pyside6 >=6.4",
"qtpy >=2",
]
Expand Down
4 changes: 3 additions & 1 deletion src/ndv/views/_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def array_canvas_class() -> type[ArrayCanvas]:

@staticmethod
def histogram_canvas_class() -> type[HistogramCanvas]:
raise RuntimeError("Histogram not supported for pygfx")
from ndv.views._pygfx._histogram import PyGFXHistogramCanvas

return PyGFXHistogramCanvas


# -------------------- Provider selection --------------------
Expand Down
Loading

0 comments on commit 796588a

Please sign in to comment.