MCPcopy Create free account
hub / github.com/microsoft/SandDance / handleAction

Method handleAction

docs/app/js/sanddance-app.js:10647–10684  ·  view source on GitHub ↗
(action)

Source from the content-addressed store, hash-verified

10645 this.render();
10646 }
10647 handleAction(action) {
10648 let p;
10649 const u = this.state.userSelection;
10650 switch(action){
10651 case Action.deselect:
10652 this.clearSelection();
10653 p = this.animator.deselect();
10654 break;
10655 case Action.exclude:
10656 this.clearSelection();
10657 p = this.animator.filter((0, _searchExpression.invert)(u.search), u.excluded, u.included, false);
10658 this.state.remapColor = false;
10659 break;
10660 case Action.isolate:
10661 this.clearSelection();
10662 p = this.animator.filter(u.search, u.included, u.excluded, false);
10663 this.state.remapColor = false;
10664 break;
10665 case Action.reset:
10666 this.clear();
10667 p = this.animator.reset();
10668 break;
10669 default:
10670 switch(action){
10671 case Action.previous:
10672 this.state.index--;
10673 if (this.state.index < 0) this.state.index = this.state.userSelection.included.length - 1;
10674 break;
10675 case Action.next:
10676 this.state.index++;
10677 if (this.state.index >= this.state.userSelection.included.length) this.state.index = 0;
10678 break;
10679 }
10680 this.render();
10681 p = this.animator.activate(this.state.userSelection.included[this.state.index]);
10682 }
10683 p.then(()=>this.render());
10684 }
10685 render() {
10686 const hasRefinedData = this.dataScope.hasFilteredData();
10687 const renderProps = {

Callers 1

renderMethod · 0.95

Calls 7

clearSelectionMethod · 0.95
clearMethod · 0.95
renderMethod · 0.95
deselectMethod · 0.45
filterMethod · 0.45
resetMethod · 0.45
activateMethod · 0.45

Tested by

no test coverage detected