Skip to content

Commit

Permalink
[BugFix] Make paper_bgcolor transparent in PyWry backend (#6385)
Browse files Browse the repository at this point in the history
* make paper_bgcolor transparent in PyWry backend

* black

---------

Co-authored-by: Henrique Joaquim <[email protected]>
  • Loading branch information
deeleeramone and hjoaquim committed May 14, 2024
1 parent 29dfc7b commit 2ac1af3
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ def send_figure(
self.check_backend()
# pylint: disable=C0415

paper_bg = (
"rgba(0,0,0,0)"
if self.charting_settings.chart_style == "dark"
else "rgba(255,255,255,0)"
)

title = "Interactive Chart"

fig.layout.title.text = re.sub(
Expand All @@ -210,9 +216,8 @@ def send_figure(
export_image = Path(export_image).resolve()

json_data = json.loads(fig.to_json())

json_data.update(self.get_json_update(command_location))

json_data["layout"]["paper_bgcolor"] = paper_bg
outgoing = dict(
html=self.get_plotly_html(),
json_data=json_data,
Expand Down

0 comments on commit 2ac1af3

Please sign in to comment.