Skip to content

Commit bc60487

Browse files
authored
Merge pull request #93 from jasongrout/jlabupdates
Update for JupyterLab 0.20.3
2 parents bed9dc3 + c739252 commit bc60487

File tree

3 files changed

+34
-1
lines changed

3 files changed

+34
-1
lines changed

jslab/lib/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ var jupyter_threejs = require('jupyter-threejs');
22

33
var jupyterlab_widgets = require('@jupyterlab/nbwidgets');
44

5-
module.exports = {
5+
module.exports.default = {
66
id: 'jupyter.extensions.jupyter-threejs',
77
requires: [jupyterlab_widgets.INBWidgetExtension],
88
activate: function(app, widgets) {

jslab/package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "jupyterlab-threejs",
3+
"version": "0.1.0",
4+
"description": "",
5+
"main": "lib/index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"author": "jupyterlab-threejs developers",
10+
"license": "BSD-3-Clause",
11+
"dependencies": {
12+
"@jupyterlab/nbwidgets": "^0.18.0",
13+
"jupyter-threejs": "^0.3.0-alpha.0"
14+
},
15+
"jupyterlab": {
16+
"extension": true
17+
}
18+
}

pythreejs/pythreejs.py

+15
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,15 @@ def vector2(trait_type=CFloat, default=None, **kwargs):
3838
default = [0, 0]
3939
return List(trait_type, default_value=default, minlen=2, maxlen=2, **kwargs)
4040

41+
PYTHREEJS_VERSION='0.3.0-alpha.0'
4142

4243
class Texture(Widget):
4344
_view_module = Unicode(npm_pkg_name).tag(sync=True)
4445
_model_module = Unicode(npm_pkg_name).tag(sync=True)
4546
_view_name = Unicode('TextureView').tag(sync=True)
4647
_model_name = Unicode('TextureModel').tag(sync=True)
48+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
49+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
4750

4851

4952
class ImageTexture(Texture):
@@ -104,6 +107,8 @@ class Object3d(Widget):
104107
_model_module = Unicode(npm_pkg_name).tag(sync=True)
105108
_view_name = Unicode('Object3dView').tag(sync=True)
106109
_model_name = Unicode('Object3dModel').tag(sync=True)
110+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
111+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
107112

108113
position = vector3(CFloat).tag(sync=True)
109114
quaternion = List(CFloat).tag(sync=True) # [x,y,z,w]
@@ -217,6 +222,8 @@ class Controls(Widget):
217222
_model_module = Unicode(npm_pkg_name).tag(sync=True)
218223
_view_name = Unicode('ControlsView').tag(sync=True)
219224
_model_name = Unicode('ControlsModel').tag(sync=True)
225+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
226+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
220227

221228
controlling = Instance(Object3d, allow_none=True).tag(sync=True, **widget_serialization)
222229

@@ -269,6 +276,8 @@ class Geometry(Widget):
269276
_model_module = Unicode(npm_pkg_name).tag(sync=True)
270277
_view_name = Unicode('GeometryView').tag(sync=True)
271278
_model_name = Unicode('GeometryModel').tag(sync=True)
279+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
280+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
272281

273282

274283
class PlainGeometry(Geometry):
@@ -474,6 +483,8 @@ class Material(Widget):
474483
_model_module = Unicode(npm_pkg_name).tag(sync=True)
475484
_view_name = Unicode('MaterialView').tag(sync=True)
476485
_model_name = Unicode('MaterialModel').tag(sync=True)
486+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
487+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
477488

478489
# id = TODO
479490
name = Unicode(sync=True)
@@ -753,6 +764,8 @@ class Scene(Object3d):
753764
class Effect(Widget):
754765
_view_module = Unicode(npm_pkg_name).tag(sync=True)
755766
_model_module = Unicode(npm_pkg_name).tag(sync=True)
767+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
768+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
756769

757770

758771
class AnaglyphEffect(Effect):
@@ -765,6 +778,8 @@ class Renderer(DOMWidget):
765778
_model_module = Unicode(npm_pkg_name).tag(sync=True)
766779
_view_name = Unicode('RendererView').tag(sync=True)
767780
_model_name = Unicode('RendererModel').tag(sync=True)
781+
_model_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
782+
_view_module_version = Unicode(PYTHREEJS_VERSION).tag(sync=True)
768783

769784
width = Unicode('600').tag(sync=True) # TODO: stop relying on deprecated DOMWidget attribute
770785
height = Unicode('400').tag(sync=True)

0 commit comments

Comments
 (0)