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 2020/08/17 13:26:03 UTC

[incubator-echarts-doc] branch next updated: not expand marker, tooltip in series by default

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

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


The following commit(s) were added to refs/heads/next by this push:
     new 832cd15  not expand marker, tooltip in series by default
832cd15 is described below

commit 832cd1577969031f2b189f18abeec5610f97648d
Author: pissang <bm...@gmail.com>
AuthorDate: Mon Aug 17 21:25:41 2020 +0800

    not expand marker, tooltip in series by default
---
 src/components/DocContentItemCard.vue |  5 ++++-
 src/components/LiveExample.vue        |  4 ++--
 src/config.js                         | 12 +++++++++++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/src/components/DocContentItemCard.vue b/src/components/DocContentItemCard.vue
index 0e1d882..28e224b 100644
--- a/src/components/DocContentItemCard.vue
+++ b/src/components/DocContentItemCard.vue
@@ -84,6 +84,7 @@ import PropertiesList from './PropertiesList.vue';
 import OptionControl from './OptionControl.vue';
 
 import {store, changeOption} from '../store';
+import {PROPERTIES_NOT_EXPAND} from '../config';
 
 export default {
     name: 'DocContentItemCard',
@@ -145,7 +146,9 @@ export default {
                 return this.manualExpanded;
             }
             else {
-                return this.depth < 2
+                // Default expanded logic
+                const parts = this.nodeData.path.split('.');
+                return (this.depth < 2 && PROPERTIES_NOT_EXPAND.indexOf(parts.pop()) < 0)
                     || store.currentPath.indexOf(this.nodeData.path) >= 0;
             }
         },
diff --git a/src/components/LiveExample.vue b/src/components/LiveExample.vue
index 0881f35..0708f01 100644
--- a/src/components/LiveExample.vue
+++ b/src/components/LiveExample.vue
@@ -73,14 +73,14 @@ import beautifier from 'js-beautify';
 import throttle from 'lodash.throttle';
 import arrayDiff from 'zrender/src/core/arrayDiff';
 import scrollIntoView from 'scroll-into-view';
-import {EChartsLib} from '../config';
+import {ECHARTS_LIB} from '../config';
 
 let echartsLoadPromise;
 
 function fetchECharts() {
     return echartsLoadPromise || (echartsLoadPromise = new Promise(function (resolve) {
         const script = document.createElement('script');
-        script.src = EChartsLib;
+        script.src = ECHARTS_LIB;
         script.async = true;
         script.onload = function () {
             resolve();
diff --git a/src/config.js b/src/config.js
index d3552ec..0c8722a 100644
--- a/src/config.js
+++ b/src/config.js
@@ -1,2 +1,12 @@
 
-export const EChartsLib = 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.1/dist/echarts.min.js';
\ No newline at end of file
+export const ECHARTS_LIB = 'https://cdn.jsdelivr.net/npm/echarts@5.0.0-alpha.1/dist/echarts.min.js';
+
+// Properties that will not be expanded by default.
+// To reduce the display of unnecessary info.
+export const PROPERTIES_NOT_EXPAND = [
+    'data',
+    'markPoint',
+    'markLine',
+    'markArea',
+    'tooltip'
+];
\ No newline at end of file


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