SideBar
Aims to provide a sidebar for searching capability for SPARC portal.
Props
| Name | Description | Type | Required | Default |
|---|---|---|---|---|
| tabs | - | array | false | [ { title: 'Dataset Explorer', id: 1, type: 'datasetExplorer', closable: false }, { title: 'Connectivity Explorer', id: 2, type: 'connectivityExplorer', closable: false }, { title: 'Annotation', id: 3, type: 'annotation', closable: true }, ] |
| visible | The option to show side bar. | boolean | false | false |
| envVars | The environment variables object with API_LOCATION, ALGOLIA_KEY, ALGOLIA_ID, ALGOLIA_INDEX, PENNSIEVE_API_LOCATION, BL_SERVER_URL, ROOT_URL | object | false | () => {} |
| openAtStart | The option to show or hide sidebar on page load. | boolean | false | false |
| connectivityEntry | The connectivity info data to show in sidebar. | array | false | [] |
| annotationEntry | The annotation data to show in sidebar. | array | false | [] |
| createData | - | object | false | { toBeConfirmed: false, points: [], shape: '', x: 0, y: 0 } |
| connectivityKnowledge | - | array | false | [] |
| filterOptions | - | array | false | [] |
| showVisibilityFilter | - | boolean | false | false |
| showLongLabel | - | boolean | false | false |
Events
| Event Name | Description | Parameters |
|---|---|---|
| annotation-submitted | - | - |
| confirm-create | - | - |
| cancel-create | - | - |
| confirm-delete | - | - |
| filter-visibility | - | - |
| connectivity-collapse-change | - | - |
| connectivity-item-close | - | - |
| hover-changed | - | - |
| show-connectivity | - | - |
| show-reference-connectivities | - | - |
| connectivity-hovered | - | - |
| search-changed | - | - |
| tabClicked | - | - |
| tabClosed | - | - |
| trackEvent | - | - |
| actionClick | This event is emitted when the image is clicked on or the button below the image is clicked on. | payLoad |
| number-of-datasets-for-anatomies | This emits a object with keys as anatomy and values as number of datasets for that anatomy. | payload |
| anatomy-in-datasets | This emits a lis of datasets, with the anatomy for each one. Used by flatmap for markers | payload |
| contextUpdate | This event is emitted when the context card is updated. Example, context card update on first load. | payload |
| datalink-clicked | This event is emitted when the dataset button or dataset image thumbnail from the gallery component is clicked. | payload |
| connectivity-source-change | - | - |
| show-connectivity-graph | - | - |
Methods
| Method | Description | Parameters |
|---|---|---|
| close | The function to close sidebar. | - |
| toggleDrawer | The function to toggle (open and close) sidebar. | - |
| addFilter | The function to add filters to sidebar search. | filter |
| getState | This function returns the current state of the sidebar to store in the map state. | - |
| setState | This function restores the state of the sidebar from the provided state object. | state |
| trackEvent | Track an event for analytics | data |