Skip to content

Commit

Permalink
feat: replace datapane by Panel
Browse files Browse the repository at this point in the history
  • Loading branch information
Thierry Loron committed Jul 8, 2024
1 parent bb54ba3 commit 1a5794c
Show file tree
Hide file tree
Showing 7 changed files with 468 additions and 290 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ One of the schedulers you can use is Apache Airflow. To use it, you can read the
## 🔬 Built With
This section list libraries used in Eurybia.
- [Shapash](https://github.com/MAIF/shapash/tree/master/shapash)
- [Datapane](https://github.com/datapane/datapane)
- [Panel](https://github.com/holoviz/panel)
- [Plotly](https://github.com/plotly/plotly.py)
- [Catboost](https://github.com/catboost/catboost)

Expand Down
12 changes: 8 additions & 4 deletions eurybia/core/smartplotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,15 @@ def generate_fig_univariate_continuous(
"""
df_all.loc[:, col].fillna(0, inplace=True)
datasets = [df_all[df_all[hue] == val][col].values.tolist() for val in df_all[hue].unique()]
group_labels = [str(val) for val in df_all[hue].unique()]
colors = list(self._style_dict["univariate_cont_bar"].values())
if group_labels[0] == 'Current dataset':
group_labels = ['Baseline dataset', 'Current dataset']

fig = ff.create_distplot(
datasets,
group_labels=[str(val) for val in df_all[hue].unique()],
colors=list(self._style_dict["univariate_cont_bar"].values()),
group_labels=group_labels,
colors=list(colors),
show_hist=False,
show_curve=True,
show_rug=False,
Expand Down Expand Up @@ -285,7 +289,7 @@ def generate_fig_univariate_categorical(
color=hue,
text="Percent_displayed",
)
fig1.update_traces(marker_color=list(self._style_dict["univariate_cat_bar"].values())[0], showlegend=True)
fig1.update_traces(marker_color=list(self._style_dict["univariate_cat_bar"].values())[1], showlegend=True)

fig2 = px.bar(
df_cat[df_cat[hue] == modalities[1]],
Expand All @@ -296,7 +300,7 @@ def generate_fig_univariate_categorical(
color=hue,
text="Percent_displayed",
)
fig2.update_traces(marker_color=list(self._style_dict["univariate_cat_bar"].values())[1], showlegend=True)
fig2.update_traces(marker_color=list(self._style_dict["univariate_cat_bar"].values())[0], showlegend=True)

fig = fig1.add_trace(fig2.data[0])

Expand Down
Loading

0 comments on commit 1a5794c

Please sign in to comment.