# Chemistry kit

> The chemistry kit is the chemistry feature of fframes-kit (fframes-kit = { .., features = ["chemistry"] }).

Page: https://fframes-kit.pages.dev/docs/chemistry/
Cargo feature: `chemistry` (`fframes-kit = { version = "..", features = ["chemistry"] }`)

The chemistry kit is the `chemistry` feature of `fframes-kit`
(`fframes-kit = { .., features = ["chemistry"] }`). It brings two crates:
[`mendeleev`](https://crates.io/crates/mendeleev) for the element data and
[`chematic`](https://crates.io/crates/chematic) to read SMILES strings and lay molecules out in
2D. Both build for wasm32, so every figure here also runs in the editor, except the 3D\nfigures, which need the `3d` feature as well. Every entry names its
scene in the components gallery
(`cargo run --release -p components-gallery -- strip <Scene> -n 8`).

- **Placement.** A figure is placed in units of `ui.space` (Manim's frame: 8 units tall, `y`
  up, the origin in the middle). Its sizes are in pixels: shell gaps, tile sizes, bond
  lengths.
- **Elements** are given by atomic number. `symbol`, `name`, `atomic_weight`,
  `atomic_number` (from a symbol), `shells` (electrons per shell) and `table_cell` are in
  `fframes_kit::kits::chemistry`. `Category::of(number)` gives the family, and its `color`
  tints the tiles.
- **Animation props.** The fixed parts (rings, bonds) draw with `enter`. The rest (electrons,
  labels) fades with `parts_enter`. Tiles fade with `enter`.

- [BohrAtom](https://fframes-kit.pages.dev/docs/chemistry/bohr-atom.md): The Bohr model of an element: its symbol on the nucleus and its electrons on rings, shell_gap pixels apart.
- [ElementTile and PeriodicTable](https://fframes-kit.pages.dev/docs/chemistry/element-tile-and-periodic-table.md): ElementTile is one element as a square: the atomic number, the symbol, the name and the atomic weight, tinted with the colour of its category (or color…
- [ElementCard](https://fframes-kit.pages.dev/docs/chemistry/element-card.md): ElementCard is the larger card of one element, size pixels high: the atomic number, the symbol, the name, the atomic mass, the ground state electron…
- [Molecule2D and Molecule](https://fframes-kit.pages.dev/docs/chemistry/molecule-2d-and-molecule.md): Molecule2D draws a skeletal formula from a Structure: atoms with positions in bond lengths (y up) and bonds between them.
- [Molecule3D and Orbital](https://fframes-kit.pages.dev/docs/chemistry/molecule-3d-and-orbital.md): These two need the 3d feature as well (features = ["chemistry", "3d"]), which turns on fframes/3d.
- [MolFile](https://fframes-kit.pages.dev/docs/chemistry/mol-file.md): MolFile::parse reads a V2000 molfile (.mol), or the first record of an .sdf file: the title, the atoms with their positions and charges (M CHG lines…
- [NamedMolecule](https://fframes-kit.pages.dev/docs/chemistry/named-molecule.md): NamedMolecule { name: "caffeine".into(), .. } draws a molecule by its common name, like Molecule draws a SMILES string.
- [GraphMolecule](https://fframes-kit.pages.dev/docs/chemistry/graph-molecule.md): GraphMolecule is manim-chemistry's GraphMolecule with the animations of its GMAnimationBuilder.
- [ReactionEquation](https://fframes-kit.pages.dev/docs/chemistry/reaction-equation.md): Reaction holds a reaction's formulas. atom_counts reads one, with parentheses (Ca(OH)2). balance finds the smallest whole coefficients.
- [BondFormation](https://fframes-kit.pages.dev/docs/chemistry/bond-formation.md): Two atoms with their valence electrons on a ring around each symbol, placed as in a Lewis diagram.
- [EnergyProfile](https://fframes-kit.pages.dev/docs/chemistry/energy-profile.md): A reaction's energy along its progress: the reactants' level, the hump of the transition state and the products' level, in unit.
- [TitrationCurve and PhScale](https://fframes-kit.pages.dev/docs/chemistry/titration-curve-and-ph-scale.md): Titration is an acid titrated with sodium hydroxide: the acid's concentration and volume, the base's concentration, and a pka for a weak acid…
- [StatesOfMatter](https://fframes-kit.pages.dev/docs/chemistry/states-of-matter.md): Particles in a box going from from to to (MatterState::Solid, Liquid or Gas) over duration seconds after at:
- [Equilibrium](https://fframes-kit.pages.dev/docs/chemistry/equilibrium.md): EquilibriumModel is a reaction in a closed vessel.
