add labelLayout and universalTransition feature imports in generated code
diff --git a/common/buildCode.js b/common/buildCode.js
index 88db799..2274157 100644
--- a/common/buildCode.js
+++ b/common/buildCode.js
@@ -79,6 +79,8 @@
linesGL: 'LinesGLChart'
};
+const FEATURES = ['UniversalTransition', 'LabelLayout'];
+
const COMPONENTS_MAP_REVERSE = {};
const CHARTS_MAP_REVERSE = {};
const CHARTS_GL_MAP_REVERSE = {};
@@ -180,6 +182,13 @@
deps.push(COMPONENTS_MAP[markerType]);
}
});
+ // Features
+ if (seriesOpt.labelLayout) {
+ deps.push('LabelLayout');
+ }
+ if (seriesOpt.universalTransition) {
+ deps.push('UniversalTransition');
+ }
});
// Remove duplicates
@@ -191,6 +200,7 @@
const componentsImports = [];
const chartsGLImports = [];
const componentsGLImports = [];
+ const featuresImports = [];
const renderersImports = [];
deps.forEach(function (dep) {
if (dep.endsWith('Renderer')) {
@@ -209,6 +219,8 @@
chartsGLImports.push(dep);
} else if (COMPONENTS_GL_MAP_REVERSE[dep]) {
componentsGLImports.push(dep);
+ } else if (FEATURES.includes(dep)) {
+ featuresImports.push(dep);
}
});
@@ -226,7 +238,8 @@
...chartsImports,
...componentsGLImports,
...chartsGLImports,
- ...renderersImports
+ ...renderersImports,
+ ...featuresImports
];
const ECOptionTypeCode = `
@@ -236,6 +249,7 @@
const importsCodes = [
[componentsImports, 'echarts/components'],
[chartsImports, 'echarts/charts'],
+ [featuresImports, 'echarts/features'],
[renderersImports, 'echarts/renderers'],
[chartsGLImports, 'echarts-gl/charts'],
[componentsGLImports, 'echarts-gl/components']