@antv/g-svg 1.8.29 → 1.8.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,6 @@
1
1
  import type { CanvasContext, DataURLOptions, GlobalRuntime, ContextService } from '@antv/g-lite';
2
2
  export declare class SVGContextService implements ContextService<SVGElement> {
3
+ context: GlobalRuntime & CanvasContext;
3
4
  private $container;
4
5
  private $namespace;
5
6
  private dpr;
@@ -13,6 +14,7 @@ export declare class SVGContextService implements ContextService<SVGElement> {
13
14
  destroy(): void;
14
15
  resize(width: number, height: number): void;
15
16
  applyCursorStyle(cursor: string): void;
17
+ private generateCSSText;
16
18
  toDataURL(options?: Partial<DataURLOptions>): Promise<string>;
17
19
  }
18
20
  //# sourceMappingURL=SVGContextService.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"SVGContextService.d.ts","sourceRoot":"","sources":["../src/SVGContextService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,aAAa,EAEb,cAAc,EACf,MAAM,cAAc,CAAC;AAKtB,qBAAa,iBAAkB,YAAW,cAAc,CAAC,UAAU,CAAC;IAClE,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,YAAY,CAAwB;gBAEhC,OAAO,EAAE,aAAa,GAAG,aAAa;IAI5C,IAAI;IA2BV,aAAa;IAIb,UAAU;IAIV,MAAM;IAIN,qBAAqB;IAIrB,OAAO;IAOP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQpC,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAMzB,SAAS,CAAC,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM;CAiBtD"}
1
+ {"version":3,"file":"SVGContextService.d.ts","sourceRoot":"","sources":["../src/SVGContextService.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,aAAa,EAEb,cAAc,EAEf,MAAM,cAAc,CAAC;AAKtB,qBAAa,iBAAkB,YAAW,cAAc,CAAC,UAAU,CAAC;IAO/C,OAAO,EAAE,aAAa,GAAG,aAAa;IANzD,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,UAAU,CAAoB;IACtC,OAAO,CAAC,GAAG,CAAS;IAEpB,OAAO,CAAC,YAAY,CAAwB;gBAEzB,OAAO,EAAE,aAAa,GAAG,aAAa;IAInD,IAAI;IA2BV,aAAa;IAIb,UAAU;IAIV,MAAM;IAIN,qBAAqB;IAIrB,OAAO;IAOP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAQpC,gBAAgB,CAAC,MAAM,EAAE,MAAM;IAM/B,OAAO,CAAC,eAAe;IA8BjB,SAAS,CAAC,OAAO,GAAE,OAAO,CAAC,cAAc,CAAM;CAgItD"}
package/dist/index.esm.js CHANGED
@@ -1,4 +1,4 @@
1
- import { isBrowser, AbstractRendererPlugin, AbstractRenderer } from '@antv/g-lite';
1
+ import { propertyMetadataCache, isBrowser, AbstractRendererPlugin, AbstractRenderer } from '@antv/g-lite';
2
2
  import { Plugin as Plugin$1 } from '@antv/g-plugin-dom-interaction';
3
3
  import * as DomInteraction from '@antv/g-plugin-dom-interaction';
4
4
  export { DomInteraction };
@@ -341,49 +341,10 @@ function _asyncToGenerator(fn) {
341
341
  });
342
342
  };
343
343
  }
