Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow multiple view plugins for the same neurodata type #78

Closed
magland opened this issue Jul 21, 2023 · 0 comments
Closed

allow multiple view plugins for the same neurodata type #78

magland opened this issue Jul 21, 2023 · 0 comments

Comments

@magland
Copy link
Collaborator

magland commented Jul 21, 2023

This addresses #75

It is now possible to register multiple view plugins for the same neurodata type, with one of them being explicitly tagged as the default view. Then it appears like this:

Image

So the user can select multiple views to see them in the same tab, or open just the default view, or just an optional view. There's a lot more flexibility this way.

Here's the relevant section of the code for registering the default and optional view plugins:

///////////////////////////////////////////////////////////////////////////////////////
// REGISTER VIEW PLUGINS HERE
// ImageSegmentation
viewPlugins.push({
name: 'ImageSegmentation',
neurodataType: 'ImageSegmentation',
defaultForNeurodataType: true,
component: ImageSegmentationItemView
})
// SpatialSeries
viewPlugins.push({
name: 'SpatialSeries',
neurodataType: 'SpatialSeries',
defaultForNeurodataType: true,
component: NeurodataSpatialSeriesItemView
})
viewPlugins.push({
name: 'X/Y',
neurodataType: 'SpatialSeries',
defaultForNeurodataType: false,
component: SpatialSeriesXYView,
buttonLabel: 'X/Y'
})
// TwoPhotonSeries
viewPlugins.push({
name: 'TwoPhotonSeries',
neurodataType: 'TwoPhotonSeries',
defaultForNeurodataType: true,
component: TwoPhotonSeriesItemView
})
// TimeSeries
viewPlugins.push({
name: 'TimeSeries',
neurodataType: 'TimeSeries',
defaultForNeurodataType: true,
component: NeurodataTimeSeriesItemView
})
// DynamicTable
viewPlugins.push({
name: 'DynamicTable',
neurodataType: 'DynamicTable',
defaultForNeurodataType: true,
component: DynamicTableView
})
// TimeIntervals
viewPlugins.push({
name: 'TimeIntervals',
neurodataType: 'TimeIntervals',
defaultForNeurodataType: true,
component: NeurodataTimeIntervalsItemView
})
// ElectricalSeries
viewPlugins.push({
name: 'ElectricalSeries',
neurodataType: 'ElectricalSeries',
defaultForNeurodataType: true,
component: NeurodataElectricalSeriesItemView
})
// HelloWorld
viewPlugins.push({
name: 'HelloWorld',
neurodataType: 'LabeledEvents', // hi-jacking this type for now
defaultForNeurodataType: true,
component: HelloWorldView // see ./HelloWorld/HelloWorldView.tsx
})
// See https://flatironinstitute.github.io/neurosift/#/nwb?url=https://dandiarchive.s3.amazonaws.com/blobs/8cf/38e/8cf38e36-6cd8-4c10-9d74-c2e6be70f019
// for an example that has a LabeledEvents object inside processing/behavior
// ImageSeries
viewPlugins.push({
name: 'ImageSeries',
neurodataType: 'ImageSeries',
defaultForNeurodataType: true,
component: ImageSeriesItemView
})
// Units
viewPlugins.push({
name: 'DirectRasterPlot',
neurodataType: 'Units',
defaultForNeurodataType: false,
buttonLabel: 'raster plot',
component: DirectRasterPlotUnitsItemView
})
viewPlugins.push({
name: 'RasterPlot',
neurodataType: 'Units',
defaultForNeurodataType: false,
buttonLabel: 'precomputed raster plot',
component: RasterPlotUnitsItemView
})
viewPlugins.push({
name: 'Autocorrelograms',
neurodataType: 'Units',
defaultForNeurodataType: false,
buttonLabel: 'autocorrelograms',
component: AutocorrelogramsUnitsItemView
})
// Images
viewPlugins.push({
name: 'Images',
neurodataType: 'Images',
defaultForNeurodataType: true,
component: ImagesItemView
})
///////////////////////////////////////////////////////////////////////////////////////

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

1 participant