# dashvis

> Dash Plotly implementation of vis.js library

Latest version **0.1.14** (published 2024-01-12) · MIT, Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install dashvis
pnpm add dashvis
yarn add dashvis
bun add dashvis
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.14 |
| Published | 2024-01-12 |
| First published | 2022-07-13 |
| Weekly downloads | 0 |
| License | MIT, Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.11.0 |
| Dependencies | 3 |
| Unpacked size | 8.7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Levko Ivanchuk |
| Maintainers | lewkoo |

## Links

- npm: https://www.npmjs.com/package/dashvis
- Repository: https://github.com/lewkoo/dashvis
- Issues: https://github.com/lewkoo/dashvis/issues
- npm.io page: https://npm.io/package/dashvis

## Dependencies (3)

- [ramda](https://npm.io/package/ramda.md) ^0.26.1
- [vis-data](https://npm.io/package/vis-data.md) ^7.1.4
- [vis-network](https://npm.io/package/vis-network.md) ^9.1.2

## Recent versions

- 0.1.14 (latest) — 2024-01-12
- 0.1.13 — 2024-01-12
- 0.1.12 — 2024-01-11
- 0.1.11 — 2024-01-10
- 0.1.10 — 2024-01-10
- 0.1.9 — 2023-12-14
- 0.1.8 — 2023-10-23
- 0.1.7 — 2023-10-10
- 0.1.6 — 2023-10-03
- 0.1.5 — 2023-10-02
- 0.1.4 — 2023-09-29
- 0.1.3 — 2023-01-24
- 0.1.2 — 2023-01-23
- 0.1.1 — 2023-01-20
- 0.1.0 — 2023-01-20
- … 8 more at https://npm.io/package/dashvis/versions

## README

<p align="center">
  <a href="https://github.com/lewkoo/dashvis">
    <img src="https://github.com/lewkoo/dashvis/blob/main/readme_images/DashVis_Logo.png?raw=true" alt="vis.js logo" width="500" height="200">
  </a>
</p>

<h3 align="center">DashVis Component</h3>

<p align="center">
  Full implementation of vis.js network framework for Plotly Dash
  <br>
  <a href="https://visjs.github.io/vis-network/docs/network/">Explore the documentation</a>
  ·
  <a href="https://github.com/lewkoo/dashvis/issues/new?template=bug.md">Report a bug</a>
  ·
  <a href="https://github.com/lewkoo/dashvis/issues/new?template=feature.md">Request a feature</a>
  <br>
  <br>
  <img alt="GitHub Actions" src="https://github.com/facultyai/dash-bootstrap-components/workflows/Tests/badge.svg?branch=main">
  <img alt="GitHub" src="https://img.shields.io/github/license/lewkoo/dashvis">
  <img alt="npm" src="https://img.shields.io/npm/v/dashvis">
  <img alt="PyPI" src="https://img.shields.io/pypi/v/dashvis">
  <img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/dashvis">
</p>

A full implementation of [vis.js][visjs-homepage] Network component for [Dash Plotly][dash-homepage]. Useful for displaying dynamic, automatically organised, customizable network views.

## Table of contents

- [Table of contents](#table-of-contents)
- [Installation](#installation)
  - [PyPI](#pypi)
- [Quick start](#quick-start)
- [See how it is used](#see-how-it-is-used)
- [Advanced examples](#advanced-examples)
- [Linking a stylesheet](#linking-a-stylesheet)
- [Contributing](#contributing)
- [Future work 🔨](#future-work-)

## Installation

### PyPI

You can install _dashvis_ with `pip`:

```sh
pip install dashvis
```

## Quick start

_dashvis_ exposes a single component, _DashNetwork_. Simply create one and include it in your Dash layout. Simplest example:

```python
import dash
from dash import html
from dashvis import DashNetwork

app = dash.Dash()
app.layout = html.Div([
    DashNetwork()
])

if __name__ == '__main__':
    app.run_server(debug=True)
```

## See how it is used

A simple usage example is provided in `usage.py`.

1. Run: 
```shell
python -m venv dashvis-venv 
source dashvis-venv/bin/activate 
pip install -r requirements.txt
npm install
npm run build
python usage.py
```
2. Visit <http://localhost:8050> in your web browser

## Advanced examples

Examples which cover the entire API of `vis.js` are available in `usage_examples` folder. 
Running them requires PYTHONPATH to be made aware of `dashvis`.
Simply run:
```shell
export PYTHONPATH="${PYTHONPATH}:./dashvis"
````
and then run any example from repo root directory of the repository:
```shell
python usage_examples/<example_name>.py
```

## Linking a stylesheet

dashvis doesn't come with CSS included. 
If you enable network manipulation or navigation features, you need to include a stylesheet to draw those components of
the network.

For convenience, links to vis.js stylesheets are included for you and can be used as follows:

```python
import dash
import dashvis.stylesheets

app = dash.Dash(external_stylesheets=[dashvis.stylesheets.VIS_NETWORK_STYLESHEET])
```

## Contributing

See [CONTRIBUTING.md](./CONTRIBUTING.md)

## Future work 🔨

- [x] Update `usage.py`
- [x] Fix two disabled `vis.js` function calls
- [ ] Write tests
- [ ] Add tests and code coverage badges
- [x] Update this README

[dash-homepage]: https://dash.plotly.com/
[visjs-homepage]: https://visjs.github.io/vis-network/docs/network/
[bug-report]: https://github.com/lewkoo/dashvis/issues/new?template=bug.md
[feature-request]: https://github.com/lewkoo/dashvis/issues/new?template=feature.md
[contribution-guide]: https://github.com/lewkoo/dashvis/blob/main/.github/CONTRIBUTING.md

---
_Source: https://npm.io/package/dashvis · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
