HMPlot

identity

Which rows are the same thing across tables, by key, so selections carry over.

rows = hm.identity(keys=ids)
hm.Points(position=positions, identity=rows, select=True)

Members

This table describes the JavaScript interface. Python has its own Node and resource methods, listed under “Python members” below; these member names are not Python method names.

idstring
Required.
lengthnumber
Required.
selectionSelectionResource
Required.
brushSelectionResource
Required.
hoverSelectionResource
Required.
offsetsOffsetLayer
Required.

Usage

Data and Table normally own identity for you. Explicit identity is useful for raw-array marks. Matching names in separate tables do not imply shared observation identity; use keys when rows reorder.

identity({ keys }) gives the rows of marks that take raw arrays (position={...}) an owner: row i is the observation keys[i], so a selection made on one mark selects the same observations on every mark with that identity, and keyed updates and connections match rows by key. Keys must be unique, present and finite: strings, categories, integers (int64 and uint64 exact) or float32 values. The member table above is the JavaScript object; its selection, brush and hover are SelectionResources owned by it.

Python members

hm.identity(keys=...) returns an identity resource with these members, plain attributes fixed when it is made. Its selections’ await members need a displayed notebook view (see selection). Keys that differ only beyond float32 precision are refused, naming the pair; use integer or string keys for large identifiers.

MemberKindWhat it does
idattributeThe resource’s id in the scene.
keysattributeThe keys as the column the browser receives (one-dimensional, typed as hm.typed_column types them).
selectionattributeThe SelectionResource of the rows clicked or set from code.
brushattributeThe SelectionResource of the brushed rows.
hoverattributeThe SelectionResource of the hovered rows.
nearbyattributeThe SelectionResource of the rows near the pointer.
nearestattributeThe SelectionResource of the row a tooltip shows (nearest).

Related examples

Data selections and brushing