Plotly.py: Surface plots with opacity < 1 not rendering in Safari 14

Created on 17 Sep 2020  路  6Comments  路  Source: plotly/plotly.py

My 3D surface plots with opacity lower than 1 do not render anymore in Safari 14 (just updated from Safari 13).

Take this minimal example (almost equal to this one on Plotly's website, except for the opacity):

import plotly.graph_objects as go

import pandas as pd

# Read data from a csv
z_data = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/api_docs/mt_bruno_elevation.csv')

fig = go.Figure(data=[go.Surface(z=z_data.values, opacity=0.5)])
fig.update_layout(title='Mt Bruno Elevation', autosize=False,
                  width=500, height=500,
                  margin=dict(l=65, r=50, b=65, t=90))

fig.show()

In Safari (Version 14.0 (14610.1.28.1.9)) this is rendered as:
Unknown

In Chrome (v85.0.4183.102), it's properly rendered:
newplot

I'm wondering whether this is something that can be fixed on Plotly's side, or whether it's a bug in the new Safari that Apple needs to address.

For completeness, Safari's console logs this error:
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (individual-plots.json, line 0)

All 6 comments

I can confirm that I see this as well:

import numpy as np
import plotly.graph_objects as go

u = np.linspace(0, 2*np.pi, 100)
v = np.linspace(0, 2*np.pi, 100)
x = np.outer(np.cos(u), np.sin(v))
y = np.outer(np.sin(u), np.sin(v))
z = np.outer(np.ones(np.size(u)), np.cos(v))

color="black"
opacity = 0.99 # Set to 1.0 for a black sphere

fig = go.Figure()


fig.add_trace(go.Surface(x=x, y=y, z=z,
                         opacity=opacity,
                         showscale=False,
                         hoverinfo='skip',
                         colorscale=[[0, color],
                                     [1, color]],
                         contours=dict(
                             x=dict(highlight=False),
                             y=dict(highlight=False),
                             z=dict(highlight=False))
                         ))
fig

Screen Shot 2020-10-02 at 10 35 13

+1, seeing an issue identical to @nonhermitian's

@archmoj can you take a look please?

Is there a plan to address this?

This should be closed in favor of https://github.com/plotly/plotly.js/issues/5158

This is addressed in plotly.js v1.58.4.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhirschfeld picture dhirschfeld  路  4Comments

eshort0401 picture eshort0401  路  4Comments

jisaacso picture jisaacso  路  4Comments

fcollonval picture fcollonval  路  3Comments

astrojuanlu picture astrojuanlu  路  4Comments