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

No visibility (black background) with JupyterLab in Dark theme #242

Closed
JonnyTran opened this issue Sep 17, 2022 · 3 comments
Closed

No visibility (black background) with JupyterLab in Dark theme #242

JonnyTran opened this issue Sep 17, 2022 · 3 comments

Comments

@JonnyTran
Copy link
Contributor

JonnyTran commented Sep 17, 2022

What happened:
With JupyterLab in Dark theme, the Bokeh dashboards doesn't have a white background so drawings are not visible.

image

What you expected to happen:
Bokeh dashboards should have a white plot background.

Environment:
JupyterLab 3.4.7
dask-labextension (pip install)

@ian-r-rose
Copy link
Collaborator

Thanks for the report @JonnyTran , there is some additional discussion here. I think the easiest fix would be to add a bit of explicit CSS to the background of the plot iframes. Would you be interested in submitting a PR?

@JonnyTran
Copy link
Contributor Author

Sure! I'll take a look. If I have any questions I'll post it here or the orig issue.

@ian-r-rose
Copy link
Collaborator

Great! I think the easiest approach would be to create a new CSS class for the iframes here, and then to add that CSS class to the iframe widgets in the constructor here:

constructor() {
super({
// Disable allow some iframe extensions to let server requests
// and scripts to execute in the bokeh server context.
// This is unsafe, but we presumably trust the code in the bokeh server.
content: new IFrame({ sandbox: ['allow-scripts', 'allow-same-origin'] })
});
this._inactivePanel = Private.createInactivePanel();
this.content.node.appendChild(this._inactivePanel);
this.update();
}

There are other widgets in the same file that add CSS classes (using addClass()) that you can look to for examples.

JonnyTran pushed a commit to JonnyTran/dask-labextension that referenced this issue Sep 28, 2022
… even in JupyterLab Dark theme

iframe widgets in the constructor to use new CSS class

Issue: dask#242
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants