Skip to content

Commit

Permalink
Fix for plotly PDPlotter/ChemicalPotentialDiagram.get_plot() (#…
Browse files Browse the repository at this point in the history
…4292)

* Update deprecated `titlefont` with `plotly` (v6)

* Update `plotly` requirement
  • Loading branch information
kavanase authored Feb 18, 2025
1 parent 8d9a40f commit a6793b5
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ dependencies = [
"networkx>=2.7", # PR4116
"palettable>=3.3.3",
"pandas>=2",
"plotly>=4.5.0,<6.0.0",
"plotly>=5.0.0",
"pybtex>=0.24.0",
"requests>=2.32",
"ruamel.yaml>=0.17.0",
Expand Down
4 changes: 2 additions & 2 deletions src/pymatgen/util/plotly_chempot_layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"yanchor": "middle"
},
"default_2d_axis_layout": {
"titlefont": {
"title.font": {
"size": 24
},
"gridcolor": "#dbdbdb",
Expand All @@ -68,7 +68,7 @@
"showline": true
},
"default_3d_axis_layout": {
"titlefont": {
"title.font": {
"size": 18
},
"gridcolor": "#dbdbdb",
Expand Down
4 changes: 2 additions & 2 deletions src/pymatgen/util/plotly_interface_rxn_layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"size": 16.0
},
"ticks": "inside",
"titlefont": {
"title.font": {
"color": "#000000",
"size": 20.0
},
Expand All @@ -32,7 +32,7 @@
"size": 16.0
},
"ticks": "inside",
"titlefont": {
"title.font": {
"color": "#000000",
"size": 20.0
},
Expand Down
6 changes: 3 additions & 3 deletions src/pymatgen/util/plotly_pd_layouts.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"size": 16.0
},
"ticks": "inside",
"titlefont": {
"title.font": {
"color": "#000000",
"size": 20.0
},
Expand Down Expand Up @@ -54,7 +54,7 @@
"size": 16.0
},
"ticks": "inside",
"titlefont": {
"title.font": {
"color": "#000000",
"size": 20.0
},
Expand All @@ -73,7 +73,7 @@
"size": 16.0
},
"ticks": "inside",
"titlefont": {
"title.font": {
"color": "#000000",
"size": 20.0
},
Expand Down
4 changes: 2 additions & 2 deletions src/pymatgen/util/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ def periodic_table_heatmap(
kwargs.setdefault("color_bar", {}).setdefault("title", cbar_label)
print('cbar_label is deprecated, use color_bar={"title": cbar_label} instead')
if cbar_label_size != 14:
kwargs.setdefault("color_bar", {}).setdefault("titlefont", {}).setdefault("size", cbar_label_size)
print('cbar_label_size is deprecated, use color_bar={"titlefont": {"size": cbar_label_size}} instead')
kwargs.setdefault("color_bar", {}).setdefault("title.font", {}).setdefault("size", cbar_label_size)
print('cbar_label_size is deprecated, use color_bar={"title.font": {"size": cbar_label_size}} instead')
if cmap:
kwargs.setdefault("colorscale", cmap)
print("cmap is deprecated, use colorscale=cmap instead")
Expand Down

0 comments on commit a6793b5

Please sign in to comment.