liuwo23 opened a new issue, #19184:
URL: https://github.com/apache/echarts/issues/19184

   ### What problem does this feature solve?
   
   In development, there is often a need to obtain Region information based on 
screen coordinates. However, the echartsInstance API does not directly expose 
the getRegionByCoord function. It is necessary to access this function by 
obtaining the coordinateSystem: Geo. Why not directly add this functionality to 
the echartsInstance API? Moreover, functions like convertFromPixel and 
convertToPixel from the Geo class have already been exposed in the 
echartsInstance, making it straightforward to implement getRegionByCoord.
   
   ### What does the proposed API look like?
   
   we can get region by screen coord, directly add the method 
`getRegionByCoord` from the `Geo` class to `echartsInstance`.
   
   the current implementation:
   `
   const coordinateSystem = 
echartsInstance.getModel().getSeriesByIndex(0).coordinateSystem;
   const coords = echartsInstance.convertFromPixel({geoIndex: 0,},[x,y]);
   const region = coordinateSystem.getRegionByCoord(coords)
   `
   
   the desired implementation:
   `const region = echartsInstance .getRegionByCoord({finder,coords})`


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