villebro commented on code in PR #22082:
URL: https://github.com/apache/superset/pull/22082#discussion_r1023970627


##########
superset-frontend/plugins/plugin-chart-echarts/src/defaults.ts:
##########
@@ -23,7 +23,7 @@ export const defaultGrid = {
 };
 
 export const defaultTooltip = {
-  confine: true,
+  confine: false,

Review Comment:
   Oh ok, I hadn't noticed that. I dug out the original PR that enabled 
confine: https://github.com/apache-superset/superset-ui/pull/764 Here's a 
screencapture of way too many items on the tooltip with `confine: true`:
   
   
https://user-images.githubusercontent.com/33317356/202183731-fa6e8310-5f25-4853-83a0-b30c2991c58a.mp4
   
   And the same with `confine: false`:
   
   
https://user-images.githubusercontent.com/33317356/202183890-304cf230-82fb-4947-a793-7134b82131da.mp4
   
   So I believe one unwanted side-effect of disabling `confine` is that the 
tooltip position happily overflows the top of the screen. Looking at the docs, 
I tested the example position they gave, and cleverly using those additional 
objects that are passed to the callback, it should be possible to do some 
exotic positioning that is as convenient as possible:
   
   ```javascript
   {
     ...,
     position: function (pos, params, dom, rect, size) {
         // tooltip will be fixed on the right if mouse hovering on the left,
         // and on the left if hovering on the right.
         var obj = {top: 60};
         obj[['left', 'right'][+(pos[0] < size.viewSize[0] / 2)]] = 5;
         return obj;
     },
   }
   ```
   
https://user-images.githubusercontent.com/33317356/202188068-04a8ce49-279c-43a9-9efb-0479ed16ea4e.mp4
   
   https://echarts.apache.org/en/option.html#tooltip.position
   



-- 
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