@antv/g-svg 1.1.6 → 1.1.8-alpha.1

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.
package/dist/index.js CHANGED
@@ -33,195 +33,494 @@ var DomInteraction__namespace = /*#__PURE__*/_interopNamespace(DomInteraction);
33
33
  var SVGRenderer__namespace = /*#__PURE__*/_interopNamespace(SVGRenderer);
34
34
  var SVGPicker__namespace = /*#__PURE__*/_interopNamespace(SVGPicker);
35
35
 
36
- function _classCallCheck(instance, Constructor) {
37
- if (!(instance instanceof Constructor)) {
38
- throw new TypeError("Cannot call a class as a function");
36
+ function _regeneratorRuntime() {
37
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
38
+
39
+ _regeneratorRuntime = function () {
40
+ return exports;
41
+ };
42
+
43
+ var exports = {},
44
+ Op = Object.prototype,
45
+ hasOwn = Op.hasOwnProperty,
46
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
47
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
48
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
49
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
50
+
51
+ function define(obj, key, value) {
52
+ return Object.defineProperty(obj, key, {
53
+ value: value,
54
+ enumerable: !0,
55
+ configurable: !0,
56
+ writable: !0
57
+ }), obj[key];
39
58
  }
40
- }
41
59
 
42
- function _defineProperties(target, props) {
43
- for (var i = 0; i < props.length; i++) {
44
- var descriptor = props[i];
45
- descriptor.enumerable = descriptor.enumerable || false;
46
- descriptor.configurable = true;
47
- if ("value" in descriptor) descriptor.writable = true;
48
- Object.defineProperty(target, descriptor.key, descriptor);
60
+ try {
61
+ define({}, "");
62
+ } catch (err) {
63
+ define = function (obj, key, value) {
64
+ return obj[key] = value;
65
+ };
49
66
  }
50
- }
51
67
 
52
- function _createClass(Constructor, protoProps, staticProps) {
53
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
54
- if (staticProps) _defineProperties(Constructor, staticProps);
55
- Object.defineProperty(Constructor, "prototype", {
56
- writable: false
57
- });
58
- return Constructor;
59
- }
68
+ function wrap(innerFn, outerFn, self, tryLocsList) {
69
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
70
+ generator = Object.create(protoGenerator.prototype),
71
+ context = new Context(tryLocsList || []);
72
+ return generator._invoke = function (innerFn, self, context) {
73
+ var state = "suspendedStart";
74
+ return function (method, arg) {
75
+ if ("executing" === state) throw new Error("Generator is already running");
76
+
77
+ if ("completed" === state) {
78
+ if ("throw" === method) throw arg;
79
+ return doneResult();
80
+ }
60
81
 
61
- function _inherits(subClass, superClass) {
62
- if (typeof superClass !== "function" && superClass !== null) {
63
- throw new TypeError("Super expression must either be null or a function");
82
+ for (context.method = method, context.arg = arg;;) {
83
+ var delegate = context.delegate;
84
+
85
+ if (delegate) {
86
+ var delegateResult = maybeInvokeDelegate(delegate, context);
87
+
88
+ if (delegateResult) {
89
+ if (delegateResult === ContinueSentinel) continue;
90
+ return delegateResult;
91
+ }
92
+ }
93
+
94
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
95
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
96
+ context.dispatchException(context.arg);
97
+ } else "return" === context.method && context.abrupt("return", context.arg);
98
+ state = "executing";
99
+ var record = tryCatch(innerFn, self, context);
100
+
101
+ if ("normal" === record.type) {
102
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
103
+ return {
104
+ value: record.arg,
105
+ done: context.done
106
+ };
107
+ }
108
+
109
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
110
+ }
111
+ };
112
+ }(innerFn, self, context), generator;
64
113
  }
65
114
 
66
- subClass.prototype = Object.create(superClass && superClass.prototype, {
67
- constructor: {
68
- value: subClass,
69
- writable: true,
70
- configurable: true
115
+ function tryCatch(fn, obj, arg) {
116
+ try {
117
+ return {
118
+ type: "normal",
119
+ arg: fn.call(obj, arg)
120
+ };
121
+ } catch (err) {
122
+ return {
123
+ type: "throw",
124
+ arg: err
125
+ };
71
126
  }
127
+ }
128
+
129
+ exports.wrap = wrap;
130
+ var ContinueSentinel = {};
131
+
132
+ function Generator() {}
133
+
134
+ function GeneratorFunction() {}
135
+
136
+ function GeneratorFunctionPrototype() {}
137
+
138
+ var IteratorPrototype = {};
139
+ define(IteratorPrototype, iteratorSymbol, function () {
140
+ return this;
72
141
  });
73
- Object.defineProperty(subClass, "prototype", {
74
- writable: false
75
- });
76
- if (superClass) _setPrototypeOf(subClass, superClass);
77
- }
142
+ var getProto = Object.getPrototypeOf,
143
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
144
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
145
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
146
+
147
+ function defineIteratorMethods(prototype) {
148
+ ["next", "throw", "return"].forEach(function (method) {
149
+ define(prototype, method, function (arg) {
150
+ return this._invoke(method, arg);
151
+ });
152
+ });
153
+ }
78
154
 
79
- function _getPrototypeOf(o) {
80
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
81
- return o.__proto__ || Object.getPrototypeOf(o);
82
- };
83
- return _getPrototypeOf(o);
84
- }
155
+ function AsyncIterator(generator, PromiseImpl) {
156
+ function invoke(method, arg, resolve, reject) {
157
+ var record = tryCatch(generator[method], generator, arg);
158
+
159
+ if ("throw" !== record.type) {
160
+ var result = record.arg,
161
+ value = result.value;
162
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
163
+ invoke("next", value, resolve, reject);
164
+ }, function (err) {
165
+ invoke("throw", err, resolve, reject);
166
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
167
+ result.value = unwrapped, resolve(result);
168
+ }, function (error) {
169
+ return invoke("throw", error, resolve, reject);
170
+ });
171
+ }
85
172
 
86
- function _setPrototypeOf(o, p) {
87
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
88
- o.__proto__ = p;
89
- return o;
90
- };
173
+ reject(record.arg);
174
+ }
91
175
 
92
- return _setPrototypeOf(o, p);
93
- }
176
+ var previousPromise;
94
177
 
95
- function _isNativeReflectConstruct() {
96
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
97
- if (Reflect.construct.sham) return false;
98
- if (typeof Proxy === "function") return true;
178
+ this._invoke = function (method, arg) {
179
+ function callInvokeWithMethodAndArg() {
180
+ return new PromiseImpl(function (resolve, reject) {
181
+ invoke(method, arg, resolve, reject);
182
+ });
183
+ }
99
184
 
100
- try {
101
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
102
- return true;
103
- } catch (e) {
104
- return false;
185
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
186
+ };
105
187
  }
106
- }
107
188
 
108
- function _assertThisInitialized(self) {
109
- if (self === void 0) {
110
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
189
+ function maybeInvokeDelegate(delegate, context) {
190
+ var method = delegate.iterator[context.method];
191
+
192
+ if (undefined === method) {
193
+ if (context.delegate = null, "throw" === context.method) {
194
+ if (delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
195
+ context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
196
+ }
197
+
198
+ return ContinueSentinel;
199
+ }
200
+
201
+ var record = tryCatch(method, delegate.iterator, context.arg);
202
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
203
+ var info = record.arg;
204
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
205
+ }
206
+
207
+ function pushTryEntry(locs) {
208
+ var entry = {
209
+ tryLoc: locs[0]
210
+ };
211
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
212
+ }
213
+
214
+ function resetTryEntry(entry) {
215
+ var record = entry.completion || {};
216
+ record.type = "normal", delete record.arg, entry.completion = record;
217
+ }
218
+
219
+ function Context(tryLocsList) {
220
+ this.tryEntries = [{
221
+ tryLoc: "root"
222
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
223
+ }
224
+
225
+ function values(iterable) {
226
+ if (iterable) {
227
+ var iteratorMethod = iterable[iteratorSymbol];
228
+ if (iteratorMethod) return iteratorMethod.call(iterable);
229
+ if ("function" == typeof iterable.next) return iterable;
230
+
231
+ if (!isNaN(iterable.length)) {
232
+ var i = -1,
233
+ next = function next() {
234
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
235
+
236
+ return next.value = undefined, next.done = !0, next;
237
+ };
238
+
239
+ return next.next = next;
240
+ }
241
+ }
242
+
243
+ return {
244
+ next: doneResult
245
+ };
111
246
  }
112
247
 
113
- return self;
248
+ function doneResult() {
249
+ return {
250
+ value: undefined,
251
+ done: !0
252
+ };
253
+ }
254
+
255
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
256
+ var ctor = "function" == typeof genFun && genFun.constructor;
257
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
258
+ }, exports.mark = function (genFun) {
259
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
260
+ }, exports.awrap = function (arg) {
261
+ return {
262
+ __await: arg
263
+ };
264
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
265
+ return this;
266
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
267
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
268
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
269
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
270
+ return result.done ? result.value : iter.next();
271
+ });
272
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
273
+ return this;
274
+ }), define(Gp, "toString", function () {
275
+ return "[object Generator]";
276
+ }), exports.keys = function (object) {
277
+ var keys = [];
278
+
279
+ for (var key in object) keys.push(key);
280
+
281
+ return keys.reverse(), function next() {
282
+ for (; keys.length;) {
283
+ var key = keys.pop();
284
+ if (key in object) return next.value = key, next.done = !1, next;
285
+ }
286
+
287
+ return next.done = !0, next;
288
+ };
289
+ }, exports.values = values, Context.prototype = {
290
+ constructor: Context,
291
+ reset: function (skipTempReset) {
292
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
293
+ },
294
+ stop: function () {
295
+ this.done = !0;
296
+ var rootRecord = this.tryEntries[0].completion;
297
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
298
+ return this.rval;
299
+ },
300
+ dispatchException: function (exception) {
301
+ if (this.done) throw exception;
302
+ var context = this;
303
+
304
+ function handle(loc, caught) {
305
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
306
+ }
307
+
308
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
309
+ var entry = this.tryEntries[i],
310
+ record = entry.completion;
311
+ if ("root" === entry.tryLoc) return handle("end");
312
+
313
+ if (entry.tryLoc <= this.prev) {
314
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
315
+ hasFinally = hasOwn.call(entry, "finallyLoc");
316
+
317
+ if (hasCatch && hasFinally) {
318
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
319
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
320
+ } else if (hasCatch) {
321
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
322
+ } else {
323
+ if (!hasFinally) throw new Error("try statement without catch or finally");
324
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
325
+ }
326
+ }
327
+ }
328
+ },
329
+ abrupt: function (type, arg) {
330
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
331
+ var entry = this.tryEntries[i];
332
+
333
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
334
+ var finallyEntry = entry;
335
+ break;
336
+ }
337
+ }
338
+
339
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
340
+ var record = finallyEntry ? finallyEntry.completion : {};
341
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
342
+ },
343
+ complete: function (record, afterLoc) {
344
+ if ("throw" === record.type) throw record.arg;
345
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
346
+ },
347
+ finish: function (finallyLoc) {
348
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
349
+ var entry = this.tryEntries[i];
350
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
351
+ }
352
+ },
353
+ catch: function (tryLoc) {
354
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
355
+ var entry = this.tryEntries[i];
356
+
357
+ if (entry.tryLoc === tryLoc) {
358
+ var record = entry.completion;
359
+
360
+ if ("throw" === record.type) {
361
+ var thrown = record.arg;
362
+ resetTryEntry(entry);
363
+ }
364
+
365
+ return thrown;
366
+ }
367
+ }
368
+
369
+ throw new Error("illegal catch attempt");
370
+ },
371
+ delegateYield: function (iterable, resultName, nextLoc) {
372
+ return this.delegate = {
373
+ iterator: values(iterable),
374
+ resultName: resultName,
375
+ nextLoc: nextLoc
376
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
377
+ }
378
+ }, exports;
114
379
  }
