code: @Override
      public Rectangle paint(IReactionSet reactionSet, IDrawVisitor drawVisitor) {
          // total up the bounding boxes
          Rectangle2D totalBounds = BoundsCalculator.calculateBounds(reactionSet);
  
          // setup and draw
          this.setupTransformNatural(totalBounds);
  
          ElementGroup diagram = new ElementGroup();
          for (IReaction reaction : reactionSet.reactions()) {
              diagram.add(reactionRenderer.generateDiagram(reaction));
          }
          this.paint(drawVisitor, diagram);
  
          // the size of the painted diagram is returned
          return this.convertToDiagramBounds(totalBounds);
      }
docs: {@inheritDoc}