Skip to content

Commit ba762cf

Browse files
Merge pull request #8 from TileDB-Inc/nb/mouse_wheel
Add wheel precision property to prevent model bouncing in display
2 parents 4f50c0a + 571dfe9 commit ba762cf

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pybabylonjs/babylonjs.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class BabylonJS(DOMWidget):
3232
token = Unicode(os.getenv("TILEDB_REST_TOKEN", "")).tag(sync=True)
3333
uri = Unicode().tag(sync=True)
3434
value = Dict().tag(sync=True)
35+
wheel_precision = Float(50.0).tag(sync=True)
3536
z_scale = Float(0.5).tag(sync=True)
3637

3738
@validate("value")

src/widget.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export class BabylonJSModel extends DOMWidgetModel {
3131
uri: '',
3232
width: 700,
3333
height: 500,
34+
wheel_precision: 50.0,
3435
z_scale: 0.5
3536
};
3637
}
@@ -80,6 +81,7 @@ export class BabylonJSView extends DOMWidgetView {
8081
const data = JSON.parse(this.model.get('value'));
8182
const extents = this.model.get('extents');
8283
const z_scale = this.model.get('z_scale');
84+
const wheel_precision = this.model.get('wheel_precision');
8385
const num_coords = data.X.length
8486
const minx = extents[0];
8587
const maxx = extents[1];
@@ -88,6 +90,8 @@ export class BabylonJSView extends DOMWidgetView {
8890
const minz = extents[4];
8991
const maxz = extents[5];
9092

93+
camera.wheelPrecision = wheel_precision
94+
9195
const pcs = new BABYLON.PointsCloudSystem("pcs", 1, scene, { updatable: false });
9296

9397
const myLoader = function(particle:any, i:number, s:string) {

0 commit comments

Comments
 (0)