mc-react-structure-visualizer 0.4.3 → 0.5.0
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.
- package/README.md +48 -74
- package/dist/index.css +1 -3
- package/dist/main.js +24523 -0
- package/package.json +37 -58
- package/dist/ControlBox/index.css +0 -67
- package/dist/ControlBox/index.js +0 -116
- package/dist/StructureWindow/3dmol/Visualizer3dmol.css +0 -5
- package/dist/StructureWindow/3dmol/Visualizer3dmol.js +0 -164
- package/dist/StructureWindow/3dmol/bondLengths.js +0 -107
- package/dist/StructureWindow/index.css +0 -43
- package/dist/StructureWindow/index.js +0 -66
- package/dist/index.js +0 -117
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/App.css +0 -38
- package/src/App.js +0 -44
- package/src/StructureVisualizer/ControlBox/index.css +0 -67
- package/src/StructureVisualizer/ControlBox/index.js +0 -94
- package/src/StructureVisualizer/StructureWindow/3dmol/Visualizer3dmol.css +0 -5
- package/src/StructureVisualizer/StructureWindow/3dmol/Visualizer3dmol.js +0 -140
- package/src/StructureVisualizer/StructureWindow/3dmol/bondLengths.js +0 -100
- package/src/StructureVisualizer/StructureWindow/index.css +0 -43
- package/src/StructureVisualizer/StructureWindow/index.js +0 -46
- package/src/StructureVisualizer/index.css +0 -3
- package/src/StructureVisualizer/index.js +0 -87
- package/src/index.css +0 -13
- package/src/index.js +0 -17
- package/src/reportWebVitals.js +0 -13
package/README.md
CHANGED
|
@@ -1,74 +1,48 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
A React component to visualize structures on the Materials Cloud platform.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
###
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
To learn React, check out the [React documentation](https://reactjs.org/).
|
|
51
|
-
|
|
52
|
-
### Code Splitting
|
|
53
|
-
|
|
54
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
|
|
55
|
-
|
|
56
|
-
### Analyzing the Bundle Size
|
|
57
|
-
|
|
58
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
|
|
59
|
-
|
|
60
|
-
### Making a Progressive Web App
|
|
61
|
-
|
|
62
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
|
|
63
|
-
|
|
64
|
-
### Advanced Configuration
|
|
65
|
-
|
|
66
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
|
|
67
|
-
|
|
68
|
-
### Deployment
|
|
69
|
-
|
|
70
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
|
|
71
|
-
|
|
72
|
-
### `npm run build` fails to minify
|
|
73
|
-
|
|
74
|
-
This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
|
|
1
|
+
# Materials Cloud React Structure Visualizer
|
|
2
|
+
|
|
3
|
+
A React component to visualize structures on the Materials Cloud platform.
|
|
4
|
+
|
|
5
|
+
Install via
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npm install mc-react-structure-visualizer
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Note: make sure all `peerDependencies` (defined in `package.json`) are installed in the host application!
|
|
12
|
+
|
|
13
|
+
Note: the library (i.e. npm package) only contains the code in `src/StructureVisualizer` folder. The rest of the code in `src/` is for development/demo purposes.
|
|
14
|
+
|
|
15
|
+
## Development
|
|
16
|
+
|
|
17
|
+
### Using the demo page
|
|
18
|
+
|
|
19
|
+
For developing the library of components, start the demo page (in `src\`) by
|
|
20
|
+
|
|
21
|
+
```
|
|
22
|
+
npm install
|
|
23
|
+
npm run dev
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Building and testing locally
|
|
27
|
+
|
|
28
|
+
To build the library and test it locally in an external application (before publishing to npm), use
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
npm run build
|
|
32
|
+
npm pack
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
which will create a `.tgz` file that can then be installed by the external application via
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
npm install /path/to/package-x.y.z.tgz
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Publishing a new version
|
|
42
|
+
|
|
43
|
+
To make a new version and publish to npm via GitHub Actions:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm version <patch/minor/major>
|
|
47
|
+
git push --follow-tags
|
|
48
|
+
```
|
package/dist/index.css
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
.structure-
|
|
2
|
-
width: 450px;
|
|
3
|
-
}
|
|
1
|
+
.control-box{position:relative;z-index:1;height:100px;width:450px;background:#fafafa;text-align:center;border:1px solid #999;display:flex;flex-direction:column;justify-content:center;align-items:start;margin-top:-20px;padding:30px 10px 10px;border-radius:5px}.supercell-container{display:flex;align-items:center;gap:2px}.supercell-input{width:45px;height:25px}.supercell-input::-webkit-inner-spin-button,.supercell-input::-webkit-outer-spin-button{opacity:1}.control-box-row{padding:4px 10px;width:100%;line-height:inherit;display:flex;justify-content:space-between;align-items:stretch}.form-label{margin-bottom:0rem}.form-control{padding:0rem .275rem}.camera-controls{margin-left:auto;margin-right:auto;display:inline-flex;align-items:center;justify-items:center;text-align:center;gap:2px}.camera-button{border-width:1px;border-color:#000;border-radius:4px;display:inline-flex;align-items:center;justify-items:center;color:#000;background-color:#e0e0e0;padding:8px;height:25px}.camera-button:hover{color:#000;background-color:#b9b9b9}.control-box-row .form-check-input{margin-left:0}.control-box-row .form-check-label{margin-left:4px}.control-box-row .form-check{margin:0;padding:0}.gldiv{width:98%;height:98%;position:relative}.structure-window-outer{position:relative}.structure-window{position:relative;z-index:2;height:370px;width:450px;background:#fff;text-align:center;border:1px solid #999;display:flex;justify-content:center;align-items:center;border-radius:5px}.disable-mouse{pointer-events:none}.mouse-disabled-note{background-color:#fff1f1;border:1px solid black;color:#353434;padding:2px 6px;border-radius:5px;position:absolute;top:10px;left:10px;z-index:3;cursor:pointer;-webkit-user-select:none;user-select:none}.on{background-color:#e9ffe7}.mouse-disabled-note:hover{filter:brightness(90%)}.structure-visualizer{width:450px;font-size:16px}
|