async function renderToCanvas(scaleFactor, opt) {
    const r = await renderHeadless(this, RenderType.Canvas, scaleFactor, opt);
    return r.canvas();
  }
Produce a Canvas instance containing a rendered visualization.
This method is asynchronous, returning a Promise instance.
@return {Promise} - A promise that resolves to a Canvas instance.