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/03/15 11:56:46 UTC

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

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