dash-model-viewer 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright 2025 Pip Install Python LLC
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
@@ -0,0 +1,11 @@
1
+ include dash_model_viewer/dash_model_viewer.min.js
2
+ include dash_model_viewer/dash_model_viewer.min.js.map
3
+ include dash_model_viewer/async-*.js
4
+ include dash_model_viewer/async-*.js.map
5
+ include dash_model_viewer/*-shared.js
6
+ include dash_model_viewer/*-shared.js.map
7
+ include dash_model_viewer/metadata.json
8
+ include dash_model_viewer/package-info.json
9
+ include README.md
10
+ include LICENSE
11
+ include package.json
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.2
2
+ Name: dash_model_viewer
3
+ Version: 0.0.1
4
+ Summary: Dynamic 3d AR modeling software for the Dash framework
5
+ Author: Pip Install Python LLC <pipinstallpython@gmail.com>
6
+ License: Apache-2.0
7
+ Classifier: Framework :: Dash
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: author
11
+ Dynamic: classifier
12
+ Dynamic: description
13
+ Dynamic: description-content-type
14
+ Dynamic: license
15
+ Dynamic: summary
16
+
17
+ # dash model viewer
18
+
19
+ dash model viewer is a Dash component library.
20
+
21
+ Dynamic 3d AR modeling software for the Dash framework
22
+
23
+ Get started with:
24
+ 1. Install Dash and its dependencies: https://dash.plotly.com/installation
25
+ 2. Run `python usage.py`
26
+ 3. Visit http://localhost:8050 in your web browser
27
+
28
+ ## Contributing
29
+
30
+ See [CONTRIBUTING.md](./CONTRIBUTING.md)
31
+
32
+ ### Install dependencies
33
+
34
+ If you have selected install_dependencies during the prompt, you can skip this part.
35
+
36
+ 1. Install npm packages
37
+ ```
38
+ $ npm install
39
+ ```
40
+ 2. Create a virtual env and activate.
41
+ ```
42
+ $ virtualenv venv
43
+ $ . venv/bin/activate
44
+ ```
45
+ _Note: venv\Scripts\activate for windows_
46
+
47
+ 3. Install python packages required to build components.
48
+ ```
49
+ $ pip install -r requirements.txt
50
+ ```
51
+ 4. Install the python packages for testing (optional)
52
+ ```
53
+ $ pip install -r tests/requirements.txt
54
+ ```
55
+
56
+ ### Write your component code in `src/lib/components/DashModelViewer.react.js`.
57
+
58
+ - The demo app is in `src/demo` and you will import your example component code into your demo app.
59
+ - Test your code in a Python environment:
60
+ 1. Build your code
61
+ ```
62
+ $ npm run build
63
+ ```
64
+ 2. Run and modify the `usage.py` sample dash app:
65
+ ```
66
+ $ python usage.py
67
+ ```
68
+ - Write tests for your component.
69
+ - A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium.
70
+ - Run the tests with `$ pytest tests`.
71
+ - The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
72
+ - Add custom styles to your component by putting your custom CSS files into your distribution folder (`dash_model_viewer`).
73
+ - Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
74
+ - Make sure the stylesheets are added to the `_css_dist` dict in `dash_model_viewer/__init__.py` so dash will serve them automatically when the component suite is requested.
75
+ - [Review your code](./review_checklist.md)
76
+
77
+ ### Create a production build and publish:
78
+
79
+ 1. Build your code:
80
+ ```
81
+ $ npm run build
82
+ ```
83
+ 2. Create a Python distribution
84
+ ```
85
+ $ python setup.py sdist bdist_wheel
86
+ ```
87
+ This will create source and wheel distribution in the generated the `dist/` folder.
88
+ See [PyPA](https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project)
89
+ for more information.
90
+
91
+ 3. Test your tarball by copying it into a new environment and installing it locally:
92
+ ```
93
+ $ pip install dash_model_viewer-0.0.1.tar.gz
94
+ ```
95
+
96
+ 4. If it works, then you can publish the component to NPM and PyPI:
97
+ 1. Publish on PyPI
98
+ ```
99
+ $ twine upload dist/*
100
+ ```
101
+ 2. Cleanup the dist folder (optional)
102
+ ```
103
+ $ rm -rf dist
104
+ ```
105
+ 3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
106
+ ```
107
+ $ npm publish
108
+ ```
109
+ _Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash serves the component library's CSS and JS locally, but if you choose to publish the package to NPM you can set `serve_locally` to `False` and you may see faster load times._
110
+
111
+ 5. Share your component with the community! https://community.plotly.com/c/dash
112
+ 1. Publish this repository to GitHub
113
+ 2. Tag your GitHub repository with the plotly-dash tag so that it appears here: https://github.com/topics/plotly-dash
114
+ 3. Create a post in the Dash community forum: https://community.plotly.com/c/dash
@@ -0,0 +1,98 @@
1
+ # dash model viewer
2
+
3
+ dash model viewer is a Dash component library.
4
+
5
+ Dynamic 3d AR modeling software for the Dash framework
6
+
7
+ Get started with:
8
+ 1. Install Dash and its dependencies: https://dash.plotly.com/installation
9
+ 2. Run `python usage.py`
10
+ 3. Visit http://localhost:8050 in your web browser
11
+
12
+ ## Contributing
13
+
14
+ See [CONTRIBUTING.md](./CONTRIBUTING.md)
15
+
16
+ ### Install dependencies
17
+
18
+ If you have selected install_dependencies during the prompt, you can skip this part.
19
+
20
+ 1. Install npm packages
21
+ ```
22
+ $ npm install
23
+ ```
24
+ 2. Create a virtual env and activate.
25
+ ```
26
+ $ virtualenv venv
27
+ $ . venv/bin/activate
28
+ ```
29
+ _Note: venv\Scripts\activate for windows_
30
+
31
+ 3. Install python packages required to build components.
32
+ ```
33
+ $ pip install -r requirements.txt
34
+ ```
35
+ 4. Install the python packages for testing (optional)
36
+ ```
37
+ $ pip install -r tests/requirements.txt
38
+ ```
39
+
40
+ ### Write your component code in `src/lib/components/DashModelViewer.react.js`.
41
+
42
+ - The demo app is in `src/demo` and you will import your example component code into your demo app.
43
+ - Test your code in a Python environment:
44
+ 1. Build your code
45
+ ```
46
+ $ npm run build
47
+ ```
48
+ 2. Run and modify the `usage.py` sample dash app:
49
+ ```
50
+ $ python usage.py
51
+ ```
52
+ - Write tests for your component.
53
+ - A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium.
54
+ - Run the tests with `$ pytest tests`.
55
+ - The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
56
+ - Add custom styles to your component by putting your custom CSS files into your distribution folder (`dash_model_viewer`).
57
+ - Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
58
+ - Make sure the stylesheets are added to the `_css_dist` dict in `dash_model_viewer/__init__.py` so dash will serve them automatically when the component suite is requested.
59
+ - [Review your code](./review_checklist.md)
60
+
61
+ ### Create a production build and publish:
62
+
63
+ 1. Build your code:
64
+ ```
65
+ $ npm run build
66
+ ```
67
+ 2. Create a Python distribution
68
+ ```
69
+ $ python setup.py sdist bdist_wheel
70
+ ```
71
+ This will create source and wheel distribution in the generated the `dist/` folder.
72
+ See [PyPA](https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project)
73
+ for more information.
74
+
75
+ 3. Test your tarball by copying it into a new environment and installing it locally:
76
+ ```
77
+ $ pip install dash_model_viewer-0.0.1.tar.gz
78
+ ```
79
+
80
+ 4. If it works, then you can publish the component to NPM and PyPI:
81
+ 1. Publish on PyPI
82
+ ```
83
+ $ twine upload dist/*
84
+ ```
85
+ 2. Cleanup the dist folder (optional)
86
+ ```
87
+ $ rm -rf dist
88
+ ```
89
+ 3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
90
+ ```
91
+ $ npm publish
92
+ ```
93
+ _Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash serves the component library's CSS and JS locally, but if you choose to publish the package to NPM you can set `serve_locally` to `False` and you may see faster load times._
94
+
95
+ 5. Share your component with the community! https://community.plotly.com/c/dash
96
+ 1. Publish this repository to GitHub
97
+ 2. Tag your GitHub repository with the plotly-dash tag so that it appears here: https://github.com/topics/plotly-dash
98
+ 3. Create a post in the Dash community forum: https://community.plotly.com/c/dash
@@ -0,0 +1,191 @@
1
+ # AUTO GENERATED FILE - DO NOT EDIT
2
+
3
+ import typing # noqa: F401
4
+ import numbers # noqa: F401
5
+ from typing_extensions import TypedDict, NotRequired, Literal # noqa: F401
6
+ from dash.development.base_component import Component
7
+ try:
8
+ from dash.development.base_component import ComponentType # noqa: F401
9
+ except ImportError:
10
+ ComponentType = typing.TypeVar("ComponentType", bound=Component)
11
+
12
+
13
+ class DashModelViewer(Component):
14
+ """A DashModelViewer component.
15
+
16
+
17
+ Keyword arguments:
18
+
19
+ - id (string; required):
20
+ Component ID.
21
+
22
+ - alt (string; required):
23
+ Alt text for accessibility.
24
+
25
+ - ar (boolean; default True):
26
+ Enable AR features.
27
+
28
+ - arButtonText (string; default 'View in your space'):
29
+ Text for the default AR button.
30
+
31
+ - arModes (string; default "basic_annotations scene-viewer quick-look")
32
+
33
+ - arScale (a value equal to: 'auto', 'fixed'; default 'auto')
34
+
35
+ - cameraControls (boolean; default True):
36
+ Enable camera controls.
37
+
38
+ - cameraOrbit (string; optional):
39
+ Initial camera orbital position ($theta $phi $radius).
40
+
41
+ - cameraTarget (string; optional):
42
+ Initial camera target point ($X $Y $Z).
43
+
44
+ - customArFailure (string | a list of or a singular dash component, string or number; optional):
45
+ Custom React element for the AR failure message.
46
+
47
+ - customArPrompt (string | a list of or a singular dash component, string or number; optional):
48
+ Custom React element for the AR prompt.
49
+
50
+ - fieldOfView (string; default 'auto'):
51
+ Camera field of view.
52
+
53
+ - hotspots (list of dicts; optional):
54
+ Array of hotspot objects passed from the server.
55
+
56
+ `hotspots` is a list of dicts with keys:
57
+
58
+ - slot (string; optional)
59
+
60
+ - position (string; optional)
61
+
62
+ - normal (string; optional)
63
+
64
+ - orbit (string; optional)
65
+
66
+ - target (string; optional)
67
+
68
+ - fov (string; optional)
69
+
70
+ - text (string; optional)
71
+
72
+ - children_classname (string; optional)
73
+
74
+ - interpolationDecay (number | string; default 50):
75
+ Camera interpolation decay rate.
76
+
77
+ - loading_state (dict; optional):
78
+ Object that holds the loading state object coming from
79
+ dash-renderer.
80
+
81
+ `loading_state` is a dict with keys:
82
+
83
+ - is_loading (boolean; optional):
84
+ Determines if the component is loading or not.
85
+
86
+ - prop_name (string; optional):
87
+ Holds which property is loading.
88
+
89
+ - component_name (string; optional):
90
+ Holds the name of the component that is loading.
91
+
92
+ - maxCameraOrbit (string; default 'auto auto auto'):
93
+ Maximum camera orbit bounds.
94
+
95
+ - maxFieldOfView (string; default 'auto'):
96
+ Maximum camera field of view.
97
+
98
+ - minCameraOrbit (string; default 'auto auto auto'):
99
+ Minimum camera orbit bounds.
100
+
101
+ - minFieldOfView (string; default '25deg'):
102
+ Minimum camera field of view.
103
+
104
+ - poster (string; optional):
105
+ Poster image URL.
106
+
107
+ - shadowIntensity (number | string; default 0)
108
+
109
+ - src (string; required):
110
+ Model source URL (.glb or .gltf).
111
+
112
+ - toneMapping (a value equal to: 'neutral', 'aces', 'agx', 'reinhard', 'cineon', 'linear', 'none'; default 'neutral')
113
+
114
+ - touchAction (a value equal to: 'pan-y', 'pan-x', 'none'; default "pan-y"):
115
+ Touch action behavior.
116
+
117
+ - variantName (string; optional)"""
118
+ _children_props = ['customArPrompt', 'customArFailure']
119
+ _base_nodes = ['customArPrompt', 'customArFailure', 'children']
120
+ _namespace = 'dash_model_viewer'
121
+ _type = 'DashModelViewer'
122
+ Hotspots = TypedDict(
123
+ "Hotspots",
124
+ {
125
+ "slot": NotRequired[str],
126
+ "position": NotRequired[str],
127
+ "normal": NotRequired[str],
128
+ "orbit": NotRequired[str],
129
+ "target": NotRequired[str],
130
+ "fov": NotRequired[str],
131
+ "text": NotRequired[str],
132
+ "children_classname": NotRequired[str]
133
+ }
134
+ )
135
+
136
+ LoadingState = TypedDict(
137
+ "LoadingState",
138
+ {
139
+ "is_loading": NotRequired[bool],
140
+ "prop_name": NotRequired[str],
141
+ "component_name": NotRequired[str]
142
+ }
143
+ )
144
+
145
+ _explicitize_dash_init = True
146
+
147
+ def __init__(
148
+ self,
149
+ id: typing.Optional[typing.Union[str, dict]] = None,
150
+ src: typing.Optional[str] = None,
151
+ alt: typing.Optional[str] = None,
152
+ cameraControls: typing.Optional[bool] = None,
153
+ touchAction: typing.Optional[Literal["pan-y", "pan-x", "none"]] = None,
154
+ cameraOrbit: typing.Optional[str] = None,
155
+ cameraTarget: typing.Optional[str] = None,
156
+ fieldOfView: typing.Optional[str] = None,
157
+ minFieldOfView: typing.Optional[str] = None,
158
+ maxFieldOfView: typing.Optional[str] = None,
159
+ interpolationDecay: typing.Optional[typing.Union[typing.Union[typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex], str]] = None,
160
+ minCameraOrbit: typing.Optional[str] = None,
161
+ maxCameraOrbit: typing.Optional[str] = None,
162
+ poster: typing.Optional[str] = None,
163
+ ar: typing.Optional[bool] = None,
164
+ hotspots: typing.Optional[typing.Sequence["Hotspots"]] = None,
165
+ arButtonText: typing.Optional[str] = None,
166
+ customArPrompt: typing.Optional[typing.Union[str, typing.Union[str, int, float, ComponentType, typing.Sequence[typing.Union[str, int, float, ComponentType]]]]] = None,
167
+ customArFailure: typing.Optional[typing.Union[str, typing.Union[str, int, float, ComponentType, typing.Sequence[typing.Union[str, int, float, ComponentType]]]]] = None,
168
+ style: typing.Optional[typing.Any] = None,
169
+ toneMapping: typing.Optional[Literal["neutral", "aces", "agx", "reinhard", "cineon", "linear", "none"]] = None,
170
+ arModes: typing.Optional[str] = None,
171
+ shadowIntensity: typing.Optional[typing.Union[typing.Union[typing.SupportsFloat, typing.SupportsInt, typing.SupportsComplex], str]] = None,
172
+ arScale: typing.Optional[Literal["auto", "fixed"]] = None,
173
+ variantName: typing.Optional[str] = None,
174
+ loading_state: typing.Optional["LoadingState"] = None,
175
+ **kwargs
176
+ ):
177
+ self._prop_names = ['id', 'alt', 'ar', 'arButtonText', 'arModes', 'arScale', 'cameraControls', 'cameraOrbit', 'cameraTarget', 'customArFailure', 'customArPrompt', 'fieldOfView', 'hotspots', 'interpolationDecay', 'loading_state', 'maxCameraOrbit', 'maxFieldOfView', 'minCameraOrbit', 'minFieldOfView', 'poster', 'shadowIntensity', 'src', 'style', 'toneMapping', 'touchAction', 'variantName']
178
+ self._valid_wildcard_attributes = []
179
+ self.available_properties = ['id', 'alt', 'ar', 'arButtonText', 'arModes', 'arScale', 'cameraControls', 'cameraOrbit', 'cameraTarget', 'customArFailure', 'customArPrompt', 'fieldOfView', 'hotspots', 'interpolationDecay', 'loading_state', 'maxCameraOrbit', 'maxFieldOfView', 'minCameraOrbit', 'minFieldOfView', 'poster', 'shadowIntensity', 'src', 'style', 'toneMapping', 'touchAction', 'variantName']
180
+ self.available_wildcard_properties = []
181
+ _explicit_args = kwargs.pop('_explicit_args')
182
+ _locals = locals()
183
+ _locals.update(kwargs) # For wildcard attrs and excess named props
184
+ args = {k: _locals[k] for k in _explicit_args}
185
+
186
+ for k in ['id', 'alt', 'src']:
187
+ if k not in args:
188
+ raise TypeError(
189
+ 'Required argument `' + k + '` was not specified.')
190
+
191
+ super(DashModelViewer, self).__init__(**args)
@@ -0,0 +1,87 @@
1
+ from __future__ import print_function as _
2
+
3
+ import os as _os
4
+ import sys as _sys
5
+ import json
6
+
7
+ import dash as _dash
8
+
9
+ # noinspection PyUnresolvedReferences
10
+ from ._imports_ import *
11
+ from ._imports_ import __all__
12
+
13
+ if not hasattr(_dash, '__plotly_dash') and not hasattr(_dash, 'development'):
14
+ print('Dash was not successfully imported. '
15
+ 'Make sure you don\'t have a file '
16
+ 'named \n"dash.py" in your current directory.', file=_sys.stderr)
17
+ _sys.exit(1)
18
+
19
+ _basepath = _os.path.dirname(__file__)
20
+ _filepath = _os.path.abspath(_os.path.join(_basepath, 'package-info.json'))
21
+ with open(_filepath) as f:
22
+ package = json.load(f)
23
+
24
+ package_name = package['name'].replace(' ', '_').replace('-', '_')
25
+ __version__ = package['version']
26
+
27
+ _current_path = _os.path.dirname(_os.path.abspath(__file__))
28
+
29
+ _this_module = _sys.modules[__name__]
30
+
31
+ async_resources = []
32
+
33
+ _js_dist = []
34
+
35
+ _js_dist.extend(
36
+ [
37
+ {
38
+ "relative_package_path": "async-{}.js".format(async_resource),
39
+ "external_url": (
40
+ "https://unpkg.com/{0}@{2}"
41
+ "/{1}/async-{3}.js"
42
+ ).format(package_name, __name__, __version__, async_resource),
43
+ "namespace": package_name,
44
+ "async": True,
45
+ }
46
+ for async_resource in async_resources
47
+ ]
48
+ )
49
+
50
+ # TODO: Figure out if unpkg link works
51
+ _js_dist.extend(
52
+ [
53
+ {
54
+ "relative_package_path": "async-{}.js.map".format(async_resource),
55
+ "external_url": (
56
+ "https://unpkg.com/{0}@{2}"
57
+ "/{1}/async-{3}.js.map"
58
+ ).format(package_name, __name__, __version__, async_resource),
59
+ "namespace": package_name,
60
+ "dynamic": True,
61
+ }
62
+ for async_resource in async_resources
63
+ ]
64
+ )
65
+
66
+ _js_dist.extend(
67
+ [
68
+ {
69
+ 'relative_package_path': 'dash_model_viewer.min.js',
70
+
71
+ 'namespace': package_name
72
+ },
73
+ {
74
+ 'relative_package_path': 'dash_model_viewer.min.js.map',
75
+
76
+ 'namespace': package_name,
77
+ 'dynamic': True
78
+ }
79
+ ]
80
+ )
81
+
82
+ _css_dist = []
83
+
84
+
85
+ for _component in __all__:
86
+ setattr(locals()[_component], '_js_dist', _js_dist)
87
+ setattr(locals()[_component], '_css_dist', _css_dist)
@@ -0,0 +1,5 @@
1
+ from .DashModelViewer import DashModelViewer
2
+
3
+ __all__ = [
4
+ "DashModelViewer"
5
+ ]
@@ -0,0 +1,2 @@
1
+ (()=>{"use strict";var e,t={n:e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return t.d(r,{a:r}),r},d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},r=function(){var e=document.currentScript;if(!e){for(var t=document.getElementsByTagName("script"),r=[],n=0;n<t.length;n++)r.push(t[n]);e=(r=r.filter((function(e){return!e.async&&!e.text&&!e.textContent}))).slice(-1)[0]}return e};if(Object.defineProperty(t,"p",{get:(e=r().src.split("/").slice(0,-1).join("/")+"/",function(){return e})}),"undefined"!=typeof jsonpScriptSrc){var n=jsonpScriptSrc;jsonpScriptSrc=function(e){var t,o=(t=r(),/\/_dash-component-suites\//.test(t.src)),i=n(e);if(!o)return i;var a=i.split("/"),s=a.slice(-1)[0].split(".");return s.splice(1,0,"v0_0_1m1744909483"),a.splice(-1,1,s.join(".")),a.join("/")}}var o={};t.r(o),t.d(o,{DashModelViewer:()=>u});const i=window.React;var a=t.n(i);const s=window.PropTypes;var c=t.n(s);function l(){return l=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},l.apply(null,arguments)}var d=function(e){var t=e.id,r=e.src,n=e.alt,o=e.cameraControls,s=void 0===o||o,c=e.touchAction,d=void 0===c?"pan-y":c,u=e.ar,m=void 0===u||u,v=e.hotspots,p=void 0===v?[]:v,f=e.style,g=void 0===f?{}:f,y=e.toneMapping,b=void 0===y?"neutral":y,h=e.arModes,w=void 0===h?"basic_annotations scene-viewer quick-look":h,O=e.shadowIntensity,E=void 0===O?0:O,j=e.arScale,x=void 0===j?"auto":j,S=e.interpolationDecay,_=void 0===S?50:S,T=e.fieldOfView,k=void 0===T?"auto":T,A=e.minFieldOfView,P=void 0===A?"25deg":A,V=e.maxFieldOfView,q=void 0===V?"auto":V,C=e.maxCameraOrbit,L=void 0===C?"auto auto auto":C,R=e.minCameraOrbit,M=void 0===R?"auto auto auto":R,D=e.arButtonText,F=void 0===D?"View in your space":D,N=e.customArPrompt,B=void 0===N?null:N,I=e.customArFailure,z=void 0===I?null:I,G=e.variantName,H=void 0===G?null:G,J=e.cameraOrbit,K=e.cameraTarget,Q=e.poster,U=(e.setProps,e.loading_state,(0,i.useRef)(null));(0,i.useEffect)((function(){var e,t=document.querySelector('script[src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js"]'),r=function(){customElements.whenDefined("model-viewer").then((function(){U.current&&W()}))};return t?customElements.get("model-viewer")?r():customElements.whenDefined("model-viewer").then((function(){U.current&&r()})):((e=document.createElement("script")).src="https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js",e.type="module",e.addEventListener("load",r),document.body.appendChild(e)),function(){e&&e.parentElement===document.body&&document.body.removeChild(e)}}),[]);var W=function(){X(),Y()},X=function(){var e=U.current;if(e){var t=function(e){var t=e.currentTarget,r=U.current;if(r){var n=t.dataset;n.target&&n.orbit&&(r.cameraTarget=n.target,r.cameraOrbit=n.orbit,n.fov?r.fieldOfView=n.fov:r.fieldOfView="45deg"),Object.keys({}).length}};e.querySelectorAll(".hotspot").forEach((function(e){e.removeEventListener("click",t),e.addEventListener("click",t)}))}},Y=function(){var e=U.current;if(e){var t=e.querySelector("#ar-button"),r=e.querySelector("#ar-prompt"),n=e.querySelector("#ar-failure"),o=function(){null!=e&&e.canActivateAR&&e.activateAR()},i=function(e){r&&(r.style.display="session-started"===e.detail.status?"block":"none")},a=function(e){n&&(n.style.display="not-tracking"===e.detail.status?"block":"none")};t&&(t.removeEventListener("click",o),t.addEventListener("click",o)),e.removeEventListener("ar-status",i),e.addEventListener("ar-status",i),e.removeEventListener("ar-tracking",a),e.addEventListener("ar-tracking",a)}};return(0,i.useEffect)((function(){customElements.whenDefined("model-viewer").then((function(){U.current&&X()}))}),[p]),a().createElement("model-viewer",{ref:U,id:t,src:r,alt:n,"camera-controls":s?"":void 0,"touch-action":d,"camera-orbit":J,"camera-target":K,"field-of-view":k,"min-field-of-view":P,"max-field-of-view":q,"interpolation-decay":_,"min-camera-orbit":M,"max-camera-orbit":L,poster:Q,ar:m?"":void 0,style:g,"tone-mapping":b,"ar-modes":w,"shadow-intensity":E,"ar-scale":x,"variant-name":"default"===H?void 0:H},p&&p.map((function(e,t){return a().createElement("div",l({key:e.slot||"hotspot-".concat(t),className:"hotspot ".concat(e.children_classname||"").trim(),slot:e.slot||"hotspot-".concat(t+1),"data-position":e.position,"data-normal":e.normal},e.orbit&&{"data-orbit":e.orbit},e.target&&{"data-target":e.target},e.fov&&{"data-fov":e.fov}),e.text)})),a().createElement("div",{id:"ar-button",slot:"ar-button"},F," "),a().createElement("div",{id:"ar-prompt",style:{display:"none"}},B||a().createElement("img",{src:"https://modelviewer.dev/assets/hand.png",alt:"AR Prompt"})),a().createElement("div",{id:"ar-failure",style:{display:"none"}},z||"AR is not tracking!"))};d.propTypes={id:c().string.isRequired,src:c().string.isRequired,alt:c().string.isRequired,cameraControls:c().bool,touchAction:c().oneOf(["pan-y","pan-x","none"]),cameraOrbit:c().string,cameraTarget:c().string,fieldOfView:c().string,minFieldOfView:c().string,maxFieldOfView:c().string,interpolationDecay:c().oneOfType([c().number,c().string]),minCameraOrbit:c().string,maxCameraOrbit:c().string,poster:c().string,ar:c().bool,hotspots:c().arrayOf(c().shape({slot:c().string,position:c().string,normal:c().string,orbit:c().string,target:c().string,fov:c().string,text:c().string,children_classname:c().string})),arButtonText:c().string,customArPrompt:c().oneOfType([c().string,c().node]),customArFailure:c().oneOfType([c().string,c().node]),style:c().object,toneMapping:c().oneOf(["neutral","aces","agx","reinhard","cineon","linear","none"]),arModes:c().string,shadowIntensity:c().oneOfType([c().number,c().string]),arScale:c().oneOf(["auto","fixed"]),variantName:c().string,setProps:c().func,loading_state:c().shape({is_loading:c().bool,prop_name:c().string,component_name:c().string})};const u=d;window.dash_model_viewer=o})();
2
+ //# sourceMappingURL=dash_model_viewer.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dash_model_viewer.min.js","mappings":"mBACA,IC2BYA,ED3BRC,EAAsB,CEA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EA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EhB/D,OAAQ+D,IAAAA,OAERlG,GAAIkG,IAAAA,KAGJhG,SAAUgG,IAAAA,QAAkBA,IAAAA,MAAgB,CAC1CR,KAAMQ,IAAAA,OACNH,SAAUG,IAAAA,OACVF,OAAQE,IAAAA,OACRhC,MAAOgC,IAAAA,OACPjC,OAAQiC,IAAAA,OACR/B,IAAK+B,IAAAA,OACL1H,KAAM0H,IAAAA,OACNL,mBAAoBK,IAAAA,UAItBxE,aAAcwE,IAAAA,OAEdtE,eAAgBsE,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,OAEvDpE,gBAAiBoE,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,OAExD9F,MAAO8F,IAAAA,OAGP5F,YAAa4F,IAAAA,MAAgB,CAAC,UAAW,OAAQ,MAAO,WAAY,SAAU,SAAU,SACxF1F,QAAS0F,IAAAA,OACTxF,gBAAiBwF,IAAAA,UAAoB,CAACA,IAAAA,OAAkBA,IAAAA,SACxDtF,QAASsF,IAAAA,MAAgB,CAAC,OAAQ,UAClClE,YAAakE,IAAAA,OAIb7D,SAAU6D,IAAAA,KAGV5D,cAAe4D,IAAAA,MAAgB,CAE7BE,WAAYF,IAAAA,KAEZG,UAAWH,IAAAA,OAEXI,eAAgBJ,IAAAA,UASpB,U","sources":["webpack:///webpack/bootstrap","webpack:///webpack/runtime/compat","webpack:///webpack/runtime/compat get default export","webpack:///webpack/runtime/define property getters","webpack:///webpack/runtime/hasOwnProperty shorthand","webpack:///webpack/runtime/make namespace object","webpack:///external window \"React\"","webpack:///external window \"PropTypes\"","webpack:///./src/lib/components/DashModelViewer.react.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","var getCurrentScript = function() {\n var script = document.currentScript;\n if (!script) {\n /* Shim for IE11 and below */\n /* Do not take into account async scripts and inline scripts */\n\n var doc_scripts = document.getElementsByTagName('script');\n var scripts = [];\n\n for (var i = 0; i < doc_scripts.length; i++) {\n scripts.push(doc_scripts[i]);\n }\n\n scripts = scripts.filter(function(s) { return !s.async && !s.text && !s.textContent; });\n script = scripts.slice(-1)[0];\n }\n\n return script;\n};\n\nvar isLocalScript = function(script) {\n return /\\/_dash-component-suites\\//.test(script.src);\n};\n\nObject.defineProperty(__webpack_require__, 'p', {\n get: (function () {\n var script = getCurrentScript();\n\n var url = script.src.split('/').slice(0, -1).join('/') + '/';\n\n return function() {\n return url;\n };\n })()\n});\n\nif (typeof jsonpScriptSrc !== 'undefined') {\n var __jsonpScriptSrc__ = jsonpScriptSrc;\n jsonpScriptSrc = function(chunkId) {\n var script = getCurrentScript();\n var isLocal = isLocalScript(script);\n\n var src = __jsonpScriptSrc__(chunkId);\n\n if(!isLocal) {\n return src;\n }\n\n var srcFragments = src.split('/');\n var fileFragments = srcFragments.slice(-1)[0].split('.');\n\n fileFragments.splice(1, 0, \"v0_0_1m1744909483\");\n srcFragments.splice(-1, 1, fileFragments.join('.'))\n\n return srcFragments.join('/');\n };\n}\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"React\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"PropTypes\"];","// --- START OF FILE ModelViewer.react.js ---\n\nimport React, { useEffect, useRef } from 'react';\nimport PropTypes from 'prop-types';\n\n// Import utilities for Dash 2/3 compatibility\n// Adjust the path based on your file structure (assuming dash3.js is compiled)\nimport { useLoadingState, setPersistence, getChildLayout, setComponentProps } from '../utils/dash3'; // Example path\n\n// --- Dash 3 Compatibility Notes ---\n// 1. Default Props: Moved from `ModelViewer.defaultProps` to function signature (below).\n// 2. Loading State: Uses `useLoadingState` utility (if needed) to handle Dash 2/3.\n// 3. Persistence: Uses `setPersistence` utility (if needed) called *outside* the component definition.\n// 4. Child Layout: Uses `getChildLayout` utility (if needed) for inspecting children.\n// 5. Typing: Generated by `dash-generate-components` v3+. Requires adding 'proptypes.js'\n// to _js_dist in your package's __init__.py if using TypeScript source.\n// ---\n\n// Component definition with default props in the signature\nconst DashModelViewer = ({\n // Required props (no defaults needed here)\n id,\n src,\n alt,\n\n // Props with defaults defined directly here\n cameraControls = true,\n touchAction = \"pan-y\",\n ar = true,\n hotspots = [],\n style = {},\n toneMapping = 'neutral',\n arModes = \"basic_annotations scene-viewer quick-look\",\n shadowIntensity = 0,\n arScale = 'auto',\n interpolationDecay = 50,\n fieldOfView = 'auto',\n minFieldOfView = '25deg',\n maxFieldOfView = 'auto',\n maxCameraOrbit = 'auto auto auto',\n minCameraOrbit = 'auto auto auto',\n arButtonText = 'View in your space',\n customArPrompt = null,\n customArFailure = null,\n variantName = null, // Explicit null default\n\n // Props without defaults (will be undefined if not provided by user)\n cameraOrbit,\n cameraTarget,\n poster,\n\n // Dash internal props (passed automatically)\n setProps,\n loading_state // Passed by Dash for both v2 and v3\n}) => {\n const modelViewerRef = useRef(null);\n\n // --- Example: Using the loading state utility ---\n // If you needed to render differently based on loading state:\n // const isLoading = useLoadingState(loading_state);\n // if (isLoading) {\n // return <div>Loading model...</div>;\n // }\n // ---\n\n // Effect to load the model-viewer script and set up initial listeners\n useEffect(() => {\n const existingScript = document.querySelector('script[src=\"https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js\"]');\n let script;\n\n const initializeModelViewer = () => {\n customElements.whenDefined('model-viewer').then(() => {\n if (modelViewerRef.current) {\n setupModelViewerListeners(); // Run combined setup\n }\n });\n };\n\n if (!existingScript) {\n script = document.createElement('script');\n script.src = \"https://ajax.googleapis.com/ajax/libs/model-viewer/3.5.0/model-viewer.min.js\";\n script.type = \"module\";\n script.addEventListener('load', initializeModelViewer);\n document.body.appendChild(script);\n } else {\n if (customElements.get('model-viewer')) {\n initializeModelViewer();\n } else {\n customElements.whenDefined('model-viewer').then(() => {\n if (modelViewerRef.current) {\n initializeModelViewer();\n }\n });\n }\n }\n\n return () => {\n // Cleanup script if it was added by this instance\n if (script && script.parentElement === document.body) {\n document.body.removeChild(script);\n }\n // Note: Robust listener cleanup might require storing handler references\n // outside the setup functions or using useCallback if handlers depend on props/state.\n };\n }, []); // Empty dependency array: run only once on mount\n\n // Combined setup function for listeners\n const setupModelViewerListeners = () => {\n setupHotspots(); // Setup/update hotspot listeners\n setupAR(); // Setup/update AR listeners\n };\n\n\n // Setup Hotspots - including CLICK logic for camera views\n const setupHotspots = () => {\n const modelViewer = modelViewerRef.current;\n if (!modelViewer) return;\n\n const handleAnnotationClick = (event) => {\n const annotation = event.currentTarget;\n const modelViewerElement = modelViewerRef.current;\n if (!modelViewerElement) return;\n const dataset = annotation.dataset;\n\n let updatedProps = {}; // Collect props to update via setProps\n\n if (dataset.target && dataset.orbit) {\n modelViewerElement.cameraTarget = dataset.target;\n modelViewerElement.cameraOrbit = dataset.orbit;\n // Update Dash state if these props are controllable\n // updatedProps.cameraTarget = dataset.target; // Example\n // updatedProps.cameraOrbit = dataset.orbit; // Example\n\n if (dataset.fov) {\n modelViewerElement.fieldOfView = dataset.fov;\n // updatedProps.fieldOfView = dataset.fov; // Example\n } else {\n modelViewerElement.fieldOfView = '45deg'; // Default FoV for camera view hotspots\n // updatedProps.fieldOfView = '45deg'; // Example\n }\n }\n // Add other click logic if needed\n\n // Call setProps if there are changes to report back to Dash\n if (Object.keys(updatedProps).length > 0 && setProps) {\n // setProps(updatedProps); // Uncomment if you add controllable props based on clicks\n }\n };\n\n const hotspotElements = modelViewer.querySelectorAll('.hotspot');\n\n // Re-attach listeners\n hotspotElements.forEach((hotspot) => {\n hotspot.removeEventListener('click', handleAnnotationClick); // Remove first\n hotspot.addEventListener('click', handleAnnotationClick); // Add updated handler\n });\n };\n\n // Setup AR Listeners and Button Logic\n const setupAR = () => {\n const modelViewer = modelViewerRef.current;\n if (!modelViewer) return;\n\n const arButton = modelViewer.querySelector('#ar-button');\n const arPrompt = modelViewer.querySelector('#ar-prompt');\n const arFailure = modelViewer.querySelector('#ar-failure');\n\n // Use stable function references or useCallback if needed for robust removal\n const handleARButtonClick = () => { if (modelViewer?.canActivateAR) { modelViewer.activateAR(); } };\n const handleArStatus = (event) => { if (arPrompt) { arPrompt.style.display = event.detail.status === 'session-started' ? 'block' : 'none'; } };\n const handleArTracking = (event) => { if (arFailure) { arFailure.style.display = event.detail.status === 'not-tracking' ? 'block' : 'none'; } };\n\n if (arButton) {\n arButton.removeEventListener('click', handleARButtonClick); // Attempt removal\n arButton.addEventListener('click', handleARButtonClick);\n }\n modelViewer.removeEventListener('ar-status', handleArStatus); // Attempt removal\n modelViewer.addEventListener('ar-status', handleArStatus);\n modelViewer.removeEventListener('ar-tracking', handleArTracking); // Attempt removal\n modelViewer.addEventListener('ar-tracking', handleArTracking);\n };\n\n // Effect to re-run setupHotspots when the 'hotspots' prop changes\n // Note: React's default comparison is shallow. If hotspot objects *within* the array\n // change identity or content without the array itself changing, this might not re-run.\n // For complex cases, you might need a deep comparison or a different trigger.\n useEffect(() => {\n customElements.whenDefined('model-viewer').then(() => {\n if (modelViewerRef.current) {\n setupHotspots(); // Re-attach click listeners\n }\n });\n }, [hotspots]); // Dependency on the hotspots prop array\n\n // Convert boolean props for attributes where needed\n // model-viewer attributes often just need to exist, not have a value='true'\n const cameraControlsAttr = cameraControls ? '' : null;\n const arAttr = ar ? '' : null;\n\n return (\n <model-viewer\n ref={modelViewerRef}\n id={id}\n src={src}\n alt={alt}\n // Pass attributes directly using the derived values\n camera-controls={cameraControls ? '' : undefined} // Use undefined to remove attribute if false\n touch-action={touchAction}\n camera-orbit={cameraOrbit}\n camera-target={cameraTarget}\n field-of-view={fieldOfView}\n min-field-of-view={minFieldOfView}\n max-field-of-view={maxFieldOfView}\n interpolation-decay={interpolationDecay}\n min-camera-orbit={minCameraOrbit}\n max-camera-orbit={maxCameraOrbit}\n poster={poster}\n ar={ar ? '' : undefined} // Use undefined to remove attribute if false\n style={style}\n tone-mapping={toneMapping}\n ar-modes={arModes}\n shadow-intensity={shadowIntensity}\n ar-scale={arScale}\n // Handle 'default' variant name - model-viewer expects attribute removal for default\n variant-name={variantName === 'default' ? undefined : variantName}\n >\n {/* Render hotspot divs based on the hotspots prop array */}\n {hotspots && hotspots.map((hotspot, index) => (\n <div\n key={hotspot.slot || `hotspot-${index}`}\n className={`hotspot ${hotspot.children_classname || ''}`.trim()}\n slot={hotspot.slot || `hotspot-${index + 1}`}\n data-position={hotspot.position}\n data-normal={hotspot.normal}\n // Conditionally add data attributes only if they exist in the hotspot object\n {...(hotspot.orbit && { 'data-orbit': hotspot.orbit })}\n {...(hotspot.target && { 'data-target': hotspot.target })}\n {...(hotspot.fov && { 'data-fov': hotspot.fov })}\n >\n {/* Text content (button label) */}\n {hotspot.text}\n </div>\n ))}\n\n {/* AR Button Slot */}\n <div id=\"ar-button\" slot=\"ar-button\">\n {arButtonText} {/* Default value handled in props destructuring */}\n </div>\n\n {/* AR Prompt Slot */}\n <div id=\"ar-prompt\" style={{display: 'none'}}>\n {/* Default value (null) handled in props destructuring, render conditionally */}\n {customArPrompt || <img src=\"https://modelviewer.dev/assets/hand.png\" alt=\"AR Prompt\"/>}\n </div>\n\n {/* AR Failure Slot */}\n <div id=\"ar-failure\" style={{display: 'none'}}>\n {/* Default value (null) handled in props destructuring, render conditionally */}\n {customArFailure || \"AR is not tracking!\"}\n </div>\n </model-viewer>\n );\n};\n\n// --- Remove the defaultProps block ---\n// ModelViewer.defaultProps = { ... }; // DELETED\n\n// --- Keep Prop Types ---\n// Prop types are still needed for dash-generate-components and developer documentation\nDashModelViewer.propTypes = {\n /** Component ID */\n id: PropTypes.string.isRequired,\n /** Model source URL (.glb or .gltf) */\n src: PropTypes.string.isRequired,\n /** Alt text for accessibility */\n alt: PropTypes.string.isRequired,\n /** Enable camera controls */\n cameraControls: PropTypes.bool,\n /** Touch action behavior */\n touchAction: PropTypes.oneOf(['pan-y', 'pan-x', 'none']),\n /** Initial camera orbital position ($theta $phi $radius) */\n cameraOrbit: PropTypes.string,\n /** Initial camera target point ($X $Y $Z) */\n cameraTarget: PropTypes.string,\n /** Camera field of view */\n fieldOfView: PropTypes.string,\n /** Minimum camera field of view */\n minFieldOfView: PropTypes.string,\n /** Maximum camera field of view */\n maxFieldOfView: PropTypes.string,\n /** Camera interpolation decay rate */\n interpolationDecay: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n /** Minimum camera orbit bounds */\n minCameraOrbit: PropTypes.string,\n /** Maximum camera orbit bounds */\n maxCameraOrbit: PropTypes.string,\n /** Poster image URL */\n poster: PropTypes.string,\n /** Enable AR features */\n ar: PropTypes.bool,\n\n /** Array of hotspot objects passed from the server */\n hotspots: PropTypes.arrayOf(PropTypes.shape({\n slot: PropTypes.string,\n position: PropTypes.string,\n normal: PropTypes.string,\n orbit: PropTypes.string, // Camera orbit for click\n target: PropTypes.string, // Camera target for click\n fov: PropTypes.string, // Optional: Field of view for click\n text: PropTypes.string,\n children_classname: PropTypes.string, // CSS class name (e.g., 'view-button')\n })),\n\n /** Text for the default AR button */\n arButtonText: PropTypes.string,\n /** Custom React element for the AR prompt */\n customArPrompt: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /** Custom React element for the AR failure message */\n customArFailure: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n /** CSS Style object */\n style: PropTypes.object,\n\n // --- Rendering & AR Prop Types ---\n toneMapping: PropTypes.oneOf(['neutral', 'aces', 'agx', 'reinhard', 'cineon', 'linear', 'none']),\n arModes: PropTypes.string,\n shadowIntensity: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n arScale: PropTypes.oneOf(['auto', 'fixed']),\n variantName: PropTypes.string,\n\n /** Dash-assigned callback that should be called whenever any of the\n * properties change. */\n setProps: PropTypes.func,\n\n /** Object that holds the loading state object coming from dash-renderer */\n loading_state: PropTypes.shape({\n /** Determines if the component is loading or not */\n is_loading: PropTypes.bool,\n /** Holds which property is loading */\n prop_name: PropTypes.string,\n /** Holds the name of the component that is loading */\n component_name: PropTypes.string,\n }),\n};\n\n// --- Example: Setting Persistence (if needed) ---\n// If you wanted 'cameraOrbit' and 'cameraTarget' to persist in local storage:\n// setPersistence(ModelViewer, ['cameraOrbit', 'cameraTarget']);\n// --- This call MUST be outside the component function definition ---\n\nexport default DashModelViewer;\n// --- END OF FILE ModelViewer.react.js ---"],"names":["url","__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","getCurrentScript","script","document","currentScript","doc_scripts","getElementsByTagName","scripts","i","length","push","filter","s","async","text","textContent","slice","src","split","join","jsonpScriptSrc","__jsonpScriptSrc__","chunkId","isLocal","test","srcFragments","fileFragments","splice","window","DashModelViewer","_ref","id","alt","_ref$cameraControls","cameraControls","_ref$touchAction","touchAction","_ref$ar","ar","_ref$hotspots","hotspots","_ref$style","style","_ref$toneMapping","toneMapping","_ref$arModes","arModes","_ref$shadowIntensity","shadowIntensity","_ref$arScale","arScale","_ref$interpolationDec","interpolationDecay","_ref$fieldOfView","fieldOfView","_ref$minFieldOfView","minFieldOfView","_ref$maxFieldOfView","maxFieldOfView","_ref$maxCameraOrbit","maxCameraOrbit","_ref$minCameraOrbit","minCameraOrbit","_ref$arButtonText","arButtonText","_ref$customArPrompt","customArPrompt","_ref$customArFailure","customArFailure","_ref$variantName","variantName","cameraOrbit","cameraTarget","poster","modelViewerRef","setProps","loading_state","useRef","useEffect","existingScript","querySelector","initializeModelViewer","customElements","whenDefined","then","current","setupModelViewerListeners","createElement","type","addEventListener","body","appendChild","parentElement","removeChild","setupHotspots","setupAR","modelViewer","handleAnnotationClick","event","annotation","currentTarget","modelViewerElement","dataset","target","orbit","fov","keys","querySelectorAll","forEach","hotspot","removeEventListener","arButton","arPrompt","arFailure","handleARButtonClick","canActivateAR","activateAR","handleArStatus","display","detail","status","handleArTracking","React","ref","undefined","map","index","_extends","slot","concat","className","children_classname","trim","position","normal","propTypes","PropTypes","isRequired","is_loading","prop_name","component_name"],"sourceRoot":""}
@@ -0,0 +1 @@
1
+ {"src/lib/components/DashModelViewer.react.js":{"description":"","displayName":"DashModelViewer","methods":[],"props":{"id":{"type":{"name":"string"},"required":true,"description":"Component ID"},"src":{"type":{"name":"string"},"required":true,"description":"Model source URL (.glb or .gltf)"},"alt":{"type":{"name":"string"},"required":true,"description":"Alt text for accessibility"},"cameraControls":{"type":{"name":"bool"},"required":false,"description":"Enable camera controls","defaultValue":{"value":"true","computed":false}},"touchAction":{"type":{"name":"enum","value":[{"value":"'pan-y'","computed":false},{"value":"'pan-x'","computed":false},{"value":"'none'","computed":false}]},"required":false,"description":"Touch action behavior","defaultValue":{"value":"\"pan-y\"","computed":false}},"cameraOrbit":{"type":{"name":"string"},"required":false,"description":"Initial camera orbital position ($theta $phi $radius)"},"cameraTarget":{"type":{"name":"string"},"required":false,"description":"Initial camera target point ($X $Y $Z)"},"fieldOfView":{"type":{"name":"string"},"required":false,"description":"Camera field of view","defaultValue":{"value":"'auto'","computed":false}},"minFieldOfView":{"type":{"name":"string"},"required":false,"description":"Minimum camera field of view","defaultValue":{"value":"'25deg'","computed":false}},"maxFieldOfView":{"type":{"name":"string"},"required":false,"description":"Maximum camera field of view","defaultValue":{"value":"'auto'","computed":false}},"interpolationDecay":{"type":{"name":"union","value":[{"name":"number"},{"name":"string"}]},"required":false,"description":"Camera interpolation decay rate","defaultValue":{"value":"50","computed":false}},"minCameraOrbit":{"type":{"name":"string"},"required":false,"description":"Minimum camera orbit bounds","defaultValue":{"value":"'auto auto auto'","computed":false}},"maxCameraOrbit":{"type":{"name":"string"},"required":false,"description":"Maximum camera orbit bounds","defaultValue":{"value":"'auto auto auto'","computed":false}},"poster":{"type":{"name":"string"},"required":false,"description":"Poster image URL"},"ar":{"type":{"name":"bool"},"required":false,"description":"Enable AR features","defaultValue":{"value":"true","computed":false}},"hotspots":{"type":{"name":"arrayOf","value":{"name":"shape","value":{"slot":{"name":"string","required":false},"position":{"name":"string","required":false},"normal":{"name":"string","required":false},"orbit":{"name":"string","required":false},"target":{"name":"string","required":false},"fov":{"name":"string","required":false},"text":{"name":"string","required":false},"children_classname":{"name":"string","required":false}}}},"required":false,"description":"Array of hotspot objects passed from the server","defaultValue":{"value":"[]","computed":false}},"arButtonText":{"type":{"name":"string"},"required":false,"description":"Text for the default AR button","defaultValue":{"value":"'View in your space'","computed":false}},"customArPrompt":{"type":{"name":"union","value":[{"name":"string"},{"name":"node"}]},"required":false,"description":"Custom React element for the AR prompt","defaultValue":{"value":"null","computed":false}},"customArFailure":{"type":{"name":"union","value":[{"name":"string"},{"name":"node"}]},"required":false,"description":"Custom React element for the AR failure message","defaultValue":{"value":"null","computed":false}},"style":{"type":{"name":"object"},"required":false,"description":"CSS Style object","defaultValue":{"value":"{}","computed":false}},"toneMapping":{"type":{"name":"enum","value":[{"value":"'neutral'","computed":false},{"value":"'aces'","computed":false},{"value":"'agx'","computed":false},{"value":"'reinhard'","computed":false},{"value":"'cineon'","computed":false},{"value":"'linear'","computed":false},{"value":"'none'","computed":false}]},"required":false,"description":"","defaultValue":{"value":"'neutral'","computed":false}},"arModes":{"type":{"name":"string"},"required":false,"description":"","defaultValue":{"value":"\"basic_annotations scene-viewer quick-look\"","computed":false}},"shadowIntensity":{"type":{"name":"union","value":[{"name":"number"},{"name":"string"}]},"required":false,"description":"","defaultValue":{"value":"0","computed":false}},"arScale":{"type":{"name":"enum","value":[{"value":"'auto'","computed":false},{"value":"'fixed'","computed":false}]},"required":false,"description":"","defaultValue":{"value":"'auto'","computed":false}},"variantName":{"type":{"name":"string"},"required":false,"description":"","defaultValue":{"value":"null","computed":false}},"setProps":{"type":{"name":"func"},"required":false,"description":"Dash-assigned callback that should be called whenever any of the\nproperties change."},"loading_state":{"type":{"name":"shape","value":{"is_loading":{"name":"bool","description":"Determines if the component is loading or not","required":false},"prop_name":{"name":"string","description":"Holds which property is loading","required":false},"component_name":{"name":"string","description":"Holds the name of the component that is loading","required":false}}},"required":false,"description":"Object that holds the loading state object coming from dash-renderer"}}}}
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "dash_model_viewer",
3
+ "version": "0.0.1",
4
+ "description": "Dynamic 3d AR modeling software for the Dash framework",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git://github.com/pip-install-python/dash-model-viewer.git"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/pip-install-python/dash-model-viewer/issues"
11
+ },
12
+ "homepage": "https://github.com/pip-install-python/dash-model-viewer",
13
+ "main": "build/index.js",
14
+ "scripts": {
15
+ "start": "webpack serve --config ./webpack.serve.config.js --open",
16
+ "validate-init": "python _validate_init.py",
17
+ "prepublishOnly": "npm run validate-init",
18
+ "build:js": "webpack --mode production",
19
+ "build:backends": "dash-generate-components ./src/lib/components dash_model_viewer -p package-info.json --r-prefix '' --jl-prefix '' --ignore \\.test\\.",
20
+ "build:backends-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:backends)",
21
+ "build": "npm run build:js && npm run build:backends",
22
+ "build:activated": "npm run build:js && npm run build:backends-activated"
23
+ },
24
+ "author": "Pip Install Python LLC <pipinstallpython@gmail.com>",
25
+ "license": "Apache-2.0",
26
+ "dependencies": {
27
+ "ramda": "^0.26.1"
28
+ },
29
+ "devDependencies": {
30
+ "@babel/core": "^7.22.1",
31
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
32
+ "@babel/preset-env": "^7.22.2",
33
+ "@babel/preset-react": "^7.22.3",
34
+ "@plotly/dash-component-plugins": "^1.2.3",
35
+ "@plotly/webpack-dash-dynamic-import": "^1.2.0",
36
+ "babel-eslint": "^10.1.0",
37
+ "babel-loader": "^9.1.2",
38
+ "copyfiles": "^2.1.1",
39
+ "css-loader": "^6.8.1",
40
+ "eslint": "^6.0.1",
41
+ "eslint-config-prettier": "^6.0.0",
42
+ "eslint-plugin-import": "^2.18.0",
43
+ "eslint-plugin-react": "^7.14.2",
44
+ "prop-types": "^15.8.1",
45
+ "react": "^16.8.6",
46
+ "react-docgen": "^5.4.3",
47
+ "react-dom": "^16.8.6",
48
+ "style-loader": "^3.3.3",
49
+ "styled-jsx": "^5.1.6",
50
+ "webpack": "^5.84.1",
51
+ "webpack-cli": "^5.1.1",
52
+ "webpack-dev-server": "^4.15.0"
53
+ },
54
+ "engines": {
55
+ "node": ">=8.11.0",
56
+ "npm": ">=6.1.0"
57
+ }
58
+ }
@@ -0,0 +1,114 @@
1
+ Metadata-Version: 2.2
2
+ Name: dash_model_viewer
3
+ Version: 0.0.1
4
+ Summary: Dynamic 3d AR modeling software for the Dash framework
5
+ Author: Pip Install Python LLC <pipinstallpython@gmail.com>
6
+ License: Apache-2.0
7
+ Classifier: Framework :: Dash
8
+ Description-Content-Type: text/markdown
9
+ License-File: LICENSE
10
+ Dynamic: author
11
+ Dynamic: classifier
12
+ Dynamic: description
13
+ Dynamic: description-content-type
14
+ Dynamic: license
15
+ Dynamic: summary
16
+
17
+ # dash model viewer
18
+
19
+ dash model viewer is a Dash component library.
20
+
21
+ Dynamic 3d AR modeling software for the Dash framework
22
+
23
+ Get started with:
24
+ 1. Install Dash and its dependencies: https://dash.plotly.com/installation
25
+ 2. Run `python usage.py`
26
+ 3. Visit http://localhost:8050 in your web browser
27
+
28
+ ## Contributing
29
+
30
+ See [CONTRIBUTING.md](./CONTRIBUTING.md)
31
+
32
+ ### Install dependencies
33
+
34
+ If you have selected install_dependencies during the prompt, you can skip this part.
35
+
36
+ 1. Install npm packages
37
+ ```
38
+ $ npm install
39
+ ```
40
+ 2. Create a virtual env and activate.
41
+ ```
42
+ $ virtualenv venv
43
+ $ . venv/bin/activate
44
+ ```
45
+ _Note: venv\Scripts\activate for windows_
46
+
47
+ 3. Install python packages required to build components.
48
+ ```
49
+ $ pip install -r requirements.txt
50
+ ```
51
+ 4. Install the python packages for testing (optional)
52
+ ```
53
+ $ pip install -r tests/requirements.txt
54
+ ```
55
+
56
+ ### Write your component code in `src/lib/components/DashModelViewer.react.js`.
57
+
58
+ - The demo app is in `src/demo` and you will import your example component code into your demo app.
59
+ - Test your code in a Python environment:
60
+ 1. Build your code
61
+ ```
62
+ $ npm run build
63
+ ```
64
+ 2. Run and modify the `usage.py` sample dash app:
65
+ ```
66
+ $ python usage.py
67
+ ```
68
+ - Write tests for your component.
69
+ - A sample test is available in `tests/test_usage.py`, it will load `usage.py` and you can then automate interactions with selenium.
70
+ - Run the tests with `$ pytest tests`.
71
+ - The Dash team uses these types of integration tests extensively. Browse the Dash component code on GitHub for more examples of testing (e.g. https://github.com/plotly/dash-core-components)
72
+ - Add custom styles to your component by putting your custom CSS files into your distribution folder (`dash_model_viewer`).
73
+ - Make sure that they are referenced in `MANIFEST.in` so that they get properly included when you're ready to publish your component.
74
+ - Make sure the stylesheets are added to the `_css_dist` dict in `dash_model_viewer/__init__.py` so dash will serve them automatically when the component suite is requested.
75
+ - [Review your code](./review_checklist.md)
76
+
77
+ ### Create a production build and publish:
78
+
79
+ 1. Build your code:
80
+ ```
81
+ $ npm run build
82
+ ```
83
+ 2. Create a Python distribution
84
+ ```
85
+ $ python setup.py sdist bdist_wheel
86
+ ```
87
+ This will create source and wheel distribution in the generated the `dist/` folder.
88
+ See [PyPA](https://packaging.python.org/guides/distributing-packages-using-setuptools/#packaging-your-project)
89
+ for more information.
90
+
91
+ 3. Test your tarball by copying it into a new environment and installing it locally:
92
+ ```
93
+ $ pip install dash_model_viewer-0.0.1.tar.gz
94
+ ```
95
+
96
+ 4. If it works, then you can publish the component to NPM and PyPI:
97
+ 1. Publish on PyPI
98
+ ```
99
+ $ twine upload dist/*
100
+ ```
101
+ 2. Cleanup the dist folder (optional)
102
+ ```
103
+ $ rm -rf dist
104
+ ```
105
+ 3. Publish on NPM (Optional if chosen False in `publish_on_npm`)
106
+ ```
107
+ $ npm publish
108
+ ```
109
+ _Publishing your component to NPM will make the JavaScript bundles available on the unpkg CDN. By default, Dash serves the component library's CSS and JS locally, but if you choose to publish the package to NPM you can set `serve_locally` to `False` and you may see faster load times._
110
+
111
+ 5. Share your component with the community! https://community.plotly.com/c/dash
112
+ 1. Publish this repository to GitHub
113
+ 2. Tag your GitHub repository with the plotly-dash tag so that it appears here: https://github.com/topics/plotly-dash
114
+ 3. Create a post in the Dash community forum: https://community.plotly.com/c/dash
@@ -0,0 +1,17 @@
1
+ LICENSE
2
+ MANIFEST.in
3
+ README.md
4
+ package.json
5
+ setup.py
6
+ dash_model_viewer/DashModelViewer.py
7
+ dash_model_viewer/__init__.py
8
+ dash_model_viewer/_imports_.py
9
+ dash_model_viewer/dash_model_viewer.min.js
10
+ dash_model_viewer/dash_model_viewer.min.js.map
11
+ dash_model_viewer/metadata.json
12
+ dash_model_viewer/package-info.json
13
+ dash_model_viewer.egg-info/PKG-INFO
14
+ dash_model_viewer.egg-info/SOURCES.txt
15
+ dash_model_viewer.egg-info/dependency_links.txt
16
+ dash_model_viewer.egg-info/top_level.txt
17
+ tests/test_usage.py
@@ -0,0 +1 @@
1
+ dash_model_viewer
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "dash_model_viewer",
3
+ "version": "0.0.1",
4
+ "description": "Dynamic 3d AR modeling software for the Dash framework",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git://github.com/pip-install-python/dash-model-viewer.git"
8
+ },
9
+ "bugs": {
10
+ "url": "https://github.com/pip-install-python/dash-model-viewer/issues"
11
+ },
12
+ "homepage": "https://github.com/pip-install-python/dash-model-viewer",
13
+ "main": "build/index.js",
14
+ "scripts": {
15
+ "start": "webpack serve --config ./webpack.serve.config.js --open",
16
+ "validate-init": "python _validate_init.py",
17
+ "prepublishOnly": "npm run validate-init",
18
+ "build:js": "webpack --mode production",
19
+ "build:backends": "dash-generate-components ./src/lib/components dash_model_viewer -p package-info.json --r-prefix '' --jl-prefix '' --ignore \\.test\\.",
20
+ "build:backends-activated": "(. venv/bin/activate || venv\\scripts\\activate && npm run build:backends)",
21
+ "build": "npm run build:js && npm run build:backends",
22
+ "build:activated": "npm run build:js && npm run build:backends-activated"
23
+ },
24
+ "author": "Pip Install Python LLC <pipinstallpython@gmail.com>",
25
+ "license": "Apache-2.0",
26
+ "dependencies": {
27
+ "ramda": "^0.26.1"
28
+ },
29
+ "devDependencies": {
30
+ "@babel/core": "^7.22.1",
31
+ "@babel/plugin-proposal-object-rest-spread": "^7.20.7",
32
+ "@babel/preset-env": "^7.22.2",
33
+ "@babel/preset-react": "^7.22.3",
34
+ "@plotly/dash-component-plugins": "^1.2.3",
35
+ "@plotly/webpack-dash-dynamic-import": "^1.2.0",
36
+ "babel-eslint": "^10.1.0",
37
+ "babel-loader": "^9.1.2",
38
+ "copyfiles": "^2.1.1",
39
+ "css-loader": "^6.8.1",
40
+ "eslint": "^6.0.1",
41
+ "eslint-config-prettier": "^6.0.0",
42
+ "eslint-plugin-import": "^2.18.0",
43
+ "eslint-plugin-react": "^7.14.2",
44
+ "prop-types": "^15.8.1",
45
+ "react": "^16.8.6",
46
+ "react-docgen": "^5.4.3",
47
+ "react-dom": "^16.8.6",
48
+ "style-loader": "^3.3.3",
49
+ "styled-jsx": "^5.1.6",
50
+ "webpack": "^5.84.1",
51
+ "webpack-cli": "^5.1.1",
52
+ "webpack-dev-server": "^4.15.0"
53
+ },
54
+ "engines": {
55
+ "node": ">=8.11.0",
56
+ "npm": ">=6.1.0"
57
+ }
58
+ }
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,26 @@
1
+ import json
2
+ from setuptools import setup
3
+ from pathlib import Path
4
+
5
+ here = Path(__file__).parent
6
+ with open('package.json') as f:
7
+ package = json.load(f)
8
+ long_description = (here / 'README.md').read_text()
9
+
10
+ package_name = package["name"].replace(" ", "_").replace("-", "_")
11
+
12
+ setup(
13
+ name=package_name,
14
+ version=package["version"],
15
+ author=package['author'],
16
+ packages=[package_name],
17
+ include_package_data=True,
18
+ license=package['license'],
19
+ description=package.get('description', package_name),
20
+ long_description=long_description,
21
+ long_description_content_type="text/markdown",
22
+ install_requires=[],
23
+ classifiers = [
24
+ 'Framework :: Dash',
25
+ ],
26
+ )
@@ -0,0 +1,25 @@
1
+ from dash.testing.application_runners import import_app
2
+
3
+
4
+ # Basic test for the component rendering.
5
+ # The dash_duo pytest fixture is installed with dash (v1.0+)
6
+ def test_render_component(dash_duo):
7
+ # Start a dash app contained as the variable `app` in `usage.py`
8
+ app = import_app('usage')
9
+ dash_duo.start_server(app)
10
+
11
+ # Get the generated component input with selenium
12
+ # The html input will be a children of the #input dash component
13
+ my_component = dash_duo.find_element('#input > input')
14
+
15
+ assert 'my-value' == my_component.get_attribute('value')
16
+
17
+ # Clear the input
18
+ dash_duo.clear_input(my_component)
19
+
20
+ # Send keys to the custom input.
21
+ my_component.send_keys('Hello dash')
22
+
23
+ # Wait for the text to equal, if after the timeout (default 10 seconds)
24
+ # the text is not equal it will fail the test.
25
+ dash_duo.wait_for_text_to_equal('#output', 'You have entered Hello dash')