(e: MouseEvent | PointerEvent | TouchEvent, cube: VegaDeckGl.types.Cube)
| 578 | } |
| 579 | |
| 580 | private onCubeClick(e: MouseEvent | PointerEvent | TouchEvent, cube: VegaDeckGl.types.Cube) { |
| 581 | this.options.onCubeClick && this.options.onCubeClick(e, cube); |
| 582 | const hasSelectedData = this._dataScope.hasSelectedData(); |
| 583 | if (hasSelectedData && this._dataScope.selection.included.length > 1) { |
| 584 | //if active is within selection, keep the selection and activate the one. |
| 585 | const indexWithinSelection = this._dataScope.ordinalIndexWithinSelection(cube.ordinal); |
| 586 | if (indexWithinSelection.index >= 0) { |
| 587 | this.activate(indexWithinSelection.datum); |
| 588 | this._details.populate(this._dataScope.selection, indexWithinSelection.index); |
| 589 | if (this.options.onSelectionChanged) { |
| 590 | const sel = this.getSelection(); |
| 591 | this.options.onSelectionChanged(sel.search, indexWithinSelection.index, sel.selectedData); |
| 592 | } |
| 593 | return; |
| 594 | } |
| 595 | } |
| 596 | if (hasSelectedData && this._dataScope.selection.included.length === 1 && this._dataScope.selection.included[0][GL_ORDINAL] === cube.ordinal) { |
| 597 | this.deselect(); |
| 598 | return; |
| 599 | } |
| 600 | const search: SearchExpression = { |
| 601 | name: GL_ORDINAL, |
| 602 | operator: '==', |
| 603 | value: cube.ordinal, |
| 604 | }; |
| 605 | this.select(search); |
| 606 | } |
| 607 | |
| 608 | private onCubeHover(e: MouseEvent | PointerEvent | TouchEvent, cube: VegaDeckGl.types.Cube) { |
| 609 | if (this._tooltip) { |
no test coverage detected