A selection map maps a sub-section of music (a measure, for instance) to a region on the screen. SelectionMap can contain other SelectionMaps with different 'T', for instance, notes in a measure, in a 'Russian Dolls' kind of model. This allows us to search for elements in < O(n) time and avoid expensive geometry operations.

### Type Parameters

- #### T

- #### K

### Hierarchy

- SelectionMap
  - MappedNotes
  - MappedMeasures
  - MappedSystems

## Index

### Constructors

- constructor

### Properties

- box
- systemMap

### Methods

- addArtifact
- addKeyToMap
- boxFromSelection
- createKey
- findArtifact
- findValueInMap

## Constructors

### constructor

- new SelectionMap<T, K>(): SelectionMap<T, K>

- #### Type Parameters

  - #### T

  - #### K

  #### Returns SelectionMap<T, K>

## Properties

### box

box: SvgBox = SvgBox.default

- Defined in src/render/sui/svgPageMap.ts:52

the outer bounding box of these selections

### systemMap

systemMap: Map<K, T> = ...

- Defined in src/render/sui/svgPageMap.ts:56

map of key to child SelectionMaps or SmoSelections

## Methods

### addArtifact

- addArtifact(selection: SmoSelection): void

- - Defined in src/render/sui/svgPageMap.ts:75

  Add a rendered element to the map, and update the bounding box

  #### Parameters

  - ##### selection: SmoSelection

  #### Returns void

### Abstract addKeyToMap

- addKeyToMap(key: K, selection: SmoSelection): void

- - Defined in src/render/sui/svgPageMap.ts:39

  Add the selection to our map, and possibly to our child map.

  #### Parameters

  - ##### key: K

  - ##### selection: SmoSelection

  #### Returns void

### Abstract boxFromSelection

- boxFromSelection(selection: SmoSelection): SvgBox

- - Defined in src/render/sui/svgPageMap.ts:33

  get a set of coordinates from this selection, if it has been rendered.

  #### Parameters

  - ##### selection: SmoSelection

  #### Returns SvgBox

### Abstract createKey

- createKey(selection: SmoSelection): K

- - Defined in src/render/sui/svgPageMap.ts:28

  Create a key from the selection (selector). e.g. (1,1)

  #### Parameters

  - ##### selection: SmoSelection

  #### Returns K

### findArtifact

- findArtifact(box: SvgBox): SmoSelection[]

- - Defined in src/render/sui/svgPageMap.ts:63

  Given a bounding box (or point), find all the musical elements contained in that point

  #### Parameters

  - ##### box: SvgBox

  #### Returns SmoSelection[]

  SmoSelection[]

### Abstract findValueInMap

- findValueInMap(value: T, box: SvgBox): SmoSelection[]

- - Defined in src/render/sui/svgPageMap.ts:47

  find a collection of selection that match a bounding box, possibly by recursing through our child SelectionMaps.

  #### Parameters

  - ##### value: T

  - ##### box: SvgBox

  #### Returns SmoSelection[]

Generated using TypeDoc