(clickedPtInfo)
| 873 | } |
| 874 | |
| 875 | function isPointOrBinSelected(clickedPtInfo) { |
| 876 | var trace = clickedPtInfo.searchInfo.cd[0].trace; |
| 877 | var ptNum = clickedPtInfo.pointNumber; |
| 878 | var ptNums = clickedPtInfo.pointNumbers; |
| 879 | var ptNumsSet = ptNums.length > 0; |
| 880 | |
| 881 | // When pointsNumbers is set (e.g. histogram's binning), |
| 882 | // it is assumed that when the first point of |
| 883 | // a bin is selected, all others are as well |
| 884 | var ptNumToTest = ptNumsSet ? ptNums[0] : ptNum; |
| 885 | |
| 886 | // TODO potential performance improvement |
| 887 | // Primarily we need this function to determine if a click adds |
| 888 | // or subtracts from a selection. |
| 889 | // In cases `trace.selectedpoints` is a huge array, indexOf |
| 890 | // might be slow. One remedy would be to introduce a hash somewhere. |
| 891 | return trace.selectedpoints ? trace.selectedpoints.indexOf(ptNumToTest) > -1 : false; |
| 892 | } |
| 893 | |
| 894 | function isOnlyThisBinSelected(searchTraces, clickedPtInfo) { |
| 895 | var tracesWithSelectedPts = []; |
no outgoing calls
no test coverage detected
searching dependent graphs…