MrSquaare commented on PR #18715:
URL: https://github.com/apache/echarts/pull/18715#issuecomment-1591567796

   @Ovilia The mouse position is already provided as a fourth parameter of 
`tooltip.formatter` (sadly this function already takes 3 non-named parameter, 
maybe should I return the position as a named parameter for future API changes?)
   `param.x` and `param.y` are the position of the element (I suppose the top 
left position of the element)
   From my tests, I deduced that these position were the element position 
relative to the top left canvas position (e.g.: setting absolute position to 
the canvas, seeing that `x` and `y` are not related to the canvas's DOM 
position). I can't be 100% sure that this is always the case (perhaps there are 
other transformations applied with certain options); No definition is provided 
for these two `ZRender.Element` properties (in the code or in the [ZRender 
documentation](https://ecomfe.github.io/zrender-doc/public/api.html)).
   
   For the element states, I'm not sure if this is something I have to 
calculate (how?) or if this is something I can already get; currently, from 
what I see after a code search, `DisplayState` is mainly used for labels, and 
the state is provided via a callback to the label options.
   I also see that `ECElement` has two states that correspond to 
`DisplayState`: `ECElement.hoverState` and `ECElement.selected`;
   `ECElement` also has an `applyElementStates` method for adding states to the 
`ZRender` element. Isn't this done after `TooltipView` calls `getDataParams`? 
This would mean that it would be impossible for me, without changing the order 
of proceedings, to retrieve these states.
   Note that all this may be a confusion on my part and be two separate things.
   
   To conclude, I'm new to the codebase, I'd like to do my best, but I don't 
know where to find the resources to help me.
   In fact, if retrieving the states requires kind of major changes to the 
codebase, I won't be able to make them. However, I'd be interested in following 
the development.
   
   > Does this kind of discussion have to take place as comments on this PR, or 
does echarts have specific message channels that I can use?


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