ExtensionAPI.js 609 B

123456789101112
  1. var zrUtil = require("zrender/lib/core/util");
  2. var echartsAPIList = ['getDom', 'getZr', 'getWidth', 'getHeight', 'getDevicePixelRatio', 'dispatchAction', 'isDisposed', 'on', 'off', 'getDataURL', 'getConnectedDataURL', 'getModel', 'getOption', 'getViewOfComponentModel', 'getViewOfSeriesModel']; // And `getCoordinateSystems` and `getComponentByElement` will be injected in echarts.js
  3. function ExtensionAPI(chartInstance) {
  4. zrUtil.each(echartsAPIList, function (name) {
  5. this[name] = zrUtil.bind(chartInstance[name], chartInstance);
  6. }, this);
  7. }
  8. var _default = ExtensionAPI;
  9. module.exports = _default;