115
380
 
116
- function _possibleConstructorReturn(self, call) {
117
- if (call && (typeof call === "object" || typeof call === "function")) {
118
- return call;
119
- } else if (call !== void 0) {
120
- throw new TypeError("Derived constructors may only return object or undefined");
381
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
382
+ try {
383
+ var info = gen[key](arg);
384
+ var value = info.value;
385
+ } catch (error) {
386
+ reject(error);
387
+ return;
121
388
  }
122
389
 
123
- return _assertThisInitialized(self);
390
+ if (info.done) {
391
+ resolve(value);
392
+ } else {
393
+ Promise.resolve(value).then(_next, _throw);
394
+ }
124
395
  }
125
396
 
126
- function _createSuper(Derived) {
127
- var hasNativeReflectConstruct = _isNativeReflectConstruct();
397
+ function _asyncToGenerator(fn) {
398
+ return function () {
399
+ var self = this,
400
+ args = arguments;
401
+ return new Promise(function (resolve, reject) {
402
+ var gen = fn.apply(self, args);
128
403
 
129
- return function _createSuperInternal() {
130
- var Super = _getPrototypeOf(Derived),
131
- result;
404
+ function _next(value) {
405
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
406
+ }
132
407
 
133
- if (hasNativeReflectConstruct) {
134
- var NewTarget = _getPrototypeOf(this).constructor;
408
+ function _throw(err) {
409
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
410
+ }
135
411
 
136
- result = Reflect.construct(Super, arguments, NewTarget);
137
- } else {
138
- result = Super.apply(this, arguments);
139
- }
412
+ _next(undefined);
413
+ });
414
+ };
415
+ }
416
+
417
+ function _inheritsLoose(subClass, superClass) {
418
+ subClass.prototype = Object.create(superClass.prototype);
419
+ subClass.prototype.constructor = subClass;
140
420
 
141
- return _possibleConstructorReturn(this, result);
421
+ _setPrototypeOf(subClass, superClass);
422
+ }
423
+
424
+ function _setPrototypeOf(o, p) {
425
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
426
+ o.__proto__ = p;
427
+ return o;
142
428
  };
429
+
430
+ return _setPrototypeOf(o, p);
143
431
  }
144
432
 
145
433
  var SVGContextService = /*#__PURE__*/function () {
146
434
  function SVGContextService() {
147
- _classCallCheck(this, SVGContextService);
148
-
149
435
  this.$container = void 0;
150
436
  this.$namespace = void 0;
151
437
  this.dpr = void 0;
152
438
  this.canvasConfig = void 0;
153
439
  }
154
440
 
155
- _createClass(SVGContextService, [{
156
- key: "init",
157
- value: function init() {
158
- var container = this.canvasConfig.container; // create container
441
+ var _proto = SVGContextService.prototype;
159
442
 
160
- this.$container = g.isString(container) ? document.getElementById(container) : container;
443
+ _proto.init = /*#__PURE__*/function () {
444
+ var _init = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
445
+ var _this$canvasConfig, container, doc, $namespace, dpr;
161
446
 
162
- if (this.$container) {
163
- if (!this.$container.style.position) {
164
- this.$container.style.position = 'relative';
165
- }
447
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
448
+ while (1) {
449
+ switch (_context.prev = _context.next) {
450
+ case 0:
451
+ _this$canvasConfig = this.canvasConfig, container = _this$canvasConfig.container, doc = _this$canvasConfig.document; // create container
166
452
 
167
- var $namespace = SVGRenderer.createSVGElement('svg');
168
- $namespace.setAttribute('width', "".concat(this.canvasConfig.width));
169
- $namespace.setAttribute('height', "".concat(this.canvasConfig.height));
170
- this.$container.appendChild($namespace);
171
- this.$namespace = $namespace;
172
- }
453
+ this.$container = g.isString(container) ? (doc || document).getElementById(container) : container;
173
454
 
174
- var dpr = window.devicePixelRatio || 1;
175
- dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
176
- this.dpr = dpr;
177
- } // @ts-ignore
455
+ if (this.$container) {
456
+ if (!this.$container.style.position) {
457
+ this.$container.style.position = 'relative';
458
+ }
178
459
 
179
- }, {
180
- key: "getDomElement",
181
- value: function getDomElement() {
182
- return this.$namespace;
183
- }
184
- }, {
185
- key: "getContext",
186
- value: function getContext() {
187
- return this.$namespace;
188
- }
189
- }, {
190
- key: "getDPR",
191
- value: function getDPR() {
192
- return this.dpr;
193
- }
194
- }, {
195
- key: "getBoundingClientRect",
196
- value: function getBoundingClientRect() {
197
- var _this$$namespace;
460
+ $namespace = SVGRenderer.createSVGElement('svg', doc);
461
+ $namespace.setAttribute('width', "" + this.canvasConfig.width);
462
+ $namespace.setAttribute('height', "" + this.canvasConfig.height);
463
+ this.$container.appendChild($namespace);
464
+ this.$namespace = $namespace;
465
+ }
466
+
467
+ dpr = window.devicePixelRatio || 1;
468
+ dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
469
+ this.dpr = dpr;
198
470
 
199
- return (_this$$namespace = this.$namespace) === null || _this$$namespace === void 0 ? void 0 : _this$$namespace.getBoundingClientRect();
471
+ case 6:
472
+ case "end":
473
+ return _context.stop();
474
+ }
475
+ }
476
+ }, _callee, this);
477
+ }));
478
+
479
+ function init() {
480
+ return _init.apply(this, arguments);
200
481
  }
201
- }, {
202
- key: "destroy",
203
- value: function destroy() {
204
- // destroy context
205
- if (this.$container && this.$namespace && this.$namespace.parentNode) {
206
- this.$container.removeChild(this.$namespace);
207
- }
482
+
483
+ return init;
484
+ }() // @ts-ignore
485
+ ;
486
+
487
+ _proto.getDomElement = function getDomElement() {
488
+ return this.$namespace;
489
+ };
490
+
491
+ _proto.getContext = function getContext() {
492
+ return this.$namespace;
493
+ };
494
+
495
+ _proto.getDPR = function getDPR() {
496
+ return this.dpr;
497
+ };
498
+
499
+ _proto.getBoundingClientRect = function getBoundingClientRect() {
500
+ var _this$$namespace;
501
+
502
+ return (_this$$namespace = this.$namespace) === null || _this$$namespace === void 0 ? void 0 : _this$$namespace.getBoundingClientRect();
503
+ };
504
+
505
+ _proto.destroy = function destroy() {
506
+ // destroy context
507
+ if (this.$container && this.$namespace && this.$namespace.parentNode) {
508
+ this.$container.removeChild(this.$namespace);
208
509
  }
209
- }, {
210
- key: "resize",
211
- value: function resize(width, height) {
212
- if (this.$namespace) {
213
- this.$namespace.setAttribute('width', "".concat(width));
214
- this.$namespace.setAttribute('height', "".concat(height));
215
- }
510
+ };
511
+
512
+ _proto.resize = function resize(width, height) {
513
+ if (this.$namespace) {
514
+ this.$namespace.setAttribute('width', "" + width);
515
+ this.$namespace.setAttribute('height', "" + height);
216
516
  }
217
- }, {
218
- key: "applyCursorStyle",
219
- value: function applyCursorStyle(cursor) {
220
- if (this.$container) {
221
- this.$container.style.cursor = cursor;
222
- }
517
+ };
518
+
519
+ _proto.applyCursorStyle = function applyCursorStyle(cursor) {
520
+ if (this.$container) {
521
+ this.$container.style.cursor = cursor;
223
522
  }
224
- }]);
523
+ };
225
524
 
226
525
  return SVGContextService;
227
526
  }();
@@ -240,37 +539,29 @@ var containerModule = manaSyringe.Module(function (register) {
240
539
  });
241
540
  var ContextRegisterPlugin = /*#__PURE__*/function () {
242
541
  function ContextRegisterPlugin() {
243
- _classCallCheck(this, ContextRegisterPlugin);
244
-
245
542
  this.name = 'svg-context-register';
246
543
  }
247
544
 
248
- _createClass(ContextRegisterPlugin, [{
249
- key: "init",
250
- value: function init(container) {
251
- container.load(containerModule, true);
252
- }
253
- }, {
254
- key: "destroy",
255
- value: function destroy(container) {
256
- container.unload(containerModule);
257
- }
258
- }]);
545
+ var _proto = ContextRegisterPlugin.prototype;
546
+
547
+ _proto.init = function init(container) {
548
+ container.load(containerModule, true);
549
+ };
550
+
551
+ _proto.destroy = function destroy(container) {
552
+ container.unload(containerModule);
553
+ };
259
554
 
260
555
  return ContextRegisterPlugin;
261
556
  }();
262
557
 
263
558
  var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
264
- _inherits(Renderer, _AbstractRenderer);
265
-
266
- var _super = _createSuper(Renderer);
559
+ _inheritsLoose(Renderer, _AbstractRenderer);
267
560
 
268
561
  function Renderer(config) {
269
562
  var _this;
270
563
 
271
- _classCallCheck(this, Renderer);
272
-
273
- _this = _super.call(this, config);
564
+ _this = _AbstractRenderer.call(this, config) || this;
274
565
 
275
566
  _this.registerPlugin(new ContextRegisterPlugin());
276
567
 
@@ -283,7 +574,7 @@ var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
283
574
  return _this;
284
575
  }
285
576
 
286
- return _createClass(Renderer);
577
+ return Renderer;
287
578
  }(g.AbstractRenderer);
288
579
 
289
580
  exports.DomInteraction = DomInteraction__namespace;