Skip to content

Commit 30e4914

Browse files
committed
#SDSV-30 - Update README and fixes for graphviewer bugs
1 parent 7d112ce commit 30e4914

3 files changed

Lines changed: 20 additions & 18 deletions

File tree

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Deployed version : https://metacell.github.io/sds-viewer/
66

77
The SDS Viewer can now be launched directly from datasets and models on the SPARC Portal (https://sparc.science/). From the landing page for your dataset or model of interest, simply click the SDS Viewer button, it will launch the viewer with it already loaded. In addition, users can load SPARC datasets using two other methods:
88

9-
1) Loading a SPARC Dataset from list:
9+
1) Loading a SPARC Dataset from app:
1010
- Click on 'SPARC Datasets' button, it's located on the lower left corner.
11-
- On the window that opens up, select the dataset you want to load.
11+
- On the window that opens up, select the dataset you want to load. You can search
12+
by dataset title and id.
1213
![image](https://user-images.githubusercontent.com/4562825/166984322-83b4a8c2-aa29-4e6d-96e9-bcf4d125a3a9.png)
1314
- After selection, click 'Done'
1415
- Dataset will be loaded.
@@ -21,27 +22,28 @@ The SDS Viewer can now be launched directly from datasets and models on the SPAR
2122
This will open up the SDS Viewer with the dataset already loaded.
2223

2324
##### Loaded dataset example #####
24-
![Screenshot 2023-09-21 at 3 50 49 PM](https://github.com/MetaCell/sds-viewer/assets/4562825/e7247cf1-df5e-498d-a418-4cbc7f4c4de2)
25+
![image](https://github.com/MetaCell/sds-viewer/assets/4562825/9ea43afd-28cc-4b37-8c72-96be2f821f1a)
26+
2527
##### SPARC Dataset used #####
2628
![Screenshot 2023-09-21 at 3 53 33 PM](https://github.com/MetaCell/sds-viewer/assets/4562825/f3e287ed-f93a-436b-b3b0-b85cb1c0857c)
2729

2830
2931
### Navigating the SDS Viewer
30-
- Users can search for subjects, folders and files on the sidebar. Selecting an item on the sidebar will display the Metadata for it and zoom the Graph to its corresponding node.
31-
![Screenshot 2023-09-21 at 4 04 23 PM](https://github.com/MetaCell/sds-viewer/assets/4562825/b64ea659-607f-42f7-b58f-edb01e31ab40)
32+
- Users can search for subjects, folders and files on the sidebar. Selecting an item on the sidebar will display the Metadata for it and zoom the Graph to its corresponding folder or file.
33+
![image](https://github.com/MetaCell/sds-viewer/assets/4562825/7b013f5a-eead-4996-b7d2-20b3bf35a294)
3234

3335

3436
- Selecting an item on the Graph will display its Metadata.
3537

3638
![image](https://user-images.githubusercontent.com/4562825/186723085-c6573146-82dc-4fb7-ae95-588f7b1e4842.png)
3739

38-
- Navigating the Graph Viewer can be done with the mouse. There's also controlers on the bottom right that allows the user to change the Layout view, zoom in/out, reset the view to its original state and expand all data in the viewer.
40+
- Navigating the Graph Viewer can be done with the mouse. There are also controllers on the bottom right that allow user to change the Graph Layout view, zoom in/out of the graph, reset the Layout to its original state and expand/collapse all data in the viewer.
3941

4042
![controllers](https://github.com/MetaCell/sds-viewer/assets/99416933/30aa8bb3-ec61-46d8-9f83-55ade15b95c0)
4143

42-
- Multiple Datasets can be loaded at the same time, which will open a new Graph Viewer Component for each dataset.
44+
- Multiple Datasets can be loaded at the same time, a new Graph Viewer Component will be opened for each dataset.
4345

44-
![multiple](https://github.com/MetaCell/sds-viewer/assets/99416933/a74fa033-ccd4-4609-b50f-852ce44d347a)
46+
![Multiple](https://github.com/MetaCell/sds-viewer/assets/4562825/9abe621a-a406-4e6b-8d6a-165622014425)
4547

4648

4749
### Datasets Used

src/components/GraphViewer/GraphViewer.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ const GraphViewer = (props) => {
170170

171171
const onEngineStop = () => {
172172
setForce();
173-
graphRef?.current?.ggv?.current.centerAt(selectedNode.x, selectedNode.y, ONE_SECOND);
173+
selectedNode && handleNodeRightClick(nodeSelected)
174174
}
175175

176176
useEffect(() => {
@@ -259,10 +259,10 @@ const GraphViewer = (props) => {
259259
let updatedData = getPrunedTree(props.graph_id, selectedLayout.layout);
260260
setData(updatedData);
261261
}
262+
setSelectedNode(nodeSelected);
263+
handleNodeHover(nodeSelected);
264+
graphRef?.current?.ggv?.current.centerAt(nodeSelected.x, nodeSelected.y, ONE_SECOND);
262265
}
263-
setSelectedNode(nodeSelected);
264-
handleNodeHover(nodeSelected);
265-
graphRef?.current?.ggv?.current.centerAt(nodeSelected.x, nodeSelected.y, ONE_SECOND);
266266
} else {
267267
handleNodeHover(nodeSelected);
268268
graphRef?.current?.ggv?.current.centerAt(nodeSelected.x, nodeSelected.y, ONE_SECOND);
@@ -357,11 +357,6 @@ const GraphViewer = (props) => {
357357
controls={
358358
<div>
359359
<div className='graph-view_controls'>
360-
<IconButton area-label="GraphLayout" aria-controls="layout-menu" aria-haspopup="true" onClick={handleLayoutClick}>
361-
<Tooltip id="button-report" title="Change Graph Layout">
362-
<ViewTypeIcon />
363-
</Tooltip>
364-
</IconButton>
365360
<Menu
366361
id="layout-menu"
367362
anchorEl={layoutAnchorEl}
@@ -373,6 +368,11 @@ const GraphViewer = (props) => {
373368
<MenuItem selected={TOP_DOWN.layout === selectedLayout.layout} onClick={() => handleLayoutChange(TOP_DOWN)}>{TOP_DOWN.label}</MenuItem>
374369
<MenuItem selected={LEFT_RIGHT.layout === selectedLayout.layout} onClick={() => handleLayoutChange(LEFT_RIGHT)}>{LEFT_RIGHT.label}</MenuItem>
375370
</Menu>
371+
<IconButton area-label="GraphLayout" aria-controls="layout-menu" aria-haspopup="true" onClick={handleLayoutClick}>
372+
<Tooltip id="button-report" title="Change Graph Layout">
373+
<ViewTypeIcon />
374+
</Tooltip>
375+
</IconButton>
376376
<IconButton area-label="ZoomIn" onClick={(e) => zoomIn()}>
377377
<Tooltip id="button-report" title="Zoom In">
378378
<AddRoundedIcon />

src/utils/graphModel.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ export const rdfTypes = {
137137
"key": "title",
138138
"property": "title",
139139
"label": "Label",
140-
"visible" : false
140+
"visible" : true
141141
},
142142
{
143143
"type": "dc",

0 commit comments

Comments
 (0)