Skip to content

better organization of Graphics #64

Closed

Description

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

    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
    MemberAuthor

    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
    MemberAuthor

    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>, ...
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