# react-emission-spectra

> a set of react components for the visible emission and absorption spectra of chemical elements

Latest version **1.0.4** (published 2020-08-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-emission-spectra
pnpm add react-emission-spectra
yarn add react-emission-spectra
bun add react-emission-spectra
```

## 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.4 |
| Published | 2020-08-13 |
| First published | 2020-08-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 1 |
| Unpacked size | 6 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Rested |
| Maintainers | rested |

## Links

- npm: https://www.npmjs.com/package/react-emission-spectra
- Repository: https://github.com/Rested/react-emission-spectra
- Homepage: https://github.com/Rested/react-emission-spectra#readme
- Issues: https://github.com/Rested/react-emission-spectra/issues
- npm.io page: https://npm.io/package/react-emission-spectra

## Dependencies (1)

- [tinygradient](https://npm.io/package/tinygradient.md) ^1.1.2

## Recent versions

- 1.0.4 (latest) — 2020-08-13
- 1.0.3 — 2020-08-11
- 1.0.2 — 2020-08-11
- 1.0.1 — 2020-08-11
- 1.0.0 — 2020-08-11

## README

# react-emission-spectra

> a set of react components for visualising the visible emission and absorption spectra of chemical elements

[![NPM](https://img.shields.io/npm/v/react-emission-spectra.svg)](https://www.npmjs.com/package/react-emission-spectra) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## [Demo](https://rested.github.io/react-emission-spectra/)

[![demo images](./demo.png)](https://rested.github.io/react-emission-spectra/)

## Install

```bash
npm install --save react-emission-spectra
```

## Usage

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

import {SpectralLines} from 'react-emission-spectra'

class Example extends Component {
  render() {
    return <SpectralLines elementSymbol="H" spectrumType="emission"/>
  }
}
```

For more examples see
[https://rested.github.io/react-emission-spectra/](https://rested.github.io/react-emission-spectra/)

## How it works

### The data

The data for the emission/absorption spectrum for each element comes from the
[NIST Atomic Spectra Database Lines Form](https://physics.nist.gov/PhysRefData/ASD/lines_form.html).
This collection code can be found [here](./spectra_data/scrape_data.py).

The data then gets processed into clusters using the
[jump method](https://en.wikipedia.org/wiki/Determining_the_number_of_clusters_in_a_data_set#An_information%E2%80%93theoretic_approach)
and K-Means. The code for this can be found [here](./spectra_data/get_clusters.py).

The data for some elements is missing this should be due to there not being available data on these:
```javascript
const missingElements = ["Ds", "Mt", "Nh", "Mc", "Ts", "Lv", "Fl", "Hs", "Fm", "Db", "No", "Md", "Sg", "At", "Rg", "Bh", "Cn", "Rf", "Lr", "Og"]
```

### The rendering

The rendering uses css gradients generated using the fantastic
[tinygradient](https://physics.nist.gov/PhysRefData/ASD/lines_form.html) library. This avoids cluttering the dom with
extra elements and ensures native rendering.


## License

MIT © [Rested](https://github.com/Rested)

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