Skip to content

Commit 2bc297d

Browse files
committed
Update to new components
1 parent 7818ec3 commit 2bc297d

File tree

7 files changed

+510
-106
lines changed

7 files changed

+510
-106
lines changed

dash_mp_components/Simple3DScene.py

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ class Simple3DScene(Component):
2323
staticScene: true, // disable if animation required
2424
defaultZoom: 0.8, // 1 will completely fill viewport with scene
2525
extractAxis: false // will remove the axis from the main scene
26-
isMultiSelectionEnabled: false // allow to use shift to select
26+
isMultiSelectionEnabled: false // allow to use shift to select,
27+
secondaryObjectView: true // show the selected object in a detail view
28+
animation: 'play' | 'slider' | 'none' // choose which style of animation is use
2729
}
2830
There are several additional options used for debugging and testing,
2931
please consult the source code directly for these.
@@ -47,13 +49,34 @@ class Simple3DScene(Component):
4749
- debug (optional): Display a debug view
4850
- animation (optional): Animation type"""
4951
@_explicitize_args
50-
def __init__(self, id=Component.UNDEFINED, data=Component.UNDEFINED, settings=Component.UNDEFINED, toggleVisibility=Component.UNDEFINED, downloadRequest=Component.UNDEFINED, selectedObject=Component.UNDEFINED, sceneSize=Component.UNDEFINED, axisView=Component.UNDEFINED, inletSize=Component.UNDEFINED, inletPadding=Component.UNDEFINED, debug=Component.UNDEFINED, animation=Component.UNDEFINED, **kwargs):
51-
self._prop_names = ['id', 'data', 'settings', 'toggleVisibility', 'downloadRequest', 'setProps', 'selectedObject', 'sceneSize', 'axisView', 'inletSize', 'inletPadding', 'debug', 'animation']
52+
def __init__(self,
53+
id=Component.UNDEFINED,
54+
data=Component.UNDEFINED,
55+
settings=Component.UNDEFINED,
56+
toggleVisibility=Component.UNDEFINED,
57+
downloadRequest=Component.UNDEFINED,
58+
selectedObject=Component.UNDEFINED,
59+
sceneSize=Component.UNDEFINED,
60+
axisView=Component.UNDEFINED,
61+
inletSize=Component.UNDEFINED,
62+
inletPadding=Component.UNDEFINED,
63+
debug=Component.UNDEFINED,
64+
animation=Component.UNDEFINED,
65+
**kwargs):
66+
self._prop_names = [
67+
'id', 'data', 'settings', 'toggleVisibility', 'downloadRequest',
68+
'setProps', 'selectedObject', 'sceneSize', 'axisView', 'inletSize',
69+
'inletPadding', 'debug', 'animation'
70+
]
5271
self._type = 'Simple3DScene'
5372
self._namespace = 'dash_mp_components'
54-
self._valid_wildcard_attributes = []
55-
self.available_properties = ['id', 'data', 'settings', 'toggleVisibility', 'downloadRequest', 'setProps', 'selectedObject', 'sceneSize', 'axisView', 'inletSize', 'inletPadding', 'debug', 'animation']
56-
self.available_wildcard_properties = []
73+
self._valid_wildcard_attributes = []
74+
self.available_properties = [
75+
'id', 'data', 'settings', 'toggleVisibility', 'downloadRequest',
76+
'setProps', 'selectedObject', 'sceneSize', 'axisView', 'inletSize',
77+
'inletPadding', 'debug', 'animation'
78+
]
79+
self.available_wildcard_properties = []
5780

5881
_explicit_args = kwargs.pop('_explicit_args')
5982
_locals = locals()
@@ -62,6 +85,6 @@ def __init__(self, id=Component.UNDEFINED, data=Component.UNDEFINED, settings=Co
6285

6386
for k in []:
6487
if k not in args:
65-
raise TypeError(
66-
'Required argument `' + k + '` was not specified.')
88+
raise TypeError('Required argument `' + k +
89+
'` was not specified.')
6790
super(Simple3DScene, self).__init__(**args)

dash_mp_components/dash_mp_components.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_mp_components/dash_mp_components.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dash_mp_components/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
"raw": "PropTypes.object"
291291
},
292292
"required": false,
293-
"description": "Options used for generating scene.\nSupported options and their defaults are given as follows:\n{\n antialias: true, // set to false to improve performance\n renderer: 'webgl', // 'svg' also an option, used for unit testing\n transparentBackground: false, // transparent background\n background: '#ffffff', // background color if not transparent,\n sphereSegments: 32, // decrease to improve performance\n cylinderSegments: 16, // decrease to improve performance\n staticScene: true, // disable if animation required\n defaultZoom: 0.8, // 1 will completely fill viewport with scene\n extractAxis: false // will remove the axis from the main scene\n isMultiSelectionEnabled: false // allow to use shift to select\n}\nThere are several additional options used for debugging and testing,\nplease consult the source code directly for these."
293+
"description": "Options used for generating scene.\nSupported options and their defaults are given as follows:\n{\n antialias: true, // set to false to improve performance\n renderer: 'webgl', // 'svg' also an option, used for unit testing\n transparentBackground: false, // transparent background\n background: '#ffffff', // background color if not transparent,\n sphereSegments: 32, // decrease to improve performance\n cylinderSegments: 16, // decrease to improve performance\n staticScene: true, // disable if animation required\n defaultZoom: 0.8, // 1 will completely fill viewport with scene\n extractAxis: false // will remove the axis from the main scene\n isMultiSelectionEnabled: false // allow to use shift to select,\n secondaryObjectView: true // show the selected object in a detail view\n animation: 'play' | 'slider' | 'none' // choose which style of animation is use\n}\nThere are several additional options used for debugging and testing,\nplease consult the source code directly for these."
294294
},
295295
"toggleVisibility": {
296296
"type": {

dash_mp_components/package-info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"author": "Materials Project Team <[email protected]>",
3434
"license": "BSD",
3535
"dependencies": {
36-
"@materialsproject/mp-react-components": "^0.1.2-SNAPSHOT.1589554280",
36+
"@materialsproject/mp-react-components": "0.1.2-SNAPSHOT.1590481594",
3737
"file-loader": "^5.1.0",
3838
"prettier": "^1.19.1",
3939
"ramda": "^0.26.1",

0 commit comments

Comments
 (0)