Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BugFix] Make paper_bgcolor transparent in PyWry backend #6385

Merged
merged 7 commits into from
May 14, 2024
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
Loading