* Helper function to get the items nearest to the event position considering all visible items in the chart * @param chart - the chart to look at elements from * @param position - the point to be nearest to, in relative coordinates * @param axis - the axes along which to measure distance * @para
( chart: Chart, position: Point, axis: string, intersect?: boolean, useFinalPosition?: boolean, includeInvisible?: boolean )
| 271 | * @return the nearest items |
| 272 | */ |
| 273 | function getNearestItems( |
| 274 | chart: Chart, |
| 275 | position: Point, |
| 276 | axis: string, |
| 277 | intersect?: boolean, |
| 278 | useFinalPosition?: boolean, |
| 279 | includeInvisible?: boolean |
| 280 | ): InteractionItem[] { |
| 281 | if (!includeInvisible && !chart.isPointInArea(position)) { |
| 282 | return []; |
| 283 | } |
| 284 | |
| 285 | return axis === 'r' && !intersect |
| 286 | ? getNearestRadialItems(chart, position, axis, useFinalPosition) |
| 287 | : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible); |
| 288 | } |
| 289 | |
| 290 | /** |
| 291 | * Helper function to get the items matching along the given X or Y axis |
no test coverage detected