You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2021/02/08 09:08:04 UTC

[GitHub] [echarts] plainheart opened a new pull request #14246: perf(tooltip): improve the performance of tooltip.

plainheart opened a new pull request #14246:
URL: https://github.com/apache/echarts/pull/14246


   <!-- Please fill in the following information to help us review your PR more efficiently. -->
   
   ## Brief Information
   
   This pull request is in the type of:
   
   - [ ] bug fixing
   - [ ] new feature
   - [x] others
   
   
   
   ### What does this PR do?
   
   <!-- USE ONCE SENTENCE TO DESCRIBE WHAT THIS PR DOES. -->
   As mentioned in #13680, the tooltip looks delayed and has an obvious lag. This brings the users a bad interaction experience.
   This PR is attempting to improve the performance of the tooltip. Any idea is welcome.
   
   ### Fixed issues
   
   - #13680
   - #14204
   
   ## Details
   
   ### Before: What was the problem?
   
   <!-- DESCRIBE THE BUG OR REQUIREMENT HERE. -->
   The moving of the tooltip has an obvious lag.
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   
   ### After: How is it fixed in this PR?
   
   <!-- THE RESULT AFTER FIXING AND A SIMPLE EXPLANATION ABOUT HOW IT IS FIXED. -->
   
   <!-- ADD SCREENSHOT HERE IF APPLICABLE. -->
   
   https://user-images.githubusercontent.com/26999792/107198365-f6b50e00-6a2f-11eb-9b37-3081c71ca1ed.mp4
   
   
   
   ## Usage
   
   ### Are there any API changes?
   
   - [ ] The API has been changed.
   
   <!-- LIST THE API CHANGES HERE -->
   
   
   
   ### Related test cases or examples to use the new APIs
   
   Please refer to `test/new-tooltip.html` or any other test cases related to `tooltip`.
   
   ## Others
   
   ### Merging options
   
   - [ ] Please squash the commits into a single one when merge.
   
   ### Other information
   
   Related PR in zrender: 
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] 100pah commented on pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
100pah commented on pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#issuecomment-799361063


   Wonderful job.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang commented on pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
pissang commented on pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#issuecomment-775210593


   Wow looks really nice


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] plainheart commented on a change in pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#discussion_r594307721



##########
File path: src/component/tooltip/helper.ts
##########
@@ -27,3 +30,37 @@ export function shouldTooltipConfine(tooltipModel: Model<TooltipOption>): boolea
         // In richText mode, the outside part can not be visible.
         : tooltipModel.get('renderMode') === 'richText';
 }
+
+function testStyle(styleProps: string[]): string | undefined {
+	const style = document.documentElement.style;

Review comment:
       I used zrender `env.domSupported` to detect it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] 100pah merged pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
100pah merged pull request #14246:
URL: https://github.com/apache/echarts/pull/14246


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#issuecomment-802934598


   Congratulations! Your PR has been merged. Thanks for your contribution! 👍


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] 100pah commented on a change in pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
100pah commented on a change in pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#discussion_r595795287



##########
File path: src/component/tooltip/helper.ts
##########
@@ -27,3 +31,40 @@ export function shouldTooltipConfine(tooltipModel: Model<TooltipOption>): boolea
         // In richText mode, the outside part can not be visible.
         : tooltipModel.get('renderMode') === 'richText';
 }
+
+function testStyle(styleProps: string[]): string | undefined {
+    if (!env.domSupported) {
+        return;

Review comment:
       I am not sure that if here `undefined` returned, 
   then `TRANSFORM_VENDOR` and `TRANSITION_VENDOR` will become `undefined`, 
   then 
   ```js
   const CSS_TRANSITION_VENDOR = toCSSVendorPrefix(TRANSITION_VENDOR, 'transition');
   const CSS_TRANSFORM_VENDOR = toCSSVendorPrefix(TRANSFORM_VENDOR, 'transform');
   ```
   An `undefined` will input to `toCSSVendorPrefix`.
   And then a null pointer error will be thrown in `toCSSVendorPrefix`?
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] 100pah commented on a change in pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
100pah commented on a change in pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#discussion_r594167169



##########
File path: src/component/tooltip/helper.ts
##########
@@ -27,3 +30,37 @@ export function shouldTooltipConfine(tooltipModel: Model<TooltipOption>): boolea
         // In richText mode, the outside part can not be visible.
         : tooltipModel.get('renderMode') === 'richText';
 }
+
+function testStyle(styleProps: string[]): string | undefined {
+	const style = document.documentElement.style;
+	for (let i = 0, len = styleProps.length; i < len; i++) {
+		if (styleProps[i] in style) {
+			return styleProps[i];
+		}
+	}

Review comment:
       In this file some `tab` is used.
   Need to convert them to 4 spaces.

##########
File path: src/component/tooltip/helper.ts
##########
@@ -27,3 +30,37 @@ export function shouldTooltipConfine(tooltipModel: Model<TooltipOption>): boolea
         // In richText mode, the outside part can not be visible.
         : tooltipModel.get('renderMode') === 'richText';
 }
+
+function testStyle(styleProps: string[]): string | undefined {
+	const style = document.documentElement.style;

Review comment:
       `testStyle` is called in the root of this file.
   So need to detect whether document exists. Consider running in headless environment or mini app.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] pissang edited a comment on pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
pissang edited a comment on pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#issuecomment-775210593


   Wow looks really nice!


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] plainheart commented on a change in pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
plainheart commented on a change in pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#discussion_r595814304



##########
File path: src/component/tooltip/helper.ts
##########
@@ -27,3 +31,40 @@ export function shouldTooltipConfine(tooltipModel: Model<TooltipOption>): boolea
         // In richText mode, the outside part can not be visible.
         : tooltipModel.get('renderMode') === 'richText';
 }
+
+function testStyle(styleProps: string[]): string | undefined {
+    if (!env.domSupported) {
+        return;

Review comment:
       Sorry. You are right. I missed it.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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


[GitHub] [echarts] echarts-bot[bot] commented on pull request #14246: perf(tooltip): improve the performance of tooltip.

Posted by GitBox <gi...@apache.org>.
echarts-bot[bot] commented on pull request #14246:
URL: https://github.com/apache/echarts/pull/14246#issuecomment-774991920


   Thanks for your contribution!
   The community will review it ASAP. In the meanwhile, please checkout [the coding standard](https://echarts.apache.org/en/coding-standard.html) and Wiki about [How to make a pull request](https://github.com/apache/incubator-echarts/wiki/How-to-make-a-pull-request).
   
   The pull request is marked to be `PR: author is committer` because you are a committer of this project.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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