• Stars
    star
    296
  • Rank 135,431 (Top 3 %)
  • Language
    TypeScript
  • License
    Apache License 2.0
  • Created almost 2 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Graph visualization library

Orb is a graph visualization library. Read more about Orb in the following guides:

Install

Important note: Please note that there might be breaking changes in minor version upgrades until the Orb reaches version 1.0.0, so we recommend to either set strict version (@memgraph/orb: "0.x.y") of the Orb in your package.json or to allow only fix updates (@memgraph/orb: "~0.x.y").

With npm (recommended)

npm install @memgraph/orb

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.

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

const nodes: MyNode[] = [
  { id: 1, label: 'Orb' },
  { id: 2, label: 'Graph' },
  { id: 3, label: 'Canvas' },
];
const edges: MyEdge[] = [
  { id: 1, start: 1, end: 2, label: 'DRAWS' },
  { id: 2, start: 2, end: 3, label: 'ON' },
];

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

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

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

With a direct link

Note: Simulation with web workers is not supported when Orb is used with a direct link. Graph simulation will use the main thread, which will affect performance.

<!-- Direct reference non-minified -->
<script src="dist/browser/orb.js"></script>
<!-- Direct reference minified -->
<script src="dist/browser/orb.min.js"></script>

<!-- unpkg CDN non-minified -->
<script src="https://unpkg.com/@memgraph/orb/dist/browser/orb.js"></script>
<!-- unpkg CDN minified -->
<script src="https://unpkg.com/@memgraph/orb/dist/browser/orb.min.js"></script>

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

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Orb | Simple graph</title>
    <script src="https://unpkg.com/@memgraph/orb/dist/browser/orb.min.js"></script>
    <style>
      #graph {
        border: 1px solid #e0e0e0;
        width: 600px;
        height: 600px;
      }
    </style>
  </head>
  <body>
    <div id="graph"></div>
    <script>
      const container = document.getElementById("graph");
    
      const nodes = [
        { id: 1, label: "Orb" },
        { id: 2, label: "Graph" },
        { id: 3, label: "Canvas" },
      ];
      const edges = [
        { id: 1, start: 1, end: 2, label: "DRAWS" },
        { id: 2, start: 2, end: 3, label: "ON" },
      ];
    
      // First `Orb` is just a namespace of the JS package 
      const orb = new Orb.Orb(container);
    
      // Initialize nodes and edges
      orb.data.setup({ nodes, edges });
    
      // Render and recenter the view
      orb.view.render(() => {
        orb.view.recenter();
      });
    </script>
  </body>
</html>

Build

npm run build

Test

npm run test

Development

If you want to experiment, contribute, or simply play with the Orb locally, you can set up your local development environment with:

  • Installation of all project dependencies

    npm install
    
  • Running webpack build in the watch mode

    npm run webpack:watch
    
  • Running a local http server that will serve Orb and examples/ directory on localhost:8080

    npm run serve
    

License

Copyright (c) 2016-2022 Memgraph Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

More Repositories

1

memgraph

Open-source graph database, built for real-time streaming data, compatible with Neo4j.
C++
1,997
star
2

odin

TypeScript
532
star
3

mage

MAGE - Memgraph Advanced Graph Extensions 🔮
C++
232
star
4

gqlalchemy

GQLAlchemy is a library developed with the purpose of assisting in writing and running queries on Memgraph. GQLAlchemy supports high-level connection to Memgraph as well as modular query builder.
Python
199
star
5

docs

The official documentation for Memgraph, Memgraph Lab, GQLAlchemy and MAGE
MDX
55
star
6

example-streaming-app

An example repository on how to start building graph applications on streaming data. Just clone and start building 💻 💪
Rust
52
star
7

mgconsole

mgconsole is a command-line interface (CLI) used to interact with Memgraph from any terminal or operating system.
C++
45
star
8

reddit-network-explorer

A graph-powered Reddit explorer that can perform real-time graph visualizations and sentiment analysis.
Python
44
star
9

twitter-network-analysis

Analyzing a network of tweets and retweets using graph algorithms
JavaScript
38
star
10

spotify-song-recommender

A Spotify song recommendation engine built with the power of graph analytics.
Python
38
star
11

mgclient

C/C++ Memgraph Client
C++
37
star
12

