icn3d 3.11.6 → 3.12.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 +45 -8
- package/icn3d.css +402 -0
- package/icn3d.js +6744 -652
- package/icn3d.min.js +4 -0
- package/icn3d.module.js +71084 -0
- package/package.json +24 -2
- package/three.module.js +50449 -0
package/README.md
CHANGED
|
@@ -19,14 +19,6 @@ The following packages are required as shown in dependency:
|
|
|
19
19
|
Usage
|
|
20
20
|
--------
|
|
21
21
|
|
|
22
|
-
* <b>Use icn3d as a 3D Viewer</b>
|
|
23
|
-
|
|
24
|
-
To use icn3d as a 3D Viewer, the source code is available in the [iCn3D GitHub page](https://github.com/ncbi/icn3d), not this icn3d npm package. You can following the instruction at [iCn3D Doc](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#HowToUse). The JavaScript code could be as simple as the following:
|
|
25
|
-
|
|
26
|
-
var cfg = {'mmdbid': '1tup'};
|
|
27
|
-
var icn3dui = new icn3d.iCn3DUI(cfg);
|
|
28
|
-
icn3dui.show3DStructure();
|
|
29
|
-
|
|
30
22
|
* <b>Use icn3d to generate Node.js scripts</b>
|
|
31
23
|
|
|
32
24
|
To use icn3d to generate Node.js scripts, the source code is from this icn3d npm package. As shown in [one example of Node.js script](https://github.com/ncbi/icn3d/blob/master/icn3dnode/interaction2.js), part of the script can be like the following. All classes and functions can be accessed with the variable "icn3dui". The class structure is listed at [iCn3D Doc](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#classstructure).
|
|
@@ -38,3 +30,48 @@ Usage
|
|
|
38
30
|
let icn3d = require('icn3d');
|
|
39
31
|
let icn3dui = new icn3d.iCn3DUI({});
|
|
40
32
|
|
|
33
|
+
* <b>Use icn3d as a 3D Viewer with React</b>
|
|
34
|
+
|
|
35
|
+
You can first specify the "dependencies.js" file as follows:
|
|
36
|
+
|
|
37
|
+
import * as THREE from 'icn3d/three'
|
|
38
|
+
import $ from 'jquery'
|
|
39
|
+
import 'jquery-ui-bundle';
|
|
40
|
+
|
|
41
|
+
import 'jquery-ui-bundle/jquery-ui.min.css';
|
|
42
|
+
|
|
43
|
+
global.THREE = THREE
|
|
44
|
+
global.$ = $
|
|
45
|
+
global.jQuery = $
|
|
46
|
+
|
|
47
|
+
Then specify the "icn3d-viewer.js" file as follows:
|
|
48
|
+
|
|
49
|
+
import React, { useEffect } from "react";
|
|
50
|
+
import './dependencies';
|
|
51
|
+
|
|
52
|
+
import * as icn3d from 'icn3d/module'
|
|
53
|
+
import * from 'icn3d/css'
|
|
54
|
+
|
|
55
|
+
function Icn3dViewer() {
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
const cfg = {
|
|
58
|
+
divid: 'viewer',
|
|
59
|
+
mobilemenu: true
|
|
60
|
+
};
|
|
61
|
+
cfg['mmdbid'] = '1tup';
|
|
62
|
+
const icn3dui = new icn3d.iCn3DUI(cfg);
|
|
63
|
+
icn3dui.show3DStructure();
|
|
64
|
+
}, []);
|
|
65
|
+
return <div id="viewer"></div>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default Icn3dViewer;
|
|
69
|
+
|
|
70
|
+
* <b>Use icn3d as a 3D Viewer with jQuery</b>
|
|
71
|
+
|
|
72
|
+
The source code is available in the [iCn3D GitHub page](https://github.com/ncbi/icn3d). You can following the instruction at [iCn3D Doc](https://www.ncbi.nlm.nih.gov/Structure/icn3d/icn3d.html#HowToUse). The JavaScript code could be as simple as the following:
|
|
73
|
+
|
|
74
|
+
var cfg = {'mmdbid': '1tup'};
|
|
75
|
+
var icn3dui = new icn3d.iCn3DUI(cfg);
|
|
76
|
+
icn3dui.show3DStructure();
|
|
77
|
+
|