Skip to content

Commit 99d5d0a

Browse files
committed
Add getting started
1 parent 73903de commit 99d5d0a

24 files changed

+155
-31
lines changed

.~lock.ecosystms_output.csv#

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
,mark,bear-desk,21.07.2024 19:40,file:///home/mark/.config/libreoffice/4;

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,7 @@ MOSS is a project of [OSSci](https://www.opensource.science/), an initiative of
88
> The Map of Open Source Science is a proof of concept and as such, nothing is accurate.
99
1010

11-
## Getting Started
12-
1. Clone this repository
13-
2. Deploy neo4j locally using Docker
14-
- view [neo4j-docker/README.md](./neo4j-docker/README.md)
15-
3. load example-data
16-
- run [import-db-neo4j]() cypher script from neo4j web interface
11+
## [Getting Started](./scripts/README.md)
1712

1813

1914
## Goal

index.html

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<head>
2+
<style> body { margin: 0; } </style>
3+
4+
<script src="//unpkg.com/3d-force-graph"></script>
5+
<script src="https://unpkg.com/neo4j-driver"></script>
6+
<!--<script src="../../dist/3d-force-graph.js"></script>-->
7+
</head>
8+
9+
<body>
10+
<div id="3d-graph"></div>
11+
12+
<script>
13+
const elem = document.getElementById('3d-graph');
14+
const driver = neo4j.driver("bolt://localhost:7689", neo4j.auth.basic("neo4j", "mossmossmoss"));
15+
const session = driver.session({database:"neo4j"});
16+
const start = new Date()
17+
session
18+
.run('MATCH (n)-[r]->(m) RETURN { id: id(n), label:head(labels(n)), caption:n.Name } as source, { id: id(m), label:head(labels(m)), caption:m.Name } as target, {type:type(r)} as rel LIMIT $limit', {limit: neo4j.int(50000)})
19+
.then(function (result) {
20+
const nodes = {}
21+
const links = result.records.map(r => {
22+
var source = r.get('source');source.id = source.id.toNumber();
23+
nodes[source.id] = source;
24+
var target = r.get('target');target.id = target.id.toNumber();
25+
nodes[target.id] = target;
26+
var rel = r.get('rel');
27+
return Object.assign({source:source.id,target:target.id}, rel);
28+
});
29+
session.close();
30+
console.log(links.length+" links loaded in "+(new Date()-start)+" ms.")
31+
const gData = { nodes: Object.values(nodes), links: links}
32+
const Graph = ForceGraph3D()(elem)
33+
.graphData(gData)
34+
.nodeAutoColorBy('label')
35+
.linkAutoColorBy('type')
36+
.nodeLabel(node => `${node.label}: ${node.caption}`)
37+
.onNodeHover(node => elem.style.cursor = node ? 'pointer' : null);
38+
})
39+
.catch(function (error) {
40+
console.log(error);
41+
});
42+
</script>
43+
</body>

neo4j-docker/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@
99
```
1010
> Notes:
1111
> - The '-d' argument tells Docker to run the containers detached (as a daemon) and is optional.
12-
> - You may need to use sudo if you have not configured your user to be in the docker group.
12+
> - You may need to use sudo if you have not configured your user to be in the docker group.
13+
> - Also, if you find yourself doing this over and over trying to get the password right, make sure to delete the folder created by docker between runs ;)

readme-assets/bloom-setup0.png

68.5 KB
Loading

readme-assets/bloom-setup1.png

1.91 MB
Loading

readme-assets/bloom-setup2.png

54.7 KB
Loading

readme-assets/ecosystms-setup0.png

91.7 KB
Loading

readme-assets/ecosystms-setup1.png

34.7 KB
Loading

readme-assets/ecosystms-setup2.png

106 KB
Loading

0 commit comments

Comments
 (0)