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 — working on toolbar by clewis7 · Pull Request #195 · fastplotlib/fastplotlib

Conversation

@clewis7

@clewis7 clewis7 commented May 17, 2023

Copy link
Copy Markdown
Member

#149

started working on creating a toolbar similar to bokeh's

used thenounproject.com to get free icons for buttons

have buttons in place in ipywidget HBox and then put plot and toolbar in VBox

just playing around in notebooks for now, need to figure out event system before incorporating into plots

Sorry, something went wrong.

Uh oh!

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

All reactions
Caitlin Lewis
working on toolbar
7869153
@clewis7

clewis7 commented May 17, 2023

Copy link
Copy Markdown
Member Author

current thought is to just use default bool for tool_buttons and when plot.show is called if True will render plot in VBox with toolbar

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented May 17, 2023

Copy link
Copy Markdown
Member

Do these images appear as buttons? If not is there a way to set an image inside a ipywidget button?

All reactions

Sorry, something went wrong.

Uh oh!

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

@clewis7

clewis7 commented May 17, 2023

Copy link
Copy Markdown
Member Author

I tried to make the buttons as images and was unsuccessful but then I found a library called ipyevents that allows you to make the images clickable but was going to keep playing around with making the button widget as images

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented May 17, 2023

Copy link
Copy Markdown
Member

Seems like you can choose icons from the "FontAwesome" collection and set them on ipywidget buttons with the icon= arg!

https://ipywidgets.readthedocs.io/en/stable/examples/Widget%20List.html#togglebutton
https://fontawesome.com/icons

All reactions

Sorry, something went wrong.

Uh oh!

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

Caitlin Lewis
toolbar updates
6a9fa9a
@clewis7

clewis7 commented May 18, 2023

Copy link
Copy Markdown
Member Author

got icons working in notebook with event handling, just need to implement into fpl

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented May 19, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Member

I think the best places to implement would be Plot.show() and GridPlot.show() . And make and return them only if it's detected to be running within jupyter.

One caveat with GridPlot is that we often want to apply these options (like not maintain aspect) to only certain subplots. Maybe we can have a dropdown menu for GridPlot which is filled with the subplot positions or names (if exists). Clicking within a subplot's scene also activates it in the dropdown menu.

Ideally it would be nice to show these buttons within the canvas, but that is more involved: pygfx/pygfx#519

what do you think about this for center-scene? https://fontawesome.com/icons/arrows-to-eye?f=classic&s=solid