344
- function _classCallCheck(instance, Constructor) {
345
- if (!(instance instanceof Constructor)) {
346
- throw new TypeError("Cannot call a class as a function");
347
- }
348
- }
349
- function _defineProperties(target, props) {
350
- for (var i = 0; i < props.length; i++) {
351
- var descriptor = props[i];
352
- descriptor.enumerable = descriptor.enumerable || false;
353
- descriptor.configurable = true;
354
- if ("value" in descriptor) descriptor.writable = true;
355
- Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
356
- }
357
- }
358
- function _createClass(Constructor, protoProps, staticProps) {
359
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
360
- if (staticProps) _defineProperties(Constructor, staticProps);
361
- Object.defineProperty(Constructor, "prototype", {
362
- writable: false
363
- });
364
- return Constructor;
365
- }
366
- function _inherits(subClass, superClass) {
367
- if (typeof superClass !== "function" && superClass !== null) {
368
- throw new TypeError("Super expression must either be null or a function");
369
- }
370
- subClass.prototype = Object.create(superClass && superClass.prototype, {
371
- constructor: {
372
- value: subClass,
373
- writable: true,
374
- configurable: true
375
- }
376
- });
377
- Object.defineProperty(subClass, "prototype", {
378
- writable: false
379
- });
380
- if (superClass) _setPrototypeOf(subClass, superClass);
381
- }
382
- function _getPrototypeOf(o) {
383
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
384
- return o.__proto__ || Object.getPrototypeOf(o);
385
- };
386
- return _getPrototypeOf(o);
344
+ function _inheritsLoose(subClass, superClass) {
345
+ subClass.prototype = Object.create(superClass.prototype);
346
+ subClass.prototype.constructor = subClass;
347
+ _setPrototypeOf(subClass, superClass);
387
348
  }
388
349
  function _setPrototypeOf(o, p) {
389
350
  _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
@@ -392,219 +353,276 @@ function _setPrototypeOf(o, p) {
392
353
  };
393
354
  return _setPrototypeOf(o, p);
394
355
  }
