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 — better organization of Graphics · Issue #64 · fastplotlib/fastplotlib

better organization of Graphics #64

New issue
Copy link
New issue
Copy link
Closed
Closed
better organization of Graphics#64
Copy link

Description

@kushalkolar
kushalkolar
opened on Dec 13, 2022
Issue body actions
  1. We will soon have LineCollection so we should probably add a class attribute to each Graphic subclass which is used by Plot when attaching all the graphic names as methods, since we'd want plot.line_collection() rather than plot.linecollection() and it maintains pep8 standards
  2. It would be useful for Subplot.get_graphics() to return a dict instead of a list, where the keys are the object class.
    example:
from fastlotlib.graphics import ImageGraphic

graphics_in_subplot = gp[0, 0].get_graphics() 

graphics_in_subplot[ImageGraphic] # list of all `ImageGraphic` graphic instances within the subplot

@clewis7 thoughts?

Activity

  1. clewis7 commented on Dec 13, 2022

    @clewis7
    clewis7
    on Dec 13, 2022
    Member
    More actions

    I like this idea! I can work on making Subplot.get_graphics() return a dict instead of a list

  2. kushalkolar commented on Dec 17, 2022

    @kushalkolar
    kushalkolar
    on Dec 17, 2022
    MemberAuthor
    More actions

    I think it'd be useful to use the __init_subclass__ to parse Graphic class names automatically and set it as a class attribute that can be used for this purpose, but also for attaching the various add_graphic-name methods, so we can have this parsing code in just one place.

    This would also make it so that the dict keys for this PR are str, I think str is better since then the user doesn't need another set of import statements for graphic objects.

  3. kushalkolar commented on Jan 2, 2023

    @kushalkolar
    kushalkolar
    on Jan 2, 2023
    MemberAuthor
    More actions

    printing it out like a table or just with nice tabspacing would be nice:

    images:
      "image-name-a" <mem location etc...>
    line_collection:
      "lc-A" <n-items>, ...
  4. kushalkolar
    closed this as completedon Jan 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      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.