MCPcopy Index your code
hub / github.com/microsoft/SandDance / onCubeClick

Method onCubeClick

docs/app/js/sanddance-app.js:9765–9791  ·  view source on GitHub ↗
(e, cube)

Source from the content-addressed store, hash-verified

9763 if (this.options.onStage) this.options.onStage(stage, deckProps);
9764 }
9765 onCubeClick(e, cube) {
9766 this.options.onCubeClick && this.options.onCubeClick(e, cube);
9767 const hasSelectedData = this._dataScope.hasSelectedData();
9768 if (hasSelectedData && this._dataScope.selection.included.length > 1) {
9769 //if active is within selection, keep the selection and activate the one.
9770 const indexWithinSelection = this._dataScope.ordinalIndexWithinSelection(cube.ordinal);
9771 if (indexWithinSelection.index >= 0) {
9772 this.activate(indexWithinSelection.datum);
9773 this._details.populate(this._dataScope.selection, indexWithinSelection.index);
9774 if (this.options.onSelectionChanged) {
9775 const sel = this.getSelection();
9776 this.options.onSelectionChanged(sel.search, indexWithinSelection.index, sel.selectedData);
9777 }
9778 return;
9779 }
9780 }
9781 if (hasSelectedData && this._dataScope.selection.included.length === 1 && this._dataScope.selection.included[0][0, _constants.GL_ORDINAL] === cube.ordinal) {
9782 this.deselect();
9783 return;
9784 }
9785 const search = {
9786 name: (0, _constants.GL_ORDINAL),
9787 operator: "==",
9788 value: cube.ordinal
9789 };
9790 this.select(search);
9791 }
9792 onCubeHover(e, cube) {
9793 if (this._tooltip) {
9794 this._tooltip.finalize();

Callers 1

newCubeLayerFunction · 0.45

Calls 7

activateMethod · 0.95
getSelectionMethod · 0.95
deselectMethod · 0.95
selectMethod · 0.95
hasSelectedDataMethod · 0.45
populateMethod · 0.45

Tested by

no test coverage detected