source: node_modules/recharts/lib/util/cursor/getCursorPoints.js@ a762898

Last change on this file since a762898 was a762898, checked in by istevanoska <ilinastevanoska@…>, 5 months ago

Added visualizations

  • Property mode set to 100644
File size: 1.3 KB
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getCursorPoints = getCursorPoints;
7var _PolarUtils = require("../PolarUtils");
8var _types = require("../types");
9var _getRadialCursorPoints = require("./getRadialCursorPoints");
10function getCursorPoints(layout, activeCoordinate, offset) {
11 if (layout === 'horizontal') {
12 return [{
13 x: activeCoordinate.x,
14 y: offset.top
15 }, {
16 x: activeCoordinate.x,
17 y: offset.top + offset.height
18 }];
19 }
20 if (layout === 'vertical') {
21 return [{
22 x: offset.left,
23 y: activeCoordinate.y
24 }, {
25 x: offset.left + offset.width,
26 y: activeCoordinate.y
27 }];
28 }
29 if ((0, _types.isPolarCoordinate)(activeCoordinate)) {
30 if (layout === 'centric') {
31 var {
32 cx,
33 cy,
34 innerRadius,
35 outerRadius,
36 angle
37 } = activeCoordinate;
38 var innerPoint = (0, _PolarUtils.polarToCartesian)(cx, cy, innerRadius, angle);
39 var outerPoint = (0, _PolarUtils.polarToCartesian)(cx, cy, outerRadius, angle);
40 return [{
41 x: innerPoint.x,
42 y: innerPoint.y
43 }, {
44 x: outerPoint.x,
45 y: outerPoint.y
46 }];
47 }
48 return (0, _getRadialCursorPoints.getRadialCursorPoints)(activeCoordinate);
49 }
50 return undefined;
51}
Note: See TracBrowser for help on using the repository browser.