Coder Social home page Coder Social logo

periodic-table's Introduction

Periodic Table

This package is a wrapper for a dataset of periodic elements. These elements were taken from a modified Penn State CS class CSV file, transformed into JSON, and then wrapped in some pretty JavaScript accessors.

npm install periodic-table

Usage

var pt = require('periodic-table');

// entire dataset
var allElements = pt.all();

// single elements by name
var he = pt.elements.Helium;

// single elements by symbol
var he = pt.symbols.He;

// single elements by atomic number
var he = pt.numbers[2];

var util = require('periodic-table/util');

// atomic mass of molecule
// atomicMass("[Element][Number] [Element][Number] ...")
// parenthesis around elements not supported..yet
var waterMass = util.atomicMass("H2 O");
var organicMass = util.atomicMass("C12 H22 O11");

Sample data

{ atomicNumber: 1,
  symbol: 'H',
  name: 'Hydrogen',
  atomicMass: '1.00794(4)',
  cpkHexColor: 'FFFFFF',
  electronicConfiguration: '1s1',
  electronegativity: 2.2,
  atomicRadius: 37,
  ionRadius: '',
  vanDelWaalsRadius: 120,
  ionizationEnergy: 1312,
  electronAffinity: -73,
  oxidationStates: '-1, 1',
  standardState: 'gas',
  bondingType: 'diatomic',
  meltingPoint: 14,
  boilingPoint: 20,
  density: 0.0899,
  groupBlock: 'nonmetal',
  yearDiscovered: 1766 
}

Contributing

Is any table information wrong? Does some field need to be added or better formatted? Is there a more reliable source of information to work with? Open an issue or be even cooler and open a pull-request.

# running tests
npm run test

Follow me on Twitter for updates or just for the lolz and please check out my other repositories if I have earned it. I thank you for reading.

periodic-table's People

Contributors

adam-moss avatar andrejewski avatar dacornu avatar madsfaerch avatar nathanhleung avatar viditmaniyar avatar vynlar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

periodic-table's Issues

molar volume

I think the molar volume would be a nice addition, because it is measured/calculated for liquid or solid states. So it is not the same info as density.

Fluorine's cpkHexColor

Is there an error with fluorine's cpkHexColor? It's listed as '9e+51', which isn't hexadecimal (and is way out of the range of the largest hex number writeable in 6 characters).

typo

In data.csv resp. data.json it is not vandelWaalsRadius ... Named after the dutch physician Johannes Diderik van der Waals it must read van derWaalsRadius see en.wikipedia.org.

Name for Aluminium

Hello,

Your chemical elements webservice is great and fill with tasty data.
I just regret that Aluminium is named "Aluminum or Aluminium". It's not really representing the name and can broke display.
al

I think you sould state for one or the other.

Parsing Complex Formulae

Hello,

Would you be open to a modification of the atomicMass function that allows it to parse complex formulae?

I mean two things by this:

  1. Natural formulas with no spaces between the elements (C6H12O6 rather than C6 H12 O6)
  2. Brackets (eg C2[Cr(H2O)4]2N2 for the sake of illustration)

I wrote a Python module at one point with this functionality so it should be pretty easy to port to JS.

If interested, I can fork and make a PR

Incorrect groupBlock for elements 113-118

Hey!

First of all, thanks for making this package, I love it.

While colouring elements by groupBlock I noticed that the groupBlock value of elements 113, 114, 115, 116, 117 and 118 don't match what I expected. I checked Wikipedia and confirmed that they do not match Wikipedia's records.

Element Atomic Number Expected Group Block Actual Group Block
Nihonium 113 Post-transition metal Metal
Flerovium 114 Post-transition metal Metal
Moscovium 115 Post-transiton metal Halogen
Livermorium 116 Post-transition metal Noble gas
Tennessine 117 Post-transition metal Alkali metal
Oganesson 118 Noble gas Alkaline earth metal

Let me know what you think and if you need a pull request.

Thanks!

`yearDiscovered` should give an approximate year if possible

Some elements have their year of discovery marked as "Ancient" which I'd like to narrow down to at least some approximate integer date (even if it is a negative to represent BC). This adds more context to the data but also better normalizes it so users don't have to check for number or string when working with the values.

spelling correction: vanDelWaalsRadius TO vanDerWaalsRadius

I looked up spelling for this item and found no reference to the spelling used.
I know it may cause some of the code in other parts of the package to have errors if just the JSON file is updated, so please be sure to fix all and push.
If I have time to repair these connections, I will post the updated code.
(my lack of experience showing here...)
If necessary, push update to branches and/or pull requests, and/or add version numbers...
Thanks for sharing the data!!
I'll probably be building on it, comparing it, and posting an appended dataset if all goes well.

Typescript support

I've forked off and switched the project over to using typescript, that way it's easier and nicer to work with from within other typescript modules.

If it's of interest I can submit a pull request for it?

There is a bit of a breaking change with it, in that to load the 'utils' part, you have to now do 'var util = require('periodic-table/lib/util');`, but I've updated the readme with the correct method, and extended the file with the typescript usage syntax too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.