code: function snapshot(params) {
      params = params || {};
  
      // Enforcing
      if (params.format && !(params.format in TYPES))
        throw Error('sigma.renderers.snaphot: unsupported format "' +
                    params.format + '".');
  
      var self = this,
          webgl = this instanceof sigma.renderers.webgl,
          doneContexts = [];
  
      // Creating a false canvas where we'll merge the other
      var merged = document.createElement('canvas'),
          mergedContext = merged.getContext('2d'),
          sized = false;
  
      // Iterating through context
      CONTEXTS.forEach(function(name) {
        if (!self.contexts[name])
          return;
  
        if (params.labels === false && name === 'labels')
          return;
  
        var canvas = self.domElements[name] || self.domElements['scene'],
            context = self.contexts[name];
  
        if (~doneContexts.indexOf(context))
          return;
  
        if (!sized) {
          merged.width = webgl && context instanceof WebGLRenderingContext ?
           canvas.width / 2 :
           canvas.width;
          merged.height = webgl && context instanceof WebGLRenderingContext ?
            canvas.height / 2 :
            canvas.height
          sized = true;
  
          // Do we want a background color?
          if (params.background) {
            mergedContext.rect(0, 0, merged.width, merged.height);
            mergedContext.fillStyle = params.background;
            mergedContext.fill();
          }
        }
  
        if (context instanceof WebGLRenderingContext)
          mergedContext.drawImage(canvas, 0, 0,
            canvas.width / 2, canvas.height / 2);
        else
          mergedContext.drawImage(canvas, 0, 0);
  
        doneContexts.push(context);
      });
  
      var dataUrl = merged.toDataURL(TYPES[params.format || 'png']);
  
      if (params.download)
        download(
          dataUrl,
          params.format || 'png',
          params.filename
        );
  
      // Cleaning
      delete mergedContext;
      delete merged;
      delete doneContexts;
  
      return dataUrl;
    }
docs: Main function