# arc-graph

> Quick library to plot the arc/ring like graphs with lots of options!

Latest version **1.0.0** (published 2016-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install arc-graph
pnpm add arc-graph
yarn add arc-graph
bun add arc-graph
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-08-09 |
| First published | 2016-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Mrinal |
| Maintainers | bemrinal |
| Keywords | arc-graph, ring-graph, concentric, circle, graph |

## Links

- npm: https://www.npmjs.com/package/arc-graph
- Repository: https://github.com/bmrinal/arc-graph
- Homepage: https://github.com/bmrinal/arc-graph#readme
- Issues: https://github.com/bmrinal/arc-graph/issues
- npm.io page: https://npm.io/package/arc-graph

## Alternatives

- [apollo-link-http-common](https://npm.io/package/apollo-link-http-common.md) — 879.0K weekly downloads
- [react-relay](https://npm.io/package/react-relay.md) — 336.8K weekly downloads
- [relay-test-utils](https://npm.io/package/relay-test-utils.md) — 181.6K weekly downloads
- [@vendure/core](https://npm.io/package/@vendure/core.md) — 14.8K weekly downloads
- [@pnpm/deps.graph-sequencer](https://npm.io/package/@pnpm/deps.graph-sequencer.md) — 13.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-08-09

## README

# arc-graph


Built on top of [d3.js](https://d3js.org/).

## Demo
See this [demo](http://mrinalpurohit.com/demos/arc-graph/)



## Installing
1. Include [d3.js](https://d3js.org/) library
2. Include arc-chart.js library

### Prerequisities

D3.js is required for this to work. Make sure you include it before arc-chart.js.

```
<script src='d3.v3.min.js' type="text/javascript"></script>
<script src='arc-chart.js' type="text/javascript"></script>

```

### How to use

The library exposes a global object  ```arcChart``` which has the method : ```createChart```. To plot a arc chart, you will need to use the code somewhat like below:

```
arcChart.create({
  data: data, //see data section below for compatible data format
  selector: "#chartContainer", //the selector for the container where the graph will be plotted
  compact:true
});
```
This will plot you a shiny graph with default values. See the full options below.

## Data Format

The data should be an array of objects having the three properties:

1. **label**: label to be displayed in legends
2. **value**: value of the label 
3. **fill**: color of the ring/arc that you would like to have for this object/datum

Here is how a sample data would look like:
```
var data = [
  {
    'label':'Calculate',
    'value': 100,
    'fill':'steelBlue'
  },
  {
    'label':'Format',
    'value': 90,
    'fill':'red'
  }
]
```

## Quick note about graph dimensions
The graph drawn will span over the width of the container. If you want the graph to be of specific size, set dimensions of the container and the graph will expand within that container :P

## Options

- **arcThickness**: Number. Thickness of each arc (defaults to 15)
- **arcDistance**: Number. Distance between two arcs (defaults to 5)
- **compact**: Boolean. Switch to full circle mode/semi circle mode (defaults to false)
- **selector**: String. Selector string for DOM element - this is where the graph is going to be drawn into
- **data**: Array. See the data section above
- **plotQuadrant** Object. Defines the start and end quadrants numbered as shown in the below diagram. Can have only two keys : 'start' and 'end' have possible values as 1,2,3 and 4 respectively. e.g:

 ```arcChart.create({
  data: data,
  selector: "#chartContainer",
  compact:true,
  plotQuadrant:{
    start:1,
    end: 3
  },
});
```

<p align="center">
  <img src="http://mrinalpurohit.com/demos/arc-graph/demo_quadrant.png" width="350"/>
</p>

## Built With

* [d3.js](https://d3js.org/) 
* [Atom] (http://atom.io/)

## Contributing
Just send a pull request :P

## Authors

**Mrinal Purohit**

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

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