New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-emission-spectra

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-emission-spectra

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

latest
Source
npmnpm
Version
1.0.4
Version published
Weekly downloads
3
-62.5%
Maintainers
1
Weekly downloads
 
Created
Source

react-emission-spectra

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

NPM JavaScript Style Guide

Demo

demo images

Install

npm install --save react-emission-spectra

Usage

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/

How it works

The data

The data for the emission/absorption spectrum for each element comes from the NIST Atomic Spectra Database Lines Form. This collection code can be found here.

The data then gets processed into clusters using the jump method and K-Means. The code for this can be found here.

The data for some elements is missing this should be due to there not being available data on these:

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 library. This avoids cluttering the dom with extra elements and ensures native rendering.

License

MIT © Rested

FAQs

Package last updated on 13 Aug 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts