-
-
Notifications
You must be signed in to change notification settings - Fork 565
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
Dark theme for Three.js viewer #30462
Comments
comment:1
Here are a couple examples: Points, lines, surfaces, and texts surface = dodecahedron(mesh=True, color='blue').scale(0.5)
curve = parametric_plot3d([sin(x), cos(x), x/pi], (x, -pi, pi), color='red')
points = point3d([random_vector(RR, 3) for i in range(0, 100)], color='green')
text = text3d("Hello world!", (1, 1, 1), color='yellow')
show(surface + curve + points + text, theme='dark') animate([dodecahedron().rotateZ(t*pi/32) for t in range(0, 64)]).interactive(delay=5, theme='dark') |
Commit: |
Changed dependencies from 30246 to #30246 |
Author: Joshua Campbell |
comment:2
Cool idea! Minor quibble: you don't need parentheses around the condition during variable assignment via the ternary operator. |
Reviewer: Paul Masson |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:4
Replying to @paulmasson:
Good point. I have removed those unnecessary parentheses. Thanks for taking a look at this. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:6
I can confirm that things work as expected, so almost ready to go. I don't quite like the code inside Also, why are the lines for testing viewpoint values highlighted? Can't see any changes... |
comment:7
Replying to @paulmasson:
Although I'm not particularly happy with it either in hindsight. I think that if the user explicitly sets the color to black, we should respect that. Same if they set it to white in the normal theme. Maybe it would make more sense then to default the
Sorry. It was probably vscode automatically cleaning up whitespace at the end of the line. I enabled all that auto-format stuff at one point, didn't like all the useless changes I was seeing in diffs, and thought I'd disabled it all. Guess not :) |
comment:8
Replying to @jcamp0x2a:
I don't think we want to change defaults in the Python code: might affect the current user experience in other viewers. Perhaps we should just check for the defaults we know are being set, 'black' and '!#000000', and let the other formats exist as a way to override this behavior. If you agree then make that minor change and I'll set the ticket to positive. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:10
Replying to @paulmasson:
Agreed...and done! Many thanks. |
comment:11
Thanks! All set now. You really seem to be getting into the nuts and bolts of every part of Sage, even the build system. I'm curious as to what motivates such interest. My GitHub profile has an email address if you're willing to share information about your Sage-related projects. |
comment:12
Replying to @paulmasson:
Thanks Paul. I appreciate your time in reviewing this ticket. No particular projects underway. I've been using Sage in my own hobbyist adventures into math & physics, particularly for trying to visualize things and of course to cheat on the integrals in my books' exercise questions :) Figured it'd be nice to contribute back to the project in some way. |
Changed branch from u/gh-jcamp0x2a/30462-threejs-dark-theme to |
This ticket proposes introducing a dark theme to the Three.js viewer. The new
theme
viewer option will be used to control whether the original (and default) 'light' theme or the new 'dark' theme is used.Aside from appeasing users -- myself included -- who generally prefer dark UIs, the main justification for this feature is that JupyterLab, unlike the Jupyter notebook, allows you to use a dark theme for its UI. When using that theme, however, the contrast between the dark UI and the bright background of Three.js plots can be quite harsh.
Depends on #30246
Component: graphics
Keywords: threejs dark theme colors background jupyterlab
Author: Joshua Campbell
Branch/Commit:
b310bfb
Reviewer: Paul Masson
Issue created by migration from https://trac.sagemath.org/ticket/30462
The text was updated successfully, but these errors were encountered: