-
Notifications
You must be signed in to change notification settings - Fork 463
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
WebGL support for bqplot (threejs based) #714
Conversation
bc8c5ef
to
5874968
Compare
@SylvainCorlay do you feel like merging this or should we first attempt to recover from lost webgl context, similar to what jupyter-threejs is doing (cc @vidartf), and make ipyvolume, jupyter-threejs and bqplot use a similar strategy for recovering. |
74db385
to
e9cb01f
Compare
} | ||
|
||
float scale_transform_log(float domain_value, vec2 range, vec2 domain) { | ||
float normalized = (log(domain_value) - log(domain[0])) / (log(domain[1]) - log(domain[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
log(domain_value / domain[0]) / log(domain[1] / domain[0]));
(for speed?)
|
||
float scale_transform_log_inverse(float range_value, vec2 range, vec2 domain) { | ||
float normalized = (range_value - range[0]) / (range[1] - range[0]); | ||
float domain_value = exp(normalized * (log(domain[1]) - log(domain[0])) + log(domain[0])); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem?
@@ -18,6 +18,9 @@ var d3 = require("d3"); | |||
var _ = require("underscore"); | |||
var popperreference = require("./PopperReference"); | |||
var popper = require("popper.js"); | |||
var THREE = require('three') | |||
|
|||
THREE.ShaderChunk['scales'] = require('raw-loader!../shaders/scales.glsl') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we namespace scales?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bqscales?
This adds support for WebGL based on threejs (although I think we can also support regl). This will be the basis for #661 and #630.
It works by overlaying a canvas on top of the svg (for performance reasons). However, when a screenshot is needed, the canvas is converted to an image and embedded.