395
- function _isNativeReflectConstruct() {
396
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
397
- if (Reflect.construct.sham) return false;
398
- if (typeof Proxy === "function") return true;
399
- try {
400
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
401
- return true;
402
- } catch (e) {
403
- return false;
404
- }
405
- }
406
- function _assertThisInitialized(self) {
407
- if (self === void 0) {
408
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
409
- }
410
- return self;
411
- }
412
- function _possibleConstructorReturn(self, call) {
413
- if (call && (typeof call === "object" || typeof call === "function")) {
414
- return call;
415
- } else if (call !== void 0) {
416
- throw new TypeError("Derived constructors may only return object or undefined");
356
+ function _objectWithoutPropertiesLoose(source, excluded) {
357
+ if (source == null) return {};
358
+ var target = {};
359
+ var sourceKeys = Object.keys(source);
360
+ var key, i;
361
+ for (i = 0; i < sourceKeys.length; i++) {
362
+ key = sourceKeys[i];
363
+ if (excluded.indexOf(key) >= 0) continue;
364
+ target[key] = source[key];
417
365
  }
418
- return _assertThisInitialized(self);
419
- }
420
- function _createSuper(Derived) {
421
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
422
- return function _createSuperInternal() {
423
- var Super = _getPrototypeOf(Derived),
424
- result;
425
- if (hasNativeReflectConstruct) {
426
- var NewTarget = _getPrototypeOf(this).constructor;
427
- result = Reflect.construct(Super, arguments, NewTarget);
428
- } else {
429
- result = Super.apply(this, arguments);
430
- }
431
- return _possibleConstructorReturn(this, result);
432
- };
433
- }
434
- function _toPrimitive(input, hint) {
435
- if (typeof input !== "object" || input === null) return input;
436
- var prim = input[Symbol.toPrimitive];
437
- if (prim !== undefined) {
438
- var res = prim.call(input, hint || "default");
439
- if (typeof res !== "object") return res;
440
- throw new TypeError("@@toPrimitive must return a primitive value.");
441
- }
442
- return (hint === "string" ? String : Number)(input);
443
- }
444
- function _toPropertyKey(arg) {
445
- var key = _toPrimitive(arg, "string");
446
- return typeof key === "symbol" ? key : String(key);
366
+ return target;
447
367
  }
448
368
 
369
+ var _excluded = ["offset", "composite", "computedOffset", "easing"],
370
+ _excluded2 = ["offset", "composite", "computedOffset", "easing", "transformOrigin"],
371
+ _excluded3 = ["offset", "composite", "computedOffset", "easing", "transformOrigin"],
372
+ _excluded4 = ["offset", "composite", "computedOffset", "easing", "transformOrigin"];
449
373
  var SVGContextService = /*#__PURE__*/function () {
450
374
  function SVGContextService(context) {
451
- _classCallCheck(this, SVGContextService);
375
+ this.context = void 0;
452
376
  this.$container = void 0;
453
377
  this.$namespace = void 0;
454
378
  this.dpr = void 0;
455
379
  this.canvasConfig = void 0;
380
+ this.context = context;
456
381
  this.canvasConfig = context.config;
457
382
  }
458
- _createClass(SVGContextService, [{
459
- key: "init",
460
- value: function () {
461
- var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
462
- var _this$canvasConfig, container, doc, devicePixelRatio, $namespace, dpr;
463
- return _regeneratorRuntime().wrap(function _callee$(_context) {
464
- while (1) {
465
- switch (_context.prev = _context.next) {
466
- case 0:
467
- _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, doc = _this$canvasConfig.document, devicePixelRatio = _this$canvasConfig.devicePixelRatio; // create container
468
- this.$container = isString(container) ? (doc || document).getElementById(container) : container;
469
- if (this.$container) {
470
- if (!this.$container.style.position) {
471
- this.$container.style.position = 'relative';
472
- }
473
- $namespace = createSVGElement('svg', doc);
474
- $namespace.setAttribute('width', "".concat(this.canvasConfig.width));
475
- $namespace.setAttribute('height', "".concat(this.canvasConfig.height));
476
- this.$container.appendChild($namespace);
477
- this.$namespace = $namespace;
383
+ var _proto = SVGContextService.prototype;
384
+ _proto.init = /*#__PURE__*/function () {
385
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
386
+ var _this$canvasConfig, container, doc, devicePixelRatio, $namespace, dpr;
387
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
388
+ while (1) {
389
+ switch (_context.prev = _context.next) {
390
+ case 0:
391
+ _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, doc = _this$canvasConfig.document, devicePixelRatio = _this$canvasConfig.devicePixelRatio; // create container
392
+ this.$container = isString(container) ? (doc || document).getElementById(container) : container;
393
+ if (this.$container) {
394
+ if (!this.$container.style.position) {
395
+ this.$container.style.position = 'relative';
478
396
  }
479
- // use user-defined dpr first
480
- dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
481
- dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
482
- this.dpr = dpr;
483
- case 6:
484
- case "end":
485
- return _context.stop();
486
- }
397
+ $namespace = createSVGElement('svg', doc);
398
+ $namespace.setAttribute('width', "" + this.canvasConfig.width);
399
+ $namespace.setAttribute('height', "" + this.canvasConfig.height);
400
+ this.$container.appendChild($namespace);
401
+ this.$namespace = $namespace;
402
+ }
403
+ // use user-defined dpr first
404
+ dpr = devicePixelRatio || isBrowser && window.devicePixelRatio || 1;
405
+ dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
406
+ this.dpr = dpr;
407
+ case 6:
408
+ case "end":
409
+ return _context.stop();
487
410
  }
488
- }, _callee, this);
489
- }));
490
- function init() {
491
- return _init.apply(this, arguments);
492
- }
493
- return init;
494
- }() // @ts-ignore
495
- }, {
496
- key: "getDomElement",
497
- value: function getDomElement() {
498
- return this.$namespace;
499
- }
500
- }, {
501
- key: "getContext",
502
- value: function getContext() {
503
- return this.$namespace;
504
- }
505
- }, {
506
- key: "getDPR",
507
- value: function getDPR() {
508
- return this.dpr;
411
+ }
412
+ }, _callee, this);
413
+ }));
414
+ function init() {
415
+ return _init.apply(this, arguments);
509
416
  }
510
- }, {
511
- key: "getBoundingClientRect",
512
- value: function getBoundingClientRect() {
513
- var _this$$namespace;
514
- return (_this$$namespace = this.$namespace) === null || _this$$namespace === void 0 ? void 0 : _this$$namespace.getBoundingClientRect();
417
+ return init;
418
+ }() // @ts-ignore
419
+ ;
420
+ _proto.getDomElement = function getDomElement() {
421
+ return this.$namespace;
422
+ };
423
+ _proto.getContext = function getContext() {
424
+ return this.$namespace;
425
+ };
426
+ _proto.getDPR = function getDPR() {
427
+ return this.dpr;
428
+ };
429
+ _proto.getBoundingClientRect = function getBoundingClientRect() {
430
+ var _this$$namespace;
431
+ return (_this$$namespace = this.$namespace) === null || _this$$namespace === void 0 ? void 0 : _this$$namespace.getBoundingClientRect();
432
+ };
433
+ _proto.destroy = function destroy() {
434
+ // destroy context
435
+ if (this.$container && this.$namespace && this.$namespace.parentNode) {
436
+ this.$container.removeChild(this.$namespace);
515
437
  }
516
- }, {
517
- key: "destroy",
518
- value: function destroy() {
519
- // destroy context
520
- if (this.$container && this.$namespace && this.$namespace.parentNode) {
521
- this.$container.removeChild(this.$namespace);
522
- }
438
+ };
439
+ _proto.resize = function resize(width, height) {
440
+ // SVG should ignore DPR
441
+ if (this.$namespace) {
442
+ this.$namespace.setAttribute('width', "" + width);
443
+ this.$namespace.setAttribute('height', "" + height);
523
444
  }
524
- }, {
525
- key: "resize",
526
- value: function resize(width, height) {
527
- // SVG should ignore DPR
528
- if (this.$namespace) {
529
- this.$namespace.setAttribute('width', "".concat(width));
530
- this.$namespace.setAttribute('height', "".concat(height));
531
- }
445
+ };
446
+ _proto.applyCursorStyle = function applyCursorStyle(cursor) {
447
+ if (this.$container) {
448
+ this.$container.style.cursor = cursor;
532
449
  }
533
- }, {
534
- key: "applyCursorStyle",
535
- value: function applyCursorStyle(cursor) {
536
- if (this.$container) {
537
- this.$container.style.cursor = cursor;
538
- }
450
+ };
451
+ _proto.generateCSSText = function generateCSSText(animationName, selector, keyframes, timing, prefixes) {
452
+ if (prefixes === void 0) {
453
+ prefixes = {};
539
454
  }
540
- }, {
541
- key: "toDataURL",
542
- value: function () {
543
- var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
544
- var cloneNode,
545
- svgDocType,
546
- svgDoc;
547
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
548
- while (1) {
549
- switch (_context2.prev = _context2.next) {
550
- case 0:
551
- cloneNode = this.$namespace.cloneNode(true);
552
- svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');
553
- svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);
554
- svgDoc.replaceChild(cloneNode, svgDoc.documentElement);
555
- return _context2.abrupt("return", "data:image/svg+xml;charset=utf8,".concat(encodeURIComponent(new XMLSerializer().serializeToString(svgDoc))));
556
- case 6:
557
- case "end":
558
- return _context2.stop();
559
- }
455
+ var duration = timing.duration,
456
+ easing = timing.easing,
457
+ delay = timing.delay,
458
+ direction = timing.direction,
459
+ iterations = timing.iterations,
460
+ fill = timing.fill;
461
+ return "@keyframes " + animationName + "{" + keyframes.map(function (keyframe) {
462
+ var offset = keyframe.offset,
463
+ composite = keyframe.composite,
464
+ computedOffset = keyframe.computedOffset,
465
+ easing = keyframe.easing,
466
+ rest = _objectWithoutPropertiesLoose(keyframe, _excluded);
467
+ var rules = Object.keys(rest).map(function (attributeName) {
468
+ return attributeName + ":" + (prefixes[attributeName] || '') + rest[attributeName] + ";";
469
+ }).join('');
470
+ return computedOffset * 100 + "%{" + rules + "}";
471
+ }).join('') + "}" + (selector + " {animation: " + animationName + " " + duration + "ms " + easing + " " + delay + "ms " + (iterations === Infinity ? 'infinite' : iterations) + " " + direction + " " + fill + ";}");
472
+ };
473
+ _proto.toDataURL = /*#__PURE__*/function () {
474
+ var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
475
+ var _this = this;
476
+ var cloneNode, doc, animationCounter, $style, svgDocType, svgDoc;
477
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
478
+ while (1) {
479
+ switch (_context2.prev = _context2.next) {
480
+ case 0:
481
+ cloneNode = this.$namespace.cloneNode(true);
482
+ doc = this.canvasConfig.document;
483
+ animationCounter = 0;
484
+ $style = null;
485
+ this.context.renderingContext.root.forEach(function (object) {
486
+ var animations = object.getAnimations();
487
+ if (animations.length) {
488
+ if (!$style) {
489
+ // export animations to <style>, using CSS Transformation
490
+ $style = (doc || document).createElement('style');
491
+ cloneNode.appendChild($style);
492
+ }
493
+ // @ts-ignore
494
+ var svgElement = object.elementSVG;
495
+ var selfSelector = "#" + svgElement.$el.id;
496
+ var groupSelector = "#" + svgElement.$groupEl.id;
497
+ var selfCssText = '';
498
+ var groupCssText = '';
499
+ animations.forEach(function (animation) {
500
+ var keyframes = animation.effect.getKeyframes();
501
+ // split attributes into self and group
502
+ if (keyframes.length) {
503
+ var selfAttributes = [];
504
+ var groupAttributes = [];
505
+ var _keyframes$ = keyframes[0],
506
+ offset = _keyframes$.offset,
507
+ composite = _keyframes$.composite,
508
+ computedOffset = _keyframes$.computedOffset,
509
+ easing = _keyframes$.easing,
510
+ transformOrigin = _keyframes$.transformOrigin,
511
+ rest = _objectWithoutPropertiesLoose(_keyframes$, _excluded2);
512
+ Object.keys(rest).forEach(function (attributeName) {
513
+ var _propertyMetadataCach;
514
+ if (attributeName === 'transform') {
515
+ groupAttributes.push(attributeName);
516
+ }
517
+ var inherited = !!((_propertyMetadataCach = propertyMetadataCache[attributeName]) === null || _propertyMetadataCach === void 0 ? void 0 : _propertyMetadataCach.inh);
518
+ if (inherited) {
519
+ groupAttributes.push(attributeName);
520
+ } else if (attributeName !== 'transform') {
521
+ selfAttributes.push(attributeName);
522
+ }
523
+ });
524
+ if (groupAttributes.length) {
525
+ var keyframesWithGroup = keyframes.map(function (keyframe) {
526
+ var offset = keyframe.offset,
527
+ composite = keyframe.composite,
528
+ computedOffset = keyframe.computedOffset,
529
+ easing = keyframe.easing,
530
+ transformOrigin = keyframe.transformOrigin,
531
+ rest = _objectWithoutPropertiesLoose(keyframe, _excluded3);
532
+ var ret = {
533
+ offset: offset,
534
+ composite: composite,
535
+ computedOffset: computedOffset,
536
+ easing: easing
537
+ };
538
+ Object.keys(rest).forEach(function (attributeName) {
539
+ if (groupAttributes.includes(attributeName)) {
540
+ ret[attributeName] = keyframe[attributeName];
541
+ }
542
+ });
543
+ return ret;
544
+ });
545
+ groupCssText += _this.generateCSSText("a" + animationCounter++, groupSelector, keyframesWithGroup, animation.effect.getComputedTiming(), {
546
+ transform: svgElement.$groupEl.getAttribute('transform')
547
+ });
548
+ }
549
+ if (selfAttributes.length) {
550
+ var keyframesWithSelf = keyframes.map(function (keyframe) {
551
+ var offset = keyframe.offset,
552
+ composite = keyframe.composite,
553
+ computedOffset = keyframe.computedOffset,
554
+ easing = keyframe.easing,
555
+ transformOrigin = keyframe.transformOrigin,
556
+ rest = _objectWithoutPropertiesLoose(keyframe, _excluded4);
557
+ var ret = {
558
+ offset: offset,
559
+ composite: composite,
560
+ computedOffset: computedOffset,
561
+ easing: easing
562
+ };
563
+ Object.keys(rest).forEach(function (attributeName) {
564
+ if (selfAttributes.includes(attributeName)) {
565
+ ret[attributeName] = keyframe[attributeName];
566
+ }
567
+ });
568
+ return ret;
569
+ });
570
+ selfCssText += _this.generateCSSText("a" + animationCounter++, selfSelector, keyframesWithSelf, animation.effect.getComputedTiming());
571
+ }
572
+ }
573
+ });
574
+ $style.textContent += selfCssText + groupCssText;
575
+ }
576
+ });
577
+ svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');
578
+ svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);
579
+ svgDoc.replaceChild(cloneNode, svgDoc.documentElement);
580
+ return _context2.abrupt("return", "data:image/svg+xml;charset=utf8," + encodeURIComponent(new XMLSerializer().serializeToString(svgDoc)));
581
+ case 10:
582
+ case "end":
583
+ return _context2.stop();
560
584
  }
561
- }, _callee2, this);
562
- }));
563
- function toDataURL() {
564
- return _toDataURL.apply(this, arguments);
565
- }
566
- return toDataURL;
567
- }()
568
- }]);
585
+ }
586
+ }, _callee2, this);
587
+ }));
588
+ function toDataURL(_x) {
589
+ return _toDataURL.apply(this, arguments);
590
+ }
591
+ return toDataURL;
592
+ }();
569
593
  return SVGContextService;
