index.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var gLite = require('@antv/g-lite');
  4. var CanvasPathGenerator = require('@antv/g-plugin-canvas-path-generator');
  5. var CanvasPicker = require('@antv/g-plugin-canvas-picker');
  6. var CanvasRenderer = require('@antv/g-plugin-canvas-renderer');
  7. var DomInteraction = require('@antv/g-plugin-dom-interaction');
  8. var HTMLRenderer = require('@antv/g-plugin-html-renderer');
  9. var ImageLoader = require('@antv/g-plugin-image-loader');
  10. var util = require('@antv/util');
  11. function _interopNamespace(e) {
  12. if (e && e.__esModule) return e;
  13. var n = Object.create(null);
  14. if (e) {
  15. Object.keys(e).forEach(function (k) {
  16. if (k !== 'default') {
  17. var d = Object.getOwnPropertyDescriptor(e, k);
  18. Object.defineProperty(n, k, d.get ? d : {
  19. enumerable: true,
  20. get: function () {
  21. return e[k];
  22. }
  23. });
  24. }
  25. });
  26. }
  27. n['default'] = e;
  28. return Object.freeze(n);
  29. }
  30. var CanvasPathGenerator__namespace = /*#__PURE__*/_interopNamespace(CanvasPathGenerator);
  31. var CanvasPicker__namespace = /*#__PURE__*/_interopNamespace(CanvasPicker);
  32. var CanvasRenderer__namespace = /*#__PURE__*/_interopNamespace(CanvasRenderer);
  33. var DomInteraction__namespace = /*#__PURE__*/_interopNamespace(DomInteraction);
  34. var HTMLRenderer__namespace = /*#__PURE__*/_interopNamespace(HTMLRenderer);
  35. var ImageLoader__namespace = /*#__PURE__*/_interopNamespace(ImageLoader);
  36. function _regeneratorRuntime() {
  37. _regeneratorRuntime = function () {
  38. return exports;
  39. };
  40. var exports = {},
  41. Op = Object.prototype,
  42. hasOwn = Op.hasOwnProperty,
  43. defineProperty = Object.defineProperty || function (obj, key, desc) {
  44. obj[key] = desc.value;
  45. },
  46. $Symbol = "function" == typeof Symbol ? Symbol : {},
  47. iteratorSymbol = $Symbol.iterator || "@@iterator",
  48. asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
  49. toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
  50. function define(obj, key, value) {
  51. return Object.defineProperty(obj, key, {
  52. value: value,
  53. enumerable: !0,
  54. configurable: !0,
  55. writable: !0
  56. }), obj[key];
  57. }
  58. try {
  59. define({}, "");
  60. } catch (err) {
  61. define = function (obj, key, value) {
  62. return obj[key] = value;
  63. };
  64. }
  65. function wrap(innerFn, outerFn, self, tryLocsList) {
  66. var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
  67. generator = Object.create(protoGenerator.prototype),
  68. context = new Context(tryLocsList || []);
  69. return defineProperty(generator, "_invoke", {
  70. value: makeInvokeMethod(innerFn, self, context)
  71. }), generator;
  72. }
  73. function tryCatch(fn, obj, arg) {
  74. try {
  75. return {
  76. type: "normal",
  77. arg: fn.call(obj, arg)
  78. };
  79. } catch (err) {
  80. return {
  81. type: "throw",
  82. arg: err
  83. };
  84. }
  85. }
  86. exports.wrap = wrap;
  87. var ContinueSentinel = {};
  88. function Generator() {}
  89. function GeneratorFunction() {}
  90. function GeneratorFunctionPrototype() {}
  91. var IteratorPrototype = {};
  92. define(IteratorPrototype, iteratorSymbol, function () {
  93. return this;
  94. });
  95. var getProto = Object.getPrototypeOf,
  96. NativeIteratorPrototype = getProto && getProto(getProto(values([])));
  97. NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
  98. var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
  99. function defineIteratorMethods(prototype) {
  100. ["next", "throw", "return"].forEach(function (method) {
  101. define(prototype, method, function (arg) {
  102. return this._invoke(method, arg);
  103. });
  104. });
  105. }
  106. function AsyncIterator(generator, PromiseImpl) {
  107. function invoke(method, arg, resolve, reject) {
  108. var record = tryCatch(generator[method], generator, arg);
  109. if ("throw" !== record.type) {
  110. var result = record.arg,
  111. value = result.value;
  112. return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
  113. invoke("next", value, resolve, reject);
  114. }, function (err) {
  115. invoke("throw", err, resolve, reject);
  116. }) : PromiseImpl.resolve(value).then(function (unwrapped) {
  117. result.value = unwrapped, resolve(result);
  118. }, function (error) {
  119. return invoke("throw", error, resolve, reject);
  120. });
  121. }
  122. reject(record.arg);
  123. }
  124. var previousPromise;
  125. defineProperty(this, "_invoke", {
  126. value: function (method, arg) {
  127. function callInvokeWithMethodAndArg() {
  128. return new PromiseImpl(function (resolve, reject) {
  129. invoke(method, arg, resolve, reject);
  130. });
  131. }
  132. return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
  133. }
  134. });
  135. }
  136. function makeInvokeMethod(innerFn, self, context) {
  137. var state = "suspendedStart";
  138. return function (method, arg) {
  139. if ("executing" === state) throw new Error("Generator is already running");
  140. if ("completed" === state) {
  141. if ("throw" === method) throw arg;
  142. return doneResult();
  143. }
  144. for (context.method = method, context.arg = arg;;) {
  145. var delegate = context.delegate;
  146. if (delegate) {
  147. var delegateResult = maybeInvokeDelegate(delegate, context);
  148. if (delegateResult) {
  149. if (delegateResult === ContinueSentinel) continue;
  150. return delegateResult;
  151. }
  152. }
  153. if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
  154. if ("suspendedStart" === state) throw state = "completed", context.arg;
  155. context.dispatchException(context.arg);
  156. } else "return" === context.method && context.abrupt("return", context.arg);
  157. state = "executing";
  158. var record = tryCatch(innerFn, self, context);
  159. if ("normal" === record.type) {
  160. if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
  161. return {
  162. value: record.arg,
  163. done: context.done
  164. };
  165. }
  166. "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
  167. }
  168. };
  169. }
  170. function maybeInvokeDelegate(delegate, context) {
  171. var methodName = context.method,
  172. method = delegate.iterator[methodName];
  173. if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
  174. var record = tryCatch(method, delegate.iterator, context.arg);
  175. if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
  176. var info = record.arg;
  177. 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);
  178. }
  179. function pushTryEntry(locs) {
  180. var entry = {
  181. tryLoc: locs[0]
  182. };
  183. 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
  184. }
  185. function resetTryEntry(entry) {
  186. var record = entry.completion || {};
  187. record.type = "normal", delete record.arg, entry.completion = record;
  188. }
  189. function Context(tryLocsList) {
  190. this.tryEntries = [{
  191. tryLoc: "root"
  192. }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
  193. }
  194. function values(iterable) {
  195. if (iterable) {
  196. var iteratorMethod = iterable[iteratorSymbol];
  197. if (iteratorMethod) return iteratorMethod.call(iterable);
  198. if ("function" == typeof iterable.next) return iterable;
  199. if (!isNaN(iterable.length)) {
  200. var i = -1,
  201. next = function next() {
  202. for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
  203. return next.value = undefined, next.done = !0, next;
  204. };
  205. return next.next = next;
  206. }
  207. }
  208. return {
  209. next: doneResult
  210. };
  211. }
  212. function doneResult() {
  213. return {
  214. value: undefined,
  215. done: !0
  216. };
  217. }
  218. return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
  219. value: GeneratorFunctionPrototype,
  220. configurable: !0
  221. }), defineProperty(GeneratorFunctionPrototype, "constructor", {
  222. value: GeneratorFunction,
  223. configurable: !0
  224. }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
  225. var ctor = "function" == typeof genFun && genFun.constructor;
  226. return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
  227. }, exports.mark = function (genFun) {
  228. return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
  229. }, exports.awrap = function (arg) {
  230. return {
  231. __await: arg
  232. };
  233. }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
  234. return this;
  235. }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
  236. void 0 === PromiseImpl && (PromiseImpl = Promise);
  237. var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
  238. return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
  239. return result.done ? result.value : iter.next();
  240. });
  241. }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
  242. return this;
  243. }), define(Gp, "toString", function () {
  244. return "[object Generator]";
  245. }), exports.keys = function (val) {
  246. var object = Object(val),
  247. keys = [];
  248. for (var key in object) keys.push(key);
  249. return keys.reverse(), function next() {
  250. for (; keys.length;) {
  251. var key = keys.pop();
  252. if (key in object) return next.value = key, next.done = !1, next;
  253. }
  254. return next.done = !0, next;
  255. };
  256. }, exports.values = values, Context.prototype = {
  257. constructor: Context,
  258. reset: function (skipTempReset) {
  259. 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);
  260. },
  261. stop: function () {
  262. this.done = !0;
  263. var rootRecord = this.tryEntries[0].completion;
  264. if ("throw" === rootRecord.type) throw rootRecord.arg;
  265. return this.rval;
  266. },
  267. dispatchException: function (exception) {
  268. if (this.done) throw exception;
  269. var context = this;
  270. function handle(loc, caught) {
  271. return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
  272. }
  273. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  274. var entry = this.tryEntries[i],
  275. record = entry.completion;
  276. if ("root" === entry.tryLoc) return handle("end");
  277. if (entry.tryLoc <= this.prev) {
  278. var hasCatch = hasOwn.call(entry, "catchLoc"),
  279. hasFinally = hasOwn.call(entry, "finallyLoc");
  280. if (hasCatch && hasFinally) {
  281. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  282. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  283. } else if (hasCatch) {
  284. if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
  285. } else {
  286. if (!hasFinally) throw new Error("try statement without catch or finally");
  287. if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
  288. }
  289. }
  290. }
  291. },
  292. abrupt: function (type, arg) {
  293. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  294. var entry = this.tryEntries[i];
  295. if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
  296. var finallyEntry = entry;
  297. break;
  298. }
  299. }
  300. finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
  301. var record = finallyEntry ? finallyEntry.completion : {};
  302. return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
  303. },
  304. complete: function (record, afterLoc) {
  305. if ("throw" === record.type) throw record.arg;
  306. 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;
  307. },
  308. finish: function (finallyLoc) {
  309. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  310. var entry = this.tryEntries[i];
  311. if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
  312. }
  313. },
  314. catch: function (tryLoc) {
  315. for (var i = this.tryEntries.length - 1; i >= 0; --i) {
  316. var entry = this.tryEntries[i];
  317. if (entry.tryLoc === tryLoc) {
  318. var record = entry.completion;
  319. if ("throw" === record.type) {
  320. var thrown = record.arg;
  321. resetTryEntry(entry);
  322. }
  323. return thrown;
  324. }
  325. }
  326. throw new Error("illegal catch attempt");
  327. },
  328. delegateYield: function (iterable, resultName, nextLoc) {
  329. return this.delegate = {
  330. iterator: values(iterable),
  331. resultName: resultName,
  332. nextLoc: nextLoc
  333. }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
  334. }
  335. }, exports;
  336. }
  337. function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
  338. try {
  339. var info = gen[key](arg);
  340. var value = info.value;
  341. } catch (error) {
  342. reject(error);
  343. return;
  344. }
  345. if (info.done) {
  346. resolve(value);
  347. } else {
  348. Promise.resolve(value).then(_next, _throw);
  349. }
  350. }
  351. function _asyncToGenerator(fn) {
  352. return function () {
  353. var self = this,
  354. args = arguments;
  355. return new Promise(function (resolve, reject) {
  356. var gen = fn.apply(self, args);
  357. function _next(value) {
  358. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
  359. }
  360. function _throw(err) {
  361. asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
  362. }
  363. _next(undefined);
  364. });
  365. };
  366. }
  367. function _inheritsLoose(subClass, superClass) {
  368. subClass.prototype = Object.create(superClass.prototype);
  369. subClass.prototype.constructor = subClass;
  370. _setPrototypeOf(subClass, superClass);
  371. }
  372. function _setPrototypeOf(o, p) {
  373. _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
  374. o.__proto__ = p;
  375. return o;
  376. };
  377. return _setPrototypeOf(o, p);
  378. }
  379. var Canvas2DContextService = /*#__PURE__*/function () {
  380. function Canvas2DContextService(context) {
  381. this.$container = void 0;
  382. this.$canvas = void 0;
  383. this.dpr = void 0;
  384. this.context = void 0;
  385. this.canvasConfig = void 0;
  386. this.renderingContext = void 0;
  387. this.renderingContext = context.renderingContext;
  388. this.canvasConfig = context.config;
  389. }
  390. var _proto = Canvas2DContextService.prototype;
  391. _proto.init = function init() {
  392. var _this$canvasConfig = this.canvasConfig,
  393. container = _this$canvasConfig.container,
  394. canvas = _this$canvasConfig.canvas;
  395. if (canvas) {
  396. this.$canvas = canvas;
  397. if (container && canvas.parentElement !== container) {
  398. container.appendChild(canvas);
  399. }
  400. this.$container = canvas.parentElement;
  401. this.canvasConfig.container = this.$container;
  402. } else if (container) {
  403. // create container
  404. this.$container = util.isString(container) ? document.getElementById(container) : container;
  405. if (this.$container) {
  406. // create canvas
  407. var $canvas = document.createElement('canvas');
  408. this.$container.appendChild($canvas);
  409. if (!this.$container.style.position) {
  410. this.$container.style.position = 'relative';
  411. }
  412. this.$canvas = $canvas;
  413. }
  414. }
  415. this.context = this.$canvas.getContext('2d');
  416. this.resize(this.canvasConfig.width, this.canvasConfig.height);
  417. };
  418. _proto.getContext = function getContext() {
  419. return this.context;
  420. };
  421. _proto.getDomElement = function getDomElement() {
  422. return this.$canvas;
  423. };
  424. _proto.getDPR = function getDPR() {
  425. return this.dpr;
  426. };
  427. _proto.getBoundingClientRect = function getBoundingClientRect() {
  428. if (this.$canvas.getBoundingClientRect) {
  429. return this.$canvas.getBoundingClientRect();
  430. }
  431. };
  432. _proto.destroy = function destroy() {
  433. // @ts-ignore
  434. if (this.$container && this.$canvas && this.$canvas.parentNode) {
  435. // destroy context
  436. // @ts-ignore
  437. this.$container.removeChild(this.$canvas);
  438. }
  439. };
  440. _proto.resize = function resize(width, height) {
  441. var devicePixelRatio = this.canvasConfig.devicePixelRatio;
  442. // use user-defined dpr first
  443. var dpr = devicePixelRatio || gLite.isBrowser && window.devicePixelRatio || 1;
  444. dpr = dpr >= 1 ? Math.ceil(dpr) : 1;
  445. this.dpr = dpr;
  446. if (this.$canvas) {
  447. // set canvas width & height
  448. this.$canvas.width = this.dpr * width;
  449. this.$canvas.height = this.dpr * height;
  450. // set CSS style width & height
  451. gLite.setDOMSize(this.$canvas, width, height);
  452. // const dpr = this.getDPR();
  453. // scale all drawing operations by the dpr
  454. // @see https://www.html5rocks.com/en/tutorials/canvas/hidpi/
  455. // this.context.scale(dpr, dpr);
  456. }
  457. this.renderingContext.renderReasons.add(gLite.RenderReason.CAMERA_CHANGED);
  458. };
  459. _proto.applyCursorStyle = function applyCursorStyle(cursor) {
  460. if (this.$container && this.$container.style) {
  461. this.$container.style.cursor = cursor;
  462. }
  463. };
  464. _proto.toDataURL = /*#__PURE__*/function () {
  465. var _toDataURL = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
  466. var _options, type, encoderOptions;
  467. return _regeneratorRuntime().wrap(function _callee$(_context) {
  468. while (1) switch (_context.prev = _context.next) {
  469. case 0:
  470. if (options === void 0) {
  471. options = {};
  472. }
  473. _options = options, type = _options.type, encoderOptions = _options.encoderOptions;
  474. return _context.abrupt("return", this.context.canvas.toDataURL(type, encoderOptions));
  475. case 3:
  476. case "end":
  477. return _context.stop();
  478. }
  479. }, _callee, this);
  480. }));
  481. function toDataURL(_x) {
  482. return _toDataURL.apply(this, arguments);
  483. }
  484. return toDataURL;
  485. }();
  486. return Canvas2DContextService;
  487. }();
  488. var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
  489. _inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
  490. function ContextRegisterPlugin() {
  491. var _this;
  492. for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
  493. args[_key] = arguments[_key];
  494. }
  495. _this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
  496. _this.name = 'canvas-context-register';
  497. return _this;
  498. }
  499. var _proto = ContextRegisterPlugin.prototype;
  500. _proto.init = function init() {
  501. this.context.ContextService = Canvas2DContextService;
  502. };
  503. _proto.destroy = function destroy() {
  504. delete this.context.ContextService;
  505. };
  506. return ContextRegisterPlugin;
  507. }(gLite.AbstractRendererPlugin);
  508. var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
  509. _inheritsLoose(Renderer, _AbstractRenderer);
  510. function Renderer(config) {
  511. var _this;
  512. _this = _AbstractRenderer.call(this, config) || this;
  513. // register Canvas2DContext
  514. _this.registerPlugin(new ContextRegisterPlugin());
  515. _this.registerPlugin(new ImageLoader.Plugin());
  516. _this.registerPlugin(new CanvasPathGenerator.Plugin());
  517. // enable rendering with Canvas2D API
  518. _this.registerPlugin(new CanvasRenderer.Plugin());
  519. _this.registerPlugin(new DomInteraction.Plugin());
  520. // enable picking with Canvas2D API
  521. _this.registerPlugin(new CanvasPicker.Plugin());
  522. // render HTML component
  523. _this.registerPlugin(new HTMLRenderer.Plugin());
  524. return _this;
  525. }
  526. return Renderer;
  527. }(gLite.AbstractRenderer);
  528. exports.CanvasPathGenerator = CanvasPathGenerator__namespace;
  529. exports.CanvasPicker = CanvasPicker__namespace;
  530. exports.CanvasRenderer = CanvasRenderer__namespace;
  531. exports.DomInteraction = DomInteraction__namespace;
  532. exports.HTMLRenderer = HTMLRenderer__namespace;
  533. exports.ImageLoader = ImageLoader__namespace;
  534. exports.Renderer = Renderer;