Socket
Socket
Sign inDemoInstall

elementari

Package Overview
Dependencies
237
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    elementari

Interactive visualizations for materials science: periodic tables, Bohr atoms, nuclei, heatmaps, scatter plots.


Version published
Maintainers
1
Created

Changelog

Source

v0.2.0

8 July 2023

  • Add Lattice.svelte #41
  • Show cylinder between active and hovered sites #40
  • Fix structure controls for atom_radius, same_size_atoms #38
  • Add Bond component #37
  • Split /src/lib into submodules #36
  • Add materials detail pages #35
  • Highlight active and hovered sites in Structure #34
  • Structure tooltips when hovering atoms #33
  • get started with testing Structure.svelte and structure.ts #32
  • Structure hide buttons on desktop until hover #31
  • Structure grid example #30
  • Structure allow selecting from different element color schemes + override individual elements #29
  • add function find_image_atoms() used in StructureScene to draw images of atoms 3098d6c
  • Structure add prop show_image_atoms, expand MaterialCard to show more attrs, mp-[slug] pages sync material ID with url f43dd31
  • add Structure control bond_color + make all Structure CSS into variables a79ff00
  • make initial camera_position responsive to crystal size 5b1e82a
  • use InstancedMesh from @threlte/extras for more efficient drawing of crystal sites 142effb
  • add API explorer page (under /api) 2a7c60e
  • display distance between active and hovered site in hover tooltip 9e1af46
  • add props c586225
  • drop valid Pymatgen structures as JSON files on Structure.svelte to display them 7127b18
  • PeriodicTable add prop color_overrides 1042bf2
  • add copy buttons to all code blocks 7f3fb5c
  • fix landing page layout broken in last commit 6f675dd

Readme

Source

Logo
Periodic Table

Tests GH Pages pre-commit.ci status Open in StackBlitz

Interactive Periodic Table component written in Svelte. With scatter plot showing periodicity of elemental properties and Bohr atoms showing electron shell configuration of different elements.

Screenshot of landing page

📦   Heatmap

Below a screenshot demonstrating the periodicity of elemental properties, the reason it's called periodic table. In this case, you're seeing recurring bumps and valleys in the first ionization energy as a function of atomic number.

Screenshot of periodic table heatmap

⚛️   Element Details Pages

The details page for gold.

https://user-images.githubusercontent.com/30958850/186975855-8e0d94f9-e4e3-47a2-9354-9c012b37307c.mp4

🔨   Installation

npm install --dev elementari

📙   Usage

Import the PeriodicTable component and pass it some heatmap values:

<script>
  import PeriodicTable from 'elementari'

  const heatmap_values = { H: 10, He: 4, Li: 8, Fe: 3, O: 24 }
</script>

<PeriodicTable {heatmap_values} />

🎬   Events

PeriodicTable.svelte forwards the following events from each ElementTile:

  1. click
  2. mouseenter
  3. mouseleave
  4. keyup
  5. keydown

Each event is a Svelte dispatch event with the following detail payload:

detail: {
  element: ChemicalElement
  active: boolean // whether the event target tile is currently active
  dom_event: Event // the DOM event that triggered the Svelte dispatch
}

See DispatchPayload and PeriodicTableEvents in src/lib/index.ts

🧪   Coverage

StatementsBranchesLines
StatementsBranchesLines

🙏   Acknowledgements

Keywords

FAQs

Last updated on 04 May 2023

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc