Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
89e11c6
Update existing Pourbaix components, stylistic updates just for practice
zccalka Apr 22, 2026
e166e74
Add reverse Pourbaix components for demo
zccalka Apr 22, 2026
14d055d
small changes to reverse_pourbaix, added reverse pourbiax to init
zccalka Apr 24, 2026
b644096
addition of dummy stability cutoff slider
zccalka Apr 24, 2026
593a3c3
reverse pourbaix with eV cutoff now, heatmap updates at selected cutoff
zccalka Apr 27, 2026
8459956
working demo of full list of mp_ids in each heatmap region displayed …
zccalka Apr 27, 2026
5adf13f
stylistic changes to reverse pourbaix app, added comment to pourbaix …
zccalka Apr 29, 2026
b346737
small stylistic changes to reverse pourbaix app
zccalka Apr 30, 2026
47b1ad6
small refactor of code, functionality looks the same
zccalka May 1, 2026
f8e2b2f
updated examples and data
zccalka May 1, 2026
3ae396a
updated comments
zccalka May 4, 2026
8c596a2
Revert unrelated changes for demo branch
zccalka May 4, 2026
9c215e6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 4, 2026
fba1e9f
Merge remote-tracking branch 'origin/main' into reverse_pourbaix
zccalka May 4, 2026
9daafe7
Merge branch 'reverse_pourbaix' of https://github.com/zccalka/crystal…
zccalka May 4, 2026
b0bce4f
fixes fersponding to PR comments
zccalka May 7, 2026
6c43a1b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 7, 2026
b81e001
test with dummy options for solid filter and ion conc.
zccalka May 20, 2026
ca2ea36
test with dummy options for solid filter and ion conc.
zccalka May 20, 2026
ce9a150
functionality to allow acceptance of composition from reverse_pourbai…
zccalka May 22, 2026
ec4dbdf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 22, 2026
dd74d90
Merge branch 'main' into reverse_pourbaix
zccalka May 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions crystal_toolkit/apps/examples/reverse_pourbaix_example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
"""Example app for the Reverse Pourbaix Diagram Component.

Renders the heatmap statically using the component's `get_heatmap_figure`
staticmethod. No interactivity. See the Materials Project web integration.
"""

from __future__ import annotations

import json
from pathlib import Path

import dash
from dash import dcc, html

import crystal_toolkit.components as ctc
from crystal_toolkit.components.reverse_pourbaix import ReversePourbaixDiagramComponent
from crystal_toolkit.settings import SETTINGS

app = dash.Dash(assets_folder=SETTINGS.ASSETS_PATH)

# Load pre-computed heatmap data
DATA_PATH = Path(__file__).parent / "reverse_pourbaix_heatmap.json"

with open(DATA_PATH) as f:
heatmap_data = json.load(f)

# Build the heatmap figure directly — no component, no callbacks.
figure = ReversePourbaixDiagramComponent.get_heatmap_figure(heatmap_data)

layout = html.Div(
[
html.H1("Reverse Pourbaix Diagram"),
html.P(
"Number of thermodynamically stable materials at each pH/potential "
"combination (decomposition energy < 0.2 eV/atom)."
),
dcc.Graph(
figure=figure,
config={"displayModeBar": False, "displaylogo": False},
),
],
style=dict(maxWidth="900px", margin="2em auto"),
)

ctc.register_crystal_toolkit(app=app, layout=layout)

if __name__ == "__main__":
app.run(debug=True, port=8050)
Loading