You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2022/07/30 17:55:18 UTC

[echarts-examples] branch gh-pages updated (27ab94fa -> 9c1803c2)

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

wangzx pushed a change to branch gh-pages
in repository https://gitbox.apache.org/repos/asf/echarts-examples.git


    from 27ab94fa fix(explore): fix example card placeholder
     new cfc74c61 feat(editor): add outline link for bmap extension
     new 9c1803c2 feat(explore): scroll nav into view and change url when scrolling right example list.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/editor/Editor.vue   |  8 +++++---
 src/explore/Explore.vue | 32 +++++++++++++++++++++-----------
 2 files changed, 26 insertions(+), 14 deletions(-)


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


[echarts-examples] 01/02: feat(editor): add outline link for bmap extension

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit cfc74c61389f144034607757aaeea030ee5252e2
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Sun Jul 31 01:50:56 2022 +0800

    feat(editor): add outline link for bmap extension
---
 src/editor/Editor.vue | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/editor/Editor.vue b/src/editor/Editor.vue
index 7421618d..46da4e3a 100644
--- a/src/editor/Editor.vue
+++ b/src/editor/Editor.vue
@@ -375,9 +375,11 @@ export default {
           }
 
           const isObjOrArray = typeof obj === 'object' && obj != null;
-          const link = `https://echarts.apache.org/${lang}/option.html#${hash.join(
-            '.'
-          )}`;
+          const link = hash.includes('bmap')
+            ? 'https://github.com/apache/echarts/blob/release/extension-src/bmap/README.md'
+            : `https://echarts.apache.org/${lang}/option.html#${hash.join(
+                '.'
+              )}`;
           return !isObjOrArray
             ? `<a href="${link}" target="_blank" title="${tipTitle}">${name}</a>`
             : `${name}<a href="${link}" target="_blank" title="${tipTitle}"><i class="el-icon-document"></i></a>`;


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


[echarts-examples] 02/02: feat(explore): scroll nav into view and change url when scrolling right example list.

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 9c1803c2d4ad0cdb8835d9207397e836fa32eafc
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Sun Jul 31 01:55:02 2022 +0800

    feat(explore): scroll nav into view and change url when scrolling right example list.
---
 src/explore/Explore.vue | 32 +++++++++++++++++++++-----------
 1 file changed, 21 insertions(+), 11 deletions(-)

diff --git a/src/explore/Explore.vue b/src/explore/Explore.vue
index 1d4371ce..1900023e 100644
--- a/src/explore/Explore.vue
+++ b/src/explore/Explore.vue
@@ -1,6 +1,6 @@
 <template>
   <div id="example-explore">
-    <div id="left-container">
+    <div id="left-container" ref="leftContainer">
       <div id="left-chart-nav">
         <scrollactive
           active-class="active"
@@ -69,7 +69,6 @@ import { EXAMPLE_CATEGORIES, BLACK_MAP } from '../common/config';
 import { store } from '../common/store';
 import ExampleCard from './ExampleCard.vue';
 import LazyLoad from 'vanilla-lazyload/dist/lazyload.esm';
-// import scrollIntoView from 'scroll-into-view';
 
 const icons = {};
 
@@ -238,15 +237,25 @@ export default {
 
   methods: {
     onActiveNavChanged(event, currentItem, lastActiveItem) {
-      // currentItem && currentItem.scrollIntoView && currentItem.parentNode.scrollIntoView();
-      // scrollIntoView(currentItem, {
-      //     time: 100,
-      //     cancellable: false,
-      //     align: {
-      //         top: 0,
-      //         topOffset: 50
-      //     }
-      // });
+      if (!event) {
+        return;
+      }
+      // change url
+      history.replaceState(null, null, currentItem.href);
+
+      // scroll nav
+      const leftContainer = this.$refs.leftContainer;
+      const containerOffsetHeight = leftContainer.offsetHeight;
+      const rect = currentItem.parentElement.getBoundingClientRect();
+      if (rect.top < 0 || rect.bottom > containerOffsetHeight) {
+        const scrollTop =
+          currentItem.offsetTop -
+          containerOffsetHeight +
+          currentItem.offsetHeight;
+        leftContainer.scrollTo
+          ? leftContainer.scrollTo(0, scrollTop)
+          : (leftContainer.scrollTop = scrollTop);
+      }
     }
   }
 };
@@ -345,6 +354,7 @@ $pd-lg: 20px;
   width: $chart-nav-width;
   box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
   overflow-y: auto;
+  scroll-behavior: smooth;
 }
 
 #toolbar {


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