sholloway / agents-playground

MIT License
4 stars 0 forks source link

Graphical Layers #35

Closed sholloway closed 2 years ago

sholloway commented 2 years ago

The current division of responsibility between the Simulation class, EventBasedSimulation, and individual sims is messy due to the rendering of statistics. Need to pull the concept of layers into the Simulation abstraction. To further complicate things, layers can be toggled as displayed or not using the simulation toolbar.

Tasks

Common Layers

Rendering Layers

Layers are technically rendered using DearPyGUI.draw_layer call. These need to be established in a DearPyGUI.draw_list.

Layer Related Components

Operations

From an abstraction perspective these are the activities involving layers that need to be supported.

Add Layer

def add_layer(id: DearPyGUITag, layer: Callable, label: str) -> None:
  """Adds a layer

  Args
    - id: The layer identifier.
    - layer: The code to run to render the layer. 
    - label: The text to display in the Layers menu of the simulation toolbar.
  """
  # Makes the layer available for rendering in the draw_list.
  # Adds a toggle control in the Layers menu.

Remove Layer

def remove_layer(id: DearPyGUITag) -> None:
  """ Removes a layer from the simulation

  Args
    - id: The layer identifier.
  """
  pass