mc-react-structure-visualizer 0.6.0 → 0.7.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/dist/index.css +1 -1
- package/dist/main.js +17 -20
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.control-box{position:relative;z-index:1;
|
|
1
|
+
.control-box{position:relative;z-index:1;width:100%;background:#f8f8f8;text-align:center;border:1px solid #999;display:flex;flex-wrap:wrap;flex-direction:column;justify-content:center;align-items:start;border-radius:5px;margin-top:-5px;padding:15px 10px 10px}.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;width:100%;line-height:inherit;display:flex;flex-wrap:wrap;justify-content:space-around;align-items:stretch}.form-label{margin-bottom:0rem}.form-control{padding:0rem .275rem}.camera-controls{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;width:100%;flex:1;display:flex;align-items:stretch}.structure-window-click-handler{width:100%}.structure-window{position:relative;z-index:2;height:100%;width:100%;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:#f8f8f8;border:1px solid #999999;color:#353434;padding:1px 6px;border-radius:5px;position:absolute;bottom:10px;right:10px;z-index:3;cursor:pointer;-webkit-user-select:none;user-select:none}.on{display:none}.mouse-disabled-note:hover{filter:brightness(90%)}.structure-visualizer{width:100%;height:100%;min-height:250px;min-width:250px;font-size:16px;display:flex;flex-direction:column}
|
package/dist/main.js
CHANGED
|
@@ -24386,22 +24386,12 @@ const covalentRadii = {
|
|
|
24386
24386
|
function mod(X, L) {
|
|
24387
24387
|
return (X % L + L) % L;
|
|
24388
24388
|
}
|
|
24389
|
-
const overrideBondLengths = {
|
|
24390
|
-
// uuid = "aaea1e0f-337c-453f-a23a-acc06ddc93c9"; // BaTiO3 mc3d-46554/pbe
|
|
24391
|
-
Ba: 0.92 * covalentRadii.Ba,
|
|
24392
|
-
Ti: 0.94 * covalentRadii.Ti,
|
|
24393
|
-
// uuid = "a490b0ff-012a-44c8-a48a-f734dc634b3c"; // EuI4La mc3d-34858/pbe
|
|
24394
|
-
I: 1.05 * covalentRadii.I,
|
|
24395
|
-
Eu: 1.05 * covalentRadii.Eu
|
|
24396
|
-
};
|
|
24397
24389
|
function setCustomBondLengths() {
|
|
24398
24390
|
function X(L, f) {
|
|
24399
|
-
_3DmolExports.setBondLength(L, f
|
|
24391
|
+
_3DmolExports.setBondLength(L, f);
|
|
24400
24392
|
}
|
|
24401
24393
|
Object.keys(covalentRadii).forEach((L) => {
|
|
24402
24394
|
X(L, covalentRadii[L]);
|
|
24403
|
-
}), Object.keys(overrideBondLengths).forEach((L) => {
|
|
24404
|
-
X(L, overrideBondLengths[L]);
|
|
24405
24395
|
});
|
|
24406
24396
|
}
|
|
24407
24397
|
class Visualizer3dmol extends React.Component {
|
|
@@ -24482,7 +24472,7 @@ class Visualizer3dmol extends React.Component {
|
|
|
24482
24472
|
let L = {
|
|
24483
24473
|
sphere: { scale: 0.3, colorscheme: "Jmol" }
|
|
24484
24474
|
};
|
|
24485
|
-
this.props.viewerParams.vdwRadius && (L.sphere.scale = 1), this.props.viewerParams.bonds && (L.stick = { radius: 0.
|
|
24475
|
+
this.props.viewerParams.vdwRadius && (L.sphere.scale = 1), this.props.viewerParams.bonds && (L.stick = { radius: 0.15, colorscheme: "Jmol" }), this.viewer.setStyle(L), this.viewer.addUnitCell(this.model), this.model.assignBonds(), this.viewer.removeAllLabels(), this.props.viewerParams.atomLabels && this.model.atoms.forEach((f) => {
|
|
24486
24476
|
this.viewer.addLabel(
|
|
24487
24477
|
f.elem,
|
|
24488
24478
|
{
|
|
@@ -24513,16 +24503,23 @@ class StructureWindow extends React.Component {
|
|
|
24513
24503
|
render() {
|
|
24514
24504
|
let L = "structure-window";
|
|
24515
24505
|
this.props.mouseEnabled || (L += " disable-mouse");
|
|
24516
|
-
let f = "
|
|
24517
|
-
return this.props.mouseEnabled && (
|
|
24518
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24519
|
-
|
|
24506
|
+
let f = "Click to interact", C = "mouse-disabled-note";
|
|
24507
|
+
return this.props.mouseEnabled && (C = "mouse-disabled-note on"), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "structure-window-outer", children: [
|
|
24508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24509
|
+
"div",
|
|
24520
24510
|
{
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24511
|
+
className: "structure-window-click-handler",
|
|
24512
|
+
onClick: () => this.props.setMouseEnabledState(!0),
|
|
24513
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: L, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24514
|
+
Visualizer3dmol,
|
|
24515
|
+
{
|
|
24516
|
+
ref: this.props.visualizerRef,
|
|
24517
|
+
viewerParams: this.props.viewerParams,
|
|
24518
|
+
cifText: this.props.cifText
|
|
24519
|
+
}
|
|
24520
|
+
) })
|
|
24524
24521
|
}
|
|
24525
|
-
)
|
|
24522
|
+
),
|
|
24526
24523
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
24527
24524
|
"div",
|
|
24528
24525
|
{
|