GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — start imgui implementation by kushalkolar · Pull Request #571 · fastplotlib/fastplotlib

Conversation

@kushalkolar

@kushalkolar kushalkolar commented Jul 30, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

The actual imgui implementation discussed with @clewis7

image

Started implemetning ImguiFigure, kinda alright so far.

tasks:

  • BaseGUI
  • complete ImguiFigure
    • manages imgui rendering
    • manages standard right click menu
    • manages EdgeWindows
  • subplot toolbar
  • standard right click menu
  • allow adding custom GUIs to edges of canvas, these are managed by ImguiFigure
  • allow graphics to "request" starting their own right click menu on the next render cycle
    • right click menu for hlut/colorbar tool
  • ImageWidget, along with play button etc. Maybe we can use time.perf_counter() and actually display a specific FPS?
  • tests :D
  • image widget imgui example with EdgeWindow
  • a basic imgui example with EdgeWindow
  • move image widget examples from notebook to main docs
  • make sure non-imgui use is not affected!
  • remove ipywidget and qt toolbars, cleanup anything else that needs cleaning up, remove output contexts!

closes #494 , closes #260 , closes #360

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

niksirbi, lauraporta, and EricThomson reacted with hooray emoji
All reactions
  • 🎉 3 reactions
kushalkolar added 10 commits June 17, 2024 20:48
@kushalkolar
ndarray.ptp -> np.ptp for numpy v2
57702ac
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
eecb5a3
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
ddf13bd
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
d1c9c31
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
ebebc91
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
89bf7cd
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
41f7205
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
47e9979
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
85d278c
@kushalkolar
Merge branch 'main' of https://github.com/fastplotlib/fastplotlib
abab244
This was referenced Jul 30, 2024
imgui prototype #552
Closed
Usage with glfw - imgui #260
Closed
@kushalkolar

kushalkolar commented Jul 30, 2024

Copy link
Copy Markdown
Member Author

