Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Improve description of the new option
  • Loading branch information
yiwwan committed May 24, 2022
commit 6ccd491ba18397f40ef590d48c55899aeb0ed4b3
2 changes: 1 addition & 1 deletion docs/configuration/interactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Namespace: `options.interaction`, the global interaction configuration is at `Ch
| `mode` | `string` | `'nearest'` | Sets which elements appear in the interaction. See [Interaction Modes](#modes) for details.
| `intersect` | `boolean` | `true` | if true, the interaction mode only applies when the mouse position intersects an item on the chart.
| `axis` | `string` | `'x'` | Can be set to `'x'`, `'y'`, `'xy'` or `'r'` to define which directions are used in calculating distances. Defaults to `'x'` for `'index'` mode and `'xy'` in `dataset` and `'nearest'` modes.
| `includeInvisible` | `boolean` | `true` | if true, the invisible points will also be included when evaluating interactions.
| `includeInvisible` | `boolean` | `true` | if true, the invisible points that outside the chart area will also be included when evaluating interactions.

By default, these options apply to both the hover and tooltip interactions. The same options can be set in the `options.hover` namespace, in which case they will only affect the hover interaction. Similarly, the options can be set in the `options.plugins.tooltip` namespace to independently configure the tooltip interactions.

Expand Down
6 changes: 3 additions & 3 deletions src/core/core.interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function getDistanceMetricForAxis(axis) {
* @param {Point} position - the point to be nearest to, in relative coordinates
* @param {string} axis - the axis mode. x|y|xy|r
* @param {boolean} [useFinalPosition] - use the element's animation target instead of current position
* @param {boolean} [includeInvisible] - include invisible points
* @param {boolean} [includeInvisible] - include invisible points that outside the chart area
* @return {InteractionItem[]} the nearest items
*/
function getIntersectItems(chart, position, axis, useFinalPosition, includeInvisible) {
Expand Down Expand Up @@ -142,7 +142,7 @@ function getNearestRadialItems(chart, position, axis, useFinalPosition) {
* @param {string} axis - the axes along which to measure distance
* @param {boolean} [intersect] - if true, only consider items that intersect the position
* @param {boolean} [useFinalPosition] - use the element's animation target instead of current position
* @param {boolean} [includeInvisible] - include invisible points
* @param {boolean} [includeInvisible] - include invisible points that outside the chart area
* @return {InteractionItem[]} the nearest items
*/
function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
Expand Down Expand Up @@ -183,7 +183,7 @@ function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosi
* @param {string} axis - the axes along which to measure distance
* @param {boolean} [intersect] - if true, only consider items that intersect the position
* @param {boolean} [useFinalPosition] - use the element's animation target instead of current position
* @param {boolean} [includeInvisible] - include invisible points
* @param {boolean} [includeInvisible] - include invisible points that outside the chart area
* @return {InteractionItem[]} the nearest items
*/
function getNearestItems(chart, position, axis, intersect, useFinalPosition, includeInvisible) {
Expand Down
2 changes: 1 addition & 1 deletion types/index.esm.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1437,7 +1437,7 @@ export interface CoreInteractionOptions {
axis: InteractionAxis;

/**
* if true, the invisible points will also be included when evaluating interactions.
* if true, the invisible points that outside the chart area will also be included when evaluating interactions.
* @default false
*/
includeInvisible: boolean;
Expand Down