Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/swimlane/ngx-graph

Graph visualization library for angular
https://github.com/swimlane/ngx-graph

angular angular2 chart dag data-viz directed-graph svg workflow

Last synced: 28 days ago
JSON representation

Graph visualization library for angular

Awesome Lists containing this project

README

        

# ngx-graph

[![Join the chat at https://gitter.im/swimlane/ngx-graph](https://badges.gitter.im/swimlane/ngx-graph.svg)](https://gitter.im/swimlane/ngx-graph?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

A Graph visualization for angular

## Documentation & Demos

https://swimlane.github.io/ngx-graph/

## Installation

1. `npm install @swimlane/ngx-graph --save`
2. Import `NgxGraphModule` into your module
3. Use the `ngx-graph` component in your components

## Usage

### Simple

```html

```

### Custom Templates

```html













{{node.label}}







{{link.label}}



```

## Data

### Nodes

```javascript
[
{
id: '1',
label: 'Node A'
},
{
id: '2',
label: 'Node B'
},
{
id: '3',
label: 'Node C'
},
{
id: '4',
label: 'Node D'
},
{
id: '5',
label: 'Node E'
},
{
id: '6',
label: 'Node F'
}
];
```

### Edges

```javascript
[
{
id: 'a',
source: '1',
target: '2'
},
{
id: 'b',
source: '1',
target: '3'
},
{
id: 'c',
source: '3',
target: '4'
},
{
id: 'd',
source: '3',
target: '5'
},
{
id: 'e',
source: '4',
target: '5'
},
{
id: 'f',
source: '2',
target: '6'
}
];
```

### Clusters

```javascript
[
{
id: 'cluster0',
label: 'Cluster node',
childNodeIds: ['2', '3']
}
];
```

## Building ngx-graph

To get started with development, clone a fork of the repository and run `npm install --legacy-peer-deps`.

Run `npm run build:lib` to build ngx-graph. This must be done prior to building the demo.

## Development server

Run `npm run start` to serve the demo at `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Building

Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.

## Running tests

Run `npm run test` to execute the linter

## Release

- Checkout master (`git checkout master`)
- Pull master (`git pull`)
- Refresh node modules (`npm ci`)
- Run tests (`npm test`)
- Examine log to determine next version (X.Y.Z)
- Run `git checkout -b release/X.Y.Z`
- Update version in `projects/swimlane/ngx-graph/package.json`.
- Update changelog in `CHANGELOG.md`
- Run `git commit -am "(release): X.Y.Z"`
- Run `git tag X.Y.Z`
- Run `git push origin HEAD --tags`
- Run `npm run publish:lib`
- Submit PR

## Credits

`ngx-graph` is a [Swimlane](http://swimlane.com) open-source project; we believe in giving back to the open-source community by sharing some of the projects we build for our application. Swimlane is an automated cyber security operations and incident response platform that enables cyber security teams to leverage threat intelligence, speed up incident response and automate security operations.

[SecOps Hub](http://secopshub.com) is an open, product-agnostic, online community for security professionals to share ideas, use cases, best practices, and incident response strategies.