Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/n-yousefi/connect-it

<connect-it> is a web component that allows you to create various types of diagrams, such as flowcharts, mind maps, network diagrams, org charts, and flow diagrams.
https://github.com/n-yousefi/connect-it

arrow connect-it diagram digraph flowchart graph javascript line mind-map network-diagram svg tree web-component

Last synced: 24 days ago
JSON representation

<connect-it> is a web component that allows you to create various types of diagrams, such as flowcharts, mind maps, network diagrams, org charts, and flow diagrams.

Awesome Lists containing this project

README

        

# <connect-it>

Connect everything together with SVG lines. `` is a web component that allows you to create various types of diagrams, such as flowcharts, mind maps, network diagrams, org charts, and flow diagrams. The component is highly customizable, so you can create many other types of diagrams as well.

## Features

- Suitable for creating different types of diagrams
- independent of node types
- Customizable link colors and sizes
- Customizable markers (circle, square, triangle)
- Create interactive diagrams by adding event handlers for edges (click, mouseover, mouseout)

## Examples/Demos

The best way to become familiar with the library is to check out this demos:

- [Diffrent node types](https://htmlpreview.github.io/?https://github.com/n-yousefi/connect-it/blob/main/samples/diffrent-node-types.html)
- [Movable random nodes](https://htmlpreview.github.io/?https://github.com/n-yousefi/connect-it/blob/main/samples/movable-random-nodes.html)
- [Flowchart](https://htmlpreview.github.io/?https://github.com/n-yousefi/connect-it/blob/main/samples/flowchart.html)

## Installing

Using npm:

[![npm](https://img.shields.io/badge/npm-connect--to-brightgreen)](https://www.npmjs.com/package/connect-it/)

```bash
$ npm install connect-it
```

Using jsDelivr CDN:

```html

```

Using unpkg CDN:

```html

```

## Usage

### Nodes

Specify an Id for your node and put it inside the `` tag. You can style it as you wish.

```html


First

Second

Third

```

### Adjacents

Define source and adjacent nodes to draw the graph. You can specify the color and size of the link.

```html


First

Second

Third






```

### Edge Markers

You can define different shapes inside the `` tag and use them as an edge marker.
For now, we support 3 type of shapes; `circle`, `square` and `triangle`.

```html


First

Second

Third











```

### Event Handlers

`connect-it` provides some event handlers that you can use to create interactive diagrams. The following event handlers are available now:

- onEdgesMouseover: Called when the user hovers over an edge
- onEdgesMouseout: Called when the user stops hovering over an edge
- onEdgesClick: Called when the user clicks on an edge

You can use these event handlers to create custom interactions and animations in your graph.

### Limitations

Currently fixed and sticky position is not supported.