mirror of
https://github.com/Tria-plc/emaui.git
synced 2026-08-27 17:50:56 +00:00
25 lines
571 B
JavaScript
25 lines
571 B
JavaScript
import { polarToCartesian } from '../PolarUtils';
|
|
/**
|
|
* Only applicable for radial layouts
|
|
* @param {Object} activeCoordinate ChartCoordinate
|
|
* @returns {Object} RadialCursorPoints
|
|
*/
|
|
export function getRadialCursorPoints(activeCoordinate) {
|
|
var {
|
|
cx,
|
|
cy,
|
|
radius,
|
|
startAngle,
|
|
endAngle
|
|
} = activeCoordinate;
|
|
var startPoint = polarToCartesian(cx, cy, radius, startAngle);
|
|
var endPoint = polarToCartesian(cx, cy, radius, endAngle);
|
|
return {
|
|
points: [startPoint, endPoint],
|
|
cx,
|
|
cy,
|
|
radius,
|
|
startAngle,
|
|
endAngle
|
|
};
|
|
} |