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 — storing graphics in dict by clewis7 · Pull Request #65 · fastplotlib/fastplotlib

Conversation

@clewis7

@clewis7 clewis7 commented Dec 13, 2022

Copy link
Copy Markdown
Member

addresses #64

moved to store graphics in dict with keys as the graphic class

keys currently need to passed in as a string, need to work on implementation to allow for

gp[0,0].get_graphics()[ImageGraphic]

as opposed to

gp[0,0].get_graphics()["ImageGraphic"]

Sorry, something went wrong.

Uh oh!

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

All reactions
Caitlin Lewis
storing graphics in dict
97ef592
@clewis7

clewis7 commented Dec 13, 2022

Copy link
Copy Markdown
Member Author

right now, I have it creating the keys to the dict by

self._graphics[graphic.__class__.__name__] = list()
self._graphics[graphic.__class__.__name__].append(graphic)

but __name__ returns a string, any suggestions on how to get graphic class name not as a string when just __class__ gives fastplotlib.graphics.image.ImageGraphic

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented Dec 13, 2022

Copy link
Copy Markdown
Member

yea not sure whether the best approach is to have it as a str or the class type itself, I think using graphic.__class__ should work, you can check if:

graphic.__class__ is ImageGraphic
All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented Dec 20, 2022

Copy link
Copy Markdown
Member

after this is done modify the __repr__ for PlotArea such that if there are > 5 graphics of any type, show only the first 5 and last 5 because I know there will be someone at the workshop who crashes their jupyter because they ended up calling the repr while having 10,000 graphics in a gridplot 🙃

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented Dec 26, 2022

Copy link
Copy Markdown
Member

after #88 there is now a class attribute that stores the name of the graphic as a str in lower case, see: https://github.com/kushalkolar/fastplotlib/pull/88/files#diff-a57994ecff1cde4e05c8175265219f0b5200da144ce8733b9eb560c09bcea7ddR9

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented Dec 26, 2022

Copy link
Copy Markdown
Member

rebase on mater or just start a new PR, this is pretty straight forward.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar

kushalkolar commented Jan 9, 2023

Copy link
Copy Markdown
Member

I think that since PlotAreas are indexable we don't really need this. We can revisit if it becomes necessary in the future.

All reactions

Sorry, something went wrong.

Uh oh!

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

@kushalkolar kushalkolar closed this Jan 9, 2023
@kushalkolar
kushalkolar deleted the graphic-org branch April 17, 2023 05:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

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.