@vitessce/glb 3.4.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/LICENSE +21 -0
- package/dist/index.js +13295 -0
- package/dist-tsc/GlbDataLoader.d.ts +4 -0
- package/dist-tsc/GlbDataLoader.d.ts.map +1 -0
- package/dist-tsc/GlbDataLoader.js +30 -0
- package/dist-tsc/GlbSource.d.ts +9 -0
- package/dist-tsc/GlbSource.d.ts.map +1 -0
- package/dist-tsc/GlbSource.js +6 -0
- package/dist-tsc/index.d.ts +3 -0
- package/dist-tsc/index.d.ts.map +1 -0
- package/dist-tsc/index.js +2 -0
- package/package.json +46 -0
- package/src/GlbDataLoader.js +36 -0
- package/src/GlbSource.js +6 -0
- package/src/index.js +2 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlbDataLoader.d.ts","sourceRoot":"","sources":["../src/GlbDataLoader.js"],"names":[],"mappings":"AAMA;IACE,qBA2BC;CACF"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
+
// eslint-disable-next-line import/no-unresolved
|
|
3
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
4
|
+
// eslint-disable-next-line import/no-unresolved
|
|
5
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
6
|
+
export default class GlbDataLoader extends AbstractTwoStepLoader {
|
|
7
|
+
async load() {
|
|
8
|
+
const { url, options } = this;
|
|
9
|
+
const loader = new GLTFLoader();
|
|
10
|
+
const dracoLoader = new DRACOLoader();
|
|
11
|
+
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.6/');
|
|
12
|
+
loader.setDRACOLoader(dracoLoader);
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
loader.load(url,
|
|
15
|
+
// onLoad
|
|
16
|
+
(gltf) => {
|
|
17
|
+
const { scene } = gltf;
|
|
18
|
+
resolve(new LoaderResult({
|
|
19
|
+
obsIndex: null,
|
|
20
|
+
obsSegmentations: { scene, sceneOptions: options },
|
|
21
|
+
obsSegmentationsType: 'mesh',
|
|
22
|
+
}, url));
|
|
23
|
+
},
|
|
24
|
+
// onProgress
|
|
25
|
+
() => { },
|
|
26
|
+
// onError
|
|
27
|
+
error => reject(error));
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GlbSource.d.ts","sourceRoot":"","sources":["../src/GlbSource.js"],"names":[],"mappings":"AAAA;IACE;;;OAGC;IAFC,SAAc;IACd,iBAA8B;CAEjC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.js"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vitessce/glb",
|
|
3
|
+
"version": "3.4.0",
|
|
4
|
+
"author": "Gehlenborg Lab",
|
|
5
|
+
"homepage": "http://vitessce.io",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/vitessce/vitessce.git"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "dist/index.js",
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"dist",
|
|
16
|
+
"dist-tsc"
|
|
17
|
+
],
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@react-three/drei": "~9.89.0",
|
|
20
|
+
"ajv": "^6.10.0",
|
|
21
|
+
"d3-array": "^2.4.0",
|
|
22
|
+
"lodash-es": "^4.17.21",
|
|
23
|
+
"three": "^0.154.0",
|
|
24
|
+
"@vitessce/constants-internal": "3.4.0",
|
|
25
|
+
"@vitessce/gl": "3.4.0",
|
|
26
|
+
"@vitessce/sets-utils": "3.4.0",
|
|
27
|
+
"@vitessce/spatial-utils": "3.4.0",
|
|
28
|
+
"@vitessce/image-utils": "3.4.0",
|
|
29
|
+
"@vitessce/utils": "3.4.0",
|
|
30
|
+
"@vitessce/vit-s": "3.4.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"ajv": "^6.10.0"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"bundle": "pnpm exec vite build -c ../../../scripts/vite.config.js",
|
|
37
|
+
"test": "pnpm exec vitest --run"
|
|
38
|
+
},
|
|
39
|
+
"module": "dist/index.js",
|
|
40
|
+
"exports": {
|
|
41
|
+
".": {
|
|
42
|
+
"types": "./dist-tsc/index.d.ts",
|
|
43
|
+
"import": "./dist/index.js"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { AbstractTwoStepLoader, LoaderResult } from '@vitessce/vit-s';
|
|
2
|
+
// eslint-disable-next-line import/no-unresolved
|
|
3
|
+
import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
|
|
4
|
+
// eslint-disable-next-line import/no-unresolved
|
|
5
|
+
import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
|
|
6
|
+
|
|
7
|
+
export default class GlbDataLoader extends AbstractTwoStepLoader {
|
|
8
|
+
async load() {
|
|
9
|
+
const { url, options } = this;
|
|
10
|
+
const loader = new GLTFLoader();
|
|
11
|
+
const dracoLoader = new DRACOLoader();
|
|
12
|
+
dracoLoader.setDecoderPath('https://www.gstatic.com/draco/versioned/decoders/1.5.6/');
|
|
13
|
+
loader.setDRACOLoader(dracoLoader);
|
|
14
|
+
return new Promise((resolve, reject) => {
|
|
15
|
+
loader.load(
|
|
16
|
+
url,
|
|
17
|
+
// onLoad
|
|
18
|
+
(gltf) => {
|
|
19
|
+
const { scene } = gltf;
|
|
20
|
+
resolve(new LoaderResult(
|
|
21
|
+
{
|
|
22
|
+
obsIndex: null,
|
|
23
|
+
obsSegmentations: { scene, sceneOptions: options },
|
|
24
|
+
obsSegmentationsType: 'mesh',
|
|
25
|
+
},
|
|
26
|
+
url,
|
|
27
|
+
));
|
|
28
|
+
},
|
|
29
|
+
// onProgress
|
|
30
|
+
() => {},
|
|
31
|
+
// onError
|
|
32
|
+
error => reject(error),
|
|
33
|
+
);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
}
|
package/src/GlbSource.js
ADDED
package/src/index.js
ADDED