code: def to_digraph(self, *args, **kwargs):
          digraph = _nx.DiGraph()
          for equation in self.equations:
              reactants, arrow, products = [value.strip() for value
                                            in _split_arrows(str(equation))]
              try:
                  attr = equation.to_series("reactants", *args,
                                            **kwargs).to_dict()
              except ValueError:
                  attr = dict()
              digraph.add_node(reactants, **attr)
              try:
                  attr = equation.to_series("products", *args,
                                            **kwargs).to_dict()
              except ValueError:
                  attr = dict()
              digraph.add_node(products, **attr)
              try:
                  attr = equation.to_series(*args, **kwargs).to_dict()
              except ValueError:
                  attr = dict()
              digraph.add_edge(reactants, products, **attr)
              if arrow == '<=>':
                  digraph.add_edge(products, reactants, **attr)
          return digraph