echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] An extension has been customized, but I want to introduce it on demand

Open alanwhy opened this issue 4 years ago • 2 comments

Version

5.2.2

Link to Minimal Reproduction

No response

Steps to Reproduce

I have customized an extension called GLMap, which can put echarts on my map, but now I can only fully introduce echarts, which will make my project package large.

like this

import * as echarts from "echarts"

// do something, like custom my extension

I saw the expansion mode of Baidu map, which is also full. So I want to know what I should do if I introduce it on demand?

Current Behavior

I'm now introducing it on demand:

import "./GLMap";
import * as echarts from "echarts/core";
import { VisualMapComponent } from "echarts/components";
import { CanvasRenderer } from "echarts/renderers";
echarts.use([VisualMapComponent, CanvasRenderer]);

export default echarts;

Although I feel like I don't use VisualMapComponent at all

Expected Behavior

Can be introduced on demand

Environment

- OS: Mac M1
- Browser: Chrome lasted
- Framework: native

Any additional comments?

No response

alanwhy avatar Jan 13 '22 15:01 alanwhy

Of course, I'm Chinese. In English, I think it might be more friendly in GitHub?

But my English comes from translation software🤪

alanwhy avatar Jan 13 '22 15:01 alanwhy

楼主解决了吗 我也发现了 我的版本是 "echarts": "^5.3.2", 只需要 import * as echarts from 'echarts/core'; 就能使用所有功能

压根不用如下配置就能使用所有的 而且引入了如下的跟注释了后大小也没有变化

// import { TitleComponent, TooltipComponent } from 'echarts/components';
// import { EffectScatterChart } from 'echarts/charts';// ScatterChart,
// import { UniversalTransition } from 'echarts/features';
// import { CanvasRenderer } from 'echarts/renderers';

// echarts.use([

//     // TitleComponent,
//     // TooltipComponent,
//     // ScatterChart,
//     // EffectScatterChart,
//     CanvasRenderer,
//     // UniversalTransition
// ]);

sunny-fun avatar Aug 08 '22 11:08 sunny-fun