# hitTestWord

Word-cloud-only — hit-test the word at canvas-relative coordinates.

Canonical: https://chart.syidax.com/docs/methods/hitTestWord/

<a id="definition"></a>

## Definition

```typescript
hitTestWord(cssX: number, cssY: number): Promise<{ index: number; id: string; name: string } | null>
```

| Arguments | Type | Required |
| --- | --- | --- |
| `cssX` | `number` | Required |
| `cssY` | `number` | Required |

Return type: `Promise<{ index: number; id: string; name: string } | null>`. Call the method after element registration and await its Promise result.

<a id="related"></a>

## Related charts

- [sy-word-cloud](https://chart.syidax.com/docs/components/word-cloud.md#method-hitTestWord)
