handleSaveCanvas() {

    const tempImagePath = '$:/temp/tmap/snapshot';
    this.createAndSaveSnapshot(100, 100, tempImagePath);
    let imageName = `${this.view.getLabel()}.png`;

    const args = {
      dialog: {
        snapshot: tempImagePath,
        view: this.view.getLabel(),
        preselects: {
          width: this.canvas.width.toString(),
          height: this.canvas.height.toString(),
          name: imageName,
          action: 'download',
        }
      }
    };

    $tm.dialogManager.open('saveCanvas', args, (isConfirmed, outTObj) => {
      if (!isConfirmed) return;

      const width = outTObj.fields.width || args.dialog.preselects.width;
      const height = outTObj.fields.height || args.dialog.preselects.height;

      // save the image with the new sizes defined by the user in the dialog
      this.createAndSaveSnapshot(width, height, tempImagePath);

      // allow the user to override the default name or if name is
      // empty use the original default name
      const title = outTObj.fields.name || args.dialog.preselects.imageName;
      const action = outTObj.fields.action;

      if (action === 'download') {
        this.handleDownloadSnapshot(width, height, title);

      } else if (action === 'wiki') {
        utils.cp(tempImagePath, title, true);
        this.dispatchEvent({
          type: 'tm-navigate', navigateTo: title
        });

      } else if (action === 'placeholder') {
        this.view.addPlaceholder(tempImagePath);
      }

      // in any case
      $tw.wiki.deleteTiddler('$:/temp/tmap/snapshot');

    });

  }
Triggers a download dialog where the user can store the canvas
as png on his/her harddrive.