rsmgclient

Memgraph database adapter for Rust programming language.
Rust
34
star
13

networkx-guide

We here are very big fans of NetworkX as a graph library and its comprehensive set of graph algorithms. For many though, working with NetworkX involves a steep learning curve. This guide is designed as an aid for beginners and experienced users to find specific tips and explore the world of complex networks.
JavaScript
31
star
14

twitch-analytics-demo

Visualization of Twitch analytics.
JavaScript
28
star
15

data-streams

Publicly available real-time data sets on Kafka, Redpanda, RabbitMQ & Apache Pulsar
Python
28
star
16

bluej

C++
27
star
17

jupyter-memgraph-tutorials

Learn to use Memgraph and GQLAlchemy quickly with the help of Jupyter Notebooks
Jupyter Notebook
27
star
18

memgraph-academy

Jupyter Notebook
27
star
19

bolt-proxy

Bolt protocol support for a Kubernetes cluster with authentication via Ingress
Go
25
star
20

cypher.vim

Vim syntax for the Cypher query language
Vim Script
24
star
21

slack-influence-bot

A slack bot that helps you understand and influence your slack community
Python
23
star
22

nodemgclient

Node.js Memgraph Client
C++
21
star
23

memgraph-platform

Memgraph Platform is a multi-container application containing Memgraph+MAGE and Memgraph Lab.
Shell
20
star
24

mgmigrate

mgmigrate is a tool for migrating data from MySQL or PostgreSQL to Memgraph and between Memgraph instances.
Cypher
20
star
25

bitclout-visualizing-hodlers

Visualizing BitClout 🪙☁️ HODLers
Python
20
star
26

protein-explorer

Visualizing protein-protein interaction networks
HTML
19
star
27

mgp

Pypi package used for type hinting when creating MAGE modules.
Python
18
star
28

physics-papers-recommender

Recommendation system used for blog post on physics papers recommendation system with node2vec
Python
17
star
29

graph-landscape-2022

A graph visualization of popular graph technologies and companies
Python
14
star
30

card-fraud

Python app for detecting credit card frauds using a graph database
SCSS
14
star
31

rune

TypeScript
12
star
32

memgraph-rs

Rust
12
star
33

starlink

This project implements dynamic shortest-path routing for Starlink using Memgraph. Starlink satellites are low earth orbit communications satellites currently being launched and operated by SpaceX.
JavaScript
12
star
34

helm-charts

Helm charts for deploying Memgraph, an open-source in-memory graph database.
Smarty
11
star
35

sng-demo

A Flask web application that displays a social network graph stored in Memgraph DB.
Python
10
star
36

documentation

The official documentation for Memgraph open-source graph database.
MDX
8
star
37

docs-recommendation-system

JavaScript
8
star
38

orbicon

Explore your userbase and community with the power of graph analytics.
Python
7
star
39

jsmgclient

JavaScript
6
star
40

hacker-news-analyzer

TypeScript
5
star
41

link-prediction-node-embeddings

Python
5
star
42

app-challenge-starter-pack

A Python starter pack for building streaming applications with Memgraph.
Python
5
star
43

insurance-fraud

Insurance companies lose a lot of money on different kinds of fraud. By using graphs along with machine learning, you can model and detect fraudulent insurance claims.
Jupyter Notebook
5
star
44

bor

Python
4
star
45

design

SCSS
4
star
46

MemFlights

Tutorial app using memgraph and C#
C#
4
star
47

mgui

Memgraph user interface library.
TypeScript
3
star
48

ecommerce-recommender-demo

E-Commerce recommender demo with real-time data and a graph database
Python
3
star
49

kafka-offset-demo

Demo showing how Kafka users can manually set the offset of the next consumed message with a call to the query procedure.
Python
3
star
50

benchgraph

TypeScript
2
star
51

cugraph-guide

JavaScript
1
star
52

conference-connector

TypeScript
1
star
53

depsy

Code dependencies analyzer
Python
1
star
54

cloud-interview-task

TypeScript
1
star
55

gasoline

A safe object-graph mapper and query builder for Rust.
1
star
56

blog

1
star
57

live-stream

C
1
star
58

cmake

This is a collection of CMake modules that are useful for all Memgraph projects.
CMake
1
star
59

mgcxx

Rust
1
star