← 返回首页
Image widget by almarklein · Pull Request #429 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Image widget#429

Merged
kushalkolar merged 5 commits into
fastplotlib:mainfrom
almarklein:image-widget
Mar 12, 2024
Merged

Image widget#429
kushalkolar merged 5 commits into
fastplotlib:mainfrom
almarklein:image-widget

Conversation

Copy link
Copy Markdown
Collaborator

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

Copy link
Copy Markdown
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?

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
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.

Copy link
Copy Markdown
Collaborator Author

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

Copy link
Copy Markdown
Member

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

Yup! I updated that issue with the specifics.

almarklein commented Mar 12, 2024
edited
Loading

Copy link
Copy Markdown
Collaborator Author

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

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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 marked this pull request as ready for review March 12, 2024 11:41

Copy link
Copy Markdown
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? :)

Copy link
Copy Markdown
Member

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

Copy link
Copy Markdown
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

Copy link
Copy Markdown
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 merged commit d45c723 into fastplotlib:main Mar 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Footer

© 2026 GitHub, Inc.