Should be possible to dynamically add and remove GUIs to edges if the BaseGUI subclass implements a cleanup method.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tlambert03 and others added 13 commits July 31, 2024 01:25
@tlambert03 @kushalkolar
use cmap library for colormaps (#390)
1c92d97
* example with cmap

* add to deps

* fix shape

* use full map

* remove break

* undo changes to screenshots

* fix parse

* remove diffs

* remove x.py

* minimize diff

* add docstring

* remove colormaps

---------

Co-authored-by: Kushal Kolar <[email protected]>
@kushalkolar
fix pygfx docs move
0b6f53d
@kushalkolar
black
c75c0b0
@kushalkolar
start imgui implementation
e48a855
@kushalkolar
right click menu, hard-code toolbar height
f6d7de3
@kushalkolar
happy with right click menu
d72b2a0
@kushalkolar
black
7f8d501
@kushalkolar
remove old id counter global
9e75262
@kushalkolar
cmap picker menu working, going to use cmap next to get textures working
0030744
@kushalkolar
remove unused texture sampler
d290317
@kushalkolar
black
27bed10
@kushalkolar
use selectable instead of menu_item
1ad7c0f
@kushalkolar
bug and filter out wheel events too
247c191
@kushalkolar
kushalkolar force-pushed the imgui-implementation branch from 4a08c2e to 247c191 Compare July 31, 2024 06:32
@kushalkolar

kushalkolar commented Jul 31, 2024

Copy link
Copy Markdown
Member Author

depends on #574

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Jul 31, 2024

Copy link
Copy Markdown
Member Author

cmap picker, last thing I'm making before the sliders for ImageWidget 😄

cmap-picker-2024-07-31_02.37.21.mp4

@clewis7 @apasarkar

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar

kushalkolar commented Aug 1, 2024

Copy link
Copy Markdown
Member Author

Might make more sense to subclass Subplot and add the toolbar to it directly

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
heavily subsample cockatoo vid because sphinx gallery has a memory le…
ae6ce34
…ak :/
@kushalkolar

kushalkolar commented Sep 28, 2024

Copy link
Copy Markdown
Member Author

ok now after subsampling the cockatoo video memory consumption when I build locally remains < 1.5GB. Before it was ~2.7 GB.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 10 commits September 28, 2024 05:24
@kushalkolar
iw video examples play
36d35a6
@kushalkolar
add imagewidget grid to docs gallery
d373fd9
@kushalkolar
proper imgui render for docs
daa7d01
@kushalkolar
add subsampled iw video screenshots
6a996d2
@kushalkolar
add image widget grid example
f3085bf
@kushalkolar
tweak lorenz example
5037aef
@kushalkolar
added the wrong screenshot
8acfc25
@kushalkolar
bring back linear selector image example
709140b
@kushalkolar
update examples
eaadf65
@kushalkolar
update setup.py
bca702f
kushalkolar
kushalkolar commented Sep 28, 2024
View reviewed changes
Comment thread examples/desktop/image_widget/image_widget_single_video.py
Comment on lines +18 to +21
# Ignore and do not use the next 2 lines
# for the purposes of docs gallery generation we subsample and only use 15 frames
movie_sub = movie[:15, ::12, ::12].copy()
del movie

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clewis7 until we either figure out a way to hide this from the docs example code (maybe do it under the hood in ImageWidget by checking for RTD_BUILD=1 env variable) or fix the annoying sphinx gallery memory leak

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clewis7 clewis7 Sep 29, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we do it under the hood by checking for env variable

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread fastplotlib/graphics/_features/_image.py
Comment on lines +23 to +25
shared = pygfx.renderers.wgpu.get_shared()
self._texture_limit_2d = shared.device.limits["max-texture-dimension2d"]

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clewis7 so now instead of tiling textures based on the default 8192 WGPU limit, it will read the limits currently set on the adapter and use those 😄 . This way we can set it to whatever we want in the tests, such as 1024 or 2048, and it will dynamically read the value that has been set for creating the texture array!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@clewis7 clewis7 Sep 29, 2024

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread fastplotlib/layouts/_plot_area.py Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread fastplotlib/widgets/image_widget/_sliders.py
Comment on lines +27 to +30
if "RTD_BUILD" in os.environ.keys():
if os.environ["RTD_BUILD"] == "1":
self._playing["t"] = True
self._loop = True

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clewis7 this is how the video auto-plays upon ImageWidget create for docs gallery generation

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clewis7 reacted with rocket emoji
All reactions
  • 🚀 1 reaction
Comment thread tests/conftest.py
Comment on lines +7 to +8
def pytest_sessionstart(session):
pygfx.renderers.wgpu.set_wgpu_limits(**{"max-texture-dimension2d": MAX_TEXTURE_SIZE})

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clewis7 This is how we set the limit before the test session starts. The limit must be set before any renderer object is created, so it that's why it's in pytest_sessionstart()

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

clewis7 reacted with rocket emoji
All reactions
  • 🚀 1 reaction
Comment thread tests/test_texture_array.py

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clewis7 so the difs here make sure that the TextureArray can be created correctly for the various scenarios given a limit of 1024, could you go through it and just check that the logic is correct? I've put notes.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread tests/test_texture_array.py
Comment on lines +172 to +173
row_indices_values=np.array([0, MAX_TEXTURE_SIZE]),
col_indices_values=np.array([0, MAX_TEXTURE_SIZE, 2 * MAX_TEXTURE_SIZE]),

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if we have an data array of shape (1200, 2200), and the limit is 1024 then we need a TextureArray of shape (2, 3), that's the buffer_shape here.

for the rows, we need 2 because 1200 with a limit of 1024 means we will have array with 1024 rows and another with 176

Same logic for the columns and the other tests below for test_tall and test_square

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kushalkolar
I a comma
a0deda9
kushalkolar
kushalkolar commented Sep 28, 2024
View reviewed changes
Comment thread examples/desktop/screenshots/image_widget_single_video.png

@kushalkolar kushalkolar Sep 28, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imagewidget tools show up in test screenshots too :D

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kushalkolar
slider tweaks
692c069
@kushalkolar

kushalkolar commented Sep 28, 2024

Copy link
Copy Markdown
Member Author

ALL TESTS FINALLY PASSING AND RTD BUILD IS BUILDING 🥳 🥳 🥳 🥳

I didn't expent the hardest thing about this would be dealing with rtd limits and sphinx gallery memory leak 🤦

@clewis7 few final comments up here just to get you up to speed, and if you could do a final check on that TextureArray test stuff I pointed out at the bottom. Other than that good to go!!

EricThomson reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 3 commits September 28, 2024 21:56
@kushalkolar
update user guide
2db61d7
@kushalkolar
update doc for image widget example
98bed34
@kushalkolar
fix guide
f4cfc23
@kushalkolar

kushalkolar commented Sep 29, 2024

Copy link
Copy Markdown
Member Author

I updated the user guide with imgui images, need to figure out why the vids are not looping, I used imageio to make them 🤔

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

kushalkolar added 2 commits September 28, 2024 23:13
@kushalkolar
update guide images
27e3d06
@kushalkolar
other update docs
31b6544
clewis7
clewis7 approved these changes Sep 29, 2024
View reviewed changes
@clewis7

clewis7 commented Sep 29, 2024

Copy link
Copy Markdown
Member

LGTM!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar
kushalkolar merged commit ab5b787 into main Sep 29, 2024
@kushalkolar
kushalkolar deleted the imgui-implementation branch September 29, 2024 17:18
@EricThomson

EricThomson commented Sep 30, 2024

Copy link
Copy Markdown
Contributor

This looks amazing Kushal!!!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@kushalkolar kushalkolar mentioned this pull request Oct 1, 2024
expose HistogramLUT tool at top level? #539
Closed
@kushalkolar kushalkolar mentioned this pull request Oct 9, 2024
reduce WGPU max texture limit for tests #610
Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@clewis7 clewis7 clewis7 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Qt UI small toolbar buttons on Mac traitlet's deprecation Usage with glfw - imgui

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@kushalkolar @lauraporta @clewis7 @EricThomson @tlambert03
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.