An easy-to-use platform for EEG experimentation in the classroom
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

object -> Record<string,any>

+37 -32
+25 -16
app/components/AnalyzeComponent.tsx
··· 112 112 removeOutliers: boolean; 113 113 showDataPoints: boolean; 114 114 isSidebarVisible: boolean; 115 - displayOutlierVisible: boolean; 115 + // TODO: implement outlier display toggle 116 + // displayOutlierVisible: boolean; 116 117 displayMode: string; 118 + dataToPlot: number[]; 119 + layout: Record<string, any>; 117 120 helpMode: string; 118 121 dependentVariables: Array< 119 122 | { ··· 128 131 // TODO: Add a channel callback from reading epochs so this screen can be aware of which channels are 129 132 // available in dataset 130 133 export default class Analyze extends Component<Props, State> { 131 - // handleDependentVariableChange: (Object, Object) => void; 132 - 133 - // handleRemoveOutliers: (Object, Object) => void; 134 - // handleDisplayModeChange: (string) => void; 135 - // handleDataPoints: (Object, Object) => void; 136 - // saveSelectedDatasets: () => void; 137 - // handleStepClick: (Object, Object) => void; 138 - // toggleDisplayInfoVisibility: () => void; 139 134 constructor(props: Props) { 140 135 super(props); 141 136 this.state = { ··· 217 212 return subjects.reduce((acc, curr) => `${acc}-${curr}`); 218 213 }; 219 214 220 - handleDatasetChange(event: object, data: object) { 215 + handleDatasetChange(event: Record<string, any>, data: Record<string, any>) { 221 216 this.setState({ 222 217 selectedFilePaths: data.value, 223 218 selectedSubjects: getSubjectNamesFromFiles(data.value), ··· 225 220 this.props.JupyterActions.LoadCleanedEpochs(data.value); 226 221 } 227 222 228 - handleBehaviorDatasetChange(event: object, data: object) { 229 - const { dataToPlot, layout } = aggregateDataForPlot( 223 + handleBehaviorDatasetChange( 224 + event: Record<string, any>, 225 + data: Record<string, any> 226 + ) { 227 + const aggregatedData = aggregateDataForPlot( 230 228 readBehaviorData(data.value), 231 229 this.state.selectedDependentVariable, 232 230 this.state.removeOutliers, 233 231 this.state.showDataPoints, 234 232 this.state.displayMode 235 233 ); 234 + if (!aggregatedData) { 235 + return; 236 + } 237 + const { dataToPlot, layout } = aggregatedData; 236 238 this.setState({ 237 239 selectedBehaviorFilePaths: data.value, 238 240 selectedSubjects: getSubjectNamesFromFiles(data.value), ··· 254 256 } 255 257 } 256 258 257 - handleDependentVariableChange(event: object, data: object) { 258 - const { dataToPlot, layout } = aggregateDataForPlot( 259 + handleDependentVariableChange( 260 + event: Record<string, any>, 261 + data: Record<string, any> 262 + ) { 263 + const aggregatedData = aggregateDataForPlot( 259 264 readBehaviorData(this.state.selectedBehaviorFilePaths), 260 265 data.value, 261 266 this.state.removeOutliers, 262 267 this.state.showDataPoints, 263 268 this.state.displayMode 264 269 ); 270 + if (!aggregatedData) { 271 + return; 272 + } 273 + const { dataToPlot, layout } = aggregatedData; 265 274 this.setState({ 266 275 selectedDependentVariable: data.value, 267 276 dataToPlot, ··· 269 278 }); 270 279 } 271 280 272 - handleRemoveOutliers(event: object, data: object) { 281 + handleRemoveOutliers(event: Record<string, any>, data: Record<string, any>) { 273 282 const { dataToPlot, layout } = aggregateDataForPlot( 274 283 readBehaviorData(this.state.selectedBehaviorFilePaths), 275 284 this.state.selectedDependentVariable, ··· 285 294 }); 286 295 } 287 296 288 - handleDataPoints(event: object, data: object) { 297 + handleDataPoints(event: Record<string, any>, data: Record<string, any>) { 289 298 const { dataToPlot, layout } = aggregateDataForPlot( 290 299 readBehaviorData(this.state.selectedBehaviorFilePaths), 291 300 this.state.selectedDependentVariable,
+2 -2
app/components/CleanComponent/index.tsx
··· 101 101 }); 102 102 } 103 103 104 - handleRecordingChange(event: object, data: DropdownProps) { 104 + handleRecordingChange(event: Record<string, any>, data: DropdownProps) { 105 105 if (isArray(data.value)) { 106 106 const filePaths = data.value.filter<string>(isString); 107 107 this.setState({ selectedFilePaths: filePaths }); 108 108 } 109 109 } 110 110 111 - handleSubjectChange(event: object, data: DropdownProps) { 111 + handleSubjectChange(event: Record<string, any>, data: DropdownProps) { 112 112 if (!isNil(data) && isString(data.value)) { 113 113 this.setState({ selectedSubject: data.value, selectedFilePaths: [] }); 114 114 }
+1 -1
app/components/CollectComponent/ConnectModal.tsx
··· 16 16 history: HashHistory; 17 17 open: boolean; 18 18 onClose: () => void; 19 - connectedDevice: object; 19 + connectedDevice: Record<string, any>; 20 20 signalQualityObservable?: Observable<SignalQualityData>; 21 21 deviceType: DEVICES; 22 22 deviceAvailability: DEVICE_AVAILABILITY;
+2 -6
app/components/DesignComponent/CustomDesignComponent.tsx
··· 55 55 type: EXPERIMENTS | null | undefined; 56 56 title: string; 57 57 params: ExperimentParameters; 58 - trials: { 59 - [key: string]: Trial; 60 - }; 61 - timelines: {}; 62 58 ExperimentActions: typeof ExperimentActions; 63 59 isEEGEnabled: boolean; 64 60 description: ExperimentDescription; ··· 103 99 this.setState({ activeStep: step }); 104 100 } 105 101 106 - handleProgressBar(event: object, data: object) { 102 + handleProgressBar(event: Record<string, any>, data: Record<string, any>) { 107 103 this.setState({ 108 104 params: { ...this.state.params, showProgessBar: data.checked }, 109 105 }); 110 106 } 111 107 112 - handleEEGEnabled(event: object, data: object) { 108 + handleEEGEnabled(event: Record<string, any>, data: Record<string, any>) { 113 109 this.props.ExperimentActions.SetEEGEnabled(data.checked); 114 110 } 115 111
+1 -1
app/components/EEGExplorationComponent.tsx
··· 23 23 24 24 interface Props { 25 25 history: HashHistory; 26 - connectedDevice: object; 26 + connectedDevice: Record<string, any>; 27 27 signalQualityObservable: any | null | undefined; 28 28 deviceType: DEVICES; 29 29 deviceAvailability: DEVICE_AVAILABILITY;
+1 -1
app/components/InputModal.tsx
··· 48 48 this.props.onExit(); 49 49 } 50 50 51 - handleEnterSubmit(event: object) { 51 + handleEnterSubmit(event: Record<string, any>) { 52 52 if (event.key === 'Enter') { 53 53 this.handleClose(); 54 54 }
+3 -3
app/constants/interfaces.ts
··· 80 80 id: string; 81 81 timeline: Array<Trial>; 82 82 sample?: SampleParameter; 83 - timeline_variables?: Array<object>; 83 + timeline_variables?: Array<Record<string, any>>; 84 84 }; 85 85 86 86 export interface SampleParameter { ··· 105 105 // Jupyter 106 106 107 107 export interface Kernel { 108 - config: object; 108 + config: Record<string, any>; 109 109 connectionFile: string; 110 - kernelSpec: object; 110 + kernelSpec: Record<string, any>; 111 111 spawn: ChildProcess; 112 112 } 113 113
+2 -2
app/utils/jupyter/functions.ts
··· 3 3 export const parseSingleQuoteJSON = (string: string) => 4 4 JSON.parse(string.replace(/'/g, '"')); 5 5 6 - export const parseKernelStatus = (msg: object) => { 6 + export const parseKernelStatus = (msg: Record<string, any>) => { 7 7 switch (msg.content.execution_state) { 8 8 case 'busy': 9 9 return KERNEL_STATUS.BUSY; ··· 15 15 } 16 16 }; 17 17 18 - export const debugParseMessage = (msg: object) => { 18 + export const debugParseMessage = (msg: Record<string, any>) => { 19 19 let content = ''; 20 20 switch (msg.channel) { 21 21 case 'iopub':