Skip to content

Image widget #429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 12, 2024
Merged

Image widget #429

merged 5 commits into from
Mar 12, 2024

Conversation

almarklein
Copy link
Collaborator

Just a small example to show the image widget on desktop.

image

@almarklein
Copy link
Collaborator Author

BTW, there are a lot of files that get touched when I run black. What is the policy related to formatting and linting?

@kushalkolar
Copy link
Member

Ah I think we forgot to run black on the examples, they're only run on the source files I think.

We haven't made a strict linting policy yet but we should. I'll see if I can export my flake8 options from pycharm.

For this example, I think it'd be useful to add a note that if you want sliders to scroll through one or two dimensions you should use the ImageWidget in either Qt or jupyter. Since we don't have within canvas UI right now.

@almarklein
Copy link
Collaborator Author

For this example, I think it'd be useful to add a note that if you want sliders to scroll through one or two dimensions you should use the ImageWidget in either Qt or jupyter. Since we don't have within canvas UI right now.

👍

Odd though, because I have PySide6 installed, and it selects glfw. Will have a look why this is.

@almarklein
Copy link
Collaborator Author

Oh, it only looks for PyQt6 for now. Ref #384

@kushalkolar
Copy link
Member

Oh, it only looks for PyQt6 for now. Ref #384

Yup! I updated that issue with the specifics.

@almarklein
Copy link
Collaborator Author

almarklein commented Mar 12, 2024

Backend selection is a bit iffy. Will still select glfw because wgpu prefers it over qt. Something for another PR :)

@kushalkolar
Copy link
Member

Yup I think that's why our Qt example explicitly chooses the canvas

@kushalkolar
Copy link
Member

If this is good to go you can mark it as ready for review to trigger the CI to run, and then copy the new screenshot from the regenerate action to the corresponding examples dir.

@almarklein almarklein marked this pull request as ready for review March 12, 2024 11:41
@almarklein
Copy link
Collaborator Author

CI: AttributeError: module 'fastplotlib' has no attribute 'widgets'

But when I import fastplotlib as flp I can use flp.widgets. Which behavior is to be expected? :)

@kushalkolar
Copy link
Member

ImageWidget is intended to be used from top level, i.e. fpl.ImageWidget. Not entirely sure how this is happening.

@almarklein
Copy link
Collaborator Author

This is. Perhaps at some point the ImageWidget relied on ipywidgets?

try:
import ipywidgets
except (ModuleNotFoundError, ImportError):
pass
else:
from .widgets import ImageWidget

@kushalkolar
Copy link
Member

This is. Perhaps at some point the ImageWidget relied on ipywidgets?

try:
import ipywidgets
except (ModuleNotFoundError, ImportError):
pass
else:
from .widgets import ImageWidget

Ah yes good catch! That shouldn't be there.

@kushalkolar kushalkolar merged commit d45c723 into fastplotlib:main Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy