@abi-software/map-side-bar 2.2.0 → 2.2.1-alpha-2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,168 +1,168 @@
1
- # map-side-bar
2
-
3
- [![npm version](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar.svg)](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar)
4
-
5
- The project is developed based on Vite-Vue3. Aims to provide a sidebar for searching capability for
6
- SPARC portal.
7
-
8
- ## Customize configuration
9
-
10
- See [Vite Configuration Reference](https://vitejs.dev/config/).
11
-
12
- ## Package installation
13
-
14
- ```
15
- npm i @abi-software/map-side-bar
16
- ```
17
-
18
- ## Project Setup
19
-
20
- ```
21
- npm install
22
- ```
23
-
24
- ### Compile and Hot-Reload for Development
25
-
26
- ```
27
- npm run serve
28
- ```
29
-
30
- ### Compile and Minify for Production
31
-
32
- ```
33
- npm run build-bundle
34
- ```
35
-
36
- ## How to use
37
-
38
- Import the component and the style from the package.
39
-
40
- ```javascript
41
- import { SideBar } from "@abi-software/map-side-bar";
42
- import "@abi-software/map-side-bar/dist/style.css";
43
- ```
44
-
45
- The code in template should looks like this
46
-
47
- ```html
48
- <SideBar
49
- :envVars="envVars"
50
- :visible="sideBarVisibility"
51
- @actionClick="actionClick"
52
- />
53
- ```
54
-
55
- envVars contains environment variables like so:
56
-
57
- ```yaml
58
- {
59
- API_LOCATION: 'http://localhost:5000/',
60
- ALGOLIA_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
61
- ALGOLIA_ID: 'xxxxx',
62
- ALGOLIA_INDEX: 'k-core_dev_published_time_desc',
63
- }
64
- ```
65
-
66
- actionClick event is called when an action button has been clicked on.
67
-
68
- ## Sidebar Data formats
69
- ### Algolia
70
-
71
- Data retrieved from Algolia can be found here:
72
- https://github.com/ABI-Software/map-sidebar/blob/3310b165489b10901f50a21e5689ef046251dbd9/src/algolia/algolia.js#L136
73
-
74
- ```
75
- [
76
- 'pennsieve.publishDate', // optional
77
- 'pennsieve.updatedAt', // optional
78
- 'Item.curie', //contains the DOI for the dataset (required)
79
- 'Item.name', // dataset title (required)
80
- 'Item.description', // dataset description (required)
81
- 'objectID', // Pennsieve discover ID (required)
82
- ],
83
- ```
84
-
85
- ### Scicrunch
86
-
87
- Data retrieved from scicrunch can be found here:
88
- https://github.com/nih-sparc/sparc-api/blob/f3444a32964f5340e0ee1f10a08a05839620d098/app/scicrunch_processing_common.py#L25
89
-
90
- And mimetypes can be viewed here
91
- https://github.com/nih-sparc/sparc-api/blob/f3444a32964f5340e0ee1f10a08a05839620d098/app/scicrunch_processing_common.py#L28
92
-
93
- ```
94
- ADDITIONAL_LINKS = 'additionalLinks'
95
- BIOLUCIDA_2D = 'biolucida-2d'
96
- BIOLUCIDA_3D = 'biolucida-3d'
97
- COMMON_IMAGES = 'common-images'
98
- CONTEXT_FILE = 'abi-context-file'
99
- CSV = 'csv'
100
- NAME = 'name'
101
- ORGANS = 'organs'
102
- PLOT_FILE = 'abi-plot'
103
- SEGMENTATION_FILES = 'mbf-segmentation'
104
- SCAFFOLD_DIR = 'abi-scaffold-dir'
105
- SCAFFOLD_FILE = 'abi-scaffold-metadata-file'
106
- THUMBNAIL_IMAGE = 'abi-thumbnail'
107
- SCAFFOLD_VIEW_FILE = 'abi-scaffold-view-file'
108
- SIMULATION_FILE = 'abi-simulation-file'
109
- VIDEO = 'video'
110
- VERSION = 'version'
111
- README = 'readme'
112
- TITLE = 'title'
113
- ```
114
-
115
- Note: All are optional except for ‘name’
116
-
117
- ### Sidebar input processing
118
- Sidebar input processing can be viewed here:
119
- https://github.com/ABI-Software/map-sidebar/blob/3310b165489b10901f50a21e5689ef046251dbd9/src/components/SidebarContent.vue#L318
120
-
121
- It is used to keep the code from attempting to access an object property that does not exist
122
-
123
- ### Context card data format
124
- All fields are strings:
125
- ```
126
- {
127
- "description": required ,
128
- "id": optional,
129
- "samples": [ // array required here (can be empty)
130
- {
131
- "annotation": optional,
132
- "description": required,
133
- "doi": optional // Doi will be used to link sample to a separate dataset,
134
- "heading": required,
135
- "id": required,
136
- "path": optional // path will be used to link to file location,
137
- "view": optional // Will be used to link to “views[i].id”
138
- }
139
- ],
140
- "version": // not currently used,
141
- "views": [ // array required here (can be empty)
142
- {
143
- "annotation": optional,
144
- "description": required,
145
- "id": required,
146
- "path": required // relative path to the view file, eg "derivative\\Scaffolds\\scaffoldMap_tenial_view.json",
147
- "sample": optional // used to link to views to samples
148
- "thumbnail": optional // technically optional but it won’t look great
149
- }
150
- ]
151
- }
152
- ```
153
-
154
- An example context card file can be viewed here:
155
- https://drive.google.com/file/d/15NVRBny7WGltpMSRbsgMglXo0xOC3-Q9/view?usp=sharing
156
-
157
-
158
- ## API Documentation
159
-
160
- The API documentation is developed with `vitepress` and `vuese`. Documentation pages are in the `docs` folder.
161
-
162
- ### To run in local development mode
163
- ```bash
164
- npm run docs:watch
165
- ```
166
-
167
- This will start the documentation server with `vitepress` on port `:5173` and watch the components' changes.
168
-
1
+ # map-side-bar
2
+
3
+ [![npm version](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar.svg)](https://badge.fury.io/js/%40abi-software%2Fmap-side-bar)
4
+
5
+ The project is developed based on Vite-Vue3. Aims to provide a sidebar for searching capability for
6
+ SPARC portal.
7
+
8
+ ## Customize configuration
9
+
10
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
11
+
12
+ ## Package installation
13
+
14
+ ```
15
+ npm i @abi-software/map-side-bar
16
+ ```
17
+
18
+ ## Project Setup
19
+
20
+ ```
21
+ npm install
22
+ ```
23
+
24
+ ### Compile and Hot-Reload for Development
25
+
26
+ ```
27
+ npm run serve
28
+ ```
29
+
30
+ ### Compile and Minify for Production
31
+
32
+ ```
33
+ npm run build-bundle
34
+ ```
35
+
36
+ ## How to use
37
+
38
+ Import the component and the style from the package.
39
+
40
+ ```javascript
41
+ import { SideBar } from "@abi-software/map-side-bar";
42
+ import "@abi-software/map-side-bar/dist/style.css";
43
+ ```
44
+
45
+ The code in template should looks like this
46
+
47
+ ```html
48
+ <SideBar
49
+ :envVars="envVars"
50
+ :visible="sideBarVisibility"
51
+ @actionClick="actionClick"
52
+ />
53
+ ```
54
+
55
+ envVars contains environment variables like so:
56
+
57
+ ```yaml
58
+ {
59
+ API_LOCATION: 'http://localhost:5000/',
60
+ ALGOLIA_KEY: 'xxxxxxxxxxxxxxxxxxxxxxxxx',
61
+ ALGOLIA_ID: 'xxxxx',
62
+ ALGOLIA_INDEX: 'k-core_dev_published_time_desc',
63
+ }
64
+ ```
65
+
66
+ actionClick event is called when an action button has been clicked on.
67
+
68
+ ## Sidebar Data formats
69
+ ### Algolia
70
+
71
+ Data retrieved from Algolia can be found here:
72
+ https://github.com/ABI-Software/map-sidebar/blob/3310b165489b10901f50a21e5689ef046251dbd9/src/algolia/algolia.js#L136
73
+
74
+ ```
75
+ [
76
+ 'pennsieve.publishDate', // optional
77
+ 'pennsieve.updatedAt', // optional
78
+ 'Item.curie', //contains the DOI for the dataset (required)
79
+ 'Item.name', // dataset title (required)
80
+ 'Item.description', // dataset description (required)
81
+ 'objectID', // Pennsieve discover ID (required)
82
+ ],
83
+ ```
84
+
85
+ ### Scicrunch
86
+
87
+ Data retrieved from scicrunch can be found here:
88
+ https://github.com/nih-sparc/sparc-api/blob/f3444a32964f5340e0ee1f10a08a05839620d098/app/scicrunch_processing_common.py#L25
89
+
90
+ And mimetypes can be viewed here
91
+ https://github.com/nih-sparc/sparc-api/blob/f3444a32964f5340e0ee1f10a08a05839620d098/app/scicrunch_processing_common.py#L28
92
+
93
+ ```
94
+ ADDITIONAL_LINKS = 'additionalLinks'
95
+ BIOLUCIDA_2D = 'biolucida-2d'
96
+ BIOLUCIDA_3D = 'biolucida-3d'
97
+ COMMON_IMAGES = 'common-images'
98
+ CONTEXT_FILE = 'abi-context-file'
99
+ CSV = 'csv'
100
+ NAME = 'name'
101
+ ORGANS = 'organs'
102
+ PLOT_FILE = 'abi-plot'
103
+ SEGMENTATION_FILES = 'mbf-segmentation'
104
+ SCAFFOLD_DIR = 'abi-scaffold-dir'
105
+ SCAFFOLD_FILE = 'abi-scaffold-metadata-file'
106
+ THUMBNAIL_IMAGE = 'abi-thumbnail'
107
+ SCAFFOLD_VIEW_FILE = 'abi-scaffold-view-file'
108
+ SIMULATION_FILE = 'abi-simulation-file'
109
+ VIDEO = 'video'
110
+ VERSION = 'version'
111
+ README = 'readme'
112
+ TITLE = 'title'
113
+ ```
114
+
115
+ Note: All are optional except for ‘name’
116
+
117
+ ### Sidebar input processing
118
+ Sidebar input processing can be viewed here:
119
+ https://github.com/ABI-Software/map-sidebar/blob/3310b165489b10901f50a21e5689ef046251dbd9/src/components/SidebarContent.vue#L318
120
+
121
+ It is used to keep the code from attempting to access an object property that does not exist
122
+
123
+ ### Context card data format
124
+ All fields are strings:
125
+ ```
126
+ {
127
+ "description": required ,
128
+ "id": optional,
129
+ "samples": [ // array required here (can be empty)
130
+ {
131
+ "annotation": optional,
132
+ "description": required,
133
+ "doi": optional // Doi will be used to link sample to a separate dataset,
134
+ "heading": required,
135
+ "id": required,
136
+ "path": optional // path will be used to link to file location,
137
+ "view": optional // Will be used to link to “views[i].id”
138
+ }
139
+ ],
140
+ "version": // not currently used,
141
+ "views": [ // array required here (can be empty)
142
+ {
143
+ "annotation": optional,
144
+ "description": required,
145
+ "id": required,
146
+ "path": required // relative path to the view file, eg "derivative\\Scaffolds\\scaffoldMap_tenial_view.json",
147
+ "sample": optional // used to link to views to samples
148
+ "thumbnail": optional // technically optional but it won’t look great
149
+ }
150
+ ]
151
+ }
152
+ ```
153
+
154
+ An example context card file can be viewed here:
155
+ https://drive.google.com/file/d/15NVRBny7WGltpMSRbsgMglXo0xOC3-Q9/view?usp=sharing
156
+
157
+
158
+ ## API Documentation
159
+
160
+ The API documentation is developed with `vitepress` and `vuese`. Documentation pages are in the `docs` folder.
161
+
162
+ ### To run in local development mode
163
+ ```bash
164
+ npm run docs:watch
165
+ ```
166
+
167
+ This will start the documentation server with `vitepress` on port `:5173` and watch the components' changes.
168
+