Skip to main content
Version: Next

Interface: PrimitiveHoveredItem

Data representing the currently hovered object from the Hit test.

Properties

distance?

optional distance: number

Geometric distance from the cursor to the hovered primitive, in CSS pixels. Lower values win over higher values for hits on the same z-order layer.


hitTestPriority?

optional hitTestPriority: number

Optional hit priority used when comparing overlapping primitive hits on the same z-order layer.

Recommended values:

  • 0 for range-style hits such as covered regions
  • 1 for line-style hits such as strokes
  • 2 for point-style hits such as explicit markers

Point-style hits receive special precedence over non-point hits. Otherwise distance decides, and equal-distance non-point ties preserve the existing visual/source order.


cursorStyle?

optional cursorStyle: string

CSS cursor style as defined here: MDN: CSS Cursor or undefined if you want the library to use the default cursor style instead.


externalId

externalId: string

Hovered objects external ID. Can be used to identify the source item within a mouse subscriber event.


zOrder

zOrder: PrimitivePaneViewZOrder

The zOrder of the hovered item.


isBackground?

optional isBackground: boolean

Set to true if the object is rendered using drawBackground instead of draw.


itemType?

optional itemType: "marker" | "primitive"

Optional public-facing hover item type hint.

This should normally be 'marker' for marker-like primitive hits or 'primitive' for all other primitive-owned objects.