    # File lib/graphviz.rb, line 228
      def add_graph( xGraphName = nil, hOpts = {}, &block )
        if xGraphName.kind_of?(Hash)
          hOpts = xGraphName
          xGraphName = nil
        end

        if xGraphName.nil?
          xGraphID = String.random(11)
          xGraphName = ""
        else
          xGraphID = xGraphName
        end

        @hoGraphs[xGraphID] = GraphViz::new( xGraphName, {:parent => self, :type => @oGraphType}, &block )

        hOpts.each do |xKey, xValue|
          @hoGraphs[xGraphID][xKey.to_s] = xValue
        end

        @elements_order.push( {
          "type" => "graph",
          "name" => xGraphName,
          "value" => @hoGraphs[xGraphID]
        } )

        return( @hoGraphs[xGraphID] )
      end