Is your feature request related to a problem? Please describe.
With the current tooltip, direction information is difficult to define in the code during the hover data event.
Describe the solution you'd like
Keep the tooltip automatically in the visible region depending on the view zone.
Describe alternatives you've considered and additional context
direction = "bottom" if y > 1.5 else "top"
https://dash.plotly.com/dash-core-components/tooltip

As you can observe 1.5 threshold is not good in all the contexts.
Examples of similar requests:
https://community.plotly.com/t/how-to-position-custom-tooltip-within-visible-window/58819
https://stackoverflow.com/questions/72715452/plotly-dash-how-to-align-the-tooltip-to-the-top-instead-of-top-right/72717007
Is your feature request related to a problem? Please describe.
With the current tooltip, direction information is difficult to define in the code during the hover data event.
Describe the solution you'd like
Keep the tooltip automatically in the visible region depending on the view zone.
Describe alternatives you've considered and additional context
https://dash.plotly.com/dash-core-components/tooltip

As you can observe 1.5 threshold is not good in all the contexts.
Examples of similar requests:
https://community.plotly.com/t/how-to-position-custom-tooltip-within-visible-window/58819
https://stackoverflow.com/questions/72715452/plotly-dash-how-to-align-the-tooltip-to-the-top-instead-of-top-right/72717007