crystal_toolkit.components.pourbaix module
- class crystal_toolkit.components.pourbaix.PourbaixDiagramComponent(default_data: MSONable | dict | str | None = None, id: str | None = None, links: dict[str, str] | None = None, storage_type: Literal['memory', 'local', 'session'] = 'memory', disable_callbacks: bool = False)[source]
Bases:
MPComponent
- colorscale = 'magma'
- colorscale_classic = [[0.0, '#4728fa'], [0.33, '#f9f273'], [0.66, '#e5211b'], [1.0, '#ffffff']]
- default_plot_style = {'height': 550, 'hovermode': 'closest', 'legend': {'orientation': 'h', 'tracegroupgap': 5, 'traceorder': 'reversed', 'x': 1.0, 'xanchor': 'right', 'y': 1.08}, 'margin': {'b': 70, 'l': 80, 'r': 20, 't': 10}, 'paper_bgcolor': 'rgba(0,0,0,0)', 'plot_bgcolor': 'rgba(0,0,0,0)', 'showlegend': True, 'width': 700, 'xaxis': {'anchor': 'y', 'mirror': 'ticks', 'range': [-2, 16], 'showgrid': False, 'showline': True, 'side': 'bottom', 'tickfont': {'size': 16.0}, 'ticks': 'inside', 'title': 'pH', 'titlefont': {'color': '#000000', 'size': 24.0}, 'type': 'linear', 'zeroline': False}, 'yaxis': {'anchor': 'x', 'mirror': 'ticks', 'range': [-2, 4], 'showgrid': False, 'showline': True, 'side': 'left', 'tickfont': {'size': 16.0}, 'ticks': 'inside', 'title': 'Applied Potential (V vs. SHE)', 'titlefont': {'color': '#000000', 'size': 24.0}, 'type': 'linear', 'zeroline': False}}
- default_state = {'filter_solids': True, 'show_heatmap': False}
- default_table_params = [{'col': 'Material ID', 'edit': False}, {'col': 'Formula', 'edit': True}, {'col': 'Formation Energy (eV/atom)', 'edit': True}, {'col': 'Energy Above Hull (eV/atom)', 'edit': False}, {'col': 'Predicted Stable?', 'edit': False}]
- empty_plot_style = {'paper_bgcolor': 'rgba(0,0,0,0)', 'plot_bgcolor': 'rgba(0,0,0,0)', 'xaxis': {'visible': False}, 'yaxis': {'visible': False}}
- empty_row = {'Energy Above Hull (eV/atom)': None, 'Formation Energy (eV/atom)': 'INSERT', 'Formula': 'INSERT', 'Material ID': None, 'Predicted Stable': None}
- generate_callbacks(app, cache)[source]
Generate all callbacks associated with the layouts in this app. Assume that “suppress_callback_exceptions” is True, since it is not always guaranteed that all layouts will be displayed to the end user at all times, but it’s important the callbacks are defined on the server.
- static get_figure(pourbaix_diagram: PourbaixDiagram, heatmap_entry=None, show_water_lines=True) Figure [source]
Static method for getting plotly figure from a Pourbaix diagram.
- Parameters
pourbaix_diagram (PourbaixDiagram) – Pourbaix diagram to plot
heatmap_entry (PourbaixEntry) – id for the heatmap generation
show_water_lines (bool) – if True, show region of water stability
- Returns
(dict) figure layout