message: fix: use the first registered renderer if renderer not exists
diff: @@ -101,19 +101,18 @@ class ZRender {
  this.id = id;
  - const self = this;
  const storage = new Storage();
  - let rendererType = opts.renderer;
  + let rendererType = opts.renderer || 'canvas';
  +
  // TODO WebGL
  if (useVML) {
  - if (!painterCtors.vml) {
  - throw new Error('You need to require \'zrender/vml/vml\' to support IE8');
  - }
  - rendererType = 'vml';
  + throw new Error('IE8 support has been dropped since 5.0');
  }
  - else if (!rendererType) {
  - rendererType = 'canvas';
  +
  + if (!painterCtors[rendererType]) {
  + // Use the first registered renderer.
  + rendererType = zrUtil.keys(painterCtors)[0];
  }
  if (!painterCtors[rendererType]) {
  throw new Error(`Renderer '${rendererType}' is not imported. Please import it first.`);
  @@ -146,7 +145,7 @@ class ZRender {
  */
  add(el: Element) {
  if (!el) {
  - return
  + return;
  }
  this.storage.addRoot(el);
  el.addSelfToZr(this);
  @@ -158,7 +157,7 @@ class ZRender {
  */
  remove(el: Element) {
  if (!el) {
  - return
  + return;
  }
  this.storage.delRoot(el);
  el.removeSelfFromZr(this);
  