-
-
- {`Events (${visibleEpochsInRange.length}/${epochsInRange.length})`}
-
-
-
in timeline view [Total: {epochs.length}]
+
+
+ {` showing ${
+ filteredEpochs
+ .searchVisibility
+ .filter((i) => filteredEpochs.plotVisibility.includes(i))
+ .length
+ }/${epochsInRange.length}`}
+
+
+ = MAX_RENDERED_EPOCHS ? ' glyphicon-greyed' : '')}
+ style={{cursor: 'pointer', paddingTop: '0.375em', paddingRight: '0.5em',}}
+ onClick={() => setCommentsInRangeVisibility(!allCommentsVisible)}
+ >
+ = MAX_RENDERED_EPOCHS ? ' glyphicon-greyed' : '')
+ }
+ style={{cursor: 'pointer', padding: '0.5em'}}
+ onClick={() => setEpochsInViewVisibility(!allEpochsVisible)}
+ >
+
+
+
+
+ Total events in recording {epochs.length}
-
-
- setCommentsInRangeVisibility(!allCommentsVisible)}
- >
- setEpochsInViewVisibility(!allEpochsVisible)}
- >
- {
- setRightPanel(null);
+
+
+
+ Display by:
+
+
+
+
+ {
+ getDatasetColumns().map((column, i) => {
+ return - {
+ setActiveLabel(column);
+ }}>
+ {column}
+
+ })
+ }
+
+
+
+
+
+ Ignore 'n/a'}
+ value={ignoreNA}
+ onUserInput={() => {
+ setIgnoreNA(!ignoreNA);
+ }}
+ outerStyles={{}}
+ innerLabelStyle={{
+ display: 'flex',
+ whiteSpace: 'nowrap',
}}
- >
+ />
+ {
+ searchText.length > 0 &&
+
+ Exclude
+
+ {
+ searchText.length > 0
+ ? searchText
+ : ''
+ }
+
+ >
+ }
+ value={invertSearchResults}
+ onUserInput={() => {
+ setInvertSearchResults(!invertSearchResults);
+ }}
+ outerStyles={{}}
+ innerLabelStyle={{
+ display: 'flex',
+ whiteSpace: 'nowrap',
+ }}
+ />
+ }
{epochsInRange.length >= MAX_RENDERED_EPOCHS &&
-
- Too many events to display for the timeline range.
+
+ Too many events to plot for this timeline range
+
+ }
+ {epochsInRange.length === 0 &&
+
+ No events in timeline range.
Try selecting a different time range.
}
- {epochsInRange.map((epochIndex) => {
- const epoch = epochs[epochIndex];
- const epochVisible = filteredEpochs.plotVisibility.includes(epochIndex);
- const hedVisible = filteredEpochs.columnVisibility.includes(epochIndex);
+ {
+ // epochsInRange.length < MAX_RENDERED_EPOCHS &&
+ epochsInRange.map((epochIndex) => {
+ const epoch = epochs[epochIndex];
+ const epochVisible = filteredEpochs.plotVisibility.includes(epochIndex);
+ const hedVisible = filteredEpochs.columnVisibility.includes(epochIndex);
- /**
- *
- */
- const handleCommentVisibilityChange = () => {
- if (!hedVisible) {
- setFilteredEpochs({
- plotVisibility: filteredEpochs.plotVisibility,
- columnVisibility: [
- ...filteredEpochs.columnVisibility,
- epochIndex,
- ]
- });
- } else {
- setFilteredEpochs({
- plotVisibility: filteredEpochs.plotVisibility,
- columnVisibility: filteredEpochs.columnVisibility.filter(
- (value) => value !== epochIndex
- )
- });
- }
- };
+ /**
+ *
+ */
+ const handleCommentVisibilityChange = () => {
+ if (!hedVisible) {
+ setFilteredEpochs({
+ ...filteredEpochs,
+ columnVisibility: [
+ ...filteredEpochs.columnVisibility,
+ epochIndex,
+ ]
+ });
+ } else {
+ setFilteredEpochs({
+ ...filteredEpochs,
+ columnVisibility: filteredEpochs.columnVisibility.filter(
+ (value) => value !== epochIndex
+ )
+ });
+ }
+ };
- /**
- *
- */
- const handleEditClick = () => {
- setCurrentAnnotation(epoch);
- setRightPanel('annotationForm');
- const startTime = epoch.onset;
- const endTime = epoch.duration + startTime;
- setTimeSelection([startTime, endTime]);
- };
+ /**
+ *
+ */
+ const handleEditClick = () => {
+ setCurrentAnnotation(epoch);
+ setRightPanel('annotationForm');
+ const startTime = epoch.onset;
+ const endTime = epoch.duration + startTime;
+ setTimeSelection([startTime, endTime]);
+ };
+ const channelNamesInView = channelMetadata.filter((_, index) => {
+ return channels.map((channel) => channel.index).includes(index)
+ }).map(metadata => metadata.name);
- return (
-
updateActiveEpoch(epochIndex)}
- onMouseLeave={() => updateActiveEpoch(null)}
- >
+ return filteredEpochs.searchVisibility.includes(epochIndex) && (
0
+ ? '-channel-based'
+ : ''
+ )
+ }
+ style={{
+ position: 'relative',
+ }}
+ onMouseEnter={() => updateActiveEpoch(epochIndex)}
+ onMouseLeave={() => updateActiveEpoch(null)}
>
-
- {epoch.label}
-
- {Math.round(epoch.onset * 1000) / 1000}
- {epoch.duration > 0
- && ' - '
- + (Math.round((epoch.onset + epoch.duration) * 1000) / 1000)
- }
-
- {(epoch.properties.length > 0 || epoch.hed) &&
+
+ {
+ activeLabel === 'trial_type'
+ ? epoch.trialType ?? 'n/a'
+ : activeLabel === 'HED'
+ ? [
+ ...epoch.hed,
+ ...getTagsForEpoch(epoch, datasetTags, hedSchema),
+ ].length > 0
+ ? buildHEDString([
+ ...epoch.hed,
+ ...getTagsForEpoch(epoch, datasetTags, hedSchema),
+ ]).join(', ')
+ : 'n/a'
+ : epoch.properties.find((prop) => prop.PropertyName === activeLabel)
+ ?.PropertyValue ?? 'n/a'
+ }
+
+ {Math.round(epoch.onset * 1000) / 1000}
+ {epoch.duration > 0
+ && ' - '
+ + (Math.round((epoch.onset + epoch.duration) * 1000) / 1000)
+ }
+
+ {
+ (epoch.channels.length === 0)
+ ? '' // 'All channels'
+ : epoch.channels
+ .sort((channelA, channelB) => {
+ return channelMetadata.findIndex(channel => channel.name === channelA)
+ - channelMetadata.findIndex(channel => channel.name === channelB);
+ })
+ .map((channel, i) => {
+ return
+ {i > 0 && <>{channelDelimiter} >}
+ {channel}
+
+ })
+ }
+
+
- }
-
- {epoch.type === 'Event' &&
- }
+ {
+ /*
+ (
+ {epoch.properties.length > 0 ||
+ epoch.hed.length > 0 ||
+ getTagsForEpoch(epoch, datasetTags, hedSchema).length > 0 ||
+ epoch.channels.length > 0
+ ) &&
+ */
+ (
+
+ )
+ }
+ {
+ epoch.type === 'Event' &&
+
+ }
+
-
- {(hedVisible && (epoch.properties.length > 0 || epoch.hed)) &&
-
- {epoch.properties.length > 0 &&
-
Additional Columns:
- {
- epoch.properties.map((property) =>
- `${property.PropertyName}: ${property.PropertyValue}`
- ).join(', ')
- }
+ {(hedVisible /*&& (
+ epoch.properties.length > 0 ||
+ epoch.hed ||
+ epoch.channels.length > 0
+ )*/
+ ) &&
+
+ {/*{epoch.channels.length > 0 &&*/}
+ {/*
Channel(s) */}
+ {/* {epoch.channels.join(channelDelimiter)}*/}
+ {/*
*/}
+ {/*}*/}
+
+
+ trial_type
+
+
+
+ {epoch.trialType}
+
- }
- {epoch.hed &&
-
HED:
- {buildHEDString([
- ...epoch.hed,
- ...getTagsForEpoch(epoch, datasetTags, hedSchema),
- ]).join(', ')}
+
+
+ channel
+
+
+
+ {
+ epoch.channels.length > 0
+ ? epoch.channels.map((channel, i) => {
+ return
+ {i > 0 && <>{channelDelimiter} >}
+ {channel}
+ ;
+ })
+ : 'n/a'
+ }
+
- }
-
- }
-
- );
- })}
+ {epoch.properties.length > 0 &&
+
Additional Columns
+ {
+ epoch.properties.map((property) => {
+ return
+
+ {property.PropertyName}
+
+
+
+ {property.PropertyValue}
+
+
+ })
+ }
+
+ }
+ {
+
HED
+ {
+ [
+ ...epoch.hed,
+ ...getTagsForEpoch(epoch, datasetTags, hedSchema)
+ ].length > 0
+ ? (
+ buildHEDString([
+ ...epoch.hed,
+ ...getTagsForEpoch(epoch, datasetTags, hedSchema),
+ ]).join(', ')
+ )
+ : 'n/a'
+ }
+
+ }
+
+ }
+
+ );
+ })}
);
};
-EventManager.defaultProps = {
- timeSelection: null,
- epochs: [],
- filteredEpochs: {
- plotVisibility: [],
- columnVisibility: [],
- },
-};
+EventManager.defaultProps = {};
export default connect(
(state: RootState)=> ({
@@ -353,10 +724,15 @@ export default connect(
epochs: state.dataset.epochs,
filteredEpochs: state.dataset.filteredEpochs,
rightPanel: state.rightPanel,
+ domain: state.bounds.domain,
interval: state.bounds.interval,
viewerHeight: state.bounds.viewerHeight,
hedSchema: state.dataset.hedSchema,
datasetTags: state.dataset.datasetTags,
+ channelDelimiter: state.dataset.channelDelimiter,
+ channels: state.channels, // TODO: merge with below and pass?
+ channelMetadata: state.dataset.channelMetadata,
+ tagsHaveChanges: state.dataset.tagsHaveChanges,
}),
(dispatch: (_: any) => void) => ({
setCurrentAnnotation: R.compose(
@@ -383,5 +759,9 @@ export default connect(
dispatch,
setFilteredEpochs
),
+ setInterval: R.compose(
+ dispatch,
+ setInterval
+ ),
})
)(EventManager);
diff --git a/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/Form.js b/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/Form.js
index a08425b6205..27a71059bc3 100644
--- a/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/Form.js
+++ b/modules/electrophysiology_browser/jsx/react-series-data-viewer/src/series/components/Form.js
@@ -1,4 +1,4 @@
-import React from 'react';
+import React, {Component, useEffect} from 'react';
import PropTypes from 'prop-types';
export const SelectElement = (props) => {
@@ -29,22 +29,22 @@ export const SelectElement = (props) => {
let errorMessage = null;
let emptyOptionHTML = null;
let requiredHTML = null;
- let elementClass = props.noMargins ? '' : 'row form-group';
+ let elementClass = props.noMargins ? props.elementClass : 'row form-group';
let useOptionGroups = props.useOptionGroups;
// Add required asterisk
if (required) {
- requiredHTML = *;
+ requiredHTML = *;
}
// Add empty option
if (props.emptyOption) {
- emptyOptionHTML = ;
+ emptyOptionHTML = ;
}
// Add error message
if (props.hasError) {
- errorMessage = {props.errorMessage};
+ errorMessage = {props.errorMessage};
elementClass = elementClass + ' has-error';
}
@@ -60,8 +60,8 @@ export const SelectElement = (props) => {
let isDisabled = (newOptions[option] in disabledOptions);
return (