Skip to content

Commit

Permalink
REmove defunct method.
Browse files Browse the repository at this point in the history
  • Loading branch information
shyuep committed Nov 20, 2024
1 parent a467256 commit a3cd082
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/matpes/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import dash_bootstrap_components as dbc
import pandas as pd
import plotly.express as px
import plotly.figure_factory as ff
from dash import Dash, Input, Output, State, callback, dcc, html
from pymatgen.core import Element
from pymongo import MongoClient
Expand Down Expand Up @@ -75,28 +74,6 @@ def get_data(functional: str, element_filter: list, chemsys: str) -> pd.DataFram
return df


def get_dist_plot(data: pd.Series, label: str, ignore_nan: bool = True, nbins: int = 100):
"""
Create a distribution plot for a given dataset.
Args:
data (pd.Series): The data to plot.
label (str): Label for the x-axis.
ignore_nan (bool): Whether to ignore NaN values.
nbins (int): Number of bins for the histogram.
Returns:
plotly.graph_objects.Figure: The distribution plot figure.
"""
if ignore_nan:
data = data.dropna()
bin_size = (data.max() - data.min()) / nbins
fig = ff.create_distplot([data], [label], bin_size=bin_size, show_rug=False)
fig.update_layout(xaxis=dict(title=label), showlegend=False)
return fig


# Callback to update visualizations
@callback(
[
Output("ptheatmap", "figure"),
Expand Down

0 comments on commit a3cd082

Please sign in to comment.