All Projects → ACollectionOfAtoms → atomic-bohr-model

ACollectionOfAtoms / atomic-bohr-model

Licence: MIT license
A d3 powered customizable and animated atomic bohr model

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to atomic-bohr-model

Code Dot Org
The code powering code.org and studio.code.org
Stars: ✭ 631 (+2237.04%)
Mutual labels:  science, educational
simple-d3-heatmap
A javascript module to create heatmap calendars
Stars: ✭ 24 (-11.11%)
Mutual labels:  d3
north-korea-missile-map
A map of the world using D3 and Canvas showing missile ranges
Stars: ✭ 53 (+96.3%)
Mutual labels:  d3
awesome-science-br
Lista com canais, sites, podcasts, instituições e mídias relacionadas à divulgação científica no Brasil
Stars: ✭ 15 (-44.44%)
Mutual labels:  science
lumin
LUMIN - a deep learning and data science ecosystem for high-energy physics.
Stars: ✭ 45 (+66.67%)
Mutual labels:  science
atom-django
Build Django apps faster with Atom.
Stars: ✭ 29 (+7.41%)
Mutual labels:  atom
atom-ide-cpp
C/C++ language support for Atom-IDE
Stars: ✭ 34 (+25.93%)
Mutual labels:  atom
teknowledge
A basic CS curriculum for coding in Python.
Stars: ✭ 26 (-3.7%)
Mutual labels:  science
reactjs-calendar-heatmap
React component for d3.js calendar heatmap graph
Stars: ✭ 128 (+374.07%)
Mutual labels:  d3
atom-ts-transpiler
A transpiler for Atom packages that processes code with TypeScript
Stars: ✭ 14 (-48.15%)
Mutual labels:  atom
firewatch-syntax
A Firewatch inspired Atom red syntax theme
Stars: ✭ 48 (+77.78%)
Mutual labels:  atom
oxc
The first C compiler written in Rust.. mostly unworking.
Stars: ✭ 40 (+48.15%)
Mutual labels:  educational
sherpa
Fit models to your data in Python with Sherpa.
Stars: ✭ 125 (+362.96%)
Mutual labels:  science
newtonjs-graph
Cloud Architecture Graphs for Humans
Stars: ✭ 85 (+214.81%)
Mutual labels:  d3
ipydagred3
ipywidgets library for drawing directed acyclic graphs in jupyterlab using dagre-d3
Stars: ✭ 38 (+40.74%)
Mutual labels:  d3
atom-zurb-foundation
Zurb Foundation 6 for sites snippets.
Stars: ✭ 31 (+14.81%)
Mutual labels:  atom
PyPOMDP
Python implementation of POMDP framework and PBVI & POMCP algorithms.
Stars: ✭ 60 (+122.22%)
Mutual labels:  educational
mulle-thread
🔠 Cross-platform thread/mutex/tss/atomic operations in C
Stars: ✭ 22 (-18.52%)
Mutual labels:  atomic
adapt
A package for designing activity-informed nucleic acid diagnostics for viruses.
Stars: ✭ 16 (-40.74%)
Mutual labels:  science
Covid-19-d3
Created with CodeSandbox
Stars: ✭ 13 (-51.85%)
Mutual labels:  d3

atomic-bohr-model

This d3 powered visualization package provides atomic animations which are highly customizable. An example app using this package can be found here: https://acollectionofatoms.github.io/atomic-bohr-model-examples/index.html

Features

  • Responsive
  • Built with d3.js in ES6
  • Easily modified nucleus, orbital, and electron radii, color
  • Animated initialization
  • Orbital rotational patterns:
    • linearPositive
    • linearNegative
    • cubedPositive
    • cubedNegative
    • parabolaUp
    • parabolaDown
    • random
    • uniform
  • Orbital patterns can be entirely clockwise, counter-clockwise, or alternating
  • Dynamic "address" system provides distinct ID's for each component of the Atom (Helpful for animation and styling. See: Properties)
  • Wikipedia summary and links provided for each Atom object (See: Properties)
  • Electron configurations provided by https://en.wikipedia.org/wiki/Electron_shell

Installation

npm install atomic-bohr-model --save

Usage

Include this script element in your mark-up:

<script type="text/javascript" src="./node_modules/atomic-bohr-model/dist/atomicBohrModel.min.js" charset="utf-8"></script>

along with a div to contain your atom.

<div id="bohr-model-container"></div>`

You MUST ensure your div has a width and height

The atoms provided are restricted to those which exist and have been discovered, therefore:

1 <= numElectrons <= 118

(passing anything < 1 or > 118 will result in either Hydrogen or Ununoctium)

At minimum numElectrons, containerId, and a unique idNumber must be provided.

var atomicConfig = {
  containerId: "#bohr-model-container",
  numElectrons: 88,
  idNumber: 1
}

var myAtom = new Atom(atomicConfig)

Options

var myAtom = new Atom({
  containerId: '#my-container',
  numElectrons: 1, // An integer between 1 and 118
  nucleusRadius: 30, // If not supplied will be 1/12 of the containers width
  nucleusColor: 'rgba(124,240,10,0.5)', // Hex, string or rbga
  electronRadius: 3, // Default value is 3
  electronColor: 'blue', // See nucleusColor
  orbitalSpacing: 10, // If not specified will be a 1/3rd of the nucleusRadius
  orbitalWidth: 1, // width of orbital paths, default is 0.1
  orbitalColor: 'black', // see electronColor
  idNumber: 1, // Required int to provide unique Atoms
  animationTime: 1300, // Time in milliseconds for initial electron animation
  rotateConfig: {speed: 50, clockwise: true}, // Rotates entire Atom with given params
  orbitalRotationConfig: { // Invokes orbital rotations at initialization
    pattern: {
      alternating: false, // Alternate orbital direction
      clockwise: false, // Direction for all orbitals
      preset: 'cubedPositive', // String to set pattern (see Features section)
    }
  },
  symbolOffset: 8, // When modifying nucleus radius this may need adjusting
  drawSymbol: true // Render atomic symbol or not
})

Methods

myAtom.removeElectrons(2)

Removes a given number of electrons

myAtom.addElectrons(7)

Adds a given number of electrons

myAtom.setNumElectrons(33)

Sets the number of electrons

var orbitalRotationConfig = {
  pattern: {
    alternating: true,
    clockwise: false,
    preset: 'parabolaUp',
  }
}
myAtom.rotateOrbitals(orbitalRotationConfig)

Rotates orbitals with given configuration

myAtom.destroy()

Destroys the <g> element housing the Atom but, NOT the parent <svg>

var rotateConfig = {speed: 50, clockwise: true}
myAtom.rotate(rotateConfig)

Rotates entire atom with given configuration

Properties

// Wikipedia data
myAtom.elementName
myAtom.wikiSummary
myAtom.wikiUrl
myAtom.electronConfig
myAtom.atomicSymbol
// Identifying Atoms and their components
myAtom.atomId // ex: atom-0
var firstOrb = myAtom.orbitals[0] // d3 selection
firstOrb.orbitalId // ex: atom-0-orbital-0
firstOrb.electrons[0].eId // ex: atom-0-oribital-0-electron-0
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].