Periodic table
Periodic table with responsive layout.
Demo
netbek.github.io/periodic-table
Integration
Install the package:
npm install @netbek/periodic-table
Create a Sass file:
@import 'node_modules/@netbek/periodic-table/src/css/mixins';
// Define vars that should override defaults
$nb-periodic-table-cell-bg: #eee;
$nb-periodic-table-cell-border: #ccc;
// Load default vars
@import 'node_modules/@netbek/periodic-table/src/css/variables';
// Mobile-first layout
@include nb-periodic-table-base;
@include nb-periodic-table-color;
@include nb-periodic-table-size;
// Wide breakpoint layout
@media (min-width: 82em) {
@include nb-periodic-table-color('category');
@include nb-periodic-table-size('wide');
}
Create a Nunjucks template:
{%- from "path/to/node_modules/@netbek/periodic-table/nunjucks/macros/nb_pt_legend.njk" import nb_pt_legend %}
{%- from "path/to/node_modules/@netbek/periodic-table/nunjucks/macros/nb_pt_table_18.njk" import nb_pt_table_18 %}
<html>
<body>
{% set element_columns = {
atomic_number: 'Atomic number',
symbol: 'Symbol',
name: 'Name',
atomic_mass: 'Atomic mass',
electronegativity: 'Electronegativity'
} %}
{{ nb_pt_legend(elements, categories, element_columns) }}
{{ nb_pt_table_18(elements, groups) }}
</body>
</html>
Render the Nunjucks template:
import nunjucks from 'nunjucks';
import periodicTable from '@netbek/periodic-table';
async function render() {
const categories = await periodicTable.loadCategories();
const elements = await periodicTable.loadElements();
const groups = await periodicTable.loadGroups();
const data = {
categories,
elements,
groups
};
return nunjucks.render('path/to/template.njk', data);
}
render();
Development: Installation
-
Clone the repo:
git clone git@github.com:netbek/periodic-table.git
-
Install Mise and add activation to
~/.bashrc, e.g.curl -fsSL https://github.com/jdx/mise/releases/download/v2026.7.13/install.sh | sh
-
Trust
mise.toml:mise trust -
Create a PyPI API token, and add the token to the system keyring as the password:
keyring set pypi-periodic-table __token__
Development: Usage
Automatically build and refresh browser during development:
gulp livereload
Build and publish the JavaScript and Python distribution packages:
make bump-version [major|minor|patch]
git push
make build-and-commit
git push
make create-release
make publish
Feature ideas
- Group and period axes
- Color by group or block; different palettes (mendeleevapp)
Credit
Data from mendeleev (MIT License)
License
Copyright (c) 2016 Hein Bekker. Licensed under the GNU Affero General Public License, version 3.
Metadata
Release files for netbek-periodic-table 0.3.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| netbek_periodic_table-0.3.4.tar.gz | 20.2 kB | Without provenance | Details for netbek_periodic_table-0.3.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| netbek_periodic_table-0.3.4-py3-none-any.whl | Python 3 | none | any | Details for netbek_periodic_table-0.3.4-py3-none-any.whl |
Total release size: 42.7 kB
Release files / netbek_periodic_table-0.3.4.tar.gz
| Download URL | netbek_periodic_table-0.3.4.tar.gz |
|---|---|
| Size | 20.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fcdf37b48497c368b9c6229fc730019d621ca2535dc211e0406f5c72434da10
|
|
BLAKE2b-256 checksum How to use checksums |
9862002fcd590920f8b86b974a172c7c1d6ad07dce355130cbccb8b17e523280
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Release files / netbek_periodic_table-0.3.4-py3-none-any.whl
| Download URL | netbek_periodic_table-0.3.4-py3-none-any.whl |
|---|---|
| Size | 22.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
020c8517dab17de3c68fc10538b906a38dfaf93712cfdb4005080398f03b8874
|
|
BLAKE2b-256 checksum How to use checksums |
1e5e9aabf0d0bd20f2d2df6f7fed8023e4765d8b1b6dbfca18061b1a50b9ea99
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Security for netbek-periodic-table 0.3.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.