mc-react-structure-visualizer 0.4.3 → 0.6.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 CHANGED
@@ -1,74 +1,48 @@
1
- # React Materials Cloud Structure Visualizer
2
-
3
- A React component to visualize structures on the Materials Cloud platform.
4
-
5
- # Getting Started with Create React App
6
-
7
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
8
-
9
- ## Available Scripts
10
-
11
- In the project directory, you can run:
12
-
13
- ### `npm start`
14
-
15
- Runs the app in the development mode.\
16
- Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
17
-
18
- The page will reload when you make changes.\
19
- You may also see any lint errors in the console.
20
-
21
- ### `npm test`
22
-
23
- Launches the test runner in the interactive watch mode.\
24
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
25
-
26
- ### `npm run build`
27
-
28
- Builds the app for production to the `build` folder.\
29
- It correctly bundles React in production mode and optimizes the build for the best performance.
30
-
31
- The build is minified and the filenames include the hashes.\
32
- Your app is ready to be deployed!
33
-
34
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
35
-
36
- ### `npm run eject`
37
-
38
- **Note: this is a one-way operation. Once you `eject`, you can't go back!**
39
-
40
- If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
41
-
42
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
43
-
44
- You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
45
-
46
- ## Learn More
47
-
48
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
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-visualizer {
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}