You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/09/10 04:38:23 UTC

[echarts-examples] branch dev updated: add labelLayout and universalTransition feature imports in generated code

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git


The following commit(s) were added to refs/heads/dev by this push:
     new 8c47bef  add labelLayout and universalTransition feature imports in generated code
8c47bef is described below

commit 8c47bef31d34065ca5454b28df24547abee3f97e
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Sep 10 12:37:36 2021 +0800

    add labelLayout and universalTransition feature imports in generated code
---
 common/buildCode.js | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

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 @@ const CHARTS_GL_MAP = {
   linesGL: 'LinesGLChart'
 };
 
+const FEATURES = ['UniversalTransition', 'LabelLayout'];
+
 const COMPONENTS_MAP_REVERSE = {};
 const CHARTS_MAP_REVERSE = {};
 const CHARTS_GL_MAP_REVERSE = {};
@@ -180,6 +182,13 @@ module.exports.collectDeps = function collectDeps(option) {
         deps.push(COMPONENTS_MAP[markerType]);
       }
     });
+    // Features
+    if (seriesOpt.labelLayout) {
+      deps.push('LabelLayout');
+    }
+    if (seriesOpt.universalTransition) {
+      deps.push('UniversalTransition');
+    }
   });
 
   // Remove duplicates
@@ -191,6 +200,7 @@ function buildMinimalBundleCode(deps, includeType) {
   const componentsImports = [];
   const chartsGLImports = [];
   const componentsGLImports = [];
+  const featuresImports = [];
   const renderersImports = [];
   deps.forEach(function (dep) {
     if (dep.endsWith('Renderer')) {
@@ -209,6 +219,8 @@ function buildMinimalBundleCode(deps, includeType) {
       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 @@ function buildMinimalBundleCode(deps, includeType) {
     ...chartsImports,
     ...componentsGLImports,
     ...chartsGLImports,
-    ...renderersImports
+    ...renderersImports,
+    ...featuresImports
   ];
 
   const ECOptionTypeCode = `
@@ -236,6 +249,7 @@ type EChartsOption = echarts.ComposeOption<
   const importsCodes = [
     [componentsImports, 'echarts/components'],
     [chartsImports, 'echarts/charts'],
+    [featuresImports, 'echarts/features'],
     [renderersImports, 'echarts/renderers'],
     [chartsGLImports, 'echarts-gl/charts'],
     [componentsGLImports, 'echarts-gl/components']

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org