{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introduction"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The React Jupyter Widget keeps your JavaScript and Python state in sync."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import trident_chemwidgets as tcw"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "atoms_data = [\n",
    "    {'Formal Charge': 0, 'Hybridization': 'SP3', 'Implicit Valence': 3},\n",
    "    {'Formal Charge': 0, 'Hybridization': 'SP3', 'Implicit Valence': 2},\n",
    "    {'Formal Charge': 0, 'Hybridization': 'SP3', 'Implicit Valence': 2},\n",
    "    {'Formal Charge': 0, 'Hybridization': 'SP3', 'Implicit Valence': 2},\n",
    "    {'Formal Charge': 0, 'Hybridization': 'SP3', 'Implicit Valence': 3}\n",
    "]\n",
    "atoms_data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "w = tcw.InteractiveMolecule('CCCCC', atoms_data=atoms_data)\n",
    "w"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The value of the widget will match what you typed into the input."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "w.smiles"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "interactive_molecule = trident_chemwidgets.InteractiveMolecule('CCCCCC=C')\n",
    "interactive_molecule"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
