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

Blank plotly 3D plots #1128

Closed
yuchaz opened this issue Nov 26, 2017 · 5 comments
Closed

Blank plotly 3D plots #1128

yuchaz opened this issue Nov 26, 2017 · 5 comments
Labels
bug 🐛 For unexpected issues good first issue Good for new contributors

Comments

@yuchaz
Copy link

yuchaz commented Nov 26, 2017

Description:

I followed this tutorial to plot the 3D scatter plot. But seems like it cannot render 3D plots properly.

screen shot 2017-11-26 at 1 58 46 am

As shown on the figure above, the hover text is properly displayed but no data points are shown.

However, when I tried to do 2D line chart, it render properly.

screen shot 2017-11-26 at 2 17 19 am

Steps to Reproduce:

  1. Copy the code of "Basic 3D Scatter Plot" in 3D Scatter Plots in Python
  2. Run, 3D scatter plot does not work properly.
  3. Copy the code of "Simple Line Plot" in Line Charts in Python
  4. Run, line chart will be rendered properly.

Versions:

Mac OS 10.12.6
Atom : 1.22.1
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0

plotly: 2.2.2

Logs:

Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-eval'". Either the 'unsafe-inline' keyword, a hash ('sha256-swz/ljTjUNUGwUQTCdL2vZS/ni77MS56012RAz3iLBk='), or a nonce ('nonce-...') is required to enable inline execution.

This error is shown when I run plotly.offline.init_notebook_mode(). But same error appeared when I plotted the 2D line plots therefore I think it might not related to the issue.

@lgeiger
Copy link
Member

lgeiger commented Nov 26, 2017

This looks like a CSS issue.

@lgeiger
Copy link
Member

lgeiger commented Nov 26, 2017

I haven't tested it, but I'm pretty confident that this line introduces the problem:

svg:first-child {
background-color: white;
}

@yuchaz
Copy link
Author

yuchaz commented Nov 26, 2017

By canceling the background-color in developer tool, it solve this problem. Thanks a lot :)

screen_shot_2017-11-26_at_1_57_56_pm

Is there any workaround I can use to solve this problem without opening the dev tool? (e.g. adding some snippets when starting up or somethings). Sorry for not really familiar with CSS syntax.

Thank you!

@lgeiger
Copy link
Member

lgeiger commented Dec 10, 2017

We should better scope

svg:first-child {
background-color: white;
}

This line is mostly there to ensure a white background for SVG plots rendered with matplotlib or similar but unfortunately breaks plotly 3D plots.
Personally I'd be OK with removing this line at the cost of not having a white background for matplotlib SVG plots.

I'm going to label this as a good first issue if someone wants to dig into it and find a better solution.

@lgeiger lgeiger added bug 🐛 For unexpected issues good first issue Good for new contributors labels Dec 10, 2017
jeffgreenca added a commit to jeffgreenca/hydrogen that referenced this issue Jan 12, 2018
Fixes Plotly 3D inline charts display
@rgbkrk
Copy link
Member

rgbkrk commented Jan 12, 2018

This line is mostly there to ensure a white background for SVG plots rendered with matplotlib or similar but unfortunately breaks plotly 3D plots.
Personally I'd be OK with removing this line at the cost of not having a white background for matplotlib SVG plots.

Do matplotlib SVG plots come back as raw SVG? If so, I'd put a className on that transform (assuming no way to detect it's matplotlib) and then style it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 For unexpected issues good first issue Good for new contributors
Projects
None yet
Development

No branches or pull requests

3 participants