Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: Add simulator fixes
Browse files Browse the repository at this point in the history
tonilastre committed May 12, 2023
1 parent 26f404f commit 18b4a0f
Showing 47 changed files with 5,047 additions and 15,280 deletions.
12 changes: 4 additions & 8 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
{
"plugins": [
["@semantic-release/commit-analyzer", {
"preset": "eslint"
}],
["@semantic-release/release-notes-generator", {
"preset": "eslint"
}],
["@semantic-release/commit-analyzer"],
["@semantic-release/release-notes-generator"],
"@semantic-release/changelog",
"@semantic-release/npm",
'@semantic-release/github',
"@semantic-release/github",
["@semantic-release/git", {
"assets": ["package.json", "CHANGELOG.md"],
"message": "Chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}],
}]
],
}
34 changes: 33 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@
## 0.1.5

### Fix

* Fix web worker build with parcel (#36) - by @jondlm

## 0.1.4

### Fix

* Fix: Remove render callback after first usage in simulation end (#31)

## 0.1.3

### Fix

* Fix: Add throttle render to renderer via fps settings (#29)

## 0.1.2

### Fix

* Fix physics behavior (#26)

### Chore

* Set dimensions on parent element when undefined (#24)
* Preserve graph container children (#24)
* Apply Emitter in simulator and fix cleanup when terminated (#25)
* Refactor naming in simulator (#25)

## 0.1.1

### Fix
@@ -10,7 +41,8 @@

* Fix image loading on node style properties (#14)

### Chore
### Chore

* Add pre commit hook (#11)
* Fix docs and general orb API issues (#13)

16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -36,14 +36,14 @@ Orb is a graph visualization library. Read more about Orb in the following guide
### With `npm` (recommended)

```
npm install @memgraph/orb
npm install @memgraph/orb@beta
```

Below you can find a simple Typescript example using Orb to visualize a small graph. Feel
free to check other Javascript examples in `examples/` directory.

```typescript
import { Orb } from '@memgraph/orb';
import { OrbView } from '@memgraph/orb';
const container = document.getElementById('graph');

const nodes: MyNode[] = [
@@ -56,14 +56,14 @@ const edges: MyEdge[] = [
{ id: 2, start: 2, end: 3, label: 'ON' },
];

const orb = new Orb<MyNode, MyEdge>(container);
const orb = new OrbView<MyNode, MyEdge>(container);

// Initialize nodes and edges
orb.data.setup({ nodes, edges });

// Render and recenter the view
orb.view.render(() => {
orb.view.recenter();
orb.render(() => {
orb.recenter();
});
```

@@ -118,14 +118,14 @@ free to check other Javascript examples in `examples/` directory.
];
// First `Orb` is just a namespace of the JS package
const orb = new Orb.Orb(container);
const orb = new Orb.OrbView(container);
// Initialize nodes and edges
orb.data.setup({ nodes, edges });
// Render and recenter the view
orb.view.render(() => {
orb.view.recenter();
orb.render(() => {
orb.recenter();
});
</script>
</body>
20 changes: 15 additions & 5 deletions docs/data.md
Original file line number Diff line number Diff line change
@@ -15,7 +15,9 @@ To initialize graph data structure use `orb.data.setup` function that receives `
`edges`. Here is a simple example of it:

```typescript
const orb = new Orb<MyNode, MyEdge>(container);
import { OrbView } from "@memgraph/orb";

const orb = new OrbView<MyNode, MyEdge>(container);

const nodes: MyNode[] = [
{ id: 0, text: "Node A", myField: 12 },
@@ -65,7 +67,9 @@ There are some useful node functions that you can use such as:
Check the example to get to know node handling better:

```typescript
const orb = new Orb<MyNode, MyEdge>(container);
import { OrbView } from "@memgraph/orb";

const orb = new OrbView<MyNode, MyEdge>(container);

const nodes: MyNode[] = [
{ id: 0, text: "Node A", myField: 12 },
@@ -116,7 +120,9 @@ There are some useful node functions that you can use such as:
Check the example to get to know edge handling better:

```typescript
const orb = new Orb<MyNode, MyEdge>(container);
import { OrbView } from "@memgraph/orb";

const orb = new OrbView<MyNode, MyEdge>(container);

const nodes: MyNode[] = [
{ id: 0, text: "Node A", myField: 12 },
@@ -148,7 +154,9 @@ ones. An update of a node or edge will happen if a node or edge with the same un
exists in the graph structure. Check the example below:

```typescript
const orb = new Orb<MyNode, MyEdge>(container);
import { OrbView } from "@memgraph/orb";

const orb = new OrbView<MyNode, MyEdge>(container);

const nodes: MyNode[] = [
{ id: 0, text: "Node A", myField: 12 },
@@ -191,7 +199,9 @@ To remove nodes or edges from a graph, you just need the `id`. Removing a node w
remove all inbound and outbound edges to that node. Removing an edge will just remove that edge.

```typescript
const orb = new Orb<MyNode, MyEdge>(container);
import { OrbView } from "@memgraph/orb";

const orb = new OrbView<MyNode, MyEdge>(container);

const nodes: MyNode[] = [
{ id: 0, text: "Node A" },
Loading

0 comments on commit 18b4a0f

Please sign in to comment.