# react-constellation-sketcher

> React Component for drawing constellations

Latest version **1.0.1** (published 2020-05-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-constellation-sketcher
pnpm add react-constellation-sketcher
yarn add react-constellation-sketcher
bun add react-constellation-sketcher
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-05-15 |
| First published | 2020-05-03 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 2 |
| Unpacked size | 26.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | svank |
| Maintainers | svank |

## Links

- npm: https://www.npmjs.com/package/react-constellation-sketcher
- Repository: https://github.com/svank/react-constellation-sketcher
- Issues: https://github.com/svank/react-constellation-sketcher/issues
- npm.io page: https://npm.io/package/react-constellation-sketcher

## Dependencies (2)

- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2
- [constellation-sketcher](https://npm.io/package/constellation-sketcher.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2020-05-15
- 1.0.0 — 2020-05-03

## README

# react-constellation-sketcher

> React Component for drawing constellations, wrapping [Constellation Sketcher](https://github.com/svank/constellation-sketcher)

[![NPM](https://img.shields.io/npm/v/react-constellation-sketcher.svg)](https://www.npmjs.com/package/react-constellation-sketcher)

[Live demo](https://samvankooten.net/constellation_sketcher)

Static screenshot:

![demo image](images/readme_screenshot.png)

## Install

```bash
npm install --save react-constellation-sketcher
```

## Usage

```jsx
import React, { Component } from 'react'

import ConstellationSketcher from 'react-constellation-sketcher'

class Example extends Component {
  render() {
    return <ConstellationSketcher width="500"
                                  height="500"
                                  slideshow={true}
                                  ...
            />
  }
}
```

Every [configuration option](https://github.com/svank/constellation-sketcher#configuration) in the underlying library maps to a React prop---just remove the "set" prefix and make the first letter lowercase. The `animated` prop replaces the `setAnimated` function, `drawLines` replaces `setDrawLines`, etc. The only differences are:

 * `setCrossFade` and `setFadeIn` are broken into the props `crossFade`, `crossFadeTime`, `fadeIn`, and `fadeInTime`.
* Random selection weights are set via the `weights` prop, which should be set to an object where the keys are some or all of `all`, `popular`, `striking`, `medium`, or `small`. E.g. `weights={{'all': 0, 'striking': 1}}` will ensure only *striking* constellations are chosen, and `weights={{'medium': 0}}` will block *medium* constellations from being chosen while leaving the other categories at their default weights.

The `width` and `height` props control the size of the component (square aspect ratios are recommended), and the `style` and `className` props are passed through to the underlying `<canvas>` element.

The `constellation` prop sets the constellation to be shown (or the first constellation for a slideshow). If not given, a random constellation is chosen.

The `slideshow` prop sets whether successive constellations are shown (default `false`).

---

The list of constellation names and the constellation categories are availble:
```
import ConstellationSketcher, {constellationNames, categories} from 'react-constellation-sketcher'
```

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