function render( format ) {
	/* eslint-disable no-invalid-this */
	var out;
	var tmp;
	var fmt;

	tmp = this.renderFormat;
	if ( arguments.length ) {
		// Temporarily set the render format:
		this.renderFormat = format;
		fmt = format;
	} else {
		fmt = tmp;
	}
	debug( 'Render format: %s.', this.renderFormat );

	debug( 'Rendering...' );
	out = this._render( fmt );
	this.emit( 'render', out );

	if ( arguments.length ) {
		// Restore the render format:
		this.renderFormat = tmp;
	}
	return out;
}
Renders a plot.

@private
@param {string} [format] - render format
@returns {(VTree|string)} virtual tree or a string