class_docstr: Stores some state that persists between recursions into the element tree
code: def __init__(self, diagram_kwargs: typing.Optional[dict] = None):
      #: A dictionary mapping ParserElements to state relating to them
      self._element_diagram_states: Dict[int, ElementState] = {}
      #: A dictionary mapping ParserElement IDs to subdiagrams generated from them
      self.diagrams: Dict[int, EditablePartial[NamedDiagram]] = {}
      #: The index of the next unnamed element
      self.unnamed_index: int = 1
      #: The index of the next element. This is used for sorting
      self.index: int = 0
      #: Shared kwargs that are used to customize the construction of diagrams
      self.diagram_kwargs: dict = diagram_kwargs or {}
      self.extracted_diagram_names: Set[str] = set()
  
imports: import railroad
  import pyparsing
  import typing
  from typing import List, NamedTuple, Generic, TypeVar, Dict, Callable, Set, Iterable
  from jinja2 import Template
  from io import StringIO
  import inspect
label_desc: Use image node_id 1 to create a new ConverterState object  with example: obj = ConverterState(diagram_kwargs)