What problem does this feature solve?
I want to develop a node.js program to generate echarts image file. ( ssr-echarts )
There is a theme npm package in echarts4 ( echarts-themes-js ), but I can't find one for echarts5.
Some default themes are enough.
我想开发一个nodejs程序生成echarts图片( ssr-echarts )。
在echarts4,有一个echarts theme的npm包( echarts-themes-js ),但是echarts5找不到npm主题包。
只要默认主题就可以。
8条答案
按热度按时间i5desfxk1#
Hi! We've received your issue and please be patient to get responded. 🎉
The average response time is expected to be within one day for weekdays.
In the meanwhile, please make sure thatyou have posted enough image to demo your request. You may also check out the API and chart option to get the answer.
If you don't get helped for a long time (over a week) or have an urgent question to ask, you may also send an email to dev@echarts.apache.org . Please attach the issue link if it's a technical question.
If you are interested in the project, you may also subscribe our mailing list .
Have a nice day! 🍵
dzjeubhm2#
@lz1998 It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people, we'd like to suggest using English next time. 🤗
TRANSLATED
BODY
What problem does this feature solve?
I want to develop a node.js program to generate echarts image file. ( ssr-echarts )
There is a theme npm package in echarts4 ( echarts-themes-js ), but I can't find one for echarts5.
Some default themes are enough.
I want to develop a nodejs program to generate echarts pictures ( ssr-echarts ).
In echarts4, there is an npm package of echarts theme ( echarts-themes-js ), but echarts5 cannot find the npm theme package.
As long as the default theme is fine.
What does the proposed API look like?
https://www.npmjs.com/package/echarts-themes-js
chy5wohz3#
I have tries import theme from echarts/theme, but an error occured
fcipmucu4#
I replace
factory(exports, require('echarts/lib/echarts'));
tofactory(exports, require('echarts'));
in node_modules/echarts/theme/*, then the problem is fixed。bvuwiixz5#
I'm thinking it might be better to use
echarts/lib/echarts
if we need tree-shaking.This issue reminds me of another issue to look into. The current UMD header seems to make tree-shaking invalid.
@pissang There are several questions about this
1) The current UMD header invalidates tree-shaking, which makes the bundled size larger.
This is bundled result with the current UMD header
the module dependency in AMD seems incorrect, it may be also
echarts/lib/echarts
.Besides, it would be better to increase the priority of
commonjs
, just like whatrolllup
generates.This is bundled result with the tweaked UMD header
2) For themes / bmap extension or other plugins, should we import
echarts/lib/echarts
orecharts/core
?We can see
echarts/lib/echarts
is importingCanvasRenderer
&DatasetComponent
, but they are unnecessary if only SVG renderer is needed and no dataset is used. Especially theme files, they only need to import core library.Perhaps, we should also make the theme or extension installable.
1cklez4t6#
Because
echarts/lib/echarts
is not an AMD module. So I still useecharts
in the AMD branch. Didn't know the bundler will still go into the AMD branch. This change is very neat and helpful.Perhaps, we should also make the theme or extension installable.
Yes, it will be great. But we may need to provide separate ESM modules for themes that can be installed manually.
m3eecexj7#
Because echarts/lib/echarts is not an AMD module.
Never notice it before. Thank you for pointing out.
w8biq8rn8#
Yes, it will be great. But we may need to provide separate ESM modules for themes that can be installed manually.
When will the themes modules be provided?