15
15
from ipywidgets import Widget , DOMWidget , widget_serialization , Color
16
16
from traitlets import (Unicode , Int , CInt , Instance , Enum , List , Dict , Float ,
17
17
CFloat , Bool )
18
+ from ._package import npm_pkg_name
18
19
from math import pi , sqrt
19
20
21
+ from core import *
22
+
20
23
def vector3 (trait_type = CFloat , default = None , ** kwargs ):
21
24
if default is None :
22
25
default = [0 , 0 , 0 ]
@@ -29,8 +32,8 @@ def vector2(trait_type=CFloat, default=None, **kwargs):
29
32
30
33
31
34
class Texture (Widget ):
32
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
33
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
35
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
36
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
34
37
_view_name = Unicode ('TextureView' ).tag (sync = True )
35
38
_model_name = Unicode ('TextureModel' ).tag (sync = True )
36
39
@@ -92,8 +95,8 @@ class Object3d(Widget):
92
95
"""
93
96
If matrix is not None, it overrides the position, rotation, scale, and up variables.
94
97
"""
95
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
96
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
98
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
99
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
97
100
_view_name = Unicode ('Object3dView' ).tag (sync = True )
98
101
_model_name = Unicode ('Object3dModel' ).tag (sync = True )
99
102
@@ -205,8 +208,8 @@ class ScaledObject(Object3d):
205
208
206
209
207
210
class Controls (Widget ):
208
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
209
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
211
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
212
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
210
213
_view_name = Unicode ('ControlsView' ).tag (sync = True )
211
214
_model_name = Unicode ('ControlsModel' ).tag (sync = True )
212
215
@@ -257,8 +260,8 @@ class Picker(Controls):
257
260
258
261
259
262
class Geometry (Widget ):
260
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
261
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
263
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
264
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
262
265
_view_name = Unicode ('GeometryView' ).tag (sync = True )
263
266
_model_name = Unicode ('GeometryModel' ).tag (sync = True )
264
267
@@ -452,8 +455,8 @@ class ParametricGeometry(Geometry):
452
455
453
456
454
457
class Material (Widget ):
455
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
456
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
458
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
459
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
457
460
_view_name = Unicode ('MaterialView' ).tag (sync = True )
458
461
_model_name = Unicode ('MaterialModel' ).tag (sync = True )
459
462
@@ -742,8 +745,8 @@ class Scene(Object3d):
742
745
743
746
744
747
class Effect (Widget ):
745
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
746
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
748
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
749
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
747
750
748
751
749
752
class AnaglyphEffect (Effect ):
@@ -752,8 +755,8 @@ class AnaglyphEffect(Effect):
752
755
753
756
754
757
class Renderer (DOMWidget ):
755
- _view_module = Unicode ('jupyter-threejs' ).tag (sync = True )
756
- _model_module = Unicode ('jupyter-threejs' ).tag (sync = True )
758
+ _view_module = Unicode (npm_pkg_name ).tag (sync = True )
759
+ _model_module = Unicode (npm_pkg_name ).tag (sync = True )
757
760
_view_name = Unicode ('RendererView' ).tag (sync = True )
758
761
_model_name = Unicode ('RendererModel' ).tag (sync = True )
759
762
0 commit comments