chfw commented on a change in pull request #13848:
URL: 
https://github.com/apache/incubator-echarts/pull/13848#discussion_r546962137



##########
File path: src/component/tooltip/tooltipMarkup.ts
##########
@@ -278,20 +318,22 @@ const builderMap: { [key in 
TooltipMarkupBlockFragment['type']]: TooltipMarkupFr
             // It little weird if only value next to marker but far from 
marker.
             const valueCloseToMarker = !noMarker && noName;
 
+            const {nameStyle, valueStyle} = 
getTooltipTextStyle(toolTipTextStyle, renderMode);
+
             return renderMode === 'richText'
                 ? (
                     (noMarker ? '' : markerStr)
-                    + (noName ? '' : wrapInlineNameRichText(ctx, readableName))
+                    + (noName ? '' : wrapInlineNameRichText(ctx, readableName, 
nameStyle as RichTextStyle))
                     // Value has commas inside, so use ' ' as delimiter for 
multiple values.
                     + (noValue ? '' : wrapInlineValueRichText(
-                        ctx, readableValueList, valueAlignRight, 
valueCloseToMarker
+                        ctx, readableValueList, valueAlignRight, 
valueCloseToMarker, valueStyle as RichTextStyle
                     ))
                 )
                 : wrapBlockHTML(
                     (noMarker ? '' : markerStr)
-                    + (noName ? '' : wrapInlineNameHTML(readableName, 
!noMarker))
+                    + (noName ? '' : wrapInlineNameHTML(readableName, 
!noMarker, nameStyle as string))
                     + (noValue ? '' : wrapInlineValueHTML(
-                        readableValueList, valueAlignRight, valueCloseToMarker
+                        readableValueList, valueAlignRight, 
valueCloseToMarker, valueStyle as string
                     )),
                     topMarginForOuterGap
                 );

Review comment:
       I think here is an abuse of short hand if-else statement. It is inviting 
bugs to live inside and adds difficulty in debugging 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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to