For maintain-aspect you can do a toggleable button with bold text "1:1" instead of checkbox (I also call them checkable buttons because they're boolean buttons)

All reactions

Sorry, something went wrong.

Uh oh!

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

@clewis7

clewis7 commented May 19, 2023

Copy link
Copy Markdown
Member Author

unfortunately ipywidgets is only current with fontawesome buttons from version 5.15.4, so the arrow-to-eye icon is not available

All reactions

Sorry, something went wrong.

Uh oh!

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

@clewis7

clewis7 commented May 19, 2023

Copy link
Copy Markdown
Member Author

I think for now I will just use VBox and have the toolbar below the plot or gridplot and then when everything is functional I can look into doing canvas UI components

All reactions

Sorry, something went wrong.

Uh oh!

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

Caitlin Lewis added 2 commits May 19, 2023 13:25
Caitlin Lewis
basic toolbar for plot implemented
4bab1ce
Caitlin Lewis
base logic in notebook for gridplot toolbar
3e916c9
kushalkolar
kushalkolar requested changes May 19, 2023
View reviewed changes
Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

@clewis7

clewis7 commented May 19, 2023

Copy link
Copy Markdown
Member Author

Running into small issue, want to get your thoughts...

You can specify the enumeration of selectable options by passing a list (options are either (label, value) pairs, or simply values for which the labels are derived by calling str).

So gp tool bar is working when subplots have names or when there is combination of names/no names for subplots but I am running into an issue when all the subplots have no names due to above

When I try to input the options for the dropdown widget as tuples corresponding to plot position that can later be used as indexing for toolbar events, I think the widget thinks I am passing (label, value) pairs and therefore only the label is being put into the option instead of the entire subplot position :(

But I am also confused because it does fine when I am having a mix of subplots with names and no names

All reactions

Sorry, something went wrong.

Uh oh!

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

Caitlin Lewis
gp toolbar working when subplots have names & mix names/no names
2fa309b
kushalkolar
kushalkolar requested changes May 19, 2023
View reviewed changes
Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Caitlin Lewis
initial changes to simple plot toolbar
b985f31
kushalkolar
kushalkolar requested changes May 19, 2023
View reviewed changes
Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

kushalkolar
kushalkolar requested changes May 20, 2023
View reviewed changes
Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

kushalkolar
kushalkolar requested changes May 20, 2023
View reviewed changes
Comment thread fastplotlib/plot.py Resolved

Uh oh!

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

Caitlin Lewis and others added 6 commits May 22, 2023 09:54
Caitlin Lewis
updates to plot toolbar, still need to refactor into separate file
1702938
Caitlin Lewis
fixed gridplot toolbar, still need to move to separate class
20ef9dd
Caitlin Lewis
add flip button
47612a4
Caitlin Lewis
adding click event handler for gp toolbar dropdown options
14fda3c
Caitlin Lewis
keep new clicked plot up-to-date with toggle button values
5bb9f00
@clewis7
Merge branch 'master' into buttons
7519116
kushalkolar
kushalkolar requested changes May 23, 2023
View reviewed changes
Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Comment thread fastplotlib/layouts/_gridplot.py Resolved

Uh oh!

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

Caitlin Lewis added 2 commits May 23, 2023 11:37
Caitlin Lewis
requested changes
561b4eb
Caitlin Lewis
Merge branch 'buttons' of https://github.com/kushalkolar/fastplotlib …
0eacf45
…into buttons
kushalkolar
kushalkolar approved these changes May 23, 2023
View reviewed changes
@kushalkolar
kushalkolar merged commit f872155 into master May 23, 2023
@kushalkolar

kushalkolar commented May 23, 2023

Copy link
Copy Markdown
Member

works for plot and gridplot 😄

toolbar-2023-05-23_14.17.28.mp4
All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar kushalkolar mentioned this pull request Jun 4, 2023
Toolbar #149
Closed
10 tasks done
kushalkolar added a commit that referenced this pull request Jun 14, 2023
@clewis7 @kushalkolar
restarted tests, now work from the command line (#179)
a08e84c
* restarted tests, now work from the command line

* more tests

* more tests, still working on iw

* ipywidget can only be tested w/ nbmake

* updated tests

* support numpy fancy indexing for colors and data features (#177)

* type annotation fix for older python versions

* adding fancy indexing implemented in #177

* requested changes

* adding diff storage for CI pipeline usage

* use readthedocs.yaml for doc build (#189)

* tests changes, ready to start CI pipeline

* allow for screenshots to be regenerated via os.environ key

* CI build

* linux-build passes, still working on examples passing

* progress on CI pipeline, still need to figure out test build

* still failing test build, what I have for now

* kwargs for Plot and GridPlot to set canvas star size (#194)

* Update ci.yml

use pygfx before pylinalg refactor

* Update ci.yml

sed to remove pygfx from setup.py

* Update ci.yml

imageio

* Delete requirements_rtd.txt

* Update ci.yml

testing upload screens

* create BaseSelector, heatmap also works with LinearSelector and LinearRegionSelector (#187)

* BaseSelector handles most of the event handling, simplifies a lot of implementation.
* same functionality between Linear and LinearRegion, shift + arrow keys to move
* sync not tested for LinearRegion
* HeatmapGraphic has helpers to add Linear and LinearRegion
* indices getters and get_selected_data() are now based on Graphic type, so line and heatmap are handled differently
* started RectangleRegionSelector, will finish in another PR

* add features section to docs for Graphics

* fix sync bug, arrow key movements are toggleable (#198)

* finishes #107, #119, #192 (#200)

* more selector stuff (#199)

* garbage collection of selectors, not tested yet

* selecors gc progress, not there yet but not broken either

* move events for transparent fill areas

* rectangle region selector basic functionality works

* more rectangle region stuff

* basic recording for Plot (#178)

* basic recording for Plot

* opencv conditional import, reduce fps slightly in recorded vid to compensat, looks fine now

* forgot to add the actual recorder

* record Plot or GridPlot, uses PyAV, works well enough

* comment, organization

* cleaup

* changing linux build to have python versions matrix

* working on toolbar (#195)

* working on toolbar

* toolbar updates

* basic toolbar for plot implemented

* base logic in notebook for gridplot toolbar

* gp toolbar working when subplots have names & mix names/no names

* initial changes to simple plot toolbar

* updates to plot toolbar, still need to refactor into separate file

* fixed gridplot toolbar, still need to move to separate class

* add flip button

* adding click event handler for gp toolbar dropdown options

* keep new clicked plot up-to-date with toggle button values

* requested changes

* catchup with pygfx linalg refactor (#203)

* WIP, mapping to points and selectors not updated

* everything updated for linalg refactor except rectangle selector

* update toolbar w.r.t. linalg refactor

* update examples w.r.t. linalg refactor

* update readme

* image selector and heatmap linalg fixes (#204)

* add selector performance example nb

* Docs build fix (#210)

* Update .readthedocs.yaml, install pygfx from main

* Update .readthedocs.yaml

* Update .readthedocs.yaml

* all feature docs (#212)

* add all feature docs

* Create examples README

* Update README

* Update and rename README to README.md

* finish buttons for toolbar (#207)

* working on toolbar

* toolbar updates

* basic toolbar for plot implemented

* base logic in notebook for gridplot toolbar

* gp toolbar working when subplots have names & mix names/no names

* initial changes to simple plot toolbar

* updates to plot toolbar, still need to refactor into separate file

* fixed gridplot toolbar, still need to move to separate class

* add flip button

* adding click event handler for gp toolbar dropdown options

* keep new clicked plot up-to-date with toggle button values

* requested changes

* adding record button

* record button

* silly miss in merge conflict resolve

* wow I am struggling this am

* imagewidget toolbar for single plot iw

* toolbar for iw with gridplot

* requested changes

* update flip icon

* toolbar updates

* changes to linear selector event handler removal

* Update fastplotlib/widgets/image.py

* simplify toolbar stuff in show(), simplify image widget toolbar

---------

Co-authored-by: Kushal Kolar <[email protected]>

* nbmake tests work

* updating CI file

* all tests passing locally

* trying to get CI to run on ghub

* change screenshots to be stored as png files

* restarted tests, now work from the command line

* more tests

* more tests, still working on iw

* ipywidget can only be tested w/ nbmake

* updated tests

* adding fancy indexing implemented in #177

* requested changes

* adding diff storage for CI pipeline usage

* tests changes, ready to start CI pipeline

* allow for screenshots to be regenerated via os.environ key

* CI build

* linux-build passes, still working on examples passing

* progress on CI pipeline, still need to figure out test build

* still failing test build, what I have for now

* Update ci.yml

use pygfx before pylinalg refactor

* Update ci.yml

sed to remove pygfx from setup.py

* Update ci.yml

imageio

* Update ci.yml

testing upload screens

* changing linux build to have python versions matrix

* nbmake tests work

* updating CI file

* all tests passing locally

* trying to get CI to run on ghub

* change screenshots to be stored as png files

* rebase with master and update CI

* track *.png files using Git LFS

* yml for regenerating screenshots, updating CI yml to not regenerate

* update .gitignore and regen screenshots yml

* hopefully works

* add screenshots

* remove screenshots from git

* add screenshots, yet again

* setup options

* remove type annotation

* change workflow to use setup optiosn

* add pyav to setup for tests

* add scikit-image

* opencv instead of pyav

* add libpng-dev

* try pillow, better work ffs

* bah

* add git-lfs to apt install for github actions

* add interactive again

* install git lfs before checkout repo

* add git lfs fetch pull

* diffs

* diffs path

* update examples for canvas size and autoscale

* remove gpu screenshots

* add screenshot ground truth files from github actions generated screenshots

* remove interactive session stuff

---------

Co-authored-by: Kushal Kolar <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kushalkolar kushalkolar kushalkolar 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.

Uh oh!

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

2 participants

@clewis7 @kushalkolar
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.