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: 4 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 `yarn`.

## Development server

Run `yarn start` to serve Storybook at `http://localhost:6006/`. Storybook serves as the development and test environment for ngx-graph.

## Building

Run `yarn build:storybook` to build Storybook to check for production issues. The build artifacts will be stored in the `dist/` directory.

Run `yarn build:lib` to build ngx-graph.

## Running tests

Run `yarn test` to execute the linter.

## Release

- Checkout master (`git checkout master`)
- Pull master (`git pull`)
- Run tests (`yarn ci`)
- 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 `yarn package` to check the package format
- Run `git commit -am "(release): X.Y.Z"`
- Run `git tag X.Y.Z`
- Run `git push origin HEAD --tags`
- Run `yarn 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.