570
594
  }();
571
595
 
572
596
  var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
573
- _inherits(ContextRegisterPlugin, _AbstractRendererPlug);
574
- var _super = _createSuper(ContextRegisterPlugin);
597
+ _inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
575
598
  function ContextRegisterPlugin() {
576
599
  var _this;
577
- _classCallCheck(this, ContextRegisterPlugin);
578
600
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
579
601
  args[_key] = arguments[_key];
580
602
  }
581
- _this = _super.call.apply(_super, [this].concat(args));
603
+ _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
582
604
  _this.name = 'svg-context-register';
583
605
  return _this;
584
606
  }
585
- _createClass(ContextRegisterPlugin, [{
586
- key: "init",
587
- value: function init() {
588
- // @ts-ignore
589
- this.context.ContextService = SVGContextService;
590
- }
591
- }, {
592
- key: "destroy",
593
- value: function destroy() {
594
- delete this.context.ContextService;
595
- }
596
- }]);
607
+ var _proto = ContextRegisterPlugin.prototype;
608
+ _proto.init = function init() {
609
+ // @ts-ignore
610
+ this.context.ContextService = SVGContextService;
611
+ };
612
+ _proto.destroy = function destroy() {
613
+ delete this.context.ContextService;
614
+ };
597
615
  return ContextRegisterPlugin;
598
616
  }(AbstractRendererPlugin);
599
617
 
600
618
  var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
601
- _inherits(Renderer, _AbstractRenderer);
602
- var _super = _createSuper(Renderer);
603
- function Renderer() {
619
+ _inheritsLoose(Renderer, _AbstractRenderer);
620
+ function Renderer(config) {
604
621
  var _this;
605
- var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
606
- _classCallCheck(this, Renderer);
607
- _this = _super.call(this, config);
622
+ if (config === void 0) {
623
+ config = {};
624
+ }
625
+ _this = _AbstractRenderer.call(this, config) || this;
608
626
  _this.registerPlugin(new ContextRegisterPlugin());
609
627
  _this.registerPlugin(new Plugin({
610
628
  outputSVGElementId: config.outputSVGElementId
@@ -613,7 +631,7 @@ var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
613
631
  _this.registerPlugin(new Plugin$2());
614
632
  return _this;
615
633
  }
616
- return _createClass(Renderer);
634
+ return Renderer;
617
635
  }(AbstractRenderer);
618
636
 
619
637
  export { Renderer };