* Helper function to get the items nearest to the event position considering all visible items in the chart * @param {Chart} chart - the chart to look at elements from * @param {Point} position - the point to be nearest to, in relative coordinates * @param {string} axis - the axes along which to
(chart, position, axis, intersect, useFinalPosition, includeInvisible)
| 207 | * @return {InteractionItem[]} the nearest items |
| 208 | */ |
| 209 | function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) { |
| 210 | if (!includeInvisible && !chart.isPointInArea(position)) { |
| 211 | return []; |
| 212 | } |
| 213 | |
| 214 | return axis === 'r' && !intersect |
| 215 | ? getNearestRadialItems(chart, position, axis, useFinalPosition) |
| 216 | : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible); |
| 217 | } |
| 218 | |
| 219 | /** |
| 220 | * Helper function to get the items matching along the given X or Y axis |
no test coverage detected