viking7982 commented on code in PR #18436:
URL: https://github.com/apache/echarts/pull/18436#discussion_r1159553443


##########
src/component/tooltip/TooltipHTMLContent.ts:
##########
@@ -241,23 +247,25 @@ function makeStyleCoord(out: number[], zr: ZRenderType, 
appendToBody: boolean, z
 
 interface TooltipContentOption {
     /**
-     * `false`: the DOM element will be inside the container. Default value.
-     * `true`: the DOM element will be appended to HTML body, which avoid
-     *  some overflow clip but intrude outside of the container.
+     * Choose a DOM element which the tooltip element will be located in order 
to
+     * avoid some overflow clip but intrude outside of the container.
+     *
+     * this config can be either a DomElement, a function to choose a element
+     * or a selector string used by query delector to local a element
      */
-    appendToBody: boolean
+    appendTo: ((el?: HTMLElement) => HTMLElement | undefined | null) | 
HTMLElement | string

Review Comment:
   You inspired me. Currently out code looks like 
   
   `
   import commonTooltipConfig from 'xx'
   ...
   
   const option = {
     ...
     tooltip: {
        ...commonTooltipConfig,
        ...customTooltipConfigByChartType,
     },
   }
   `
   
   I can change it to 
   
   `
   import getCommonTooltipConfig from 'xx'
   ...
   
   const option = {
     ...
     tooltip: {
        ...getCommonTooltipConfig(myChartInstance),
        ...customTooltipConfigByChart
     },
   }
   `
   
   And the config file can access the instance and we still can keep those 
common configs isolated.
   
   So if you have strong willing to remove that input, I can remove it and do 
some refactor on my project.
   It is up to you, I am ok with 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.

To unsubscribe, e-mail: [email protected]

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